KVM: SEV-ES: rename guest_ins_data to sev_pio_data
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Oct 2021 14:22:34 +0000 (10:22 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Oct 2021 14:01:26 +0000 (10:01 -0400)
We will be using this field for OUTS emulation as well, in case the
data that is pushed via OUTS spans more than one page.  In that case,
there will be a need to save the data pointer across exits to userspace.

So, change the name to something that refers to any kind of PIO.
Also spell out what it is used for, namely SEV-ES.

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>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c

index f8f48a7..6bed6c4 100644 (file)
@@ -702,7 +702,7 @@ struct kvm_vcpu_arch {
 
        struct kvm_pio_request pio;
        void *pio_data;
-       void *guest_ins_data;
+       void *sev_pio_data;
 
        u8 event_exit_inst_len;
 
index 381384a..379175b 100644 (file)
@@ -12370,7 +12370,7 @@ EXPORT_SYMBOL_GPL(kvm_sev_es_mmio_read);
 
 static int complete_sev_es_emulated_ins(struct kvm_vcpu *vcpu)
 {
-       memcpy(vcpu->arch.guest_ins_data, vcpu->arch.pio_data,
+       memcpy(vcpu->arch.sev_pio_data, vcpu->arch.pio_data,
               vcpu->arch.pio.count * vcpu->arch.pio.size);
        vcpu->arch.pio.count = 0;
 
@@ -12402,7 +12402,7 @@ static int kvm_sev_es_ins(struct kvm_vcpu *vcpu, unsigned int size,
        if (ret) {
                vcpu->arch.pio.count = 0;
        } else {
-               vcpu->arch.guest_ins_data = data;
+               vcpu->arch.sev_pio_data = data;
                vcpu->arch.complete_userspace_io = complete_sev_es_emulated_ins;
        }