From: Tong Tiangen <tongtiangen@huawei.com>
To: Andrea Parri <parri.andrea@gmail.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 21:46:23 +0800 [thread overview]
Message-ID: <f1eb4756-e1e1-1f12-e767-a69a891786d6@huawei.com> (raw)
In-Reply-To: <Y1KdKATQx16Xl/iL@andrea>
在 2022/10/21 21:22, Andrea Parri 写道:
> 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
> .
Hi Andrea:
IIUC, the earlier memory access amoswap.aqrl, here .aqrl guarantee it.
But anyway, consider we don't care about performance here, using
smp_store_release()(add barrier()) surely right.
Thanks,
Tong.
next prev parent reply other threads:[~2022-10-21 13:46 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
2022-10-21 13:46 ` Tong Tiangen [this message]
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=f1eb4756-e1e1-1f12-e767-a69a891786d6@huawei.com \
--to=tongtiangen@huawei.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=parri.andrea@gmail.com \
--cc=paul.walmsley@sifive.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