Re: [PATCH v3 11/12] x86/virt/tdx: Allow SEAMCALL to handle #UD and #GP

From: Dave Hansen
Date: Mon Aug 07 2023 - 10:46:50 EST


On 8/6/23 04:41, kirill.shutemov@xxxxxxxxxxxxxxx wrote:
> On Wed, Jul 26, 2023 at 11:25:13PM +1200, Kai Huang wrote:
>> @@ -20,6 +21,9 @@
>> #define TDX_SW_ERROR (TDX_ERROR | GENMASK_ULL(47, 40))
>> #define TDX_SEAMCALL_VMFAILINVALID (TDX_SW_ERROR | _UL(0xFFFF0000))
>>
>> +#define TDX_SEAMCALL_GP (TDX_SW_ERROR | X86_TRAP_GP)
>> +#define TDX_SEAMCALL_UD (TDX_SW_ERROR | X86_TRAP_UD)
> Is there any explantion how these error codes got chosen? Looks very
> arbitrary and may collide with other error codes in the future.

If they collide, we can just fix it then.

So, please, do comment what the limitations are and what must be avoided
in the future, but I don't think we need to go mucking with this at all.