-
Notifications
You must be signed in to change notification settings - Fork 15
Boot issue with CONFIG_ZERO_CALL_USED_REGS=y and _paravirt_ident_64() #1585
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
Comments
I won't claim to fully understand all of the reasons for this level of indirection (it appears to be an attempt to reduce register pressure by calling a trampoline function, which is in charge of generating the callee-saved register code, thus reducing the view of those registers from the original function; but that just appears to be insane, so I must have something wrong). Is there a way for you to hook a GDB into the boot up process to see what's going on? When I look at similar things, I add something like this to
In GDB, you can do |
I will see if I can get this to reproduce in QEMU, I have not been able to so far. It only reproduces on bare metal and I don't think any of the consumer hardware I have has any serial port for me to use. I wonder if this issue would reproduce on an x86_64 Chromebook? Doesn't ChromeOS have some nice boot debugging utilities? |
Now, I switched to Linux v6.0-rc7 I wanted to test Might give you some debug output? [1] https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=debug/experimental |
commit 8c86f29 ("x86/paravirt: add extra clobbers with ZERO_CALL_USED_REGS enabled") |
As I originally reported on https://reviews.llvm.org/D110869, Arch Linux's configuration +
CONFIG_ZERO_CALL_USED_REGS=y
fails to boot for me on two bare metal machines (AMD Ryzen 3 4300G and Intel Core i5 4210U). There is no output on either machine, so something is going wrong before the EFI framebuffer driver is initialized; I've tried exploring earlyprintk options and I have had no success. The exact same configuration works fine with GCC 11.2.1.Bisecting the translation units and functions reveals that
_paravirt_ident_64()
is the problematic function, as the following diff allows both machines to boot:GCC 11.2.1 disassembly of this function:
Clang 15.0.0 disassembly of this function:
Unless my eyes are failing me, those functions are literally identical, so there is something else going on here. James Knight had a comment on Phabricator that this function is being used in a fragile way and we could potential use
clang
'spreserve_most
attribute to make the calling convention clear to the compiler.cc @gwelymernans
The text was updated successfully, but these errors were encountered: