linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dann frazier <dann.frazier@canonical.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Mark Brown <broonie@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: Generate cpucaps.h
Date: Wed, 22 Sep 2021 07:45:54 -0600	[thread overview]
Message-ID: <YUszkhuZPMBVVYez@xps13.dannf> (raw)
In-Reply-To: <ed36cfee-57eb-98e6-bbd8-714f530d290a@arm.com>

On Tue, Sep 21, 2021 at 10:09:12PM +0100, Suzuki K Poulose wrote:
> On 21/09/2021 19:35, Mark Brown wrote:
> > On Tue, Sep 21, 2021 at 12:08:11PM -0600, dann frazier wrote:
> > > On Wed, Apr 28, 2021 at 01:12:31PM +0100, Mark Brown wrote:
> > 
> > > > This will result in a renumbering and reordering of the existing constants,
> > > > since they are all internal only the values should not be important. The
> > > > reordering will impact the order in which some steps in enumeration handle
> > > > features but the algorithm is not intended to depend on this and I haven't
> > > > seen any issues when testing.
> > 
> > > Unfortunately I believe I've hit a regression[*] due to such an
> > > ordering dependency. UNMAP_KERNEL_AT_EL0 currently needs to be
> > > processed after WORKAROUND_CAVIUM_27456. ThunderX systems are
> > > incompatible with KPTI, so unmap_kernel_at_el0() bails if
> > > WORKAROUND_CAVIUM_27456 is set. Because of the sorting,
> > > WORKAROUND_CAVIUM_27456 will not yet have been considered when
> > > unmap_kernel_at_el0() checks for it, so the kernel tries to
> > > run w/ KPTI - and quickly falls over.
> > 
> > > I've verified that reordering cpucaps to move WORKAROUND_CAVIUM_27456
> > > just above UNMAP_KERNEL_AT_EL0 restores the old behavior. I'm not sure
> > > of the right way to address this - perhaps unmap_kernel_at_el0() could
> > > check cavium_erratum_27456_cpus[] directly instead of keying on the
> > > ARM64_WORKAROUND_CAVIUM_27456 cap?
> 
> Given that these capabilities are LOCAL_CPU scope, and the systems in
> question never have heterogeneous CPUs, you could replace
> 
>  cpus_have_const_cap() =>  this_cpu_has_cap()
> 
> in unmap_kernel_at_el0().
> 
> If they were heterogeneous, we would fail anyway, no matter what the
> order was.

That seems to me to be the simplest approach, and I've verified it
addresses the problem. I'll prepare a patch. Thanks Suzuki.

  -dann

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

      reply	other threads:[~2021-09-22 13:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 12:12 [PATCH] arm64: Generate cpucaps.h Mark Brown
2021-04-29 12:32 ` Catalin Marinas
2021-05-04 11:43 ` Mark Rutland
2021-05-10 12:55 ` Catalin Marinas
2021-05-13  5:05 ` Anshuman Khandual
2021-05-13 11:51   ` Mark Rutland
2021-05-13 12:45   ` Mark Brown
2021-05-13 11:30 ` Geert Uytterhoeven
2021-05-13 13:03   ` Mark Brown
2021-09-21 18:08 ` dann frazier
2021-09-21 18:35   ` Mark Brown
2021-09-21 21:09     ` Suzuki K Poulose
2021-09-22 13:45       ` dann frazier [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=YUszkhuZPMBVVYez@xps13.dannf \
    --to=dann.frazier@canonical.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=suzuki.poulose@arm.com \
    --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).