Thread (107 messages) 107 messages, 10 authors, 11d ago

Re: [PATCH v6 02/11] x86/virt/tdx: Allocate page bitmap for Dynamic PAMT

From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Date: 2026-07-08 02:10:22
Also in: kvm, linux-doc, lkml

On Tue, 2026-07-07 at 19:07 -0700, Rick Edgecombe wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help