-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Description
| Bugzilla Link | 36329 |
| Resolution | FIXED |
| Resolved on | Feb 14, 2018 02:10 |
| Version | 6.0 |
| OS | Linux |
| Blocks | #35152 |
| Attachments | Config file for kernel build |
| Reporter | LLVM Bugzilla Contributor |
| CC | @zmodem,@tstellar |
Extended Description
After a call via __llvm_retpoline_push, code in the calling function seems confused about where %esp points.
Reproduced with llvm/clang master (r324745 / r324741 resp.) and also with 6.0 branch (r324726 / r324719 resp) with r326645 added to the latter.
To reproduce:
git clone git://git.infradead.org/linux-retpoline.git
cd linux-retpoline
git checkout clang
cp /where/you/downloaded/the/attached/config .config
make CC=/where/is/your/clang bzImage
qemu-system-i386 -display none -serial stdio -kernel arch/x86/boot/bzImage -append earlyprintk=ttyS0,keep
Observe the output from mp_register_ioapic():
[ 0.000000] mp_register_ioapic, 0 fec00000 0 c1b31e88
[ 0.000000] At line 412, gsi_base is 0
[ 0.000000] At line 425, gsi_base is -1043707140
[ 0.000000] At line 427, gsi_base is -1043707140
Between line 412 and 425, gsi_base got clobbered.
Now uncomment the CFLAGS_io_apic_b line in arch/x86/kernel/apic/Makefile and repeat, to disable the retpoline. Observe the problem go away.
To eliminate the external thunks as a cause of this problem, also retest with
CFLAGS_io_apic_b.o += -mno-retpoline-external-thunk -mretpoline
The problem persists even when we let LLVM emit its own thunks.