KVM: x86/xen: ignore the VCPU_SSHOTTMR_future flag
authorPaul Durrant <pdurrant@amazon.com>
Wed, 4 Oct 2023 17:46:28 +0000 (17:46 +0000)
committerSean Christopherson <seanjc@google.com>
Wed, 4 Oct 2023 22:22:58 +0000 (15:22 -0700)
Upstream Xen now ignores _VCPU_SSHOTTMR_future[1], since the only guest
kernel ever to use it was buggy. By ignoring the flag the guest will
always get a callback if it sets a negative timeout which upstream Xen
has determined not to cause problems for any guest setting the flag.

[1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=19c6cbd909

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Link: https://lore.kernel.org/r/20231004174628.2073263-1-paul@xen.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/xen.c

index 75586da134b38b0bb6280ff32ee6ae71051b39c7..c539f18e0b608f46acb93993501bbf4421e7eea7 100644 (file)
@@ -1423,12 +1423,8 @@ static bool kvm_xen_hcall_vcpu_op(struct kvm_vcpu *vcpu, bool longmode, int cmd,
                        return true;
                }
 
+               /* A delta <= 0 results in an immediate callback, which is what we want */
                delta = oneshot.timeout_abs_ns - get_kvmclock_ns(vcpu->kvm);
-               if ((oneshot.flags & VCPU_SSHOTTMR_future) && delta < 0) {
-                       *r = -ETIME;
-                       return true;
-               }
-
                kvm_xen_start_timer(vcpu, oneshot.timeout_abs_ns, delta);
                *r = 0;
                return true;