Skip to content

Commit 6b5efc9

Browse files
committed
KVM: x86: remove unnecessary arguments from complete_emulator_pio_in
complete_emulator_pio_in can expect that vcpu->arch.pio has been filled in, and therefore does not need the size and count arguments. This makes things nicer when the function is called directly from a complete_userspace_io callback. No functional change intended. Cc: [email protected] Fixes: 7ed9abf ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reviewed-by: Maxim Levitsky <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 3b27de2 commit 6b5efc9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

arch/x86/kvm/x86.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6935,11 +6935,12 @@ static int __emulator_pio_in(struct kvm_vcpu *vcpu, int size,
69356935
return emulator_pio_in_out(vcpu, size, port, count, true);
69366936
}
69376937

6938-
static void complete_emulator_pio_in(struct kvm_vcpu *vcpu, int size,
6939-
unsigned short port, void *val)
6938+
static void complete_emulator_pio_in(struct kvm_vcpu *vcpu, void *val)
69406939
{
6941-
memcpy(val, vcpu->arch.pio_data, size * vcpu->arch.pio.count);
6942-
trace_kvm_pio(KVM_PIO_IN, port, size, vcpu->arch.pio.count, vcpu->arch.pio_data);
6940+
int size = vcpu->arch.pio.size;
6941+
unsigned count = vcpu->arch.pio.count;
6942+
memcpy(val, vcpu->arch.pio_data, size * count);
6943+
trace_kvm_pio(KVM_PIO_IN, vcpu->arch.pio.port, size, count, vcpu->arch.pio_data);
69436944
vcpu->arch.pio.count = 0;
69446945
}
69456946

@@ -6957,7 +6958,7 @@ static int emulator_pio_in(struct kvm_vcpu *vcpu, int size,
69576958
}
69586959

69596960
WARN_ON(count != vcpu->arch.pio.count);
6960-
complete_emulator_pio_in(vcpu, size, port, val);
6961+
complete_emulator_pio_in(vcpu, val);
69616962
return 1;
69626963
}
69636964

0 commit comments

Comments
 (0)