linux/arch/s390/kvm
Sean Christopherson df06dae3f2 KVM: Don't actually set a request when evicting vCPUs for GFN cache invd
Don't actually set a request bit in vcpu->requests when making a request
purely to force a vCPU to exit the guest.  Logging a request but not
actually consuming it would cause the vCPU to get stuck in an infinite
loop during KVM_RUN because KVM would see the pending request and bail
from VM-Enter to service the request.

Note, it's currently impossible for KVM to set KVM_REQ_GPC_INVALIDATE as
nothing in KVM is wired up to set guest_uses_pa=true.  But, it'd be all
too easy for arch code to introduce use of kvm_gfn_to_pfn_cache_init()
without implementing handling of the request, especially since getting
test coverage of MMU notifier interaction with specific KVM features
usually requires a directed test.

Opportunistically rename gfn_to_pfn_cache_invalidate_start()'s wake_vcpus
to evict_vcpus.  The purpose of the request is to get vCPUs out of guest
mode, it's supposed to _avoid_ waking vCPUs that are blocking.

Opportunistically rename KVM_REQ_GPC_INVALIDATE to be more specific as to
what it wants to accomplish, and to genericize the name so that it can
used for similar but unrelated scenarios, should they arise in the future.
Add a comment and documentation to explain why the "no action" request
exists.

Add compile-time assertions to help detect improper usage.  Use the inner
assertless helper in the one s390 path that makes requests without a
hardcoded request.

Cc: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220223165302.3205276-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-02 05:34:39 -04:00
..
diag.c KVM: s390: restore old debugfs names 2021-07-27 16:59:00 -04:00
gaccess.c KVM: s390: Add vm IOCTL for key checked guest absolute memory access 2022-02-14 16:12:57 +01:00
gaccess.h KVM: s390: Add vm IOCTL for key checked guest absolute memory access 2022-02-14 16:12:57 +01:00
guestdbg.c KVM: s390: Add memcg accounting to KVM allocations 2020-12-10 13:36:05 +01:00
intercept.c KVM: s390: Honor storage keys when accessing guest memory 2022-02-14 16:12:57 +01:00
interrupt.c KVM: s390: pv: make use of ultravisor AIV support 2022-02-25 14:30:13 +01:00
irq.h KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
Kconfig KVM: Use interval tree to do fast hva lookup in memslots 2021-12-08 04:24:32 -05:00
kvm-s390.c KVM: Don't actually set a request when evicting vCPUs for GFN cache invd 2022-04-02 05:34:39 -04:00
kvm-s390.h KVM: s390: Fix, test and feature for 5.18 part 2 2022-03-15 17:19:02 -04:00
Makefile KVM: s390: Use Makefile.kvm for common files 2021-12-09 12:58:33 -05:00
priv.c KVM: s390x: fix SCK locking 2022-03-14 16:12:27 +01:00
pv.c KVM: s390: Introduce kvm_s390_get_gfn_end() 2021-12-08 04:24:33 -05:00
sigp.c KVM: s390: Clarify SIGP orders versus STOP/RESTART 2021-12-17 14:52:47 +01:00
trace-s390.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vsie.c KVM: s390: Enable specification exception interpretation 2021-08-27 18:35:20 +02:00