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

Reply via email to