[lkml]   [2023]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v12 2/3] x86/sev: Change snp_guest_issue_request's fw_err
On Fri, Jan 20, 2023 at 09:48:55PM +0000, Dionna Glaze wrote:
> The GHCB specification declares that the firmware error value for a
> guest request will be stored in the lower 32 bits of EXIT_INFO_2.
> The upper 32 bits are for the VMM's own error code. The fw_err argument
> is thus a misnomer, and callers will need access to all 64 bits.
> The type of unsigned long also causes problems, since sw_exit_info2 is
> u64 (unsigned long long) vs the argument's unsigned long*. This type
> is changed for issuing the guest request. The ioctl command struct's
> error field is passed directly instead of a local variable, since an
> incomplete guest request may not set the error code, and uninitialized
> stack memory would be written back to user space.
> The firmware might not even be called, so the call is bookended with
> the no firmware call error and clearing the error.
> Since the "fw_err" field is really exitinfo2 split into the upper bits'
> vmm error code and lower bits' firmware error code, sev-guest.h is
> updated to represent the 64 bit value as a union.
> Cc: Tom Lendacky <>
> Cc: Paolo Bonzini <>
> Cc: Joerg Roedel <>
> Cc: Peter Gonda <>
> Cc: Thomas Gleixner <>
> Cc: Dave Hansen <>
> Cc: Ingo Molnar <>
> Cc: Borislav Petkov <>
> Cc: "H. Peter Anvin" <>
> Cc: Venu Busireddy <>
> Cc: Michael Roth <>
> Cc: "Kirill A. Shutemov" <>
> Cc: Michael Sterritt <>
> Fixes: d5af44dde546 ("x86/sev: Provide support for SNP guest request NAEs")
> Reviewed-by: Tom Lendacky <>

> Reviewed-by: Borislav Petkov <>

Please don't add tags you haven't received. Especially a Reviewed-by. Have a
look here what they mean, if unsure:


I've removed it - you don't have to resend just because of that.



 \ /
  Last update: 2023-03-26 23:51    [W:0.504 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site