Skip to content

Commit 73b725c

Browse files
ouptonMarc Zyngier
authored andcommitted
KVM: arm64: Drop unneeded minor version check from PSCI v1.x handler
We already sanitize the guest's PSCI version when it is being written by userspace, rejecting unsupported version numbers. Additionally, the 'minor' parameter to kvm_psci_1_x_call() is a constant known at compile time for all callsites. Though it is benign, the additional check against the PSCI kvm_psci_1_x_call() is unnecessary and likely to be missed the next time KVM raises its maximum PSCI version. Drop the check altogether and rely on sanitization when the PSCI version is set by userspace. No functional change intended. Signed-off-by: Oliver Upton <oupton@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220322183538.2757758-4-oupton@google.com
1 parent 827c2ab commit 73b725c

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

arch/arm64/kvm/psci.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,6 @@ static int kvm_psci_1_x_call(struct kvm_vcpu *vcpu, u32 minor)
309309
unsigned long val;
310310
int ret = 1;
311311

312-
if (minor > 1)
313-
return -EINVAL;
314-
315312
switch(psci_fn) {
316313
case PSCI_0_2_FN_PSCI_VERSION:
317314
val = minor == 0 ? KVM_ARM_PSCI_1_0 : KVM_ARM_PSCI_1_1;

0 commit comments

Comments
 (0)