linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] arch: ARM64: add isb before enable pan
@ 2021-10-08  6:07 Huangzhaoyang
  2021-10-08  8:01 ` Will Deacon
  0 siblings, 1 reply; 10+ messages in thread
From: Huangzhaoyang @ 2021-10-08  6:07 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Mark Rutland, Suzuki K Poulose,
	Ionela Voinescu, Quentin Perret, Vladimir Murzin,
	linux-arm-kernel, Zhaoyang Huang, linux-kernel, ke.wang

From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>

set_pstate_pan failure is observed in an ARM64 system occasionaly on a reboot
test, which can be work around by a msleep on the sw context. We assume
suspicious on disorder of previous instr of disabling SW_PAN and add an isb here.

PS:
The bootup test failed with a invalid TTBR1_EL1 that equals 0x34000000, which is
alike racing between on chip PAN and SW_PAN.

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
 arch/arm64/kernel/cpufeature.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index efed283..3c0de0d 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1663,6 +1663,7 @@ static void cpu_enable_pan(const struct arm64_cpu_capabilities *__unused)
 	WARN_ON_ONCE(in_interrupt());
 
 	sysreg_clear_set(sctlr_el1, SCTLR_EL1_SPAN, 0);
+	isb();
 	set_pstate_pan(1);
 }
 #endif /* CONFIG_ARM64_PAN */
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-10-11 12:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-08  6:07 [RFC PATCH] arch: ARM64: add isb before enable pan Huangzhaoyang
2021-10-08  8:01 ` Will Deacon
2021-10-08  8:34   ` Zhaoyang Huang
2021-10-08  8:45     ` Catalin Marinas
2021-10-08  8:55       ` Zhaoyang Huang
2021-10-08  9:07         ` Catalin Marinas
2021-10-11  2:49           ` Zhaoyang Huang
2021-10-11  9:38     ` Mark Rutland
2021-10-11 11:08       ` Zhaoyang Huang
2021-10-11 12:15         ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).