Re: [PATCH] x86/sev-es: Fix SEV-ES OUT/IN immediate opcode vc handling

2020-12-29 Thread Borislav Petkov
On Mon, Dec 28, 2020 at 03:43:06PM -0800, Sean Christopherson wrote: > Eh, casting to u8 is "absolutely correct" as well. I don't like using bytes[] > because it feels like accessing the raw data as opposed to the end result of > decoding, but it's not a sticking point. Ok, code in the kernel

Re: [PATCH] x86/sev-es: Fix SEV-ES OUT/IN immediate opcode vc handling

2020-12-28 Thread Sean Christopherson
On Mon, Dec 28, 2020, Borislav Petkov wrote: > On Thu, Dec 17, 2020 at 09:19:13AM -0800, Sean Christopherson wrote: > > On Wed, Dec 16, 2020, Peter Gonda wrote: > > > > > > The IN and OUT immediate instructions only use an 8-bit immediate. The > > > current VC handler uses the entire 32-bit

Re: [PATCH] x86/sev-es: Fix SEV-ES OUT/IN immediate opcode vc handling

2020-12-28 Thread Borislav Petkov
On Thu, Dec 17, 2020 at 09:19:13AM -0800, Sean Christopherson wrote: > On Wed, Dec 16, 2020, Peter Gonda wrote: > > > > The IN and OUT immediate instructions only use an 8-bit immediate. The > > current VC handler uses the entire 32-bit immediate value. These > > instructions only set the first

Re: [PATCH] x86/sev-es: Fix SEV-ES OUT/IN immediate opcode vc handling

2020-12-17 Thread Sean Christopherson
On Wed, Dec 16, 2020, Peter Gonda wrote: > > The IN and OUT immediate instructions only use an 8-bit immediate. The > current VC handler uses the entire 32-bit immediate value. These > instructions only set the first bytes. > > Tested with a loop back port with "outb %0,$0xe0". Before the port

[PATCH] x86/sev-es: Fix SEV-ES OUT/IN immediate opcode vc handling

2020-12-16 Thread Peter Gonda
The IN and OUT immediate instructions only use an 8-bit immediate. The current VC handler uses the entire 32-bit immediate value. These instructions only set the first bytes. Tested with a loop back port with "outb %0,$0xe0". Before the port seen by KVM was 0xffe0 instead of 0xe0.