linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: Add support for E0PD
Date: Wed, 26 Jun 2019 17:51:03 +0100	[thread overview]
Message-ID: <20190626165102.GE29672@arrakis.emea.arm.com> (raw)
In-Reply-To: <20190626160622.GA5379@sirena.org.uk>

On Wed, Jun 26, 2019 at 05:06:22PM +0100, Mark Brown wrote:
> On Wed, Jun 26, 2019 at 04:04:04PM +0100, Will Deacon wrote:
> > I think you're missing one small thing here: all v8.5 CPUs will have
> > hardware mitigations for meltdown as advertised in the ID registers.
> > However, we still force KPTI on for those CPUs if KASLR is enabled to avoid
> > it being trivially bypassed by looking at fault timings. As you point out,
> > there are two issues with that: (1) the performance impact of KPTI and (2)
> > the incompatibility with statistical profiling. It is these issues which
> > E0PD attempts to address, so whilst I'm ok with enabling it unconditionally
> > as you propose, we should go one step further and avoid enabling KPTI on
> > CPUs with E0PD even if KASLR is enabled.
> 
> I agree, I'm currently working on a patch which will disable KPTI by
> default if we've enabled E0PD - it's a bit of a faff due to how early we
> decide if we're going to use KPTI so it probably needs to be a separate
> patch anyway.

Could we not wire up this check in unmap_kernel_at_el0()? We can look at
this as a more efficient KPTI handled by the hardware.

> > We probably also need to consider the unfortunate situations where E0PD
> > is not supported by all of the CPUs in the system.
> 
> Yes, I've marked it as ARM64_CPUCAP_SYSTEM_FEATURE so it should be safe
> unless all the CPUs that don't support it are late CPUs (in which case
> it'd stop them booting) but it's not ideal as it means we won't use it
> at on mixed systems.  I did debate marking it as _WEAK so that we'd
> enable it on the CPUs that can use it but I worried that that'd be
> potentially misleading with regard to the level of hardening if the
> kernel said it was turning on E0PD.

I think this will become problematic in combination with disabling kpti.
If we decide early that it is meltdown-safe (unmap_kernel_at_el0()
returning false) because the boot CPU supports E0PD, any subsequent CPU
not having E0PD and hence requiring unmap_kernel_at_el0() will not boot.
That's fine by me as long as we have a Kconfig option to disable E0PD
and allow mixed CPU features on some custom SoCs.

-- 
Catalin

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

  reply	other threads:[~2019-06-26 16:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 14:45 [PATCH] arm64: Add support for E0PD Mark Brown
2019-06-26 15:04 ` Will Deacon
2019-06-26 16:06   ` Mark Brown
2019-06-26 16:51     ` Catalin Marinas [this message]
2019-06-27  9:25       ` Will Deacon
2019-06-27 10:13         ` Catalin Marinas

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=20190626165102.GE29672@arrakis.emea.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=broonie@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).