summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/kvm_nested.h
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2024-06-14 16:45:38 +0200
committerOliver Upton <oliver.upton@linux.dev>2024-06-19 10:13:49 +0200
commit61e30b9eef7ffc7f88ffd95e969cfb662e41bb05 (patch)
treee42447db945f94a2ad77e1b6cdf04513feced2ba /arch/arm64/include/asm/kvm_nested.h
parentKVM: arm64: nv: Support multiple nested Stage-2 mmu structures (diff)
downloadlinux-61e30b9eef7ffc7f88ffd95e969cfb662e41bb05.tar.xz
linux-61e30b9eef7ffc7f88ffd95e969cfb662e41bb05.zip
KVM: arm64: nv: Implement nested Stage-2 page table walk logic
Based on the pseudo-code in the ARM ARM, implement a stage 2 software page table walker. Co-developed-by: Jintack Lim <jintack.lim@linaro.org> Signed-off-by: Jintack Lim <jintack.lim@linaro.org> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20240614144552.2773592-3-maz@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/include/asm/kvm_nested.h')
-rw-r--r--arch/arm64/include/asm/kvm_nested.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_nested.h b/arch/arm64/include/asm/kvm_nested.h
index a69faee31342..5404b7b843cf 100644
--- a/arch/arm64/include/asm/kvm_nested.h
+++ b/arch/arm64/include/asm/kvm_nested.h
@@ -68,6 +68,19 @@ extern struct kvm_s2_mmu *lookup_s2_mmu(struct kvm_vcpu *vcpu);
extern void kvm_vcpu_load_hw_mmu(struct kvm_vcpu *vcpu);
extern void kvm_vcpu_put_hw_mmu(struct kvm_vcpu *vcpu);
+struct kvm_s2_trans {
+ phys_addr_t output;
+ unsigned long block_size;
+ bool writable;
+ bool readable;
+ int level;
+ u32 esr;
+ u64 upper_attr;
+};
+
+extern int kvm_walk_nested_s2(struct kvm_vcpu *vcpu, phys_addr_t gipa,
+ struct kvm_s2_trans *result);
+
int kvm_init_nv_sysregs(struct kvm *kvm);
#ifdef CONFIG_ARM64_PTR_AUTH