Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: s390: Replace KVM_REQ_MMU_RELOAD usage with arch specific request

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>

authored by

Sean Christopherson and committed by
Paolo Bonzini
cc65c3a1 527d5cd7

+7 -5
+2
arch/s390/include/asm/kvm_host.h
··· 45 45 #define KVM_REQ_START_MIGRATION KVM_ARCH_REQ(3) 46 46 #define KVM_REQ_STOP_MIGRATION KVM_ARCH_REQ(4) 47 47 #define KVM_REQ_VSIE_RESTART KVM_ARCH_REQ(5) 48 + #define KVM_REQ_REFRESH_GUEST_PREFIX \ 49 + KVM_ARCH_REQ_FLAGS(6, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP) 48 50 49 51 #define SIGP_CTRL_C 0x80 50 52 #define SIGP_CTRL_SCN_MASK 0x3f
+4 -4
arch/s390/kvm/kvm-s390.c
··· 3481 3481 if (prefix <= end && start <= prefix + 2*PAGE_SIZE - 1) { 3482 3482 VCPU_EVENT(vcpu, 2, "gmap notifier for %lx-%lx", 3483 3483 start, end); 3484 - kvm_s390_sync_request(KVM_REQ_MMU_RELOAD, vcpu); 3484 + kvm_s390_sync_request(KVM_REQ_REFRESH_GUEST_PREFIX, vcpu); 3485 3485 } 3486 3486 } 3487 3487 } ··· 3883 3883 if (!kvm_request_pending(vcpu)) 3884 3884 return 0; 3885 3885 /* 3886 - * We use MMU_RELOAD just to re-arm the ipte notifier for the 3886 + * If the guest prefix changed, re-arm the ipte notifier for the 3887 3887 * guest prefix page. gmap_mprotect_notify will wait on the ptl lock. 3888 3888 * This ensures that the ipte instruction for this request has 3889 3889 * already finished. We might race against a second unmapper that 3890 3890 * wants to set the blocking bit. Lets just retry the request loop. 3891 3891 */ 3892 - if (kvm_check_request(KVM_REQ_MMU_RELOAD, vcpu)) { 3892 + if (kvm_check_request(KVM_REQ_REFRESH_GUEST_PREFIX, vcpu)) { 3893 3893 int rc; 3894 3894 rc = gmap_mprotect_notify(vcpu->arch.gmap, 3895 3895 kvm_s390_get_prefix(vcpu), 3896 3896 PAGE_SIZE * 2, PROT_WRITE); 3897 3897 if (rc) { 3898 - kvm_make_request(KVM_REQ_MMU_RELOAD, vcpu); 3898 + kvm_make_request(KVM_REQ_REFRESH_GUEST_PREFIX, vcpu); 3899 3899 return rc; 3900 3900 } 3901 3901 goto retry;
+1 -1
arch/s390/kvm/kvm-s390.h
··· 105 105 prefix); 106 106 vcpu->arch.sie_block->prefix = prefix >> GUEST_PREFIX_SHIFT; 107 107 kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu); 108 - kvm_make_request(KVM_REQ_MMU_RELOAD, vcpu); 108 + kvm_make_request(KVM_REQ_REFRESH_GUEST_PREFIX, vcpu); 109 109 } 110 110 111 111 static inline u64 kvm_s390_get_base_disp_s(struct kvm_vcpu *vcpu, u8 *ar)