Re: [PATCH] KVM: arm64: Allow KVM to be disabled from the command line
From: Marc Zyngier <maz@kernel.org>
Date: 2021-09-30 10:25:05
Also in:
kvm, kvmarm
From: Marc Zyngier <maz@kernel.org>
Date: 2021-09-30 10:25:05
Also in:
kvm, kvmarm
Hi David, On Tue, 28 Sep 2021 15:58:08 +0100, David Brazdil [off-list ref] wrote:
Hey Marc, that all makes sense: Reviewed-by: David Brazdil <redacted>quoted
@@ -2137,8 +2142,15 @@ static int __init early_kvm_mode_cfg(char *arg) return 0; } - if (strcmp(arg, "nvhe") == 0 && !WARN_ON(is_kernel_in_hyp_mode())) + if (strcmp(arg, "nvhe") == 0 && !WARN_ON(is_kernel_in_hyp_mode())) { + kvm_mode = KVM_MODE_DEFAULT; return 0; + } + + if (strcmp(arg, "none") == 0 && !WARN_ON(is_kernel_in_hyp_mode())) {nit: I noticed we check is_kernel_in_hyp_mode here for nvhe/none but for protected it is checked in is_kvm_protected_mode. May be worth unifying?
is_kvm_protected_mode() drives a capability (as we rely on the associated static key), and we don't need this with either 'nvhe' nor 'none'. So I'm unsure what we can unify, to be honest. Can you suggest a patch? Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel