Re: [PATCHv2 4/4] x86/tdx: Enable ENUM_TOPOLOGY

From: Dave Hansen
Date: Wed Apr 24 2024 - 18:21:58 EST


On 3/25/24 03:46, Kirill A. Shutemov wrote:
> + if ((features & TDX_FEATURES0_ENUM_TOPOLOGY) &&
> + tdg_vm_rd(TDCS_TOPOLOGY_ENUM_CONFIGURED)) {
> + if (!tdcs_ctls_set(TD_CTLS_ENUM_TOPOLOGY))
> + pr_warn("Failed to enable ENUM_TOPOLOGY\n");
> + }

This is looking pretty familiar at this point.

I'd almost rather just have it do a plain old:

tdcs_ctls_set(TD_CTLS_ENUM_TOPOLOGY);

.. and leave it at that.

*If* there is a generic return code for "invalid" as opposed to a
not-supported tdcs_ctls_set(), then it's arguable that you can spit out
a message for an unexpected "invalid" error.

But seriously, why all the complexity over and over? What does this buy?