Re: [PATCH v7 16/22] x86/virt/tdx: Update tdx_sysinfo and check features post-update

Chao Gao
2026-04-08T12:17:18Z

On Tue, Apr 07, 2026 at 08:53:47AM -0700, Dave Hansen wrote:
>On 4/7/26 05:15, Chao Gao wrote:
>> Dave's comment on another patch applies here too: don't preemptively handle
>> errors that never occur. The custom error message is unnecessary, and
>> propagating the error isn't worth it. Will simplify it to:
>>
>> /* Shouldn't fail as the update has succeeded. */
>> WARN_ON_ONCE(get_tdx_sys_info(info));
>
>This is nit territory, but I don't like that either.
>
>Actual, important, normal-program-flow logic should stand on its own,
>separate from warnings.
>
>OK:
> ret = foo()
> WARN_ON(ret);
>
>Not OK:
> WARN_ON(foo());

Good point. Will separate the call from the warning. Thanks.