From: Hongbo Yao <yaohongbo@huawei.com>
To: <will@kernel.org>, <broonie@kernel.org>
Cc: <yaohongbo@huawei.com>, <linux-kernel@vger.kernel.org>
Subject: [RFC PATCH] arm64: fix the missing ktpi= cmdline check in arm64_kernel_unmapped_at_el0()
Date: Tue, 17 Mar 2020 19:47:08 +0800 [thread overview]
Message-ID: <20200317114708.109283-1-yaohongbo@huawei.com> (raw)
Kpti cannot be disabled from the kernel cmdline after the commit
09e3c22a("arm64: Use a variable to store non-global mappings decision").
Bring back the missing check of kpti= command-line option to fix the
case where the SPE driver complains the missing "kpti-off" even it has
already been set.
Signed-off-by: Hongbo Yao <yaohongbo@huawei.com>
---
arch/arm64/include/asm/mmu.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h
index 3c9533322558..ebbc0d3ac2f7 100644
--- a/arch/arm64/include/asm/mmu.h
+++ b/arch/arm64/include/asm/mmu.h
@@ -34,7 +34,8 @@ extern bool arm64_use_ng_mappings;
static inline bool arm64_kernel_unmapped_at_el0(void)
{
- return arm64_use_ng_mappings;
+ return arm64_use_ng_mappings &&
+ cpus_have_const_cap(ARM64_UNMAP_KERNEL_AT_EL0);
}
typedef void (*bp_hardening_cb_t)(void);
--
2.20.1
next reply other threads:[~2020-03-17 11:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-17 11:47 Hongbo Yao [this message]
2020-03-17 12:10 ` Mark Rutland
2020-03-17 12:43 ` Will Deacon
2020-03-17 13:57 ` Mark Brown
2020-03-17 15:18 ` Will Deacon
2020-03-17 16:36 ` Mark Brown
2020-03-17 21:01 ` Will Deacon
2020-03-18 11:32 ` Mark Brown
2020-03-18 20:13 ` Will Deacon
2020-03-19 6:14 ` Hongbo Yao
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=20200317114708.109283-1-yaohongbo@huawei.com \
--to=yaohongbo@huawei.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=will@kernel.org \
/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®