Skip to content

Commit d96c66a

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: Rationalise KVM banner output
We are not very consistent when it comes to displaying which mode we're in (VHE, {n,h}VHE, protected or not). For example, booting in protected mode with hVHE results in: [ 0.969545] kvm [1]: Protected nVHE mode initialized successfully which is mildly amusing considering that the machine is VHE only. We already cleaned this up a bit with commit 1f3ca70 ("KVM: arm64: print Hyp mode"), but that's still unsatisfactory. Unify the three strings into one and use a mess of conditional statements to sort it out (yes, it's a slow day). Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent b332014 commit d96c66a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

arch/arm64/kvm/arm.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,14 +2597,11 @@ static __init int kvm_arm_init(void)
25972597
if (err)
25982598
goto out_hyp;
25992599

2600-
if (is_protected_kvm_enabled()) {
2601-
kvm_info("Protected nVHE mode initialized successfully\n");
2602-
} else if (in_hyp_mode) {
2603-
kvm_info("VHE mode initialized successfully\n");
2604-
} else {
2605-
char mode = cpus_have_final_cap(ARM64_KVM_HVHE) ? 'h' : 'n';
2606-
kvm_info("Hyp mode (%cVHE) initialized successfully\n", mode);
2607-
}
2600+
kvm_info("%s%sVHE mode initialized successfully\n",
2601+
in_hyp_mode ? "" : (is_protected_kvm_enabled() ?
2602+
"Protected " : "Hyp "),
2603+
in_hyp_mode ? "" : (cpus_have_final_cap(ARM64_KVM_HVHE) ?
2604+
"h" : "n"));
26082605

26092606
/*
26102607
* FIXME: Do something reasonable if kvm_init() fails after pKVM

0 commit comments

Comments
 (0)