Re: [PATCH v6 02/11] x86/virt/tdx: Allocate page bitmap for Dynamic PAMT
From: Edgecombe, Rick P
Date: Tue Jul 07 2026 - 22:10:52 EST
On Tue, 2026-07-07 at 19:07 -0700, Rick Edgecombe wrote:
> > I think you can avoid the comment altogether in that case.
>
> I don't think it removes the need for a comment. The point is if
> tdx_supports_dynamic_pamt() is not supported. The comment should be more about
> "why", than what the code does, right?
>
> How about:
>
> if (ret)
> return ret;
>
> /*
> * The kernel supports using TDX without Dynamic PAMT, so
> * avoid reporting failure if it's not supported.
> */
> if (tdx_supports_dynamic_pamt(sysinfo))
> ret = get_tdx_sys_info_tdmr_dpamt(&sysinfo->tdmr);
>
> return ret;
Actually this really stands out from the autogenerated code now, how about:
/*
* The kernel supports using TDX without Dynamic PAMT, so
* avoid reporting failure if it's not supported.
*/
if (!ret && tdx_supports_dynamic_pamt(sysinfo))
ret = get_tdx_sys_info_tdmr_dpamt(&sysinfo->tdmr);
It why-ifys the comment more, but only gently moves from the auto-generated
patterns.