diff options
author | Junaid Shahid | 2018-06-27 23:59:17 +0200 |
---|---|---|
committer | Paolo Bonzini | 2018-08-06 17:58:59 +0200 |
commit | 08fb59d8a47d5e1f9de08659603a47f117fe60d5 (patch) | |
tree | 0aca93c0ea3187d9e2d6aaa3258af0d526a2f1e0 /arch/x86/include | |
parent | kvm: x86: Add a root_hpa parameter to kvm_mmu->invlpg() (diff) | |
download | kernel-qcow2-linux-08fb59d8a47d5e1f9de08659603a47f117fe60d5.tar.gz kernel-qcow2-linux-08fb59d8a47d5e1f9de08659603a47f117fe60d5.tar.xz kernel-qcow2-linux-08fb59d8a47d5e1f9de08659603a47f117fe60d5.zip |
kvm: x86: Support selectively freeing either current or previous MMU root
kvm_mmu_free_roots() now takes a mask specifying which roots to free, so
that either one of the roots (active/previous) can be individually freed
when needed.
Signed-off-by: Junaid Shahid <junaids@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 0b77c233e441..262b0bc64dfc 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1287,6 +1287,10 @@ static inline int __kvm_irq_line_state(unsigned long *irq_state, return !!(*irq_state); } +#define KVM_MMU_ROOT_CURRENT BIT(0) +#define KVM_MMU_ROOT_PREVIOUS BIT(1) +#define KVM_MMU_ROOTS_ALL (~0UL) + int kvm_pic_set_irq(struct kvm_pic *pic, int irq, int irq_source_id, int level); void kvm_pic_clear_all(struct kvm_pic *pic, int irq_source_id); @@ -1298,7 +1302,7 @@ void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu); int kvm_mmu_load(struct kvm_vcpu *vcpu); void kvm_mmu_unload(struct kvm_vcpu *vcpu); void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu); -void kvm_mmu_free_roots(struct kvm_vcpu *vcpu, bool free_prev_root); +void kvm_mmu_free_roots(struct kvm_vcpu *vcpu, ulong roots_to_free); gpa_t translate_nested_gpa(struct kvm_vcpu *vcpu, gpa_t gpa, u32 access, struct x86_exception *exception); gpa_t kvm_mmu_gva_to_gpa_read(struct kvm_vcpu *vcpu, gva_t gva, |