On Thu, Dec 12, 2024 at 10:30:10AM +0000, David Woodhouse wrote: > No, definitely not expected. Thanks for the report. I'll see if I can > reproduce it; please could you share your kernel .config? Attached. > Please could you also confirm that it still occurs if you don't use > systemctl; for speed of testing I have mostly been booting my test > kernel with no actual root file system; just an initrd which does > 'kexec -f' immediately. Yes, it appears to reproduce with just 'kexec -e' after 'kexec -l'. > Since you are running in QEMU, if you can reproduce with this patch to > QEMU itself which should dump the CPU state on a triple-fault, it would > be very useful please: > > --- a/accel/kvm/kvm-all.c > +++ b/accel/kvm/kvm-all.c > @@ -3133,6 +3133,7 @@ int kvm_cpu_exec(CPUState *cpu) > ret = EXCP_INTERRUPT; > break; > case KVM_EXIT_SHUTDOWN: > + cpu_dump_state(cpu, stderr, CPU_DUMP_CODE); > qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); > ret = EXCP_INTERRUPT; > break; > > If you get output from that, please also send the output of 'objdump -S > arch/x86/kernel/relocate_kernel_64.o' to help interpret it. Here is the output that I see with that patch applied when rebooting via 'systemctl kexec': RAX=000000010c070001 RBX=0000000000000000 RCX=0000000000000000 RDX=000000047fffb1a0 RSI=000000011c444000 RDI=000000011c450002 RBP=ff1cd0424d6e8c00 RSP=ff4178d5c5aebc60 R8 =0000000000000000 R9 =000000011c446000 R10=ffffffff909f3e00 R11=0000000000000003 R12=0000000000000000 R13=0000000000000001 R14=00000000fee1dead R15=0000000000000000 RIP=ff1cd0425c44401c RFL=00010002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] CS =0010 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA] SS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] DS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] FS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] GS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] LDT=0000 0000000000000000 ffffffff 00c00000 TR =0040 fffffe043fedb000 00004087 00008b00 DPL=0 TSS64-busy GDT= 0000000000000000 00000000 IDT= 0000000000000000 00000000 CR0=80050033 CR2=ff1cd0425c4441de CR3=000000011c446000 CR4=00771ef0 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000fffe0ff0 DR7=0000000000000400 EFER=0000000000000d01 Code=41 57 9c 6a 00 9d 0f 20 d8 4c 8b 0d ee 01 00 00 41 0f 22 d9 <48> 89 25 bb 01 00 00 48 89 05 c4 01 00 00 0f 20 c0 48 89 05 b2 01 00 00 41 0f 20 e5 4c 89 And with just 'kexec -e': RAX=0000000112280006 RBX=0000000000000000 RCX=0000000000000000 RDX=000000047fffb1a0 RSI=00000001076d1000 RDI=000000010ca2b002 RBP=ff1d6a35cd14bc00 RSP=ff541c6303a0fb50 R8 =0000000000000000 R9 =000000010bc34000 R10=ffffffff841f3e00 R11=0000000000000003 R12=0000000000000000 R13=0000000000000001 R14=00000000fee1dead R15=0000000000000000 RIP=ff1d6a35c76d101c RFL=00010002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] CS =0010 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA] SS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] DS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] FS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] GS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] LDT=0000 0000000000000000 ffffffff 00c00000 TR =0040 fffffe54abf61000 00004087 00008b00 DPL=0 TSS64-busy GDT= 0000000000000000 00000000 IDT= 0000000000000000 00000000 CR0=80050033 CR2=ff1d6a35c76d11de CR3=000000010bc34000 CR4=00771ef0 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000fffe0ff0 DR7=0000000000000400 EFER=0000000000000d01 Code=41 57 9c 6a 00 9d 0f 20 d8 4c 8b 0d ee 01 00 00 41 0f 22 d9 <48> 89 25 bb 01 00 00 48 89 05 c4 01 00 00 0f 20 c0 48 89 05 b2 01 00 00 41 0f 20 e5 4c 89 I have attached the output of 'objdump -S'. Please let me know if you would like any other information or testing. Cheers, Nathan