diff mbox series

KVM: arm64: Use cpus_have_final_cap for has_vhe()

Message ID 20200513103828.74580-1-maz@kernel.org (mailing list archive)
State Mainlined
Commit ce6f8f02f9f6786355fa6c79d88b839639dd75d8
Headers show
Series KVM: arm64: Use cpus_have_final_cap for has_vhe() | expand

Commit Message

Marc Zyngier May 13, 2020, 10:38 a.m. UTC
By the time we start using the has_vhe() helper, we have long
discovered whether we are running VHE or not. It thus makes
sense to use cpus_have_final_cap() instead of cpus_have_const_cap(),
which leads to a small text size reduction.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 arch/arm64/include/asm/virt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Brazdil May 15, 2020, 11:02 a.m. UTC | #1
Hi Marc,

> 
> Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: David Brazdil <dbrazdil@google.com>

Thanks, this is really helpful for the 'Split off nVHE code' series. Tested
them together and things seem to work just fine.

David
diff mbox series

Patch

diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h
index 61fd26752adc..5051b388c654 100644
--- a/arch/arm64/include/asm/virt.h
+++ b/arch/arm64/include/asm/virt.h
@@ -85,7 +85,7 @@  static inline bool is_kernel_in_hyp_mode(void)
 
 static __always_inline bool has_vhe(void)
 {
-	if (cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN))
+	if (cpus_have_final_cap(ARM64_HAS_VIRT_HOST_EXTN))
 		return true;
 
 	return false;