Commit 6b5efc93 authored by Paolo Bonzini's avatar Paolo Bonzini

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: stable@vger.kernel.org
Fixes: 7ed9abfe ("KVM: SVM: Support string IO operations for an SEV-ES guest")
Reviewed-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 3b27de27
...@@ -6935,11 +6935,12 @@ static int __emulator_pio_in(struct kvm_vcpu *vcpu, int size, ...@@ -6935,11 +6935,12 @@ static int __emulator_pio_in(struct kvm_vcpu *vcpu, int size,
return emulator_pio_in_out(vcpu, size, port, count, true); return emulator_pio_in_out(vcpu, size, port, count, true);
} }
static void complete_emulator_pio_in(struct kvm_vcpu *vcpu, int size, static void complete_emulator_pio_in(struct kvm_vcpu *vcpu, void *val)
unsigned short port, void *val)
{ {
memcpy(val, vcpu->arch.pio_data, size * vcpu->arch.pio.count); int size = vcpu->arch.pio.size;
trace_kvm_pio(KVM_PIO_IN, port, size, vcpu->arch.pio.count, vcpu->arch.pio_data); unsigned count = vcpu->arch.pio.count;
memcpy(val, vcpu->arch.pio_data, size * count);
trace_kvm_pio(KVM_PIO_IN, vcpu->arch.pio.port, size, count, vcpu->arch.pio_data);
vcpu->arch.pio.count = 0; vcpu->arch.pio.count = 0;
} }
...@@ -6957,7 +6958,7 @@ static int emulator_pio_in(struct kvm_vcpu *vcpu, int size, ...@@ -6957,7 +6958,7 @@ static int emulator_pio_in(struct kvm_vcpu *vcpu, int size,
} }
WARN_ON(count != vcpu->arch.pio.count); WARN_ON(count != vcpu->arch.pio.count);
complete_emulator_pio_in(vcpu, size, port, val); complete_emulator_pio_in(vcpu, val);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment