KVM: arm64: Wrap the host with a stage 2
When KVM runs in protected nVHE mode, make use of a stage 2 page-table to give the hypervisor some control over the host memory accesses. The host stage 2 is created lazily using large block mappings if possible, and will default to page mappings in absence of a better solution. >From this point on, memory accesses from the host to protected memory regions (e.g. not 'owned' by the host) are fatal and lead to hyp_panic(). Acked-by:Will Deacon <will@kernel.org> Signed-off-by:
Quentin Perret <qperret@google.com> Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210319100146.1149909-36-qperret@google.com
Showing
- arch/arm64/include/asm/kvm_asm.h 1 addition, 0 deletionsarch/arm64/include/asm/kvm_asm.h
- arch/arm64/kernel/image-vars.h 3 additions, 0 deletionsarch/arm64/kernel/image-vars.h
- arch/arm64/kvm/arm.c 10 additions, 0 deletionsarch/arm64/kvm/arm.c
- arch/arm64/kvm/hyp/include/nvhe/mem_protect.h 34 additions, 0 deletionsarch/arm64/kvm/hyp/include/nvhe/mem_protect.h
- arch/arm64/kvm/hyp/nvhe/Makefile 1 addition, 1 deletionarch/arm64/kvm/hyp/nvhe/Makefile
- arch/arm64/kvm/hyp/nvhe/hyp-init.S 1 addition, 0 deletionsarch/arm64/kvm/hyp/nvhe/hyp-init.S
- arch/arm64/kvm/hyp/nvhe/hyp-main.c 10 additions, 0 deletionsarch/arm64/kvm/hyp/nvhe/hyp-main.c
- arch/arm64/kvm/hyp/nvhe/mem_protect.c 246 additions, 0 deletionsarch/arm64/kvm/hyp/nvhe/mem_protect.c
- arch/arm64/kvm/hyp/nvhe/setup.c 5 additions, 0 deletionsarch/arm64/kvm/hyp/nvhe/setup.c
- arch/arm64/kvm/hyp/nvhe/switch.c 2 additions, 5 deletionsarch/arm64/kvm/hyp/nvhe/switch.c
- arch/arm64/kvm/hyp/nvhe/tlb.c 3 additions, 1 deletionarch/arm64/kvm/hyp/nvhe/tlb.c
Please register or sign in to comment