diff options
author | Ricardo Koller <ricarkol@google.com> | 2023-04-26 20:23:26 +0300 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2023-05-16 20:39:18 +0300 |
commit | ce2b60223800c801b4b519c07aff3aa9c75c2b6d (patch) | |
tree | 3d3c8af4dd22f5c0937f631a116f6ec01e1da15a /arch/arm64/kvm | |
parent | 6bd92b9d8b02a67d67b6d7351ad5c81321a02017 (diff) | |
download | linux-ce2b60223800c801b4b519c07aff3aa9c75c2b6d.tar.xz |
KVM: arm64: Add kvm_uninit_stage2_mmu()
Add kvm_uninit_stage2_mmu() and move kvm_free_stage2_pgd() into it. A
future commit will add some more things to do inside of
kvm_uninit_stage2_mmu().
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Link: https://lore.kernel.org/r/20230426172330.1439644-9-ricarkol@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r-- | arch/arm64/kvm/mmu.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index 8df15a174449..d3fb35a002f9 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -790,6 +790,11 @@ out_free_pgtable: return err; } +void kvm_uninit_stage2_mmu(struct kvm *kvm) +{ + kvm_free_stage2_pgd(&kvm->arch.mmu); +} + static void stage2_unmap_memslot(struct kvm *kvm, struct kvm_memory_slot *memslot) { @@ -1893,7 +1898,7 @@ void kvm_arch_memslots_updated(struct kvm *kvm, u64 gen) void kvm_arch_flush_shadow_all(struct kvm *kvm) { - kvm_free_stage2_pgd(&kvm->arch.mmu); + kvm_uninit_stage2_mmu(kvm); } void kvm_arch_flush_shadow_memslot(struct kvm *kvm, |