diff mbox series

[v1] KVM: arm64: print Hyp mode

Message ID 20240209103719.3813599-1-joey.gouly@arm.com (mailing list archive)
State New, archived
Headers show
Series [v1] KVM: arm64: print Hyp mode | expand

Commit Message

Joey Gouly Feb. 9, 2024, 10:37 a.m. UTC
Print which of the hyp modes is being used (hVHE, nVHE).

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Mark Brown <broonie@kernel.org>
---

From what I could tell there isn't a way to tell which of the two modes was
actually booted in, and this could be useful for looking at log outputs.

 arch/arm64/kvm/arm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mark Brown Feb. 9, 2024, 3:42 p.m. UTC | #1
On Fri, Feb 09, 2024 at 10:37:19AM +0000, Joey Gouly wrote:
> Print which of the hyp modes is being used (hVHE, nVHE).
> 
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Oliver Upton <oliver.upton@linux.dev>
> Cc: Mark Brown <broonie@kernel.org>

> From what I could tell there isn't a way to tell which of the two modes was
> actually booted in, and this could be useful for looking at log outputs.

Something like this would be helpful catching errors getting test
coverage.

Reviewed-by: Mark Brown <broonie@kernel.org>
Oliver Upton Feb. 12, 2024, 8:52 p.m. UTC | #2
On Fri, 9 Feb 2024 10:37:19 +0000, Joey Gouly wrote:
> Print which of the hyp modes is being used (hVHE, nVHE).
> 
> 

Applied to kvmarm/next, thanks!

[1/1] KVM: arm64: print Hyp mode
      https://git.kernel.org/kvmarm/kvmarm/c/1f3ca7023fe6

--
Best,
Oliver
diff mbox series

Patch

diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index a25265aca432..090dbc954157 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -2591,7 +2591,8 @@  static __init int kvm_arm_init(void)
 	} else if (in_hyp_mode) {
 		kvm_info("VHE mode initialized successfully\n");
 	} else {
-		kvm_info("Hyp mode initialized successfully\n");
+		char mode = cpus_have_final_cap(ARM64_KVM_HVHE) ? 'h' : 'n';
+		kvm_info("Hyp mode (%cVHE) initialized successfully\n", mode);
 	}
 
 	/*