[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <42e15cc4-56d1-b34b-d97e-d579e771788a@xen.org>
Date: Mon, 8 Feb 2021 11:50:58 +0000
From: Julien Grall <julien@....org>
To: Jürgen Groß <jgross@...e.com>,
Jan Beulich <jbeulich@...e.com>
Cc: Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Stefano Stabellini <sstabellini@...nel.org>,
linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org
Subject: Re: [PATCH 7/7] xen/evtchn: read producer index only once
On 08/02/2021 10:59, Jürgen Groß wrote:
> On 08.02.21 11:51, Jan Beulich wrote:
> Yes, but I don't see an urgent need to fix that, as there would
> be thousands of accesses in the kernel needing a fix. A compiler
> tearing a naturally aligned access into multiple memory accesses
> would be rejected as buggy from the kernel community IMO.
I would not be so sure. From lwn [1]:
"In the Linux kernel, tearing of plain C-language loads has been
observed even given properly aligned and machine-word-sized loads.)"
And for store tearing:
"Note that this tearing can happen even on properly aligned and
machine-word-sized accesses, and in this particular case, even for
volatile stores. Some might argue that this behavior constitutes a bug
in the compiler, but either way it illustrates the perceived value of
store tearing from a compiler-writer viewpoint. [...] But for properly
aligned machine-sized stores, WRITE_ONCE() will prevent store tearing."
Cheers,
[1] https://lwn.net/Articles/793253/#Load%20Tearing
>
>
> Juergen
--
Julien Grall
Powered by blists - more mailing lists