diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2013-03-25 12:22:48 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-04-02 09:14:07 -0400 |
commit | 2cef4deb4018c02fb3cd08f76c8a988f7ddee480 (patch) | |
tree | 8a97a4fa75b0b1c03afdb55b213e72b402e90673 /arch/s390/kvm | |
parent | 9a6d77d553856f461cdb5b6969b48da3a2b1f8e9 (diff) |
KVM: s390: Dont do a gmap update on minor memslot changes
Some memslot updates dont affect the gmap implementation,
e.g. setting/unsetting dirty tracking. Since a gmap update
will cause tlb flushes and segment table invalidations we
want to avoid that.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 33161b4a8280..f241e3315ebb 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -1007,6 +1007,16 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, | |||
1007 | { | 1007 | { |
1008 | int rc; | 1008 | int rc; |
1009 | 1009 | ||
1010 | /* If the basics of the memslot do not change, we do not want | ||
1011 | * to update the gmap. Every update causes several unnecessary | ||
1012 | * segment translation exceptions. This is usually handled just | ||
1013 | * fine by the normal fault handler + gmap, but it will also | ||
1014 | * cause faults on the prefix page of running guest CPUs. | ||
1015 | */ | ||
1016 | if (old->userspace_addr == mem->userspace_addr && | ||
1017 | old->base_gfn * PAGE_SIZE == mem->guest_phys_addr && | ||
1018 | old->npages * PAGE_SIZE == mem->memory_size) | ||
1019 | return; | ||
1010 | 1020 | ||
1011 | rc = gmap_map_segment(kvm->arch.gmap, mem->userspace_addr, | 1021 | rc = gmap_map_segment(kvm->arch.gmap, mem->userspace_addr, |
1012 | mem->guest_phys_addr, mem->memory_size); | 1022 | mem->guest_phys_addr, mem->memory_size); |