KVM: xen: ignore the VCPU_SSHOTTMR_future flag
Subsystems (4)
Paul Durrant
maintainerPATCH 1/1 KVM: xen: ignore the VCPU_SSHOTTMR_future flag
From: Paul Durrant <[email protected]>
Upstream Xen now ignores this flag [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
---
Cc: David Woodhouse <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: [email protected]
--- arch/x86/kvm/xen.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
arch/x86/kvm/xen.c +1 -5
@@ -1374,12 +1374,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;
Signature · 1 line
2.39.2
Quoted 10 lines · Paul Durrant
From: Paul Durrant <[email protected]>
Upstream Xen now ignores this flag [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 <[email protected]>
nit: I think the commit title should probably be 'KVM: x86:' and then mention Xen somewhere in the rest of the line?
Quoted 32 lines
---
Cc: David Woodhouse <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: [email protected]
---
arch/x86/kvm/xen.c | 6 +-----1 file changed, 1 insertion(+), 5 deletions(-)arch/x86/kvm/xen.c +0
-0@@ -1374,12 +1374,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;
Sean Christopherson
maintainerQuoted 3 lines · David Woodhouse
On Wed, 2023-10-04 at 17:11 +0000, Paul Durrant wrote:
nit: I think the commit title should probably be 'KVM: x86:' and then mention Xen somewhere in the rest of the line?
I would also be ok if we start doing "KVM: x86/xen:", because it seems like y'all are sending enough Xen specific changes that differentiating would be useful.
Quoted 7 lines · Sean Christopherson
Quoted 3 lines · David Woodhouse
On Wed, 2023-10-04 at 17:11 +0000, Paul Durrant wrote:
nit: I think the commit title should probably be 'KVM: x86:' and then mention Xen somewhere in the rest of the line?I would also be ok if we start doing "KVM: x86/xen:", because it seems like y'all are sending enough Xen specific changes that differentiating would be useful.
Ok, I'll send a v2 with an amended subject line.
Paul