[PATCH v2] arm64: mm: fix booting with 52-bit address space

Ard Biesheuvel ardb at kernel.org
Fri Jul 1 03:10:20 PDT 2022


On Fri, 1 Jul 2022 at 05:30, Anshuman Khandual
<anshuman.khandual at arm.com> wrote:
>
>
>
> On 6/30/22 19:37, Ard Biesheuvel wrote:
> > Joey reports that booting 52-bit VA capable builds on 52-bit VA capable
> > CPUs is broken since commit 0d9b1ffefabe ("arm64: mm: make vabits_actual
> > a build time constant if possible"). This is due to the fact that the
> > primary CPU reads the vabits_actual variable before it has been
> > assigned.
> >
> > The reason for deferring the assignment of vabits_actual was that we try
> > to perform as few stores to memory as we can with the MMU and caches
> > off, due to the cache coherency issues it creates.
> >
> > Since __cpu_setup() [which is where the read of vabits_actual occurs] is
> > also called on the secondary boot path, we cannot just read the CPU ID
> > registers directly, given that the size of the VA space is decided by
> > the capabilities of the primary CPU. So let's read vabits_actual only on
> > the secondary boot path, and read the CPU ID registers directly on the
> > primary boot path, by making it a function parameter of __cpu_setup().
> >
> > Cc: Will Deacon <will at kernel.org>
> > Cc: Anshuman Khandual <anshuman.khandual at arm.com>
> > Cc: Mark Rutland <mark.rutland at arm.com>
> > Fixes: 0d9b1ffefabe ("arm64: mm: make vabits_actual a build time constant if possible")
> > Reported-by: Joey Gouly <joey.gouly at arm.com>
> > Co-developed-by: Joey Gouly <joey.gouly at arm.com>
> > Signed-off-by: Joey Gouly <joey.gouly at arm.com>
> > Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
>
> Tested-by: Anshuman Khandual <anshuman.khandual at arm.com>
>

Thanks but please disregard this patch for now - we'll need something
similar for KASAN as well, which I also broke on 52-bit VAs.



More information about the linux-arm-kernel mailing list