public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Christoffer Dall <christoffer.dall@arm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: clean up has_vhe()
Date: Wed, 3 Apr 2019 13:43:50 +0200	[thread overview]
Message-ID: <20190403114350.GA7810@e113682-lin.lund.arm.com> (raw)
In-Reply-To: <20190403084125.4009-1-mark.rutland@arm.com>

On Wed, Apr 03, 2019 at 09:41:25AM +0100, Mark Rutland wrote:
> Currently, has_vhe() has a redundant if statement, and unlike other cpucap
> helpers, it doesn't check whether the relevant config option (CONFIG_ARM64_VHE)
> is enabled, leading to redundant code in some minimal kernel configurations.
> 
> This patches fixes both of these issues.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Christoffer Dall <christoffer.dall@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
>  arch/arm64/include/asm/virt.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h
> index 9d1e24e030b3..57d500abdf4f 100644
> --- a/arch/arm64/include/asm/virt.h
> +++ b/arch/arm64/include/asm/virt.h
> @@ -96,10 +96,8 @@ static inline bool is_kernel_in_hyp_mode(void)
>  
>  static inline bool has_vhe(void)
>  {
> -	if (cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN))
> -		return true;
> -
> -	return false;
> +	return IS_ENABLED(CONFIG_ARM64_VHE) &&
> +	       cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN);
>  }
>  
>  #endif /* __ASSEMBLY__ */


Acked-by: Christoffer Dall <christoffer.dall@arm.com>

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

  parent reply	other threads:[~2019-04-03 11:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03  8:41 [PATCH] arm64: clean up has_vhe() Mark Rutland
2019-04-03 10:51 ` Marc Zyngier
2019-04-03 11:43 ` Christoffer Dall [this message]
2019-04-03 11:47 ` 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=20190403114350.GA7810@e113682-lin.lund.arm.com \
    --to=christoffer.dall@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox