lkml.org 
[lkml]   [2022]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv7.1 02/30] x86/tdx: Provide common base for SEAMCALL and TDCALL C wrappers
On 4/4/22 16:35, Kai Huang wrote:
> Both error code formats defined by P-SEAMLDR and TDX module has some reserved
> bits which will never be set to 1. I think we can just add a simple comment
> explaining that and choose a value which has 1 set for those reserved bits (even
> doesn't have to be -1). For example:
>
> /*
> * Use -1ULL which will never conflict with any actual error code
> * returned by both the P-SEAMLDR and the TDX module to represent
> * VMfailInvalid. Both error code definitions defined by the
> * P-SEAMLDR and the TDX module have some reserved bits which will
> * never be set to 1.
> */
> #define TDX_SEAMCALL_VMFAILINVALID GENMASK_ULL(63, 0)

The vague "some reserved bits" magic works for exactly *one* error code.
If you ever want to make it two, then you subject some some poor future
dope to a trip to TDX documentation purgatory.

All I'm asking is that this code stand on its own. Just declare what
the *ACTUAL* reserved bits are. Not some vague reference to "some
bits". There are *REAL* documented bits. Use them, please.

\
 
 \ /
  Last update: 2022-04-05 04:59    [W:0.070 / U:2.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site