KVM: PPC: Book3S HV: Context switch IAMR on Power9

Michael Ellerman patch-notifications at ellerman.id.au
Fri Feb 22 20:48:05 AEDT 2019


On Wed, 2019-02-20 at 08:55:00 UTC, Michael Ellerman wrote:
> kvmhv_p9_guest_entry() implements a fast-path guest entry for Power9
> when guest and host are both running with the Radix MMU.
> 
> Currently in that path we don't save the host AMR (Authority Mask
> Register) value, and we always restore 0 on return to the host. That
> is OK at the moment because the AMR is not used for storage keys with
> the Radix MMU.
> 
> However we plan to start using the AMR on Radix to prevent the kernel
> from reading/writing to userspace outside of copy_to/from_user(). In
> order to make that work we need to save/restore the AMR value.
> 
> We only restore the value if it is different from the guest value,
> which is already in the register when we exit to the host. This should
> mean we rarely need to actually restore the value when running a
> modern Linux as a guest, because it will be using the same value as
> us.
> 
> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
> Tested-by: Russell Currey <ruscur at russell.cc>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/d976f6807ea613c54fcb74bd7ae68a43

cheers


More information about the Linuxppc-dev mailing list