Thread (5 messages) 5 messages, 4 authors, 2021-10-25

Re: [PATCH 1/8] KVM: SEV-ES: fix length of string I/O

From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2021-10-25 08:59:17
Also in: kvm, lkml

Possibly related (same subject, not in this thread)

On 25/10/21 03:31, Marc Orr wrote:
I could be missing something, but I'm pretty sure that this is wrong.
The GHCB spec says that `exit_info_2` is the `rep` count. Not the
string length.

For example, given a `rep outsw` instruction, with `ECX` set to `8`,
the rep count written into `SW_EXITINFO2` should be eight x86 words
(i.e., 16 bytes) and the IO size should be one x86 word (i.e., 2
bytes). In other words, the code was correct before this patch. This
patch is incorrectly dividing the rep count by the IO size, causing
the string IO to be truncated.
Then what's wrong is _also_ the call to setup_vmgexit_scratch, because 
that one definitely expects bytes:

                 scratch_va = kzalloc(len, GFP_KERNEL_ACCOUNT);

Paolo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help