From: Huangzhaoyang <huangzhaoyang@gmail.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Ionela Voinescu <ionela.voinescu@arm.com>,
Quentin Perret <qperret@google.com>,
Vladimir Murzin <vladimir.murzin@arm.com>,
linux-arm-kernel@lists.infradead.org,
Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
linux-kernel@vger.kernel.org, ke.wang@unisoc.com
Subject: [RFC PATCH] arch: ARM64: add isb before enable pan
Date: Fri, 8 Oct 2021 14:07:49 +0800 [thread overview]
Message-ID: <1633673269-15048-1-git-send-email-huangzhaoyang@gmail.com> (raw)
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
next reply other threads:[~2021-10-08 6:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-08 6:07 Huangzhaoyang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1633673269-15048-1-git-send-email-huangzhaoyang@gmail.com \
--to=huangzhaoyang@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=ionela.voinescu@arm.com \
--cc=ke.wang@unisoc.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=qperret@google.com \
--cc=suzuki.poulose@arm.com \
--cc=vladimir.murzin@arm.com \
--cc=will@kernel.org \
--cc=zhaoyang.huang@unisoc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®