Re: [EXTERNAL] [PATCH 2/2] KVM: x86: disable interrupts while pvclock_gtod_sync_lock is taken

2021-04-01 Thread David Woodhouse
On Tue, 2021-03-30 at 12:59 -0400, Paolo Bonzini wrote: > @@ -2686,13 +2688,13 @@ static int kvm_guest_time_update(struct > kvm_vcpu *v) > * If the host uses TSC clock, then passthrough TSC as stable > * to the guest. > */ > - spin_lock(>pvclock_gtod_sync_lock); >

Re: [EXTERNAL] [PATCH 2/2] KVM: x86: disable interrupts while pvclock_gtod_sync_lock is taken

2021-04-01 Thread Paolo Bonzini
On 01/04/21 17:27, David Woodhouse wrote: - spin_lock(>pvclock_gtod_sync_lock); + spin_lock_irqsave(>pvclock_gtod_sync_lock, flags); use_master_clock = ka->use_master_clock; if (use_master_clock) { host_tsc = ka->master_cycle_now;

Re: [PATCH 2/2] KVM: x86: disable interrupts while pvclock_gtod_sync_lock is taken

2021-03-30 Thread Wanpeng Li
On Wed, 31 Mar 2021 at 01:01, Paolo Bonzini wrote: > > pvclock_gtod_sync_lock can be taken with interrupts disabled if the > preempt notifier calls get_kvmclock_ns to update the Xen > runstate information: > >spin_lock include/linux/spinlock.h:354 [inline] >get_kvmclock_ns+0x25/0x390

[PATCH 2/2] KVM: x86: disable interrupts while pvclock_gtod_sync_lock is taken

2021-03-30 Thread Paolo Bonzini
pvclock_gtod_sync_lock can be taken with interrupts disabled if the preempt notifier calls get_kvmclock_ns to update the Xen runstate information: spin_lock include/linux/spinlock.h:354 [inline] get_kvmclock_ns+0x25/0x390 arch/x86/kvm/x86.c:2587 kvm_xen_update_runstate+0x3d/0x2c0