cloudius-systems / osv

OSv, a new operating system for the cloud.
osv.io
Other
4.12k stars 605 forks source link

Broken QEMU microvm support #1202

Open wkozaczuk opened 2 years ago

wkozaczuk commented 2 years ago

When trying to run OSv on the latest QEMU (6.1.0) microvm, we get the following crash and error about OSv failing to mount the block device:

SeaBIOS (version 1.15.0-1.fc35)
Booting from Hard Disk...
OSv v0.56.0-156-g45ff7d3a
Solaris: NOTICE: Cannot find the pool label for '/dev/vblk0.1'
Booted up in 119.09 ms
Cmdline: /hello
WARNING: application::prepare_argv(): missing libvdso.so -> may prevent shared libraries specifically Golang ones from functioning
Failed to load object: /hello. Powering off.
page fault outside application, addr: 0xffff8000fea00000
[registers]
RIP: 0x00000000402eaf6d <AcpiOsWriteMemory+93>
RFL: 0x0000000000010282  CS:  0x0000000000000008  SS:  0x0000000000000010
RAX: 0xffff8000fea00201  RBX: 0x0000000000000080  RCX: 0x0000000000000000  RDX: 0x0000000000000008
RSI: 0x0000000000000080  RDI: 0x00000000fea00201  RBP: 0x0000200000100a80  R8:  0x0000000000000000
R9:  0x00000000409099d0  R10: 0x000000005f35535f  R11: 0xffffa00001039200  R12: 0x0000000000000080
R13: 0x00000000409099d0  R14: 0x000000005f35535f  R15: 0xffffa00001039200  RSP: 0x0000200000100a70
Aborted

[backtrace]
0x00000000402053c7 <???+1075860423>
0x00000000402faf2f <page_fault+143>
0x00000000402f9de6 <???+1076862438>
0x0000000040337db7 <AcpiWrite+103>
0x00000000403387e3 <AcpiHwExtendedSleep+51>
0x0000000040301899 <osv::poweroff()+73>
0x0000000040202e76 <???+1075850870>
0x00000000403c9bf5 <???+1077713909>
0x0000000040366259 <thread_main_c+41>
0x00000000402fad62 <???+1076866402>

This used to work with older QEMU and was implemented with the following commits - bba793104f515908aa6e0105dc23d2b8dceae815 and 68727220fb18018b2637ab2c653d6a755761f0e0. The latter added PVH (direct kernel boot) which still works (-k option to run.py). But -k -p qemu_microvm crashes like the above.

My sense is that something has changed in QEMU since then and now even for the microVM it needs some ACPI support which used not to be needed.

I have noticed that removing --nopci from the command line does not help either.