Hi all,
Today's linux-next merge of the kvm-x86 tree got a conflict in:
arch/x86/virt/vmx/tdx/tdx_global_metadata.c
between commit:
311214bf1df4b ("x86/virt/tdx: Retrieve TDX module version")
from the tip tree and commit:
75b6c694eaed4 ("x86/virt/tdx: Tag a pile of functions as __init, and globals as __ro_after_init")
from the kvm-x86 tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc arch/x86/virt/vmx/tdx/tdx_global_metadata.c
index 4c9917a9c2c39,360963bc9328f..0000000000000
--- a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
+++ b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
@@@ -7,22 -7,7 +7,22 @@@
* Include this file to other C file instead.
*/
+static int get_tdx_sys_info_version(struct tdx_sys_info_version *sysinfo_version)
+{
+ int ret = 0;
+ u64 val;
+
+ if (!ret && !(ret = read_sys_metadata_field(0x0800000100000003, &val)))
+ sysinfo_version->minor_version = val;
+ if (!ret && !(ret = read_sys_metadata_field(0x0800000100000004, &val)))
+ sysinfo_version->major_version = val;
+ if (!ret && !(ret = read_sys_metadata_field(0x0800000100000005, &val)))
+ sysinfo_version->update_version = val;
+
+ return ret;
+}
+
- static int get_tdx_sys_info_features(struct tdx_sys_info_features *sysinfo_features)
+ static __init int get_tdx_sys_info_features(struct tdx_sys_info_features *sysinfo_features)
{
int ret = 0;
u64 val;
On Wed, Mar 04, 2026, Mark Brown wrote:
> Hi all,
>
> Today's linux-next merge of the kvm-x86 tree got a conflict in:
>
> arch/x86/virt/vmx/tdx/tdx_global_metadata.c
>
> between commit:
>
> 311214bf1df4b ("x86/virt/tdx: Retrieve TDX module version")
>
> from the tip tree and commit:
>
> 75b6c694eaed4 ("x86/virt/tdx: Tag a pile of functions as __init, and globals as __ro_after_init")
>
> from the kvm-x86 tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> diff --cc arch/x86/virt/vmx/tdx/tdx_global_metadata.c
> index 4c9917a9c2c39,360963bc9328f..0000000000000
> --- a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
> +++ b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
> @@@ -7,22 -7,7 +7,22 @@@
> * Include this file to other C file instead.
> */
>
> +static int get_tdx_sys_info_version(struct tdx_sys_info_version *sysinfo_version)
Functionally this is a-ok, but we should remember to mention to Linus (and Paolo)
that this can be marked __init when the two branches get smushed together.
Thanks Mark!
> +{
> + int ret = 0;
> + u64 val;
> +
> + if (!ret && !(ret = read_sys_metadata_field(0x0800000100000003, &val)))
> + sysinfo_version->minor_version = val;
> + if (!ret && !(ret = read_sys_metadata_field(0x0800000100000004, &val)))
> + sysinfo_version->major_version = val;
> + if (!ret && !(ret = read_sys_metadata_field(0x0800000100000005, &val)))
> + sysinfo_version->update_version = val;
> +
> + return ret;
> +}
> +
> - static int get_tdx_sys_info_features(struct tdx_sys_info_features *sysinfo_features)
> + static __init int get_tdx_sys_info_features(struct tdx_sys_info_features *sysinfo_features)
> {
> int ret = 0;
> u64 val;
On Wed, Mar 04, 2026 at 03:10:14PM -0800, Sean Christopherson wrote:
> On Wed, Mar 04, 2026, Mark Brown wrote:
> > Hi all,
> >
> > Today's linux-next merge of the kvm-x86 tree got a conflict in:
> >
> > arch/x86/virt/vmx/tdx/tdx_global_metadata.c
> >
> > between commit:
> >
> > 311214bf1df4b ("x86/virt/tdx: Retrieve TDX module version")
> >
> > from the tip tree and commit:
> >
> > 75b6c694eaed4 ("x86/virt/tdx: Tag a pile of functions as __init, and globals as __ro_after_init")
> >
> > from the kvm-x86 tree.
> >
> > I fixed it up (see below) and can carry the fix as necessary. This
> > is now fixed as far as linux-next is concerned, but any non trivial
> > conflicts should be mentioned to your upstream maintainer when your tree
> > is submitted for merging. You may also want to consider cooperating
> > with the maintainer of the conflicting tree to minimise any particularly
> > complex conflicts.
> >
> > diff --cc arch/x86/virt/vmx/tdx/tdx_global_metadata.c
> > index 4c9917a9c2c39,360963bc9328f..0000000000000
> > --- a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
> > +++ b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
> > @@@ -7,22 -7,7 +7,22 @@@
> > * Include this file to other C file instead.
> > */
> >
> > +static int get_tdx_sys_info_version(struct tdx_sys_info_version *sysinfo_version)
>
> Functionally this is a-ok, but we should remember to mention to Linus (and Paolo)
> that this can be marked __init when the two branches get smushed together.
s/can be/need to be/, I am seeing warnings from modpost as a result of
get_tdx_sys_info_version() lacking __init when building with clang:
$ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 mrproper allmodconfig all
...
WARNING: modpost: vmlinux: section mismatch in reference: get_tdx_sys_info_version+0x3e (section: .text.unlikely.) -> read_sys_metadata_field (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: get_tdx_sys_info_version+0x90 (section: .text.unlikely.) -> read_sys_metadata_field (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: get_tdx_sys_info_version+0xc0 (section: .text.unlikely.) -> read_sys_metadata_field (section: .init.text)
This obviously clears it. Mark, can that be applied to whichever merge
happens second?
Cheers,
Nathan
diff --git a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
index e854aa0ca649..c7db393a9cfb 100644
--- a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
+++ b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
@@ -7,7 +7,7 @@
* Include this file to other C file instead.
*/
-static int get_tdx_sys_info_version(struct tdx_sys_info_version *sysinfo_version)
+static __init int get_tdx_sys_info_version(struct tdx_sys_info_version *sysinfo_version)
{
int ret = 0;
u64 val;
On Thu, Mar 05, 2026 at 12:24:01PM -0700, Nathan Chancellor wrote: > This obviously clears it. Mark, can that be applied to whichever merge > happens second? I manually made a change which hopefully matches that, your patch failed patch format detection for some reason...
On Fri, Mar 06, 2026 at 01:24:34PM +0000, Mark Brown wrote: > On Thu, Mar 05, 2026 at 12:24:01PM -0700, Nathan Chancellor wrote: > > > This obviously clears it. Mark, can that be applied to whichever merge > > happens second? > > I manually made a change which hopefully matches that, your patch failed > patch format detection for some reason... Thanks, the version in next-20260306 looks good to me. Cheers, Nathan
© 2016 - 2026 Red Hat, Inc.