[PATCH 0/2] x86/virt/tdx: Minor sparse fixups

Dave Hansen posted 2 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH 0/2] x86/virt/tdx: Minor sparse fixups
Posted by Dave Hansen 1 month, 2 weeks ago
Sean recently suggested relying on sparse to add type safety in TDX code,
hoping that the robots would notice and complain. Well, that plan is not
working out so great. TDX is not even sparse clean today and nobody seems
to have noticed or cared.

I can see how folks might ignore the 0 vs. NULL complaints. But the
misplaced __user is actually bad enough it should be fixed no matter
what.

Might as well fix it all up.

Cc: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Kirill A. Shutemov" <kas@kernel.org>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Re: [PATCH 0/2] x86/virt/tdx: Minor sparse fixups
Posted by Edgecombe, Rick P 1 month, 2 weeks ago
On Wed, 2025-10-29 at 12:48 -0700, Dave Hansen wrote:
> Sean recently suggested relying on sparse to add type safety in TDX code,
> hoping that the robots would notice and complain. Well, that plan is not
> working out so great. TDX is not even sparse clean today and nobody seems
> to have noticed or cared.
> 
> I can see how folks might ignore the 0 vs. NULL complaints. But the
> misplaced __user is actually bad enough it should be fixed no matter
> what.
> 
> Might as well fix it all up.

Oof. But my local distro version of sparse spit out a bunch of noise related to
"warning: unreplaced symbol" in "include/asm-generic/bitops/generic-non-
atomic.h". It also did not find these. But checking with the latest sparse build
from source did, and this fixes them.
Re: [PATCH 0/2] x86/virt/tdx: Minor sparse fixups
Posted by Edgecombe, Rick P 1 month, 2 weeks ago
On Wed, 2025-10-29 at 13:53 -0700, Rick Edgecombe wrote:
> But checking with the latest sparse build from source did, and this fixes them.

Minus the log questions:

Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>