Re: [PATCH] arm64: mte: Clear SCTLR_EL1.TCF0 on exec

From
Catalin Marinas <catalin.marinas@arm.com>
Date
2020-02-12 17:03:57
Also in
linux-arch, linux-mm
Reply to
Peter Collingbourne, 2019-12-20
On Thu, Dec 19, 2019 at 05:48:53PM -0800, Peter Collingbourne wrote:
On Thu, Dec 19, 2019 at 12:32 PM Peter Collingbourne [off-list ref] wrote:
quoted
On Wed, Dec 11, 2019 at 10:45 AM Catalin Marinas
[off-list ref] wrote:
quoted
+       if (current->thread.sctlr_tcf0 != next->thread.sctlr_tcf0)
+               update_sctlr_el1_tcf0(next->thread.sctlr_tcf0);
I don't entirely understand why yet, but I've found that this check is
insufficient for ensuring consistency between SCTLR_EL1.TCF0 and
sctlr_tcf0. In my Android test environment with some processes having
sctlr_tcf0=SCTLR_EL1_TCF0_SYNC and others having sctlr_tcf0=0, I am
seeing intermittent tag failures coming from the sctlr_tcf0=0
processes. With this patch:
[...]
quoted
Since sysreg_clear_set only sets the sysreg if it ended up changing, I
wouldn't expect this to cause a significant performance hit unless
just reading SCTLR_EL1 is expensive. That being said, if the
inconsistency is indicative of a deeper problem, we should probably
address that.
I tracked it down to the flush_mte_state() function setting sctlr_tcf0 but
failing to update SCTLR_EL1.TCF0. With this patch I am not seeing any more
inconsistencies.
Thanks Peter. I folded in your fix.

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (45 messages) 45 messages, 5 authors, last reply 2020-02-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help