>From b134b231b49563ae2fca54dbd4f85356b10aaf53 Mon Sep 17 00:00:00 2001 From: Sean Christopherson Date: Thu, 21 Oct 2021 16:29:18 -0700 Subject: [PATCH 5/6] KVM: x86: Stop being clever and use a "completion" handler for SEV-ES OUTS Signed-off-by: Sean Christopherson --- arch/x86/kvm/x86.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a20a790ce586..fad2c7192aa3 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -12481,6 +12481,12 @@ int kvm_sev_es_mmio_read(struct kvm_vcpu *vcpu, gpa_t gpa, unsigned int bytes, } EXPORT_SYMBOL_GPL(kvm_sev_es_mmio_read); +static int complete_sev_es_emulated_outs(struct kvm_vcpu *vcpu) +{ + vcpu->arch.pio.count = 0; + return 1; +} + static int complete_sev_es_emulated_ins(struct kvm_vcpu *vcpu) { memcpy(vcpu->arch.guest_ins_data, vcpu->arch.pio_data, @@ -12500,8 +12506,7 @@ static int kvm_sev_es_outs(struct kvm_vcpu *vcpu, unsigned int size, if (ret) return ret; - vcpu->arch.pio.count = 0; - + vcpu->arch.complete_userspace_io = complete_sev_es_emulated_outs; return 0; } -- 2.33.0.1079.g6e70778dc9-goog