Re: [PATCH v2 1/3] xen/arm: set -mno-unaligned-access compiler option for Arm32
On 06/12/2023 10:57, Julien Grall wrote: Hi Juergen, On 06/12/2023 10:00, Juergen Gross wrote: On 06.12.23 09:44, Jan Beulich wrote: On 06.12.2023 08:10, Juergen Gross wrote: As the hypervisor is disabling unaligned accesses for Arm32, set the -mno-unaligned-access compiler option for building. This will prohibit unaligned accesses when e.g. accessing 2- or 4-byte data items in packed data structures. Signed-off-by: Juergen Gross Assuming this will want backporting, should it have some Fixes: tag? IMHO this might not be needed You probably miss the discussion between Arnd and I where I pointed out that this should fix [1]. I haven't yet tested to confirm. I can't find the GCC binaries I was using anymore :(. But I still think it is a good idea to backport it. @Stefano can you add it in your list? Acked-by: Julien Grall Cheers, -- Julien Grall
Re: [PATCH v2 1/3] xen/arm: set -mno-unaligned-access compiler option for Arm32
Hi Juergen, On 06/12/2023 10:00, Juergen Gross wrote: On 06.12.23 09:44, Jan Beulich wrote: On 06.12.2023 08:10, Juergen Gross wrote: As the hypervisor is disabling unaligned accesses for Arm32, set the -mno-unaligned-access compiler option for building. This will prohibit unaligned accesses when e.g. accessing 2- or 4-byte data items in packed data structures. Signed-off-by: Juergen Gross Assuming this will want backporting, should it have some Fixes: tag? IMHO this might not be needed You probably miss the discussion between Arnd and I where I pointed out that this should fix [1]. I haven't yet tested to confirm. [1] https://lore.kernel.org/xen-devel/c71163f6-2646-6fae-cb22-600eb0486...@xen.org/ Juergen -- Julien Grall
Re: [PATCH v2 1/3] xen/arm: set -mno-unaligned-access compiler option for Arm32
On 06.12.23 09:44, Jan Beulich wrote: On 06.12.2023 08:10, Juergen Gross wrote: As the hypervisor is disabling unaligned accesses for Arm32, set the -mno-unaligned-access compiler option for building. This will prohibit unaligned accesses when e.g. accessing 2- or 4-byte data items in packed data structures. Signed-off-by: Juergen Gross Assuming this will want backporting, should it have some Fixes: tag? IMHO this might not be needed, but the Arm maintainers should have the final say. This option is especially important after the whole series has been applied, as get_unaligned() and put_unaligned() can then be used in Arm32 code, too. And without the added option this could cause crashes. Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature
Re: [PATCH v2 1/3] xen/arm: set -mno-unaligned-access compiler option for Arm32
On 06.12.2023 08:10, Juergen Gross wrote: > As the hypervisor is disabling unaligned accesses for Arm32, set the > -mno-unaligned-access compiler option for building. This will prohibit > unaligned accesses when e.g. accessing 2- or 4-byte data items in > packed data structures. > > Signed-off-by: Juergen Gross Assuming this will want backporting, should it have some Fixes: tag? Jan
[PATCH v2 1/3] xen/arm: set -mno-unaligned-access compiler option for Arm32
As the hypervisor is disabling unaligned accesses for Arm32, set the -mno-unaligned-access compiler option for building. This will prohibit unaligned accesses when e.g. accessing 2- or 4-byte data items in packed data structures. Signed-off-by: Juergen Gross --- V2: - new patch --- xen/arch/arm/arch.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/arm/arch.mk b/xen/arch/arm/arch.mk index 58db76c4e1..022dcda192 100644 --- a/xen/arch/arm/arch.mk +++ b/xen/arch/arm/arch.mk @@ -7,6 +7,7 @@ $(call cc-option-add,CFLAGS,CC,-Wnested-externs) # Prevent floating-point variables from creeping into Xen. CFLAGS-$(CONFIG_ARM_32) += -msoft-float CFLAGS-$(CONFIG_ARM_32) += -mcpu=cortex-a15 +CFLAGS-$(CONFIG_ARM_32) += -mno-unaligned-access CFLAGS-$(CONFIG_ARM_64) += -mcpu=generic CFLAGS-$(CONFIG_ARM_64) += -mgeneral-regs-only # No fp registers etc -- 2.35.3