Re: [RFC PATCH v5 11/45] x86/tdx: Add helpers to check return status codes
From: Sean Christopherson
Date: Thu Jan 29 2026 - 15:35:20 EST
On Thu, Jan 29, 2026, Dave Hansen wrote:
> On 1/28/26 17:14, Sean Christopherson wrote:
> ...
> > err = tdh_mng_vpflushdone(&kvm_tdx->td);
> > - if (err == TDX_FLUSHVP_NOT_DONE)
> > + if (IS_TDX_FLUSHVP_NOT_DONE(err))
> > goto out;
> > if (TDX_BUG_ON(err, TDH_MNG_VPFLUSHDONE, kvm)) {
>
> I really despise the non-csopeable, non-ctaggable, non-greppable names
> like this. Sometimes it's unavoidable. Is it really unavoidable here?
>
> Something like this is succinct enough and doesn't have any magic ##
> macro definitions:
>
> TDX_ERR_EQ(err, TDX_FLUSHVP_NOT_DONE)
FWIW, I have zero preference on this. I included the patch purely because it was
already there.
> But, honestly, if I were trying to push a 45-patch series, I probably
> wouldn't tangle this up as part of it. It's not _that_ desperately in
> need of munging it a quarter of the way into this series.
For sure. The 45 patches are definitely not intended to land as one. I posted
the mega-series to propose an end-to-end design for DPAMT + S-EPT hugepage support.
I don't have the bandwidth or brainpower to hash out a KVM design in two different
series.