summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorPaolo Bonzini2015-05-18 13:20:23 +0200
committerPaolo Bonzini2015-05-28 10:42:58 +0200
commitf36f3f2846b5578d62910ee0b6dbef59fdd1cfa4 (patch)
treecb8e161adbf3d4f32e871e73d445d8e23856cc4b /arch/x86/kvm/mmu.c
parentKVM: add memslots argument to kvm_arch_memslots_updated (diff)
downloadkernel-qcow2-linux-f36f3f2846b5578d62910ee0b6dbef59fdd1cfa4.tar.gz
kernel-qcow2-linux-f36f3f2846b5578d62910ee0b6dbef59fdd1cfa4.tar.xz
kernel-qcow2-linux-f36f3f2846b5578d62910ee0b6dbef59fdd1cfa4.zip
KVM: add "new" argument to kvm_arch_commit_memory_region
This lets the function access the new memory slot without going through kvm_memslots and id_to_memslot. It will simplify the code when more than one address space will be supported. Unfortunately, the "const"ness of the new argument must be casted away in two places. Fixing KVM to accept const struct kvm_memory_slot pointers would require modifications in pretty much all architectures, and is left for later. Reviewed-by: Radim Krcmar <rkrcmar@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 49c34e632b91..1bf2ae9ca521 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -4621,10 +4621,12 @@ restart:
}
void kvm_mmu_zap_collapsible_sptes(struct kvm *kvm,
- struct kvm_memory_slot *memslot)
+ const struct kvm_memory_slot *memslot)
{
+ /* FIXME: const-ify all uses of struct kvm_memory_slot. */
spin_lock(&kvm->mmu_lock);
- slot_handle_leaf(kvm, memslot, kvm_mmu_zap_collapsible_spte, true);
+ slot_handle_leaf(kvm, (struct kvm_memory_slot *)memslot,
+ kvm_mmu_zap_collapsible_spte, true);
spin_unlock(&kvm->mmu_lock);
}