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
objtool warnings in localmodconfig #336
Comments
$ make CC=clang arch/x86/kernel/apic/vector.o
$ make CC=clang drivers/acpi/ec.o
$ make CC=clang drivers/cpufreq/intel_pstate.o reliably repro. Final one needs $ make CC=clang drivers/gpu/drm/i915/ |
All of the above are reproducible with 183921. Without asm goto, I don't observe. Bisection now. |
Seems to be related to orc unwinder generations ./tools/objtool/objtool orc generate --no-fp --retpoline arch/x86/kernel/apic/vector.o C Reduce spat this out from arch/x86/kernel/apic/vector.o: // $ clang -no-integrated-as -O2 -pg -mfentry vector.c
// $ tools/objtool/objtool orc generate --no-fp --retpoline vector.o
// vector.o: warning: objtool: print_PIC()+0x27: sibling call from
// callable instruction with modified stack frame
c, d;
a(char);
b(void);
void print_PIC() {
if (c) {
b();
asm goto("1:.long b - ., %l[l_yes] - . \n\t" : : : : l_yes);
l_yes:
a(d);
}
}
$ grep objtool: log.txt
arch/x86/kernel/apic/vector.o: warning: objtool: print_PIC()+0x129: sibling call from callable instruction with modified stack frame
arch/x86/pci/fixup.o: warning: objtool: pci_fixup_i450nx()+0xfd: unreachable instruction
drivers/acpi/ec.o: warning: objtool: acpi_ec_unmask_gpe()+0x35: sibling call from callable instruction with modified stack frame
sound/pci/hda/hda_generic.o: warning: objtool: parse_output_paths()+0x146: unreachable instruction
drivers/cpufreq/intel_pstate.o: warning: objtool: intel_pstate_update_perf_limits()+0x1ff: unreachable instruction
lib/crc-t10dif.o: warning: objtool: crc_t10dif_transform_show()+0x3c: return with modified stack frame
lib/crc-t10dif.o: warning: objtool: crc_t10dif_transform_show()+0x0: stack state mismatch: cfa1=7+16 cfa2=7+8
drivers/input/touchscreen/elants_i2c.o: warning: objtool: elants_i2c_query_test_version()+0x1ad: unreachable instruction
drivers/mfd/wm831x-irq.o: warning: objtool: wm831x_irq_sync_unlock()+0xc6: unreachable instruction
drivers/mmc/core/mmc.o: warning: objtool: mmc_fixup_device()+0x97: unreachable instruction
drivers/misc/mei/bus-fixup.o: warning: objtool: mei_fwver()+0x1ac: unreachable instruction
drivers/platform/x86/intel_turbo_max_3.o: warning: objtool: get_oc_core_priority()+0x11c: unreachable instruction
drivers/gpu/drm/i915/gvt/cmd_parser.o: warning: objtool: parser_exec_state_dump()+0x144: unreachable instruction
$ grep objtool: log.txt | wc -l
13 |
was C reduced down to: // clang -O2 -no-integrated-as -c -mfentry -pg
pci_fixup_i450nx() {
for (;;)
asm goto("" : : : : a);
a:;
}
The combination of |
For fixup.o, is it just complaining that we didn't delete the code after the infinite loop? It looks like gcc will compile an infinite loop for that as well. gcc still emits an unreachable retq, but not the frame pointer setup and teardown. |
Looks like -pg explicitly forces -mdisable-fp-elim in clang. This prevents the backend from removing the frame code. |
The vector.o case is a bad optimization of stack frame prologue/epilogue due to the weird control flow asm-goto creates. I've added a fix similar to what we do for EHPads in the latest patch in phabricator. |
@nickdesaulniers If you give me the original non-reduced fixup.o, I can clarify what objtool is complaining about (and why it doesn't complain about the same code for GCC). |
@topperc @nickdesaulniers |
@topperc With
UPDATE: Fix for
|
I see all the objtool warnings observed by Nick plus the following when I use a Debian kernel-config as a base:
|
If I run on bare metal I see the folowing kernel-panic (noted from the screen):
If you have any suggestions how I can log these lines (being able to read them from a system wit a running kernel), please let me know. Thanks. |
I think the best way is to either take a picture, or enable kdump. |
@jpoimboe
My colleague here suggested me to use [1] https://freedesktop.org/wiki/Software/systemd/Debugging/ |
@dileks from your trace, looks like -fstack-protector-strong guard is failing in intel_idle_probe. I wouldn't risk booting on bare metal until the objtool warnings are all fixed. At least boot in QEMU first as a base sanity check. It would suck to suffer data loss from running on bare metal (but accepting the risk is much appreciated, for the sake of testing). From your list of objtool warnings, are any from the translation unit that defines intel_idel_probe? |
@nickdesaulniers What do you mean by "from the translation unit that defines intel_idel_probe"? |
|
drivers/acpi/ec.o: warning: objtool: acpi_ec_unmask_gpe()+0x35: sibling call from callable instruction with modified stack frame:
@jpoimboe , thoughts? With my localmodconfig from the first comment on this bug, and Diff 184345: $ grep objtool: log.txt
arch/x86/pci/fixup.o: warning: objtool: pci_fixup_i450nx()+0xfd: unreachable instruction
drivers/acpi/ec.o: warning: objtool: acpi_ec_unmask_gpe()+0x35: sibling call from callable instruction with modified stack frame
arch/x86/kernel/apic/vector.o: warning: objtool: print_PIC()+0x129: sibling call from callable instruction with modified stack frame
drivers/cpufreq/intel_pstate.o: warning: objtool: intel_pstate_update_perf_limits()+0x1ff: unreachable instruction
sound/pci/hda/hda_generic.o: warning: objtool: parse_output_paths()+0x146: unreachable instruction
lib/crc-t10dif.o: warning: objtool: crc_t10dif_transform_show()+0x3c: return with modified stack frame
lib/crc-t10dif.o: warning: objtool: crc_t10dif_transform_show()+0x0: stack state mismatch: cfa1=7+16 cfa2=7+8
drivers/input/touchscreen/elants_i2c.o: warning: objtool: elants_i2c_query_test_version()+0x1ad: unreachable instruction
drivers/misc/mei/bus-fixup.o: warning: objtool: mei_fwver()+0x1ac: unreachable instruction
drivers/mfd/wm831x-irq.o: warning: objtool: wm831x_irq_sync_unlock()+0xc6: unreachable instruction
drivers/mmc/core/mmc.o: warning: objtool: mmc_fixup_device()+0x97: unreachable instruction
drivers/platform/x86/intel_turbo_max_3.o: warning: objtool: get_oc_core_priority()+0x11c: unreachable instruction
drivers/gpu/drm/i915/gvt/cmd_parser.o: warning: objtool: parser_exec_state_dump()+0x144: unreachable instruction === for lib/crc-t10dif.o, here's a creduced case: |
I'd have to look at the jump table to be sure, but I'd guess that the NOP at 0xfbe can probably be patched at runtime by the jump label code to be a JMP to 0xfc5. In which case the objtool warning is correct. (BTW, I'm out the next few days, so I may not be very responsive until Monday.) |
I've uploaded a new patch to phabricator for crc-t10dif.o. I'm not super confident in it but it fixed the reduced case. |
@nickdesaulniers @nathanchance @jpoimboe |
with clang asm goto diff 185489 and the config from above, I just see a few unreachable instruction warnings:
I'll try to provide @jpoimboe the object files pre-orc-generation. |
One
Full list:
Independent of all these warnings I can boot into bare metal when linking with GNU/ld linker (LLD is a different story). |
Another few which I can't see reported:
The last one is #199. |
I suspect this is fixed (I cannot repro any longer). If folks spot any more of these, please file individual bugs with what arch and what configs on top of the defconfig is required. |
not sure if asm goto related or not.
With D53765 Diff 183780.
localmodconfig.txt
The text was updated successfully, but these errors were encountered: