Skip to content
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

Kernel: KVM crashes with a merged Kernel and Prekernel on certain x86 hardware #18558

Closed
timschumi opened this issue Apr 28, 2023 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@timschumi
Copy link
Member

timschumi commented Apr 28, 2023

With 897c4e5 applied (this commit is currently reverted on master, so it has to be reapplied for testing), some hardware/software combinations get KVM crashes during SerenityOSes early boot sequence:

Console output
[Kernel]: Loading kernel symbol table...
[Kernel]: CPU[0]: Supported features: sse3 pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt tsc_deadline aes xsave osxsave avx f16c rdrand hypervisor fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss htt fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha umip pku waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize spec_ctrl stibp ia32_arch_capabilities ssbd lahf_lm abm 3dnowprefetch syscall nx pdpe1gb rdtscp lm constant_tsc
[Kernel]: CPU[0]: Physical address bit width: 39
[Kernel]: CPU[0]: Virtual address bit width: 48
[Kernel]: Initializing unhandled interrupt handlers
[Kernel]: CPU[0]: CPUID hypervisor signature 'KVMKVMKVM', max leaf 0x40000001
[Kernel]: Kernel Commandline: Kernel/Kernel hello
[Kernel]: Initialize MMU
[Kernel]: MM: Multiboot mmap: address=0x0000000000000000, length=654336, type=1
[Kernel]: MM: Got an unaligned physical_region from the bootloader; correcting length 654336 by 3072 bytes
[Kernel]: MM: Multiboot mmap: address=0x000000000009fc00, length=1024, type=2
[Kernel]: MM: Multiboot mmap: address=0x00000000000f0000, length=65536, type=2
[Kernel]: MM: Multiboot mmap: address=0x0000000000100000, length=1072562176, type=1
[Kernel]: MM: Multiboot mmap: address=0x000000003ffe0000, length=131072, type=2
[Kernel]: MM: Multiboot mmap: address=0x00000000feffc000, length=16384, type=2
[Kernel]: MM: Multiboot mmap: address=0x00000000fffc0000, length=262144, type=2
[Kernel]: MM: Contiguous reserved range from P000000000009fc00, length is 394240
[Kernel]: MM: Contiguous reserved range from P000000003ffe0000, length is 3221356544
[Kernel]: MM: boot_pml4t @ P0000000000115000
[Kernel]: MM: boot_pdpt @ P0000000000116000
[Kernel]: MM: boot_pd0 @ P0000000000117000
[Kernel]: MM: boot_pd_kernel @ P0000000000138000
[Kernel]: MM: Physical page entries: 0x0000002000200000 - 0x0000002000a00fff (size 0x0000000000801000)
[Kernel]: MM: Low memory range @ P0000000000000000 - P00000000000fffff (size 0x100000)
[Kernel]: MM: Kernel range @ P000000000015b000 - P00000000032aafff (size 0x3150000)
[Kernel]: MM: Physical Pages range @ P00000000032ac000 - P0000000003ab1fff (size 0x806000)
[Kernel]: MM: User physical region: P0000000000101000 - P0000000000159fff (size 0x59000)
[Kernel]: MM: User physical region: P0000000003ab2000 - P000000003ffdffff (size 0x3c52e000)
[Kernel]:  * 60x PhysicalZone (16 MiB) @ 0000000003ab2000-000000003eab1fff
[Kernel]:  * 5x PhysicalZone (1 MiB) @ 000000003fab2000-000000003feb1fff
[Kernel]: VGA Text mode console initialized!
[Kernel]: Starting SerenityOS...
KVM internal error. Suberror: 2
extra data[0]: 0x0000000080000b0e
extra data[1]: 0x0000000080000b11
extra data[2]: 0x0000000000000001
extra data[3]: 0x0000000000000004
RAX=0000002004b00000 RBX=0000002000112588 RCX=0000000000000001 RDX=000000000000000c
RSI=00000020001125f8 RDI=0000002004b00000 RBP=0000002000112490 RSP=0000002000112418
R8 =00000020001125f8 R9 =0000002004b00000 R10=0000000000000000 R11=0000000000000000
R12=0000002000112548 R13=000000000000000c R14=0000002000112550 R15=0000002021e4af50
RIP=000000202008900f RFL=00010003 [------C] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0000 0000000000000000 ffffffff 00c00000
CS =0008 0000000000000000 00000000 00209900 DPL=0 CS64 [--A]
SS =0000 0000000000000000 ffffffff 00c00000
DS =0000 0000000000000000 ffffffff 00c00000
FS =0000 0000000000000000 ffffffff 00c00000
GS =0000 0000002021e4d018 ffffffff 00c00000
LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT
TR =0028 0000002021e4d84c 00000067 00408b00 DPL=0 TSS64-busy
GDT=     0000002021e4d032 00000037
IDT=     0000002021e4b100 00000fff
CR0=80010013 CR2=0000002004b00000 CR3=0000000000115000 CR4=00340ee0
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000d01
Code=31 c9 31 f6 31 ff 45 31 db c3 0f 1f 00 48 89 d1 48 c1 e9 03 <f3> 48 a5 83 e2 07 75 dd eb e0 0f 1f 80 00 00 00 00 49 bb 30 1f dc 01 00 00 00 00 55 48 89

Tested systems

Broken

CPU Kernel QEMU
timschumi Intel(R) Core(TM) i5-1240P 6.2.12-arch1-1 8.0.0
CxByte Intel(R) Core(TM) i9-11980HK 6.2.10-arch1-1 8.0.0
fernetmatt Intel(R) Core(TM) i7-1165G7 6.1.25-1-MANJARO 7.2.1

Working

CPU Kernel QEMU
supercomputer7 Intel(R) Core(TM) i3-9100 6.2.10-arch1-1 7.2.1/8.0.0
ADKaster AMD Ryzen 9 5950X 5.19.0-32-generic 7.1.0/8.0.0
BertalanD Intel(R) Core(TM) i5-8350U 6.2.12-arch1-1 8.0.0
GMTA AMD Ryzen 5 3600 5.19.0-41-generic 8.0.0
fdellwing AMD Ryzen 5 3600 5.15.90.1-microsoft-standard-WSL2 7.2.0
jwe66 AMD Ryzen 5 3600 6.5.8-arch1-1 8.1.2
@timschumi timschumi changed the title Kernel: Kernel: KVM crashes with a merged Kernel and Prekernel on certain x86 hardware Apr 28, 2023
@ADKaster
Copy link
Member

#WorksForMe

CPU: AMD Ryzen 9 5950X
Kernel: 5.19.0-32-generic
QEMU: 8.0.0 and 7.1.0 (both from our BuildQemu.sh)

@fdellwing
Copy link
Contributor

fdellwing commented Apr 28, 2023

Working

CPU: AMD Ryzen 5 3600
Kernel: 5.15.90.1-microsoft-standard-WSL2
QEMU: 7.2.0

@fernetmatt
Copy link
Contributor

Not working

CPU: Intel(R) Core(TM) i7-1165G7
Kernel: 6.1.25-1-MANJARO
QEMU: 7.2.1

@jwe66
Copy link

jwe66 commented Oct 29, 2023

working

CPU: Ryzen 5 3600
Kernel: 6.5.8-arch1-1
QEMU: 8.1.2-1

@timschumi
Copy link
Member Author

The crash seems to be fixed and the commit has been relanded in d068af8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants