Re: [RFC PATCH v5 11/45] x86/tdx: Add helpers to check return status codes
From: Dave Hansen
Date: Thu Jan 29 2026 - 13:58:50 EST
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)
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.