]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SEV-ES: fix another issue with string I/O VMGEXITs
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 25 Oct 2021 16:14:31 +0000 (12:14 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 27 Oct 2021 14:58:26 +0000 (10:58 -0400)
commit456ad58ea2f07de1bc6d810755cc94981381bbf0
tree0c2f994c2eaeffaa02392cbe3e08909d70f61b71
parentc63b7010f239918d0e475ec34b621a610639fa55
KVM: SEV-ES: fix another issue with string I/O VMGEXITs

If the guest requests string I/O from the hypervisor via VMGEXIT,
SW_EXITINFO2 will contain the REP count.  However, sev_es_string_io
was incorrectly treating it as the size of the GHCB buffer in
bytes.

This fixes the "outsw" test in the experimental SEV tests of
kvm-unit-tests.

Cc: stable@vger.kernel.org
Fixes: d3e48bd8f6b4 ("KVM: SVM: Support string IO operations for an SEV-ES guest")
Reported-by: Marc Orr <marcorr@google.com>
Tested-by: Marc Orr <marcorr@google.com>
Reviewed-by: Marc Orr <marcorr@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c