From: Greg KH <greg@kroah.com>
To: Andy Lutomirski <luto@kernel.org>
Cc: x86@kernel.org,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
LKML <linux-kernel@vger.kernel.org>,
Nicholas Piggin <npiggin@gmail.com>,
Arnd Bergmann <arnd@arndb.de>, Anton Blanchard <anton@ozlabs.org>,
Thomas Gleixner <tglx@linutronix.de>,
stable@vger.kernel.org
Subject: Re: [PATCH backport] membarrier: Explicitly sync remote cores when SYNC_CORE is requested
Date: Sat, 19 Dec 2020 13:46:08 +0100 [thread overview]
Message-ID: <X932EI8RN90rRjyP@kroah.com> (raw)
In-Reply-To: <b0ddbb1195c5b9851cb3e9d079870b4752fdadb6.1607968697.git.luto@kernel.org>
On Mon, Dec 14, 2020 at 10:00:43AM -0800, Andy Lutomirski wrote:
> commit 758c9373d84168dc7d039cf85a0e920046b17b41 upstream
>
> membarrier() does not explicitly sync_core() remote CPUs; instead, it
> relies on the assumption that an IPI will result in a core sync. On x86,
> this may be true in practice, but it's not architecturally reliable. In
> particular, the SDM and APM do not appear to guarantee that interrupt
> delivery is serializing. While IRET does serialize, IPI return can
> schedule, thereby switching to another task in the same mm that was
> sleeping in a syscall. The new task could then SYSRET back to usermode
> without ever executing IRET.
>
> Make this more robust by explicitly calling sync_core_before_usermode()
> on remote cores. (This also helps people who search the kernel tree for
> instances of sync_core() and sync_core_before_usermode() -- one might be
> surprised that the core membarrier code doesn't currently show up in a
> such a search.)
>
> Fixes: 70216e18e519 ("membarrier: Provide core serializing command, *_SYNC_CORE")
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/r/776b448d5f7bd6b12690707f5ed67bcda7f1d427.1607058304.git.luto@kernel.org
> ---
>
> My stable membarrier series depends on commit 2a36ab717e8f
> ("rseq/membarrier: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ"). I don't
> think it makes much sense to backport that feature, so here's a backport of
> the patch that doesn't need it.
Now queued up to 5.4.y and 5.9.y, thanks.
greg k-h
prev parent reply other threads:[~2020-12-19 12:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-14 18:00 Andy Lutomirski
2020-12-19 12:46 ` Greg KH [this message]
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=X932EI8RN90rRjyP@kroah.com \
--to=greg@kroah.com \
--cc=anton@ozlabs.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=npiggin@gmail.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 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®