Skip to content
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

bug: AARCH64 not correct process VFP #16

Closed
guoweikang opened this issue Jul 26, 2024 · 2 comments
Closed

bug: AARCH64 not correct process VFP #16

guoweikang opened this issue Jul 26, 2024 · 2 comments

Comments

@guoweikang
Copy link
Contributor

AARCH64 动态库用例失败

郑友捷:

  • 原先的aarch64测例问题来自于fp_simd

4f412f78afe94d84db261f9f8cd7ee9

Starry 在65a4f5896317115cf1edc74800f0da5d92923243这次更新中将启用 fp_simd 时的平台更改为 aarch64-unknown-none,原先是aarch64-unknown-none-softfloat,然后导致运行到 memset 的时候 q0 的值发生了变化

acda1e3e342d40dc1397132b9b4f83e

但是如果我打开了fp_simd,同时指定了TARGET := aarch64-unknown-none-softfloat,会报这个错误

@guoweikang
Copy link
Contributor Author

此问题在更新升级工具链以后出现的问题

  • 工具链升级之前,编译内核支持 -neon (生成代码不适用VFP寄存器), 并且就算代码中有显示使用VFP的汇编,在编译链接时没有报错
  • 工具链升级之后,编译内核支持 -neon (生成代码不适用VFP寄存器), 但是代码中有显示使用VFP的汇编,在编译链接时会报错

解决方案: 尝试搜索过cargo 支持不同target构建 方案不适合我们场景,

建议方案: VFP.S 作为独立的汇编文件,在buidl.rs中编译,同时在链接时 在build.rs 单独链接, 不能和其他rust 项目在链接在一起

guoweikang added a commit that referenced this issue Jul 26, 2024
issue: #16

--------
1 Exception doesn't save VFP registers
2 kernel generate code shouldn't use VFP registers,
  need close -neon and -fp-armv8
3 taskctx need save/restore user application VFP ctx,
  need access VFP registers

After rustc update, it would complain when 2&3 happend,
on this commit :65a4f5896317115cf1edc74800f0da5d92923243,
opened neon when fp_smid enable,it broken 2, so it create
bug; after return user from kernel trap, usr vfp registers
ctx are changed;

This commit close neon when complie kernel, taskctx need access
VFP registers through build.rs to fix

Signed-off-by: guoweikang <[email protected]>
guoweikang added a commit that referenced this issue Jul 26, 2024
issue: #16

--------
1 Exception doesn't save VFP registers
2 kernel generate code shouldn't use VFP registers,
  need close -neon and -fp-armv8
3 taskctx need save/restore user application VFP ctx,
  need access VFP registers

After rustc update, it would complain when 2&3 happend,
on this commit :65a4f5896317115cf1edc74800f0da5d92923243,
opened neon when fp_smid enable,it broken 2, so it create
bug; after return user from kernel trap, usr vfp registers
ctx are changed;

This commit close neon when complie kernel, taskctx need access
VFP registers through build.rs to fix

Signed-off-by: guoweikang <[email protected]>
@Azure-stars
Copy link
Contributor

Azure-stars added a commit that referenced this issue Jul 31, 2024
Azure-stars pushed a commit that referenced this issue Jul 31, 2024
issue: #16

--------
1 Exception doesn't save VFP registers
2 kernel generate code shouldn't use VFP registers,
  need close -neon and -fp-armv8
3 taskctx need save/restore user application VFP ctx,
  need access VFP registers

After rustc update, it would complain when 2&3 happend,
on this commit :65a4f5896317115cf1edc74800f0da5d92923243,
opened neon when fp_smid enable,it broken 2, so it create
bug; after return user from kernel trap, usr vfp registers
ctx are changed;

This commit close neon when complie kernel, taskctx need access
VFP registers through build.rs to fix

Signed-off-by: guoweikang <[email protected]>
Azure-stars pushed a commit that referenced this issue Jul 31, 2024
issue: #16

--------
1 Exception doesn't save VFP registers
2 kernel generate code shouldn't use VFP registers,
  need close -neon and -fp-armv8
3 taskctx need save/restore user application VFP ctx,
  need access VFP registers

After rustc update, it would complain when 2&3 happend,
on this commit :65a4f5896317115cf1edc74800f0da5d92923243,
opened neon when fp_smid enable,it broken 2, so it create
bug; after return user from kernel trap, usr vfp registers
ctx are changed;

This commit close neon when complie kernel, taskctx need access
VFP registers through build.rs to fix

Signed-off-by: guoweikang <[email protected]>
guoweikang added a commit that referenced this issue Aug 14, 2024
issue: #16

--------
1 Exception doesn't save VFP registers
2 kernel generate code shouldn't use VFP registers,
  need close -neon and -fp-armv8
3 taskctx need save/restore user application VFP ctx,
  need access VFP registers

After rustc update, it would complain when 2&3 happend,
on this commit :65a4f5896317115cf1edc74800f0da5d92923243,
opened neon when fp_smid enable,it broken 2, so it create
bug; after return user from kernel trap, usr vfp registers
ctx are changed;

This commit close neon when complie kernel, taskctx need access
VFP registers through build.rs to fix

Signed-off-by: guoweikang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants