linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: maz@kernel.org, dbrazdil@google.com,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv2 2/3] arm64: cpufeature: reorder cpus_have_{const,final}_cap()
Date: Fri, 30 Oct 2020 08:20:14 +0000	[thread overview]
Message-ID: <20201030082013.GC32066@willie-the-truck> (raw)
In-Reply-To: <20201030081848.GB32066@willie-the-truck>

On Fri, Oct 30, 2020 at 08:18:48AM +0000, Will Deacon wrote:
> On Mon, Oct 26, 2020 at 01:49:30PM +0000, Mark Rutland wrote:
> > In a subsequent patch we'll modify cpus_have_const_cap() to call
> > cpus_have_final_cap(), and hence we need to define cpus_have_final_cap()
> > first.
> > 
> > To make subsequent changes easier to follow, this patch reorders the two
> > without making any other changes.
> > 
> > There should be no functional change as a result of this patch.
> 
> You say this...
> 
> > 
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > Cc: David Brazdil <dbrazdil@google.com>
> > Cc: Marc Zyngier <maz@kernel.org>
> > Cc: Will Deacon <will@kernel.org>
> > ---
> >  arch/arm64/include/asm/cpufeature.h | 16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
> > index f7e7144af174c..5d18c54507e6a 100644
> > --- a/arch/arm64/include/asm/cpufeature.h
> > +++ b/arch/arm64/include/asm/cpufeature.h
> > @@ -428,35 +428,35 @@ static __always_inline bool __cpus_have_const_cap(int num)
> >  }
> >  
> >  /*
> > - * Test for a capability, possibly with a runtime check.
> > + * Test for a capability without a runtime check.
> >   *
> > - * Before capabilities are finalized, this behaves as cpus_have_cap().
> > + * Before capabilities are finalized, this will BUG().
> >   * After capabilities are finalized, this is patched to avoid a runtime check.
> >   *
> >   * @num must be a compile-time constant.
> >   */
> > -static __always_inline bool cpus_have_const_cap(int num)
> > +static __always_inline bool cpus_have_final_cap(int num)
> >  {
> >  	if (system_capabilities_finalized())
> >  		return __cpus_have_const_cap(num);
> >  	else
> > -		return cpus_have_cap(num);
> > +		BUG();
> 
> ... but isn't the failure case of calling cpus_have_final_cap() early now
> different? What does BUG() do at EL2 w/ nVHE?

Ah no, sorry, I see you're just moving things around and the diff makes it
look confusing (that and I've been up since 5:30 for KVM Forum).

So on closer inspection:

Acked-by: Will Deacon <will@kernel.org>

Will

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

  reply	other threads:[~2020-10-30  8:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 13:49 [PATCHv2 0/3] arm64: kvm: avoid referencing cpu_hwcaps from hyp Mark Rutland
2020-10-26 13:49 ` [PATCHv2 1/3] arm64: kvm: factor out is_{vhe,nvhe}_hyp_code() Mark Rutland
2020-10-30  8:21   ` Will Deacon
2020-10-26 13:49 ` [PATCHv2 2/3] arm64: cpufeature: reorder cpus_have_{const, final}_cap() Mark Rutland
2020-10-30  8:18   ` [PATCHv2 2/3] arm64: cpufeature: reorder cpus_have_{const,final}_cap() Will Deacon
2020-10-30  8:20     ` Will Deacon [this message]
2020-10-30 14:18       ` Mark Rutland
2020-10-26 13:49 ` [PATCHv2 3/3] arm64: cpufeature: upgrade hyp caps to final Mark Rutland
2020-10-30  8:24   ` Will Deacon
2020-10-29 19:48 ` [PATCHv2 0/3] arm64: kvm: avoid referencing cpu_hwcaps from hyp Marc Zyngier
2020-10-30 10:59 ` Marc Zyngier

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=20201030082013.GC32066@willie-the-truck \
    --to=will@kernel.org \
    --cc=dbrazdil@google.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@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).