Skip to contentSkip to conversation

UML: pata_cs5536: fix build for X86_32 UML with TRACEPOINTS

PATCH In review Randy Dunlap 5 participants 6 messages Apr 10, 2023 – Apr 16, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 UML: pata_cs5536: fix build for X86_32 UML with TRACEPOINTS

Current build of pata_cs5536 for i386 UML fails with:

ERROR: modpost: "__tracepoint_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "__tracepoint_read_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_read_msr" [drivers/ata/pata_cs5536.ko] undefined!

Add the arch/x86/lib/msr.o binary to resolve these undefined symbols.

Cc Richard Weinberger <[email protected]>
Cc Anton Ivanov <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Damien Le Moal <[email protected]>
Cc Geert Uytterhoeven <[email protected]>

---
v2: change from not building on UML to fixing the build on UML
v3: add Rev-by: Damien Le Moal

 arch/x86/um/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/um/Makefile +1 -1
diff -- a/arch/x86/um/Makefile b/arch/x86/um/Makefile
@@ -21,7 +21,7 @@ obj-y += checksum_32.o syscalls_32.o
 obj-$(CONFIG_ELF_CORE) += elfcore.o
 
 subarch-y = ../lib/string_32.o ../lib/atomic64_32.o ../lib/atomic64_cx8_32.o
-subarch-y += ../lib/cmpxchg8b_emu.o ../lib/atomic64_386_32.o
+subarch-y += ../lib/cmpxchg8b_emu.o ../lib/atomic64_386_32.o ../lib/msr.o
 subarch-y += ../kernel/sys_ia32.o
 
 else

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

#1 lore raw
kernel test robot noticed the following build warnings:

Hi Randy,

kernel test robot noticed the following build warnings:

