[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1KdKATQx16Xl/iL@andrea>
Date: Fri, 21 Oct 2022 15:22:48 +0200
From: Andrea Parri <parri.andrea@...il.com>
To: Tong Tiangen <tongtiangen@...wei.com>
Cc: Guo Ren <guoren@...nel.org>, Jisheng Zhang <jszhang@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] riscv: fix race when vmap stack overflow
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
Powered by blists - more mailing lists