diff mbox series

[5/5] xen: arm64: remove -mgeneral-regs-only for vfp.c

Message ID 20241129014850.2852844-6-volodymyr_babchuk@epam.com (mailing list archive)
State New
Headers show
Series aarch64, common: improve clang and llvm support | expand

Commit Message

Volodymyr Babchuk Nov. 29, 2024, 1:49 a.m. UTC
vfp.c actually accesses VFP registers, so it can't be built with
-mgeneral-regs-only flag when using clang, as clang will complain
about this:

arch/arm/arm64/vfp.c:9:18: error: instruction requires: fp-armv8
    9 |     asm volatile("stp q0, q1, [%1, #16 * 0]\n\t"
      |

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 xen/arch/arm/arm64/Makefile | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jan Beulich Nov. 29, 2024, 8:12 a.m. UTC | #1
On 29.11.2024 02:49, Volodymyr Babchuk wrote:
> vfp.c actually accesses VFP registers, so it can't be built with
> -mgeneral-regs-only flag when using clang, as clang will complain
> about this:
> 
> arch/arm/arm64/vfp.c:9:18: error: instruction requires: fp-armv8
>     9 |     asm volatile("stp q0, q1, [%1, #16 * 0]\n\t"
>       |

Imo this needs addressing by inserting appropriate .arch_extension directives
in the asm(), to limit the scope of where VFP registers can be used to _just_
where we want them used.

> --- a/xen/arch/arm/arm64/Makefile
> +++ b/xen/arch/arm/arm64/Makefile
> @@ -18,3 +18,5 @@ obj-$(CONFIG_ARM64_SVE) += sve.o sve-asm.o
>  obj-y += traps.o
>  obj-y += vfp.o
>  obj-y += vsysreg.o
> +
> +$(obj)/vfp.o: CFLAGS_REMOVE += -mgeneral-regs-only

This, after all, allows the compiler to also use them behind our backs.

Jan
diff mbox series

Patch

diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
index 6491c5350b..af949b8ee6 100644
--- a/xen/arch/arm/arm64/Makefile
+++ b/xen/arch/arm/arm64/Makefile
@@ -18,3 +18,5 @@  obj-$(CONFIG_ARM64_SVE) += sve.o sve-asm.o
 obj-y += traps.o
 obj-y += vfp.o
 obj-y += vsysreg.o
+
+$(obj)/vfp.o: CFLAGS_REMOVE += -mgeneral-regs-only