[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMj1kXHkcTZOR1eb-GVVe3m77Lfg8qdp+wLgHMOr7yNTecBGOw@mail.gmail.com>
Date: Wed, 29 Sep 2021 22:57:30 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Fangrui Song <maskray@...gle.com>,
Peter Smith <peter.smith@....com>,
Nathan Chancellor <nathan@...nel.org>,
Richard Henderson <richard.henderson@...aro.org>,
Russell King <linux@...linux.org.uk>,
Dave Martin <dave.martin@....com>,
Nicolas Pitre <nico@...xnic.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
llvm@...ts.linux.dev
Subject: Re: [PATCH v2] ARM: mm: proc-macros: ensure *_tlb_fns are 4B aligned
On Wed, 29 Sept 2021 at 21:20, Nick Desaulniers <ndesaulniers@...gle.com> wrote:
>
> QEMU 6.1.0 is more correct about trapping on misaligned accesses.
Btw, this is not entirely relevant. QEMU now behaves like every single
hardware implementation does, and reports an alignment fault when
using a load-multiple instruction on an address that is not 32-bit
aligned, as the architecture requires.
> A
> kernel built with CONFIG_THUMB2_KERNEL=y and using clang as the
> assembler could generate non-naturally-aligned v7wbi_tlb_fns which
> results in a boot failure. The original commit adding the macro missed
> the .align directive on this data.
>
> Fixes: 66a625a88174 ("ARM: mm: proc-macros: Add generic proc/cache/tlb struct definition macros")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1447
> Link: https://lore.kernel.org/all/0699da7b-354f-aecc-a62f-e25693209af4@linaro.org/
> Debugged-by: Ard Biesheuvel <ardb@...nel.org>
> Debugged-by: Nathan Chancellor <nathan@...nel.org>
> Debugged-by: Richard Henderson <richard.henderson@...aro.org>
> Suggested-by: Ard Biesheuvel <ardb@...nel.org>
> Acked-by: Ard Biesheuvel <ardb@...nel.org>
> Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
> ---
> Changes V1 -> V2:
> * Drop accidentally committed Kconfig change.
> * Pick up Ard's AB tag.
>
> arch/arm/mm/proc-macros.S | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
> index e2c743aa2eb2..d9f7dfe2a7ed 100644
> --- a/arch/arm/mm/proc-macros.S
> +++ b/arch/arm/mm/proc-macros.S
> @@ -340,6 +340,7 @@ ENTRY(\name\()_cache_fns)
>
> .macro define_tlb_functions name:req, flags_up:req, flags_smp
> .type \name\()_tlb_fns, #object
> + .align 2
> ENTRY(\name\()_tlb_fns)
> .long \name\()_flush_user_tlb_range
> .long \name\()_flush_kern_tlb_range
>
> base-commit: 02d5e016800d082058b3d3b7c3ede136cdc6ddcb
> prerequisite-patch-id: 3edbe4a8485c7a75a61dbbe299e8ce1985d87ee0
> --
> 2.33.0.685.g46640cef36-goog
>
Powered by blists - more mailing lists