Message ID | 20220309064324.58213-1-likexu@tencent.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: x86/xen: Use a safer data type for delta to avoid shift-count-overflow | expand |
diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index 8c85a71aa8ca..097181613be5 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -1204,7 +1204,7 @@ static bool kvm_xen_hcall_set_timer_op(struct kvm_vcpu *vcpu, uint64_t timeout, if (timeout) { uint64_t guest_now = get_kvmclock_ns(vcpu->kvm); - long delta = timeout - guest_now; + uint64_t delta = timeout - guest_now; /* Xen has a 'Linux workaround' in do_set_timer_op() which * checks for negative absolute timeout values (caused by