From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>
Cc: "seanjc@google.com" <seanjc@google.com>,
"bp@alien8.de" <bp@alien8.de>, "kas@kernel.org" <kas@kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"x86@kernel.org" <x86@kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"Li, Xiaoyao" <xiaoyao.li@intel.com>
Subject: Re: [PATCH 1/2] x86/virt/tdx: Remove __user annotation from kernel pointer
Date: Wed, 29 Oct 2025 21:06:46 +0000 [thread overview]
Message-ID: <6bfe570e35364bd121b648fe8475f705666183d6.camel@intel.com> (raw)
In-Reply-To: <20251029194831.6819B2E7@davehans-spike.ostc.intel.com>
For the KVM side of tdx, the commits are getting prefixed with "KVM: TDX: ", and
"x86/virt/tdx" is being used arch/x86/virt/vmx/tdx/tdx.c. It's probably not too
late to adopt the one true naming scheme. I don't have a strong preference
except some consistency and that the maintainers agree :)
On Wed, 2025-10-29 at 12:48 -0700, Dave Hansen wrote:
> From: Dave Hansen <dave.hansen@linux.intel.com>
Pretty much the only difference between tip style logs and kvm/x86 style logs is
to lead with a short "what is the change" blurb before launching into the
background. Like:
KVM: TDX: Remove __user annotation from kernel pointer
Fix sparse warning in tdx_vcpu_get_cpuid().
There are two 'kvm_cpuid2' pointers involved here...
>
> There are two 'kvm_cpuid2' pointers involved here. There's an "input"
> side: 'td_cpuid' which is a normal kernel pointer and an 'output'
> side. The output here is userspace and there is an attempt at properly
> annotating the variable with __user:
>
> struct kvm_cpuid2 __user *output, *td_cpuid;
>
> But, alas, this is wrong. The __user in the definition applies to both
> 'output' and 'td_cpuid'.
>
> Fix it up by completely separating the two definitions so that it is
> obviously correct without even having to know what the C syntax rules
> even are.
If we want it:
Fixes: 488808e682e7 ("KVM: x86: Introduce KVM_TDX_GET_CPUID")
TIL on the syntax association here.
next prev parent reply other threads:[~2025-10-29 21:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 19:48 [PATCH 0/2] x86/virt/tdx: Minor sparse fixups Dave Hansen
2025-10-29 19:48 ` [PATCH 1/2] x86/virt/tdx: Remove __user annotation from kernel pointer Dave Hansen
2025-10-29 21:06 ` Edgecombe, Rick P [this message]
2025-10-29 21:13 ` Dave Hansen
2025-10-29 23:00 ` Sean Christopherson
2025-10-29 23:34 ` Dave Hansen
2025-10-30 0:04 ` Sean Christopherson
2025-10-29 19:48 ` [PATCH 2/2] x86/virt/tdx: Fix sparse warnings from using 0 for NULL Dave Hansen
2025-10-29 21:09 ` Edgecombe, Rick P
2025-10-29 20:53 ` [PATCH 0/2] x86/virt/tdx: Minor sparse fixups Edgecombe, Rick P
2025-10-29 21:10 ` Edgecombe, Rick P
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6bfe570e35364bd121b648fe8475f705666183d6.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kas@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox