0

Where I can found documentation or explanation how to read and understand output of qemu log by flag "-d ..".

example

qemu-system-x86_64 -cdrom $(ISO_FILE) -serial stdio -m 1024 -d int 

"     0: v=03 e=0000 i=1 cpl=0 IP=0008:ffff80000020904e pc=ffff80000020904e SP=0000:ffff800000206ff0 env->regs[R_EAX]=ffff800000209440
RAX=ffff800000209440 RBX=0000000000000800 RCX=0000000080002001 RDX=ffff800000209460
RSI=ffff800000208eeb RDI=ffff8000002096d0 RBP=ffff800000207000 RSP=ffff800000206ff0
R8 =0000000000000000 R9 =0000000000000000 R10=0000000000000000 R11=0000000000000000
R12=0000000000000000 R13=0000000000000000 R14=0000000000000000 R15=0000000000000000
RIP=ffff80000020904e RFL=00000006 [-----P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0000 0000000000000000 00000000 00000000
CS =0008 0000000000000000 00000000 00209800 DPL=0 CS64 [---]
SS =0000 0000000000000000 00000000 00000000
DS =0000 0000000000000000 00000000 00000000
FS =0000 0000000000000000 00000000 00000000
GS =0000 0000000000000000 00000000 00000000
LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT
TR =0000 0000000000000000 0000ffff 00008b00 DPL=0 TSS64-busy
GDT=     0000000000201000 0000000f
IDT=     ffff800000209460 00000fff
CR0=80000013 CR2=0000000000000000 CR3=0000000000202000 CR4=00000620
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000001ffff0000 CCD=00000000ffff8000 CCO=SARQ    
EFER=0000000000000500
check_exception old: 0xffffffff new 0xe
     1: v=0e e=0000 i=0 cpl=0 IP=0008:ffff80000020904e pc=ffff80000020904e SP=0000:ffff800000206ff0 CR2=0000000000201008
RAX=ffff800000209440 RBX=0000000000000800 RCX=0000000080002001 RDX=ffff800000209460
RSI=ffff800000208eeb RDI=ffff8000002096d0 RBP=ffff800000207000 RSP=ffff800000206ff0
R8 =0000000000000000 R9 =0000000000000000 R10=0000000000000000 R11=0000000000000000
R12=0000000000000000 R13=0000000000000000 R14=0000000000000000 R15=0000000000000000
RIP=ffff80000020904e RFL=00000006 [-----P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0000 0000000000000000 00000000 00000000
CS =0008 0000000000000000 00000000 00209800 DPL=0 CS64 [---]
SS =0000 0000000000000000 00000000 00000000
DS =0000 0000000000000000 00000000 00000000
FS =0000 0000000000000000 00000000 00000000
GS =0000 0000000000000000 00000000 00000000
LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT
TR =0000 0000000000000000 0000ffff 00008b00 DPL=0 TSS64-busy
GDT=     0000000000201000 0000000f
IDT=     ffff800000209460 00000fff
CR0=80000013 CR2=0000000000201008 CR3=0000000000202000 CR4=00000620
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000001ffff0000 CCD=00000000ffff8000 CCO=SARQ    
EFER=0000000000000500"
4
  • How did you invoke this command? Apr 16, 2021 at 20:25
  • qemu-system-x86_64 -cdrom $(ISO_FILE) -serial stdio -m 1024 -d int
    – JustOneMan
    Apr 17, 2021 at 8:16
  • You've looked at man qemu-system-x86_64 and the subsequent qemu-system-x86_64 -d help? Other than it looks like a near real-time continual register dump I'm not sure what else you want to know Apr 17, 2021 at 15:09
  • For a start, at least learn first line:" v=03 e=0000 i=1 cpl=0 IP=0008:ffff80000020904e pc=ffff80000020904e SP=0000:ffff800000206ff0 env->regs[R_EAX]=ffff800000209440". What means v, e, i, cpl, pc, SP ?
    – JustOneMan
    Apr 17, 2021 at 17:09

2 Answers 2

1

There is no documentation, because the '-d' option flags are primarily intended for debugging QEMU itself (though they can be used to give insight into what a guest binary is doing). They log things that seem useful and things that are easy to log, and interpreting them requires some understanding both of the details of the guest architecture and of the internal implementation of QEMU itself.

In this case mostly what you have is a guest register dump, probably either before or after the exception has been taken. You'd need to poke around in the QEMU sources for further information. The meaning of most of the fields should be clear if you know the x86 architecture.

1

Building up on @Peter Maydell's answer and looking at qemu's code, in

     0: v=03 e=0000 i=1 cpl=0 IP=0008:ffff80000020904e pc=ffff80000020904e SP=0000:ffff800000206ff0 env->regs[R_EAX]=ffff800000209440

0: is the count of interrupts so far
v is the interrupt vector
e is the associated error code
i is set to 1 if the exception comes from the hardware or an INT instruction, see OSDev Gate Types
cpl is the current privilege level, 0 = kernel mode
IP and PC are the instruction pointer and program counter, i.e. address of the current instruction
SP is the stack pointer

In your example,

     1: v=0e e=0000 i=0 cpl=0 IP=0008:ffff80000020904e pc=ffff80000020904e SP=0000:ffff800000206ff0 CR2=0000000000201008

corresponds to a page fault exception occurring at 0xffff80000020904e. CR2 holds the faulty address. And the error code indicates that the page is not present (e&1), not writable (e&2) and not user-accessible (e&4).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .