Skip to content

unreachable instruction in mm/workingset.o #548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ms178 opened this issue Jun 20, 2019 · 9 comments
Closed

unreachable instruction in mm/workingset.o #548

ms178 opened this issue Jun 20, 2019 · 9 comments
Labels
[ARCH] x86_64 This bug impacts ARCH=x86_64 [TOOL] objtool warning is produced by the kernel's objtool

Comments

@ms178
Copy link

ms178 commented Jun 20, 2019

Makefile.txt
config.txt
arch_x86_Makefile.txt

With a vanilla clang version 9.0.0 (363704) and Kernel 5.2-rc5 (Suse), I get the following objtool error:

mm/workingset.o: warning: objtool: count_shadow_nodes()+0x12f: unreachable instruction

I'll file others shortly which were seen with the same config and Makefile. As I didn't finish the compilation, I might post more of them if I try a second time. But before spamming the list with more of these, I wanted to hear from you if these are welcome or if there is something wrong with my setup.

CPU is an Intel i5-2410m (Sandy Bridge, x86-64). Please notice, that I have used my custom compiler and linker flags.

@ms178
Copy link
Author

ms178 commented Jun 20, 2019

By the way, I could reproduce these errors without using Polly (and I missed adding -fopenmp after -polly-parallel in the Makefile uploaded here).

@nickdesaulniers nickdesaulniers added [TOOL] objtool warning is produced by the kernel's objtool [ARCH] x86_64 This bug impacts ARCH=x86_64 low priority This bug is not critical and not a priority labels Jun 20, 2019
@MaskRay
Copy link
Member

MaskRay commented Jun 24, 2019

With clang trunk (9.0.0 r364163), https://github.com/ClangBuiltLinux/linux/files/3310077/config.txt, and the CFLAGS changes (no polly options):

diff --git i/Makefile w/Makefile
index 9514dac2660a..ebae1e47e547 100644
--- i/Makefile
+++ w/Makefile
@@ -460,0 +461 @@ KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
+                  -O3 -march=native -mtune=native \
diff --git i/arch/x86/Makefile w/arch/x86/Makefile
index 56e748a7679f..6d19308267b8 100644
--- i/arch/x86/Makefile
+++ w/arch/x86/Makefile
@@ -128 +128 @@ else
-        cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
+        cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-O3 -march=native -mtune=native)
% make -j"$(nproc)" HOSTCC=clang HOSTLD=ld.lld CC=clang LD=ld.lld O=out modules
...
/bin/sh: line 1: 151049 Segmentation fault      ./tools/objtool/objtool orc generate --module --no-fp --uaccess
drivers/hwmon/pmbus/adm1275.o

@dileks
Copy link
Collaborator

dileks commented Jul 24, 2019

@ms178

Can you retest this with Linux v5.3-rc1+ which includes "objtool fixes and enhancements v2" from [2]?

More details see thread "x86 - clang / objtool status" [1].
(It is still worked on... I see only 4 objtool warnings.)

Can you check your open CBL bugs and comment (or close?).

[1] https://lore.kernel.org/all/[email protected]/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git/log/?h=objtool-many-fixes-v2

@nickdesaulniers
Copy link
Member

So @ms178 I'd verify that -O3 builds cleanly first; there's probably bugs there. Once we can build that cleanly, should we look into -march flags.

@ms178
Copy link
Author

ms178 commented Jul 24, 2019

Just a sidenote: As I am on vacation for the next couple of weeks, I only have access to a different machine with a Westmere CPU as of right now and cannot use the exact same Kernel config. Once I get access to a newer Kernel RC and Clang build, I'll re-test it.

@ms178
Copy link
Author

ms178 commented Jul 24, 2019

With -O3, clang version 9.0.0 (365992) and Linux-Next-Next from 24 th July 2019, I get 37 objtool warnings in total:

arch/x86/kvm/svm.o: warning: objtool: is_erratum_383()+0xb1: unreachable instruction
mm/workingset.o: warning: objtool: count_shadow_nodes()+0x12f: unreachable instruction
fs/hfsplus/xattr.o: warning: objtool: hfsplus_create_attributes_file()+0x38f: unreachable instruction
kernel/module.o: warning: objtool: verify_exported_symbols()+0x147: unreachable instruction
arch/x86/pci/fixup.o: warning: objtool: pci_fixup_i450nx()+0xed: unreachable instruction
sound/pci/hda/hda_generic.o: warning: objtool: parse_output_paths()+0x15f: unreachable instruction
sound/soc/codecs/rt5663.o: warning: objtool: rt5663_v2_jack_detect()+0x2ce: unreachable instruction
sound/soc/intel/haswell/sst-haswell-pcm.o: warning: objtool: hsw_pcm_prepare()+0x1c9: unreachable instruction
net/bridge/netfilter/ebtables.o: warning: objtool: compat_calc_entry()+0x1bb: unreachable instruction
drivers/block/skd_main.o: warning: objtool: skd_pci_probe()+0x393: unreachable instruction
drivers/gpu/drm/amd/amdgpu/atom.o: warning: objtool: atom_op_move() falls through to next function atom_op_and()
drivers/hwmon/pmbus/adm1275.o: warning: objtool: adm1275_probe()+0x744: unreachable instruction
drivers/hwmon/ad7414.o: warning: objtool: ad7414_update_device()+0xf2: unreachable instruction
drivers/hwmon/adm9240.o: warning: objtool: adm9240_update_device()+0x236: unreachable instruction
drivers/hwmon/w83l785ts.o: warning: objtool: w83l785ts_read_value()+0xa1: unreachable instruction
drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.o: warning: objtool: print_bw_calcs_data()+0x284b: unreachable instruction
drivers/gpu/drm/ttm/ttm_bo.o: warning: objtool: ttm_bo_device_release()+0x207: unreachable instruction
drivers/input/mouse/elan_i2c_core.o: warning: objtool: elan_write_fw_block()+0x8d: unreachable instruction
drivers/input/tablet/gtco.o: warning: objtool: gtco_probe()+0x3d0: unreachable instruction
drivers/misc/mei/bus-fixup.o: warning: objtool: mei_fwver()+0x1ce: unreachable instruction
drivers/misc/mei/hw-txe.o: warning: objtool: mei_txe_fw_status()+0xce: unreachable instruction
drivers/input/touchscreen/elants_i2c.o: warning: objtool: elants_i2c_query_test_version()+0x16e: unreachable instruction
drivers/nfc/pn544/i2c.o: warning: objtool: pn544_hci_i2c_platform_init()+0x140: unreachable instruction
drivers/input/touchscreen/usbtouchscreen.o: warning: objtool: mtouch_init()+0x256: unreachable instruction
drivers/mtd/ssfdc.o: warning: objtool: get_logical_address()+0x161: unreachable instruction
drivers/ntb/hw/mscc/ntb_hw_switchtec.o: warning: objtool: crosslink_enum_partition()+0x107: unreachable instruction
net/netfilter/nf_conntrack_proto_gre.o: warning: objtool: nf_ct_gre_keymap_destroy()+0xe7: unreachable instruction
drivers/platform/x86/intel_turbo_max_3.o: warning: objtool: get_oc_core_priority()+0xf1: unreachable instruction
drivers/staging/rts5208/rtsx_card.o: warning: objtool: card_rw()+0x1cc: unreachable instruction
drivers/staging/rts5208/sd.o: warning: objtool: sd_tuning_rx()+0x167: unreachable instruction
drivers/thermal/intel/intel_soc_dts_iosf.o: warning: objtool: intel_soc_dts_iosf_interrupt_handler()+0xe6: unreachable instruction
drivers/usb/atm/usbatm.o: warning: objtool: usbatm_usb_probe()+0x41c: unreachable instruction
drivers/usb/storage/sierra_ms.o: warning: objtool: sierra_ms_init()+0x136: unreachable instruction
drivers/usb/serial/f81534.o: warning: objtool: f81534_calc_num_ports()+0x49e: unreachable instruction
drivers/usb/serial/keyspan.o: warning: objtool: keyspan_open()+0x153: unreachable instruction
drivers/scsi/qla2xxx/qla_target.o: warning: objtool: qlt_lport_dump()+0x116: unreachable instruction
drivers/scsi/ufs/ufshcd.o: warning: objtool: ufshcd_dme_set_attr()+0xfc: unreachable instruction

I've added the config, the Makefile and the complete build log.
config_Westmere.txt
kernellog_Westmere.txt
Makefile_Westmere.txt
objtool_warnings_Westmere.txt

System: Intel Xeon X5675, 24 GB RAM, Asus P6T WS Pro, AMD RX 580

@ms178
Copy link
Author

ms178 commented Jul 27, 2019

@nickdesaulniers @dileks Here are the results with -O3, linux-next-next-20190726 and clang version 10.0.0 (366783). There is some good progress to report, we came down from 37 to 2 warnings with the attached config on my Xeon X5675 system (mentioned above).

drivers/gpu/drm/amd/amdgpu/atom.o: warning: objtool: atom_op_move() falls through to next function atom_op_and()
drivers/hwmon/pmbus/adm1275.o: warning: objtool: adm1275_probe()+0x744: unreachable instruction

This build also doesn't succeed with several errors in drivers/gpu/drm/amd/amdgpu/amdgpu.ko at the end but this is a known issue mentioned on the LKML already.

buildlog_Westmere_2.txt

config_Westmere_2.txt

Makefile_Westmere_2.txt

arch_x86_Makefile.txt

@nickdesaulniers
Copy link
Member

@ms178, thanks for the report :

  1. is the issue in mm/workingset.o still reproducible? If no, please close this issue and file one for each individual issue you observe w/ steps to reproduce, if there's not already a tracking issue.
  2. Are the above observed at -O2 or only at -O3?

@ms178
Copy link
Author

ms178 commented Jul 29, 2019

@nickdesaulniers

  1. The mm/workingset.o issue is also not reproducible anymore (according to the buildlog), I'll close this issue then and will open two issues for the two observed. I noticed that you tag fixed issues to categorize if it was fixed in the Kernel or LLVM/Clang (etc.) but as I don't know which respective fix was responsible for fixing these, could you add the tags if necessary?

  2. I just tested -O3 with that specific config but could also check with -O2 tomorrow and could add more fancy flags after that.

@ms178 ms178 closed this as completed Jul 29, 2019
@tpimh tpimh removed the low priority This bug is not critical and not a priority label Sep 28, 2019
nathanchance pushed a commit that referenced this issue Jan 16, 2021
We should call irq trace only if interrupt is going to be enabled during
excecption handling. Otherwise, it results in following warning during
boot with lock debugging enabled.

[    0.000000] ------------[ cut here ]------------
[    0.000000] DEBUG_LOCKS_WARN_ON(early_boot_irqs_disabled)
[    0.000000] WARNING: CPU: 0 PID: 0 at kernel/locking/lockdep.c:4085 lockdep_hardirqs_on_prepare+0x22a/0x22e
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.10.0-00022-ge20097fb37e2-dirty #548
[    0.000000] epc: c005d5d4 ra : c005d5d4 sp : c1c01e80
[    0.000000]  gp : c1d456e0 tp : c1c0a980 t0 : 00000000
[    0.000000]  t1 : ffffffff t2 : 00000000 s0 : c1c01ea0
[    0.000000]  s1 : c100f360 a0 : 0000002d a1 : c00666ee
[    0.000000]  a2 : 00000000 a3 : 00000000 a4 : 00000000
[    0.000000]  a5 : 00000000 a6 : c1c6b390 a7 : 3ffff00e
[    0.000000]  s2 : c2384fe8 s3 : 00000000 s4 : 00000001
[    0.000000]  s5 : c1c0a980 s6 : c1d48000 s7 : c1613b4c
[    0.000000]  s8 : 00000fff s9 : 80000200 s10: c1613b40
[    0.000000]  s11: 00000000 t3 : 00000000 t4 : 00000000
[    0.000000]  t5 : 00000001 t6 : 00000000

Fixes: 3c46979 ("riscv:Enable LOCKDEP_SUPPORT & fixup TRACE_IRQFLAGS_SUPPORT")

Signed-off-by: Atish Patra <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] x86_64 This bug impacts ARCH=x86_64 [TOOL] objtool warning is produced by the kernel's objtool
Projects
None yet
Development

No branches or pull requests

5 participants