[PATCH 3/3] arm64: mm: Add feature override support for LVA and E0PD

Ard Biesheuvel ardb at kernel.org
Fri Nov 18 06:50:13 PST 2022


On Fri, 18 Nov 2022 at 15:47, Will Deacon <will at kernel.org> wrote:
>
> On Tue, Nov 15, 2022 at 03:38:24PM +0100, Ard Biesheuvel wrote:
> > Add support for overriding the VARange and E0PD fields of the MMFR2 CPU
> > ID register. This permits the associated features to be overridden early
> > enough for the boot code that creates the kernel mapping to take it into
> > account.
> >
> > Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
> > ---
> >  arch/arm64/include/asm/assembler.h    | 17 ++++++++++-------
> >  arch/arm64/include/asm/cpufeature.h   |  1 +
> >  arch/arm64/kernel/cpufeature.c        |  6 +++++-
> >  arch/arm64/kernel/image-vars.h        |  1 +
> >  arch/arm64/kernel/pi/idreg-override.c |  8 +++++++-
> >  arch/arm64/kernel/pi/map_kernel.c     |  4 ++++
> >  6 files changed, 28 insertions(+), 9 deletions(-)
>
> What's the rationale for overriding E0PD? It seems unrelated to the rest of
> the series.
>

It is not strictly related, but it is also taken into account by the
early kernel mapping code and sits in the same ID register. I could
imagine wanting to override it if it doesn't actually work (to avoid
running KASLR without nG attributes) but I have no reason to assume
someone actually needs that today.



More information about the linux-arm-kernel mailing list