From: Marc Zyngier <marc.zyngier@arm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Christoffer Dall <christoffer.dall@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: clean up has_vhe()
Date: Wed, 03 Apr 2019 11:51:25 +0100 [thread overview]
Message-ID: <86sguz4b0y.wl-marc.zyngier@arm.com> (raw)
In-Reply-To: <20190403084125.4009-1-mark.rutland@arm.com>
On Wed, 03 Apr 2019 09:41:25 +0100,
Mark Rutland <mark.rutland@arm.com> 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: Marc Zyngier <marc.zyngier@arm.com>
M.
--
Jazz is not dead, it just smell funny.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-04-03 10:51 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 [this message]
2019-04-03 11:43 ` Christoffer Dall
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=86sguz4b0y.wl-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=catalin.marinas@arm.com \
--cc=christoffer.dall@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--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