aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2016-03-08 05:52:54 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-06-20 03:46:48 -0400
commit414d3b07496604a4372466a6b474ca24291a143c (patch)
tree2d3a2610ec945377f27fc2b72744ac8511e1709d /arch/s390/kvm
parent64672c95ea4c2f7096e519e826076867e8ef0938 (diff)
s390/kvm: page table invalidation notifier
Pass an address range to the page table invalidation notifier for KVM. This allows to notify changes that affect a larger virtual memory area, e.g. for 1MB pages. Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/kvm-s390.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 0dcf9b8fc12c..67f1b6b4c060 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -150,7 +150,8 @@ int kvm_arch_hardware_enable(void)
150 return 0; 150 return 0;
151} 151}
152 152
153static void kvm_gmap_notifier(struct gmap *gmap, unsigned long address); 153static void kvm_gmap_notifier(struct gmap *gmap, unsigned long start,
154 unsigned long end);
154 155
155/* 156/*
156 * This callback is executed during stop_machine(). All CPUs are therefore 157 * This callback is executed during stop_machine(). All CPUs are therefore
@@ -1976,16 +1977,23 @@ void kvm_s390_sync_request(int req, struct kvm_vcpu *vcpu)
1976 kvm_s390_vcpu_request(vcpu); 1977 kvm_s390_vcpu_request(vcpu);
1977} 1978}
1978 1979
1979static void kvm_gmap_notifier(struct gmap *gmap, unsigned long address) 1980static void kvm_gmap_notifier(struct gmap *gmap, unsigned long start,
1981 unsigned long end)
1980{ 1982{
1981 int i;
1982 struct kvm *kvm = gmap->private; 1983 struct kvm *kvm = gmap->private;
1983 struct kvm_vcpu *vcpu; 1984 struct kvm_vcpu *vcpu;
1985 unsigned long prefix;
1986 int i;
1984 1987
1988 if (start >= 1UL << 31)
1989 /* We are only interested in prefix pages */
1990 return;
1985 kvm_for_each_vcpu(i, vcpu, kvm) { 1991 kvm_for_each_vcpu(i, vcpu, kvm) {
1986 /* match against both prefix pages */ 1992 /* match against both prefix pages */
1987 if (kvm_s390_get_prefix(vcpu) == (address & ~0x1000UL)) { 1993 prefix = kvm_s390_get_prefix(vcpu);
1988 VCPU_EVENT(vcpu, 2, "gmap notifier for %lx", address); 1994 if (prefix <= end && start <= prefix + 2*PAGE_SIZE - 1) {
1995 VCPU_EVENT(vcpu, 2, "gmap notifier for %lx-%lx",
1996 start, end);
1989 kvm_s390_sync_request(KVM_REQ_MMU_RELOAD, vcpu); 1997 kvm_s390_sync_request(KVM_REQ_MMU_RELOAD, vcpu);
1990 } 1998 }
1991 } 1999 }