diff mbox series

[09/17] kvm: arm: require KVM_CAP_SET_VCPU_EVENTS

Message ID 20231018163728.363879-10-pbonzini@redhat.com
State New
Headers show
Series kvm: drop support for really old kernels | expand

Commit Message

Paolo Bonzini Oct. 18, 2023, 4:37 p.m. UTC
KVM_CAP_SET_VCPU_EVENTS was added in Linux 4.19, released in 2018.
It was backported to RHEL8's 4.18 kernel and is in other supported distros
as well.

While it is nice that QEMU can run even on older kernels, for example
on boards that can only run old vendor kernels, I don't think this should
extend to ancient versions of KVM/ARM which, at the time, was still
moving pretty fast.  As a reference, 4.19 still had 32-bit
KVM support.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/arm/kvm.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index b66b936a958..a50e975181f 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -34,6 +34,7 @@ 
 #include "qemu/log.h"
 
 const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
+    KVM_CAP_INFO(VCPU_EVENTS),
     KVM_CAP_LAST_INFO
 };
 
@@ -756,10 +757,6 @@  int kvm_put_vcpu_events(ARMCPU *cpu)
     struct kvm_vcpu_events events;
     int ret;
 
-    if (!kvm_has_vcpu_events()) {
-        return 0;
-    }
-
     memset(&events, 0, sizeof(events));
     events.exception.serror_pending = env->serror.pending;
 
@@ -785,10 +782,6 @@  int kvm_get_vcpu_events(ARMCPU *cpu)
     struct kvm_vcpu_events events;
     int ret;
 
-    if (!kvm_has_vcpu_events()) {
-        return 0;
-    }
-
     memset(&events, 0, sizeof(events));
     ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_VCPU_EVENTS, &events);
     if (ret) {
@@ -927,7 +920,6 @@  static int kvm_arm_handle_dabt_nisv(CPUState *cs, uint64_t esr_iss,
          * synchronization can be exceptionally skipped.
          */
         events.exception.ext_dabt_pending = 1;
-        /* KVM_CAP_ARM_INJECT_EXT_DABT implies KVM_CAP_VCPU_EVENTS */
         if (!kvm_vcpu_ioctl(cs, KVM_SET_VCPU_EVENTS, &events)) {
             env->ext_dabt_raised = 1;
             return 0;