* x86: possible store-tearing in native_set_pte?
@ 2016-04-26 0:24 Nadav Amit
2016-04-26 0:40 ` Nadav Amit
0 siblings, 1 reply; 3+ messages in thread
From: Nadav Amit @ 2016-04-26 0:24 UTC (permalink / raw)
To: linux-mm
Can someone please explain why it is ok for native_set_pte to assign the PTE
without WRITE_ONCE() ?
Couldn’t a PTE write be torn, and the PTE be prefetched in between (or even
used for translation by another core)?
I did not encounter this case, but it seems to me possible according to the
documentation:
Intel SDM 4.10.2.3 “Detail of TLB Use": "The processor may cache
translations required for prefetches and for accesses ... that would never
actually occur in the executed code path.”
Documentation/memory-barriers.txt: "The compiler is within its rights to
invent stores to a variable”.
Thanks,
Nadav
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: x86: possible store-tearing in native_set_pte?
2016-04-26 0:24 x86: possible store-tearing in native_set_pte? Nadav Amit
@ 2016-04-26 0:40 ` Nadav Amit
2016-05-16 14:18 ` Vlastimil Babka
0 siblings, 1 reply; 3+ messages in thread
From: Nadav Amit @ 2016-04-26 0:40 UTC (permalink / raw)
To: linux-mm
Resending with fixed formatting (sorry for that):
Can someone please explain why it is ok for native_set_pte to assign
the PTE without WRITE_ONCE() ?
Isn't it possible for a PTE write to be torn, and the PTE to be
prefetched in between (or even used for translation by another core)?
I did not encounter this case, but it seems to me possible according
to the documentation:
Intel SDM 4.10.2.3 "Detail of TLB Use": "The processor may cache
translations required for prefetches and for accesses ... that would
never actually occur in the executed code path."
Documentation/memory-barriers.txt: "The compiler is within its rights
to invent stores to a variable".
Thanks,
Nadav
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: x86: possible store-tearing in native_set_pte?
2016-04-26 0:40 ` Nadav Amit
@ 2016-05-16 14:18 ` Vlastimil Babka
0 siblings, 0 replies; 3+ messages in thread
From: Vlastimil Babka @ 2016-05-16 14:18 UTC (permalink / raw)
To: Nadav Amit, linux-mm
On 04/26/2016 02:40 AM, Nadav Amit wrote:
> Resending with fixed formatting (sorry for that):
>
> Can someone please explain why it is ok for native_set_pte to assign
> the PTE without WRITE_ONCE() ?
You should probably ask also x86 maintainers/list. IMHO you might have a
point, but I may be missing something.
> Isn't it possible for a PTE write to be torn, and the PTE to be
> prefetched in between (or even used for translation by another core)?
>
> I did not encounter this case, but it seems to me possible according
> to the documentation:
>
> Intel SDM 4.10.2.3 "Detail of TLB Use": "The processor may cache
> translations required for prefetches and for accesses ... that would
> never actually occur in the executed code path."
>
> Documentation/memory-barriers.txt: "The compiler is within its rights
> to invent stores to a variable".
>
> Thanks,
> Nadav
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-16 14:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 0:24 x86: possible store-tearing in native_set_pte? Nadav Amit
2016-04-26 0:40 ` Nadav Amit
2016-05-16 14:18 ` Vlastimil Babka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox