Since yesterday, I can no longer launch qemu with an external kernel compiled on my laptop (running Arch Linux).
If I compile a vanilla Linux kernel (version 4.13, from Linus Torvalds' github repo), then try to boot qemu this way:
qemu-system-x86_64 --enable-kvm -boot c -kernel arch/x86/boot/bzImage
This starts the display, showing this SeaBIOS output refreshing every 2-3 seconds:
Booting from ROM...
Probing EDD (edd=off to disable)... ok
early console in extract_kernel
input_data: 0x0000000002c773b4
input_len: 0x000000000090c470
output: 0x0000000001000000
output_len: 0x000000000173a968
kernel_total_size: 0x00000000025a7000
Decompressing Linux... Parsing ELF...
If I add these flags to qemu to enable SeaBIOS debugging output:
-chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios
I get this output that keeps repeating: https://pastebin.com/mZKeM6r5
Funny thing, if I compile the same kernel, with the same configuration file on another machine (running Debian) and copy the bzImage to my machine, it boots just fine. So I guess something happened in my toolchain. There was an update of gcc recently, but going back to the previous version of the package (the one I had when there was no problem) does not solve my problem.
As a temporary workaround, I thought I could compile on the Debian machine using distcc to avoid copying files back and forth, but the problem still occurs, so I guess the problem is in the final steps of the compilation process (from linkage to the end, since these happen on my laptop).
Additional info:
gccversion on my laptop (ArchLinux): 8.2.0 (pkg version = 8.2.0-2)gccversion on my Debian machine: 6.3.0 (pkg version = 4:6.3.0-4)
Edit: completed SeaBIOS output
make cleanbefore the rebuild with the new toolchain?qemuuses (the same as here), and it looks likehandle_resume()is called with a status value of 0 (as in the output), which callshandle_resume32(), thentryReboot()andqemureboots.General setup, what do you have for the compiler optimization level? Did you enable any GCC plugins? What isStack protector buffer overflow detectionset to? Also, inProcessor type and features, what is the selected processor family?