From: Mark Brown <broonie@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
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 20:05:14 +0100 [thread overview]
Message-ID: <20190813190514.GH5093@sirena.co.uk> (raw)
In-Reply-To: <20190813172836.vbotnv35w3w62b2y@willie-the-truck>
[-- Attachment #1.1: Type: text/plain, Size: 1225 bytes --]
On Tue, Aug 13, 2019 at 06:28:36PM +0100, Will Deacon wrote:
> On Mon, Aug 12, 2019 at 01:57:38PM +0100, Mark Brown wrote:
> > 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;
> > }
> Hmm. I'm surprised you haven't had to hack arm64_kernel_use_ng_mappings().
> If you boot with RANDOMIZE_BASE=y on a machine with E0PDx support, can
> you dump the kernel page tables in /sys/kernel/debug/kernel_page_tables
> and check that they're using global mappings? I think some of the early
> mappings might still be nG with your patch.
Hrm, yeah - they are if I not only turn on RANDOMIZE_BASE but also
ensure KASLR gets a seed it'll pay attention to passed. I had been
testing with it on but changes I'd made in the test environment to pass
a seed in had been broken so it silently wasn't actually doing anything.
The simplest thing would just be to add an IS_ENABLED() check in
_use_ng_mappings() which I've verifed does the right thing at the
expense of requiring the remapping later, but obviously that's a useful
optimization so we should really check the FTR.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-08-13 19:05 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
2019-08-13 17:28 ` Will Deacon
2019-08-13 19:05 ` Mark Brown [this message]
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=20190813190514.GH5093@sirena.co.uk \
--to=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