All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Juergen Gross" <jgross@suse.com>
Cc: "Borislav Petkov" <bp@alien8.de>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"the arch/x86 maintainers" <x86@kernel.org>, <tglx@linutronix.de>,
	"xen-devel" <xen-devel@lists.xenproject.org>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	<longman@redhat.com>, <mingo@redhat.com>,
	<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>,
	<hpa@zytor.com>
Subject: Re: [Xen-devel] [PATCH 1/2] xen: fix race in xen_qlock_wait()
Date: Mon, 01 Oct 2018 02:54:13 -0600	[thread overview]
Message-ID: <5BB1E0B502000078001ED124@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <20181001071641.19282-2-jgross@suse.com>

>>> 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?

> takes lock again
>                                                   tries to get lock
>                                                   -> *lock = _Q_SLOW_VAL
>                         -> *lock == _Q_SLOW_VAL ?
>                         -> xen_poll_irq()
> frees the lock
> -> xen_qlock_kick(cpu3)
> 
> And cpu 2 will sleep forever.
> 
> This can be avoided easily by modifying xen_qlock_wait() to call
> xen_poll_irq() only if the related irq was not pending and to call
> xen_clear_irq_pending() only if it was pending.
> 
> Cc: stable@vger.kernel.org 
> Cc: Waiman.Long@hp.com 
> Cc: peterz@infradead.org 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Patch itself
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan



  parent reply	other threads:[~2018-10-01  8:54 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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  7:37   ` Juergen Gross
2018-10-01  7:37   ` Juergen Gross
2018-10-01  8:54   ` Jan Beulich
2018-10-01  8:54   ` Jan Beulich [this message]
2018-10-01  7:16 ` Juergen Gross
2018-10-01  7:16 ` [PATCH 2/2] xen: make xen_qlock_wait() nestable Juergen Gross
2018-10-01  7:16 ` Juergen Gross
2018-10-01  7:38   ` Juergen Gross
2018-10-01  7:38   ` Juergen Gross
2018-10-01  8:57   ` Jan Beulich
2018-10-01  8:57   ` [Xen-devel] " Jan Beulich
     [not found]   ` <5BB1E18802000078001ED127@suse.com>
2018-10-01  9:03     ` Juergen Gross
2018-10-01  9:18       ` Jan Beulich
2018-10-01  9:18       ` Jan Beulich
2018-10-10 11:53   ` David Woodhouse
2018-10-10 12:30     ` Thomas Gleixner
2018-10-10 12:30     ` Thomas Gleixner
2018-10-10 12:44       ` David Woodhouse
2018-10-10 12:47         ` Thomas Gleixner
2018-10-10 12:47         ` Thomas Gleixner
2018-10-10 13:38           ` Juergen Gross
2018-10-10 13:53             ` David Woodhouse
2018-10-10 13:53             ` David Woodhouse
2018-10-10 13:38           ` Juergen Gross
2018-10-10 12:44       ` David Woodhouse
2018-10-10 11:53   ` David Woodhouse
2018-10-01  7:37 ` [PATCH 0/2] xen: fix two issues in Xen pv qspinlock handling Juergen Gross
2018-10-01  7:37 ` Juergen Gross
2018-10-09 14:40 ` David Woodhouse
2018-10-09 14:52   ` Juergen Gross
2018-10-09 14:52   ` Juergen Gross
2018-10-09 14:40 ` David Woodhouse
2018-10-01  8:58 [Xen-devel] [PATCH 1/2] xen: fix race in xen_qlock_wait() Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5BB1E0B502000078001ED124@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.