[PATCH] arm64: kvm: handle 52-bit VA regions correctly under nVHE

Marc Zyngier maz at kernel.org
Tue Mar 30 15:24:12 BST 2021


On Tue, 30 Mar 2021 14:58:39 +0100,
Ard Biesheuvel <ardb at kernel.org> wrote:
> 
> On Tue, 30 Mar 2021 at 15:56, Marc Zyngier <maz at kernel.org> wrote:
> >
> > On Tue, 30 Mar 2021 14:15:19 +0100,
> > Ard Biesheuvel <ardb at kernel.org> wrote:

[...]

> > > It seems to me that the only way to solve this is to permit the idmap
> > > and the hyp linear region to overlap, and use the 2^47 byte window at
> > > the top of the address space for the hyp private mappings instead of
> > > the one at the bottom.
> >
> > But that's the hard problem I want to avoid thinking of.
> >
> > We need to ensure that there is no EL1 VA that is congruent with the
> > idmap over the kern_hyp_va() transformation. It means imposing
> > restrictions over the EL1 linear map, and prevent any allocation that
> > would result in this overlap (and that is including text).
> >
> > How do we do that?
> >
> 
> A phys to virt offset of 0x0 is perfectly acceptable, no? The only
> difference is that the idmapped bits are in another part of the VA
> space.

What do we lose by doing that? If that's acceptable for LVA, why don't
we do it across the board? It feels like KASLR and EL2 randomisation
are in the way...

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list