Skip to content

Commit 332b7e6

Browse files
mrutland-armMarc Zyngier
authored andcommitted
KVM: arm64: Simplify warning in kvm_arch_vcpu_load_fp()
At the end of kvm_arch_vcpu_load_fp() we check that no bits are set in SVCR. We only check this for protected mode despite this mattering equally for non-protected mode, and the comment above this is confusing. Remove the comment and simplify the check, moving from WARN_ON() to WARN_ON_ONCE() to avoid spamming the log. Signed-off-by: Mark Rutland <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 59419f1 commit 332b7e6

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

arch/arm64/kvm/fpsimd.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,7 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
6565
fpsimd_save_and_flush_cpu_state();
6666
*host_data_ptr(fp_owner) = FP_STATE_FREE;
6767

68-
/*
69-
* If normal guests gain SME support, maintain this behavior for pKVM
70-
* guests, which don't support SME.
71-
*/
72-
WARN_ON(is_protected_kvm_enabled() && system_supports_sme() &&
73-
read_sysreg_s(SYS_SVCR));
68+
WARN_ON_ONCE(system_supports_sme() && read_sysreg_s(SYS_SVCR));
7469
}
7570

7671
/*

0 commit comments

Comments
 (0)