KVM: x86: wean in-kernel PIO from vcpu->arch.pio*
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Jun 2022 14:24:01 +0000 (10:24 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Jun 2022 16:54:04 +0000 (12:54 -0400)
commit0c05e10bce5217657bcdaa9787c9ea94e6b384b2
tree07ef92c86328b9b011adf217e4dc0c4803280036
parent30d583fd4e1ecafa8642f9f74e102876b4aeb733
KVM: x86: wean in-kernel PIO from vcpu->arch.pio*

Make emulator_pio_in_out operate directly on the provided buffer
as long as PIO is handled inside KVM.

For input operations, this means that, in the case of in-kernel
PIO, __emulator_pio_in() does not have to be always followed
by complete_emulator_pio_in().  This affects emulator_pio_in() and
kvm_sev_es_ins(); for the latter, that is why the call moves from
advance_sev_es_emulated_ins() to complete_sev_es_emulated_ins().

For output, it means that vcpu->pio.count is never set unnecessarily
and there is no need to clear it; but also vcpu->pio.size must not
be used in kvm_sev_es_outs(), because it will not be updated for
in-kernel OUT.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c