]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sev: Fix SEV-ES INS/OUTS instructions for word, dword, and qword
authorMichael Sterritt <sterritt@google.com>
Fri, 19 Nov 2021 23:27:57 +0000 (15:27 -0800)
committerBorislav Petkov <bp@suse.de>
Fri, 3 Dec 2021 17:09:30 +0000 (18:09 +0100)
commit67c0350d5df279382b70bdc114e615bc714424ea
tree6cb30d68ebca4d0eda9ed38de59d4384029a224a
parentb8964b90283d80063f8f44ee6c6278c44894cd36
x86/sev: Fix SEV-ES INS/OUTS instructions for word, dword, and qword

Properly type the operands being passed to __put_user()/__get_user().
Otherwise, these routines truncate data for dependent instructions
(e.g., INSW) and only read/write one byte.

This has been tested by sending a string with REP OUTSW to a port and
then reading it back in with REP INSW on the same port.

Previous behavior was to only send and receive the first char of the
size. For example, word operations for "abcd" would only read/write
"ac". With change, the full string is now written and read back.

Fixes: 9439a3a1ab8b3 (x86/sev-es: Compile early handler code into kernel image)
Signed-off-by: Michael Sterritt <sterritt@google.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marc Orr <marcorr@google.com>
Reviewed-by: Peter Gonda <pgonda@google.com>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
Link: https://lkml.kernel.org/r/20211119232757.176201-1-sterritt@google.com
arch/x86/kernel/sev.c