-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arch: add loongarch support. #1
base: la64/master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this is not affected by bitness at all, could you please remove all mentions of "64"?
我觉得大佬说的对 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arch: add LoongArch support
Signed-off-by 行留着
另外参考下 aarch64、ia64、x86 的头文件,看下有一堆别的定义,暴露平台更多功能,合适的建议都加上。比如叫 ffz
啥啥啥的那个函数,看样子就是 ctz
这种指令可以胜任,不加感觉亏了,移植不彻底。
|
||
#define read_barrier() __asm__ __volatile__("dbar 0": : :"memory") | ||
#define write_barrier() __asm__ __volatile__("dbar 0": : :"memory") | ||
#define nop __asm__ __volatile__("nop") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看别的好多架构好像都直接写的 do {} while (0)
你觉得如何?看下代码里实际都怎么使用这边定义的宏的,尽量不要无脑移植
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我感觉不好,这得看具体应用语境,这几个宏的调用本身就很简单,并不复杂。
这个是我没有仔细看指令集文档,这个可以用ctz优化一下。 |
8968e70
to
58a910b
Compare
This patch adds support for loongarch for fio. This is tested by building FIO on an loongarch Debian 10 system. Signed-off-by: wangguofeng <[email protected]>
arch/arch-loongarch.h
Outdated
#define write_barrier() __asm__ __volatile__("dbar 0": : :"memory") | ||
#define nop __asm__ __volatile__("nop") | ||
|
||
#if __loongarch_xlen == 64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确认下新工具链是看这个?手册上叫GRLEN的东西到代码里就叫xlen?最早我拿到的正式公开源码是没这个的我记得
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/loongson/glibc/pull/10/files ,公布出来的又给删了。。。,我有句话不知当不当讲,算了不讲了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我去。。。这帮人才,RV 叫 xlen
的东西,不想借鉴(降低别人学习成本)也就算了,自己手册上写了个 GRLEN
,然后现在既不给用 xlen
也不给用 grlen
,让人用 __WORDSIZE
???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
按道理gcc应该内置这个宏的。。。,现在是啥都没了。。。,我很难过
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/loongson/glibc/pull/10/files ,公布出来的又给删了。。。,我有句话不知当不当讲,算了不讲了
为啥要删了呢? 直接去问问 ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得不妨先加着,工具链那边感觉干活不讲一致性,而且朝令夕改。不能就着他们的代码行为,下游也凑合,应该基于这边的具体使用场景给他们改进做事方式的压力。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/loongson/glibc/pull/10/files ,公布出来的又给删了。。。,我有句话不知当不当讲,算了不讲了
是我删的,C库那个文件只是用来定义WORDSIZE的。
如果要定义类似 xlen 的宏,应该在gcc中定义,具体请参考riscv:
https://github.com/loongson/glibc/blob/c8793900942229e22e54624c17fa5c9ce5bc6576/sysdeps/riscv/bits/wordsize.h#L20
https://github.com/loongson/gcc/blob/ac1026d11b3a7bc40609b0177c390b37964037af/gcc/config/riscv/riscv-c.c#L57-L59
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/loongson/glibc/pull/10/files ,公布出来的又给删了。。。,我有句话不知当不当讲,算了不讲了
为啥要删了呢? 直接去问问 ^^
那个加错地方了,应该加在gcc的内置宏里的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yetist 新的预定义符号预期叫啥?谁来改?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议在gcc那边讨论一下
32位功能不做保证,没有验证环境,不过从ffz的描述来看,不知道合适不? |
Update: loongson/LoongArch-Documentation#25、loongson/LoongArch-Documentation#28 等等一系列 PR 在讨论相关的预处理器符号了。 |
这个有更新吗? |
This patch adds support for loongarch for fio. This is tested by building
FIO on an loongarch Debian 10 system.
@loongarch64/dev-team 请帮忙review并测试,谢谢。
如果做make fulltest,请打开内核下列选项
CONFIG_BLK_DEV_NULL_BLK=m
CONFIG_BLK_DEV_ZONED=y
NOTE:
其中sudo t/zbd/run-tests-against-nullb -s 4时,会出现"null_blk does not support conventional zones",这个问题看着和本次修改无关。