From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: broonie@kernel.org, catalin.marinas@arm.com, will@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] arm64: Don't use KPTI where we have E0PD
Date: Tue, 13 Aug 2019 11:01:49 +0100 [thread overview]
Message-ID: <defe4663-770b-ee3a-21e1-29e7835c2344@arm.com> (raw)
In-Reply-To: <20190812125738.17388-3-broonie@kernel.org>
On 12/08/2019 13:57, Mark Brown wrote:
> Since E0PD is intended to fulfil the same role as KPTI we don't need to
> use KPTI on CPUs where E0PD is available, we can rely on E0PD instead.
> Change the check that forces KPTI on when KASLR is enabled to check for
> E0PD before doing so, CPUs with E0PD are not expected to be affected by
> meltdown so should not need to enable KPTI for other reasons.
>
> Since we repeat the KPTI check for all CPUs we will still enable KPTI if
> any of the CPUs in the system lacks E0PD. Since KPTI itself is not changed
> by this patch once we enable KPTI we will do so for all CPUs. This is safe
> but not optimally performant for such systems.
>
> KPTI can still be forced on from the command line if required.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> arch/arm64/kernel/cpufeature.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 4aa1d2026bef..322004409211 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -995,7 +995,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
>
> /* Useful for KASLR robustness */
> if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && kaslr_offset() > 0) {
> - if (!__kpti_forced) {
> + if (!__kpti_forced && !this_cpu_has_cap(ARM64_HAS_E0PD)) {
> str = "KASLR";
> __kpti_forced = 1;
> }
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-08-13 10:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-12 12:57 [0/2] arm64: E0PD support Mark Brown
2019-08-12 12:57 ` [PATCH 1/2] arm64: Add initial support for E0PD Mark Brown
2019-08-13 9:59 ` Suzuki K Poulose
2019-08-13 17:25 ` Will Deacon
2019-08-12 12:57 ` [PATCH 2/2] arm64: Don't use KPTI where we have E0PD Mark Brown
2019-08-13 10:01 ` Suzuki K Poulose [this message]
2019-08-13 17:28 ` Will Deacon
2019-08-13 19:05 ` Mark Brown
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=defe4663-770b-ee3a-21e1-29e7835c2344@arm.com \
--to=suzuki.poulose@arm.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.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