]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: s390: Replace KVM_REQ_MMU_RELOAD usage with arch specific request
authorSean Christopherson <seanjc@google.com>
Fri, 25 Feb 2022 18:22:46 +0000 (18:22 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 1 Mar 2022 13:58:25 +0000 (08:58 -0500)
Add an arch request, KVM_REQ_REFRESH_GUEST_PREFIX, to deal with guest
prefix changes instead of piggybacking KVM_REQ_MMU_RELOAD.  This will
allow for the removal of the generic KVM_REQ_MMU_RELOAD, which isn't
actually used by generic KVM.

No functional change intended.

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220225182248.3812651-6-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/s390/include/asm/kvm_host.h
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/kvm-s390.h

index a22c9266ea05f3d2d2975d7e1d2b7b14992d6b83..766028d54a3efef4d88c89bbc0cbbeff7cf11aa9 100644 (file)
@@ -45,6 +45,8 @@
 #define KVM_REQ_START_MIGRATION KVM_ARCH_REQ(3)
 #define KVM_REQ_STOP_MIGRATION  KVM_ARCH_REQ(4)
 #define KVM_REQ_VSIE_RESTART   KVM_ARCH_REQ(5)
+#define KVM_REQ_REFRESH_GUEST_PREFIX   \
+       KVM_ARCH_REQ_FLAGS(6, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
 
 #define SIGP_CTRL_C            0x80
 #define SIGP_CTRL_SCN_MASK     0x3f
index e056ad86ccd2a05dd9106682e55d026d7de44cce..5b2b3cbf0d554b8fb2ab644c433618235ae48035 100644 (file)
@@ -3481,7 +3481,7 @@ static void kvm_gmap_notifier(struct gmap *gmap, unsigned long start,
                if (prefix <= end && start <= prefix + 2*PAGE_SIZE - 1) {
                        VCPU_EVENT(vcpu, 2, "gmap notifier for %lx-%lx",
                                   start, end);
-                       kvm_s390_sync_request(KVM_REQ_MMU_RELOAD, vcpu);
+                       kvm_s390_sync_request(KVM_REQ_REFRESH_GUEST_PREFIX, vcpu);
                }
        }
 }
@@ -3883,19 +3883,19 @@ retry:
        if (!kvm_request_pending(vcpu))
                return 0;
        /*
-        * We use MMU_RELOAD just to re-arm the ipte notifier for the
+        * If the guest prefix changed, re-arm the ipte notifier for the
         * guest prefix page. gmap_mprotect_notify will wait on the ptl lock.
         * This ensures that the ipte instruction for this request has
         * already finished. We might race against a second unmapper that
         * wants to set the blocking bit. Lets just retry the request loop.
         */
-       if (kvm_check_request(KVM_REQ_MMU_RELOAD, vcpu)) {
+       if (kvm_check_request(KVM_REQ_REFRESH_GUEST_PREFIX, vcpu)) {
                int rc;
                rc = gmap_mprotect_notify(vcpu->arch.gmap,
                                          kvm_s390_get_prefix(vcpu),
                                          PAGE_SIZE * 2, PROT_WRITE);
                if (rc) {
-                       kvm_make_request(KVM_REQ_MMU_RELOAD, vcpu);
+                       kvm_make_request(KVM_REQ_REFRESH_GUEST_PREFIX, vcpu);
                        return rc;
                }
                goto retry;
index 098831e815e6c2e0d2b145e1670849879264fdf3..45b7c1edd85f111665d0beb28f2e1f87be8c9a7a 100644 (file)
@@ -105,7 +105,7 @@ static inline void kvm_s390_set_prefix(struct kvm_vcpu *vcpu, u32 prefix)
                   prefix);
        vcpu->arch.sie_block->prefix = prefix >> GUEST_PREFIX_SHIFT;
        kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);
-       kvm_make_request(KVM_REQ_MMU_RELOAD, vcpu);
+       kvm_make_request(KVM_REQ_REFRESH_GUEST_PREFIX, vcpu);
 }
 
 static inline u64 kvm_s390_get_base_disp_s(struct kvm_vcpu *vcpu, u8 *ar)