-
-
Notifications
You must be signed in to change notification settings - Fork 251
Only compile assembly codes as armv8.2-a #479
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
base: main
Are you sure you want to change the base?
Conversation
|
The build failure appears to be caused by https://src.fedoraproject.org is down/not working properly. |
|
updated to specify armv8.2-a directly whenever needed |
|
the build failures appears to be because of the build environment not supplying some runtime builtins that are required when LSE atomics are unavailable. however the m1n1.spec file is outside of this repo so nothing can be done here. |
jannau
left a comment
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.
I'm not sure if I'm happy with this change. I would prefer if the HV continues to use LSE atomics if available.
Could you live with enabling this only for old SoCs via a config variable?
src/utils.h
Outdated
| ({ \ | ||
| u64 val; \ | ||
| __asm__ volatile("mrs\t%0, " #reg : "=r"(val)); \ | ||
| __asm__ volatile(".arch armv8.2-a\nmrs\t%0, " #reg : "=r"(val)); \ |
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.
please break the asm statement into 2 lines like
__asm__ volatile(".arch armv8.2-a\n" \
"mrs\t%0, " #reg : "=r"(val)); \
| -ffreestanding -fpic -ffunction-sections -fdata-sections \ | ||
| -nostdinc -isystem $(shell $(CC) -print-file-name=include) -isystem sysinc \ | ||
| -fno-stack-protector -mstrict-align -march=armv8.2-a \ | ||
| -fno-stack-protector -mstrict-align -Wa,-march=armv8.2-a \ |
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.
I don't think this is enough for armv8-a under all circumstances. I think you have to explicitly set -march=armv8-a and add -mno-outline-atomics to make sure we end up with base armv8-a
Actually the HV is already not using LSE atomics in some cases when it could have: How about compiling HV C files with -march=armv8.2-a, and then define a |
|
spinlock (and hv) still use built-in atomics and with |
yeah but the asm block used to use LSE atomics as well but this was changed so m1n1 could work on armv8.0 869d2ae |
Compile non-HV C code as base armv8-a, and compile assembly and HV codes as armv8.2-a to allow m1n1 to be properly compiled for older SoCs. Signed-off-by: Nick Chan <towinchenmi@gmail.com>
|
updates: split the mrs/msr marco inline asm statement into two lines |
Compile C code as base armv8-a, and compile assembly codes as armv8.2-a to allow m1n1 to be properly compiled for older SoCs.