KVM: arm64: nv: Add basic emulation of AT S1E{0,1}{R,W}
authorMarc Zyngier <maz@kernel.org>
Wed, 19 Jun 2024 07:29:20 +0000 (08:29 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 30 Aug 2024 11:04:20 +0000 (12:04 +0100)
commit477e89cabb1428d5989430d57828347f5de2be9c
tree217d65e5fc58436261379addbeffea66b415796c
parent90659853febcf63ceb71529b247d518df3c2a76c
KVM: arm64: nv: Add basic emulation of AT S1E{0,1}{R,W}

Emulating AT instructions is one the tasks devolved to the host
hypervisor when NV is on.

Here, we take the basic approach of emulating AT S1E{0,1}{R,W}
using the AT instructions themselves. While this mostly work,
it doesn't *always* work:

- S1 page tables can be swapped out

- shadow S2 can be incomplete and not contain mappings for
  the S1 page tables

We are not trying to handle these case here, and defer it to
a later patch. Suitable comments indicate where we are in dire
need of better handling.

Co-developed-by: Jintack Lim <jintack.lim@linaro.org>
Signed-off-by: Jintack Lim <jintack.lim@linaro.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_asm.h
arch/arm64/kvm/Makefile
arch/arm64/kvm/at.c [new file with mode: 0644]