public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Parri <parri.andrea@gmail.com>
To: Tong Tiangen <tongtiangen@huawei.com>
Cc: Guo Ren <guoren@kernel.org>, Jisheng Zhang <jszhang@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: fix race when vmap stack overflow
Date: Fri, 21 Oct 2022 15:22:48 +0200	[thread overview]
Message-ID: <Y1KdKATQx16Xl/iL@andrea> (raw)
In-Reply-To: <ed7c4027-8e15-245f-cdda-0551063761e7@huawei.com>

Hi Tong,
 
> > > I use atomic_set_release here, because I need earlier memory
> > > operations finished to make sure the sp is ready then set the spin
> > > flag.

> 	Consider this implementation:)
> 
> 	smp_store_mb(&spin_shadow_stack, 0);

smp_store_mb() has "WRITE_ONCE(); smp_mb()" semantics; so it doesn't
guarantee that the store to spin_shadow_stack is ordered after program
-order earlier memory accesses.

  Andrea

  reply	other threads:[~2022-10-21 13:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 15:47 [PATCH] riscv: fix race when vmap stack overflow Jisheng Zhang
2022-10-20  1:02 ` Guo Ren
2022-10-20  2:16 ` Guo Ren
2022-10-20 14:38   ` Jisheng Zhang
2022-10-21  0:35     ` Guo Ren
2022-10-20 23:26 ` Andrea Parri
2022-10-21  1:11   ` Guo Ren
2022-10-21  8:36     ` Andrea Parri
2022-10-21 12:08       ` Tong Tiangen
2022-10-21 13:22         ` Andrea Parri [this message]
2022-10-21 13:46           ` Tong Tiangen
2022-10-21 14:41             ` Guo Ren
2022-10-21 15:17               ` Tong Tiangen
2022-10-21 14:35       ` Guo Ren

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=Y1KdKATQx16Xl/iL@andrea \
    --to=parri.andrea@gmail.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=guoren@kernel.org \
    --cc=jszhang@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=tongtiangen@huawei.com \
    /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