[auto build test WARNING on uml/next]
[also build test WARNING on uml/fixes wireless-next/main wireless/main linus/master v6.3-rc6 next-20230411] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Randy-Dunlap/UML-pata_cs5536-fix-build-for-X86_32-UML-with-TRACEPOINTS/20230410-091733
base:   git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux next
patch link:    https://lore.kernel.org/r/20230410011325.26850-1-rdunlap%40infradead.org
patch subject: [PATCH v3] UML: pata_cs5536: fix build for X86_32 UML with TRACEPOINTS
config: um-i386_defconfig (https://download.01.org/0day-ci/archive/20230412/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0

reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/2782ce24954318f1698ec910691250f4d287d817
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Randy-Dunlap/UML-pata_cs5536-fix-build-for-X86_32-UML-with-TRACEPOINTS/20230410-091733 git checkout 2782ce24954318f1698ec910691250f4d287d817
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=um SUBARCH=i386 olddefconfig
make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> arch/x86/um/../lib/msr.c:30: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

* Read an MSR with error handling
arch/x86/um/../lib/msr.c:52: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Write an MSR with error handling
arch/x86/um/../lib/msr.c:91: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Set @bit in a MSR @msr.
arch/x86/um/../lib/msr.c:104: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Clear @bit in a MSR @msr.

vim +30 arch/x86/um/../lib/msr.c

22085a66c2fab6 Borislav Petkov 2014-03-09 28 22085a66c2fab6 Borislav Petkov 2014-03-09 29 /**

22085a66c2fab6 Borislav Petkov 2014-03-09 @30   * Read an MSR with error handling
22085a66c2fab6 Borislav Petkov 2014-03-09  31   *
22085a66c2fab6 Borislav Petkov 2014-03-09  32   * @msr: MSR to read
22085a66c2fab6 Borislav Petkov 2014-03-09  33   * @m: value to read into
22085a66c2fab6 Borislav Petkov 2014-03-09  34   *
22085a66c2fab6 Borislav Petkov 2014-03-09  35   * It returns read data only on success, otherwise it doesn't change the output
22085a66c2fab6 Borislav Petkov 2014-03-09  36   * argument @m.
22085a66c2fab6 Borislav Petkov 2014-03-09  37   *
22085a66c2fab6 Borislav Petkov 2014-03-09  38   */
3e7bbe15ed84e3 Zhao Xuehui     2021-04-08  39  static int msr_read(u32 msr, struct msr *m)
22085a66c2fab6 Borislav Petkov 2014-03-09  40  {
22085a66c2fab6 Borislav Petkov 2014-03-09  41  	int err;
22085a66c2fab6 Borislav Petkov 2014-03-09  42  	u64 val;
22085a66c2fab6 Borislav Petkov 2014-03-09  43  
22085a66c2fab6 Borislav Petkov 2014-03-09  44  	err = rdmsrl_safe(msr, &val);
22085a66c2fab6 Borislav Petkov 2014-03-09  45  	if (!err)
22085a66c2fab6 Borislav Petkov 2014-03-09  46  		m->q = val;
22085a66c2fab6 Borislav Petkov 2014-03-09  47  
22085a66c2fab6 Borislav Petkov 2014-03-09  48  	return err;
22085a66c2fab6 Borislav Petkov 2014-03-09  49  }
22085a66c2fab6 Borislav Petkov 2014-03-09  50  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
maintainer
#2 lore raw
In reply to Randy Dunlap
Quoted 9 lines · Randy Dunlap

Current build of pata_cs5536 for i386 UML fails with:

ERROR: modpost: "__tracepoint_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "__tracepoint_read_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_read_msr" [drivers/ata/pata_cs5536.ko] undefined!

Add the arch/x86/lib/msr.o binary to resolve these undefined symbols.

Hm. Does this make sense? I can't see it'd work on UML to configure an IDE device through MSRs? Surely that can't work? IOW, that entire driver can't really work anyway can it?

OTOH, maybe theoretically it could work in PCI, just not with MSRs, and then this patch makes some sense?

johannes

#3 lore raw
Quoted 11 lines · Johannes Berg
Quoted 9 lines · Randy Dunlap

Current build of pata_cs5536 for i386 UML fails with:

ERROR: modpost: "__tracepoint_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "__tracepoint_read_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_read_msr" [drivers/ata/pata_cs5536.ko] undefined!

Add the arch/x86/lib/msr.o binary to resolve these undefined symbols.

Quoted 6 lines

Hm. Does this make sense? I can't see it'd work on UML to configure an IDE device through MSRs? Surely that can't work? IOW, that entire driver can't really work anyway can it?

OTOH, maybe theoretically it could work in PCI, just not with MSRs, and then this patch makes some sense?

Hi,
I was happy with v1, which just did "depends on !UML". Anyway, I'll drop this part of the quest to make UML build cleanly.

Thanks.

Signature · 6 lines
~Randy

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
#4 lore raw
In reply to Johannes Berg
Quoted 11 lines · Johannes Berg
Quoted 9 lines · Randy Dunlap

Current build of pata_cs5536 for i386 UML fails with:

ERROR: modpost: "__tracepoint_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "__tracepoint_read_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_read_msr" [drivers/ata/pata_cs5536.ko] undefined!

Add the arch/x86/lib/msr.o binary to resolve these undefined symbols.

Quoted 6 lines

Hm. Does this make sense? I can't see it'd work on UML to configure an IDE device through MSRs? Surely that can't work? IOW, that entire driver can't really work anyway can it?

OTOH, maybe theoretically it could work in PCI, just not with MSRs, and then this patch makes some sense?

I think it is is integrated into actual Geode SOCs. That being said something like the patch below seems as simple as it gets and at least gives build coverage on uml

drivers/ata/pata_cs5536.c +1 -1
index ab47aeb5587f55..4f5d9afd51c9d8 100644
@@ -27,7 +27,7 @@
 #include <scsi/scsi_host.h>
 #include <linux/dmi.h>
 
-#ifdef CONFIG_X86_32
+#if defined(CONFIG_X86_32) && !defined(CONFIG_UML)
 #include <asm/msr.h>
 static int use_msr;
 module_param_named(msr, use_msr, int, 0644);
#5 lore raw

Hi Christoph,

Quoted 16 lines · Christoph Hellwig
Quoted 15 lines · Johannes Berg
Quoted 9 lines · Randy Dunlap

Current build of pata_cs5536 for i386 UML fails with:

ERROR: modpost: "__tracepoint_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_write_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "__tracepoint_read_msr" [drivers/ata/pata_cs5536.ko] undefined!
ERROR: modpost: "do_trace_read_msr" [drivers/ata/pata_cs5536.ko] undefined!

Add the arch/x86/lib/msr.o binary to resolve these undefined symbols.

Hm. Does this make sense? I can't see it'd work on UML to configure an IDE device through MSRs? Surely that can't work? IOW, that entire driver can't really work anyway can it?

Quoted 6 lines
Quoted 2 lines

OTOH, maybe theoretically it could work in PCI, just not with MSRs, and then this patch makes some sense?

I think it is is integrated into actual Geode SOCs. That being said something like the patch below seems as simple as it gets and at least gives build coverage on uml

CS5536 is the Geode Companion Device, i.e. the South Bridge, which can be used with other devices, AFAIK.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds