All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Will Deacon <will.deacon@arm.com>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	"Mark Langsdorf" <mlangsdo@redhat.com>,
	"Christoffer Dall" <christoffer.dall@linaro.org>,
	kvm@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
	"Marc Zyngier" <marc.zyngier@arm.com>,
	"Jon Masters" <jcm@redhat.com>,
	timur@codeaurora.org, "Jonathan Corbet" <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvmarm@lists.cs.columbia.edu,
	"Christopher Covington" <cov@codeaurora.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Neil Leeder" <nleeder@codeaurora.org>,
	shankerd@codeaurora.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 2/4] arm64: Work around Falkor erratum 1003
Date: Wed, 1 Feb 2017 18:38:12 +0000	[thread overview]
Message-ID: <20170201183812.GI26507@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <20170201183400.GA31652@arm.com>

On Wed, Feb 01, 2017 at 06:34:01PM +0000, Will Deacon wrote:
> On Wed, Feb 01, 2017 at 06:22:44PM +0000, Catalin Marinas wrote:
> > On Wed, Feb 01, 2017 at 05:59:48PM +0000, Will Deacon wrote:
> > > On Wed, Feb 01, 2017 at 05:49:34PM +0000, Catalin Marinas wrote:
> > > > On Wed, Feb 01, 2017 at 05:41:05PM +0000, Will Deacon wrote:
> > > > > Maybe
> > > > > just select ARM64_PAN if the erratum workaround is selected, then
> > > > > runtime warning if we find that the h/w doesn't have PAN but does have
> > > > > the erratum (which should never fire)?
> > > > 
> > > > You still need this workaround even if you don't want any PAN (both sw
> > > > and hw PAN disabled). I wouldn't want to select ARM64_PAN since it's not
> > > > a dependency. It's more like if you do need a PAN, make sure you only
> > > > use the hw one.
> > > 
> > > True, in the case that all PAN options are disabled we still want this
> > > to work. How about:
> > > 
> > >   select ARM64_PAN if ARM64_SW_TTBR0_PAN
> > 
> > As I replied to myself, the above would work for me as well, so let's go
> > for this.
> > 
> > > In fact, what's the reason for supporting SW_PAN and ARM64_PAN as a
> > > config combination? Why not just have "PAN" that enables them both and
> > > uses the hardware feature if it's there?
> > 
> > Because SW PAN has a non-trivial performance hit. You would enable SW
> > PAN only if you are paranoid about security. HW PAN, OTOH, is very cheap
> > and I wouldn't want to miss enabling it in a single Image supporting
> > ARMv8.0 and ARMv8.1 just because SW PAN is slow on ARMv8.0.
> > 
> > IOW, ARM64_PAN is default y while ARM64_SW_TTBR0_PAN is default n.
> 
> Ok, in that case, then how about another permutation: we make
> ARM64_SW_TTBR0_PAN depend on ARM64_PAN? Then when you select "PAN Support"
> you get a new menu option underneath it for the emulation? I think that
> solves the erratum case and the use-case above.

The problem is that ARM64_PAN is an ARMv8.1 feature and currently
grouped accordingly in Kconfig. ARM64_SW_TTBR0_PAN is complementary (and
even not recommended on ARMv8.1). We can do this if we break the ARMv8.x
feature grouping but just for this erratum, I don't think it's worth.

-- 
Catalin

WARNING: multiple messages have this Message-ID (diff)
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/4] arm64: Work around Falkor erratum 1003
Date: Wed, 1 Feb 2017 18:38:12 +0000	[thread overview]
Message-ID: <20170201183812.GI26507@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <20170201183400.GA31652@arm.com>

On Wed, Feb 01, 2017 at 06:34:01PM +0000, Will Deacon wrote:
> On Wed, Feb 01, 2017 at 06:22:44PM +0000, Catalin Marinas wrote:
> > On Wed, Feb 01, 2017 at 05:59:48PM +0000, Will Deacon wrote:
> > > On Wed, Feb 01, 2017 at 05:49:34PM +0000, Catalin Marinas wrote:
> > > > On Wed, Feb 01, 2017 at 05:41:05PM +0000, Will Deacon wrote:
> > > > > Maybe
> > > > > just select ARM64_PAN if the erratum workaround is selected, then
> > > > > runtime warning if we find that the h/w doesn't have PAN but does have
> > > > > the erratum (which should never fire)?
> > > > 
> > > > You still need this workaround even if you don't want any PAN (both sw
> > > > and hw PAN disabled). I wouldn't want to select ARM64_PAN since it's not
> > > > a dependency. It's more like if you do need a PAN, make sure you only
> > > > use the hw one.
> > > 
> > > True, in the case that all PAN options are disabled we still want this
> > > to work. How about:
> > > 
> > >   select ARM64_PAN if ARM64_SW_TTBR0_PAN
> > 
> > As I replied to myself, the above would work for me as well, so let's go
> > for this.
> > 
> > > In fact, what's the reason for supporting SW_PAN and ARM64_PAN as a
> > > config combination? Why not just have "PAN" that enables them both and
> > > uses the hardware feature if it's there?
> > 
> > Because SW PAN has a non-trivial performance hit. You would enable SW
> > PAN only if you are paranoid about security. HW PAN, OTOH, is very cheap
> > and I wouldn't want to miss enabling it in a single Image supporting
> > ARMv8.0 and ARMv8.1 just because SW PAN is slow on ARMv8.0.
> > 
> > IOW, ARM64_PAN is default y while ARM64_SW_TTBR0_PAN is default n.
> 
> Ok, in that case, then how about another permutation: we make
> ARM64_SW_TTBR0_PAN depend on ARM64_PAN? Then when you select "PAN Support"
> you get a new menu option underneath it for the emulation? I think that
> solves the erratum case and the use-case above.

The problem is that ARM64_PAN is an ARMv8.1 feature and currently
grouped accordingly in Kconfig. ARM64_SW_TTBR0_PAN is complementary (and
even not recommended on ARMv8.1). We can do this if we break the ARMv8.x
feature grouping but just for this erratum, I don't think it's worth.

-- 
Catalin

  reply	other threads:[~2017-02-01 18:38 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 15:52 [PATCH v4 1/4] arm64: Define Falkor v1 CPU Christopher Covington
2017-01-25 15:52 ` Christopher Covington
2017-01-25 15:52 ` Christopher Covington
2017-01-25 15:52 ` [PATCH v4 2/4] arm64: Work around Falkor erratum 1003 Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-27 14:38   ` Mark Rutland
2017-01-27 14:38     ` Mark Rutland
2017-01-27 14:38     ` Mark Rutland
2017-01-27 14:43     ` Mark Rutland
2017-01-27 14:43       ` Mark Rutland
2017-01-27 14:43       ` Mark Rutland
2017-01-27 21:52     ` Christopher Covington
2017-01-27 21:52       ` Christopher Covington
2017-01-27 21:52       ` Christopher Covington
2017-01-30 10:56       ` Mark Rutland
2017-01-30 10:56         ` Mark Rutland
2017-01-30 10:56         ` Mark Rutland
2017-01-30 22:09         ` Christopher Covington
2017-01-30 22:09           ` Christopher Covington
2017-01-30 22:09           ` Christopher Covington
2017-01-27 19:18   ` Timur Tabi
2017-01-27 19:18     ` Timur Tabi
2017-01-27 19:18     ` Timur Tabi
2017-01-31 12:37   ` Mark Rutland
2017-01-31 12:37     ` Mark Rutland
2017-01-31 12:37     ` Mark Rutland
2017-01-31 17:48     ` Christopher Covington
2017-01-31 17:48       ` Christopher Covington
2017-01-31 17:48       ` Christopher Covington
2017-01-31 17:56       ` Marc Zyngier
2017-01-31 17:56         ` Marc Zyngier
2017-01-31 17:56         ` Marc Zyngier
2017-02-01 16:29         ` Christopher Covington
2017-02-01 16:29           ` Christopher Covington
2017-02-01 16:33           ` Will Deacon
2017-02-01 16:33             ` Will Deacon
2017-02-01 16:33             ` Will Deacon
2017-02-01 17:36             ` Catalin Marinas
2017-02-01 17:36               ` Catalin Marinas
2017-02-01 17:41               ` Will Deacon
2017-02-01 17:41                 ` Will Deacon
2017-02-01 17:41                 ` Will Deacon
2017-02-01 17:49                 ` Catalin Marinas
2017-02-01 17:49                   ` Catalin Marinas
2017-02-01 17:49                   ` Catalin Marinas
2017-02-01 17:51                   ` Catalin Marinas
2017-02-01 17:51                     ` Catalin Marinas
2017-02-01 17:59                   ` Will Deacon
2017-02-01 17:59                     ` Will Deacon
2017-02-01 18:22                     ` Catalin Marinas
2017-02-01 18:22                       ` Catalin Marinas
2017-02-01 18:34                       ` Will Deacon
2017-02-01 18:34                         ` Will Deacon
2017-02-01 18:34                         ` Will Deacon
2017-02-01 18:38                         ` Catalin Marinas [this message]
2017-02-01 18:38                           ` Catalin Marinas
2017-02-08  0:36                           ` Christopher Covington
2017-02-08  0:36                             ` Christopher Covington
2017-02-08  0:36                             ` Christopher Covington
2017-01-25 15:52 ` [PATCH v4 3/4] arm64: Use __tlbi() macros in KVM code Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-25 19:39   ` Christoffer Dall
2017-01-25 19:39     ` Christoffer Dall
2017-01-27 13:53     ` Will Deacon
2017-01-27 13:53       ` Will Deacon
2017-01-27 13:53       ` Will Deacon
2017-02-01 17:02       ` Punit Agrawal
2017-02-01 17:02         ` Punit Agrawal
2017-02-01 17:02         ` Punit Agrawal
2017-02-01 17:08         ` Will Deacon
2017-02-01 17:08           ` Will Deacon
2017-02-01 17:08           ` Will Deacon
2017-02-01 17:14           ` Punit Agrawal
2017-02-01 17:14             ` Punit Agrawal
2017-02-01 17:14             ` Punit Agrawal
2017-01-27 15:03   ` Will Deacon
2017-01-27 15:03     ` Will Deacon
2017-01-27 15:03     ` Will Deacon
2017-01-25 15:52 ` [PATCH v4 4/4] arm64: Work around Falkor erratum 1009 Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-27 15:07   ` Will Deacon
2017-01-27 15:07     ` Will Deacon
2017-01-27 15:07     ` Will Deacon

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=20170201183812.GI26507@e104818-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=corbet@lwn.net \
    --cc=cov@codeaurora.org \
    --cc=jcm@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=mlangsdo@redhat.com \
    --cc=nleeder@codeaurora.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=shankerd@codeaurora.org \
    --cc=timur@codeaurora.org \
    --cc=will.deacon@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.