summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-10-12 12:35:20 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-22 10:08:38 -0400
commit6b5efc930bbc8c97e4a1fe2ccb9a6f286365a56d (patch)
treee06620db781238e7e2e152ee12e4ff560575ad98 /arch
parent3b27de27183911d461afedf50c6fa30c59740c07 (diff)
downloadlinux-6b5efc930bbc8c97e4a1fe2ccb9a6f286365a56d.tar.bz2
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: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/x86.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c51ea81019e3..63f9cb33cc19 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -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);
}
-static void complete_emulator_pio_in(struct kvm_vcpu *vcpu, int size,
- unsigned short port, void *val)
+static void complete_emulator_pio_in(struct kvm_vcpu *vcpu, void *val)
{
- memcpy(val, vcpu->arch.pio_data, size * vcpu->arch.pio.count);
- trace_kvm_pio(KVM_PIO_IN, port, size, vcpu->arch.pio.count, vcpu->arch.pio_data);
+ int size = vcpu->arch.pio.size;
+ 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;
}
@@ -6957,7 +6958,7 @@ static int emulator_pio_in(struct kvm_vcpu *vcpu, int size,
}
WARN_ON(count != vcpu->arch.pio.count);
- complete_emulator_pio_in(vcpu, size, port, val);
+ complete_emulator_pio_in(vcpu, val);
return 1;
}