mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [Xen-devel] [PATCH 1/2] xen: fix race in xen_qlock_wait()
@ 2018-10-01  8:58 Juergen Gross
  0 siblings, 0 replies; 2+ messages in thread
From: Juergen Gross @ 2018-10-01  8:58 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Borislav Petkov, Peter Zijlstra, the arch/x86 maintainers,
	Thomas Gleixner, xen-devel, Boris Ostrovsky, longman, mingo,
	lkml, stable, H. Peter Anvin

On 01/10/2018 10:54, Jan Beulich wrote:
>>>> On 01.10.18 at 09:16, <jgross@suse.com> wrote:
>> In the following situation a vcpu waiting for a lock might not be
>> woken up from xen_poll_irq():
>>
>> CPU 1:                CPU 2:                      CPU 3:
>> takes a spinlock
>>                       tries to get lock
>>                       -> xen_qlock_wait()
>>                         -> xen_clear_irq_pending()
> 
> Doesn't the last line above ...
> 
>> frees the lock
>> -> xen_qlock_kick(cpu2)
> 
> ... need to be below here?

You are right, of course!

Thanks for noticing.


Juergen

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH 0/2] xen: fix two issues in Xen pv qspinlock handling
@ 2018-10-01  7:16 Juergen Gross
  2018-10-01  7:16 ` [PATCH 1/2] xen: fix race in xen_qlock_wait() Juergen Gross
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2018-10-01  7:16 UTC (permalink / raw)
  To: linux-kernel, xen-devel, x86
  Cc: boris.ostrovsky, hpa, tglx, mingo, bp, Juergen Gross,
	Waiman.Long, peterz

The Xen specific queue spinlock wait function has two issues which
could result in a hanging system.

They have a similar root cause of clearing a pending wakeup of a
waiting vcpu and later going to sleep waiting for the just cleared
wakeup event, which of course won't ever happen.

Juergen Gross (2):
  xen: fix race in xen_qlock_wait()
  xen: make xen_qlock_wait() nestable

 arch/x86/xen/spinlock.c | 33 ++++++++++++---------------------
 1 file changed, 12 insertions(+), 21 deletions(-)

Cc: Waiman.Long@hp.com
Cc: peterz@infradead.org

-- 
2.16.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-01  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01  8:58 [Xen-devel] [PATCH 1/2] xen: fix race in xen_qlock_wait() Juergen Gross
  -- strict thread matches above, loose matches on Subject: below --
2018-10-01  7:16 [PATCH 0/2] xen: fix two issues in Xen pv qspinlock handling Juergen Gross
2018-10-01  7:16 ` [PATCH 1/2] xen: fix race in xen_qlock_wait() Juergen Gross
2018-10-01  8:54   ` [Xen-devel] " Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®