On 07/24/2013 05:21 PM, Gleb Natapov wrote:
On Wed, Jul 24, 2013 at 05:16:09PM +0200, Paolo Bonzini wrote:
Il 24/07/2013 11:58, Alexander Graf ha scritto:
No QEMU or kvm crashes, no error message printed, I mean it just hangs, even no
BIOS information are printed.
And "top" shows QEMU consumes 100% cpu.
When I define DEBUG_KVM in kvm-all.c, and run QEMU(this time I boot a normal OS
disk),
# x86_64-softmmu/qemu-system-x86_64 -enable-kvm -hda
/mnt/nfs/Images/debian-append.img
kvm_init_vcpu
kvm_cpu_exec()
handle_io
handle_io
handle_io
handle_io
Only 4 debug messages(handle_io) are printed, then nothing is shown, and "top"
shows QEMU process uses 100% CPU.
After this we're running in an endless loop of:
qemu-system-x86-9298 [003] ...1 162090.918845: kvm_emulate_insn:
f0000:c489:66 ea 91 c4 0f 00 08 00 (prot16)
qemu-system-x86-9298 [003] d..2 162090.918846: kvm_entry: vcpu 0
(qemu) x /i $pc
0x00000000000fc489: ljmpl $0x8,$0xfc491
With current master, qemu-system-x86_64 -enable-kvm is broken on at least 3.7
kernels (openSUSE 12.3).
Gleb, I don't remember all the glorious details of ljmpl, but would it have to
raise an MMIO request for a read-only memory slot which it fails to do?
The point of KVM_CAP_READONLY_MEM should be that it doesn't.
Yes, it should not. Can you provide complete trace of kvm and kvmmmu
event up until failure?
Sure! These are all trace events up to the loop that I was able to fetch
from the "kvm" and "kvmmmu" event bucket in /sys/kernel/debug/tracing.
qemu-system-x86-13149 [001] ...1 185370.437938: kvm_set_irq: gsi 8
level 0 source 0
qemu-system-x86-13149 [001] ...2 185370.437942: kvm_pic_set_irq: chip
1 pin 0 (edge)
qemu-system-x86-13149 [001] ...2 185370.437943: kvm_ioapic_set_irq:
pin 8 dst 0 vec=0 (Fixed|physical|edge|masked)
qemu-system-x86-13149 [001] ...1 185370.437945: kvm_set_irq: gsi 4
level 0 source 0
qemu-system-x86-13149 [001] ...2 185370.437946: kvm_pic_set_irq: chip
0 pin 4 (edge)
qemu-system-x86-13149 [001] ...2 185370.437946: kvm_ioapic_set_irq:
pin 4 dst 0 vec=0 (Fixed|physical|edge|masked)
qemu-system-x86-13149 [001] ...1 185370.437947: kvm_set_irq: gsi 1
level 0 source 0
qemu-system-x86-13149 [001] ...2 185370.437947: kvm_pic_set_irq: chip
0 pin 1 (edge)
qemu-system-x86-13149 [001] ...2 185370.437948: kvm_ioapic_set_irq:
pin 1 dst 0 vec=0 (Fixed|physical|edge|masked)
qemu-system-x86-13149 [001] ...1 185370.437948: kvm_set_irq: gsi 12
level 0 source 0
qemu-system-x86-13149 [001] ...2 185370.437948: kvm_pic_set_irq: chip
1 pin 4 (edge)
qemu-system-x86-13149 [001] ...2 185370.437949: kvm_ioapic_set_irq:
pin 12 dst 0 vec=0 (Fixed|physical|edge|masked)
qemu-system-x86-13149 [001] ...1 185370.437949: kvm_set_irq: gsi 1
level 0 source 0
qemu-system-x86-13149 [001] ...2 185370.437949: kvm_pic_set_irq: chip
0 pin 1 (edge)
qemu-system-x86-13149 [001] ...2 185370.437949: kvm_ioapic_set_irq:
pin 1 dst 0 vec=0 (Fixed|physical|edge|masked)
qemu-system-x86-13149 [001] ...1 185370.437950: kvm_set_irq: gsi 12
level 0 source 0
qemu-system-x86-13149 [001] ...2 185370.437950: kvm_pic_set_irq: chip
1 pin 4 (edge)
qemu-system-x86-13149 [001] ...2 185370.437950: kvm_ioapic_set_irq:
pin 12 dst 0 vec=0 (Fixed|physical|edge|masked)
qemu-system-x86-13149 [001] ...1 185370.438050: kvm_set_irq: gsi 0
level 0 source 0
qemu-system-x86-13149 [001] ...2 185370.438051: kvm_pic_set_irq: chip
0 pin 0 (edge)
qemu-system-x86-13149 [001] ...2 185370.438051: kvm_ioapic_set_irq:
pin 2 dst 0 vec=0 (Fixed|physical|edge|masked)
qemu-system-x86-13149 [001] ...1 185370.438052: kvm_set_irq: gsi 0
level 0 source 0
qemu-system-x86-13149 [001] ...2 185370.438052: kvm_pic_set_irq: chip
0 pin 0 (edge)
qemu-system-x86-13149 [001] ...2 185370.438052: kvm_ioapic_set_irq:
pin 2 dst 0 vec=0 (Fixed|physical|edge|masked)
qemu-system-x86-13149 [001] ...1 185370.438052: kvm_set_irq: gsi 0
level 0 source 0
qemu-system-x86-13149 [001] ...2 185370.438053: kvm_pic_set_irq: chip
0 pin 0 (edge)
qemu-system-x86-13149 [001] ...2 185370.438053: kvm_ioapic_set_irq:
pin 2 dst 0 vec=0 (Fixed|physical|edge|masked)
qemu-system-x86-13150 [000] ...2 185370.441730: kvm_mmu_get_page: sp
gfn 0 4 q0 direct wux !nxe root 0 sync new
qemu-system-x86-13150 [000] ...2 185370.441734: kvm_fpu: load
qemu-system-x86-13150 [000] d..2 185370.441734: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441738: kvm_exit: reason
EPT_VIOLATION rip 0xfff0 info 81 0
qemu-system-x86-13150 [000] ...1 185370.441739: kvm_page_fault:
address feffc000 error_code 81
qemu-system-x86-13150 [000] ...2 185370.441746: kvm_mmu_get_page: sp
gfn 0 3 q0 direct wux !nxe root 0 sync new
qemu-system-x86-13150 [000] ...2 185370.441748: kvm_mmu_get_page: sp
gfn c0000 2 q0 direct wux !nxe root 0 sync new
qemu-system-x86-13150 [000] ...2 185370.441749: kvm_mmu_get_page: sp
gfn fee00 1 q0 direct wux !nxe root 0 sync new
qemu-system-x86-13150 [000] d..2 185370.441752: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441757: kvm_exit: reason
EPT_VIOLATION rip 0xfff0 info 184 0
qemu-system-x86-13150 [000] ...1 185370.441757: kvm_page_fault:
address ffff0 error_code 184
qemu-system-x86-13150 [000] ...2 185370.441760: kvm_mmu_get_page: sp
gfn 0 2 q0 direct wux !nxe root 0 sync new
qemu-system-x86-13150 [000] ...2 185370.441761: kvm_mmu_get_page: sp
gfn 0 1 q0 direct wux !nxe root 0 sync new
qemu-system-x86-13150 [000] d..2 185370.441762: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441763: kvm_exit: reason
EPT_VIOLATION rip 0xe05b info 184 0
qemu-system-x86-13150 [000] ...1 185370.441763: kvm_page_fault:
address fe05b error_code 184
qemu-system-x86-13150 [000] d..2 185370.441764: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441765: kvm_exit: reason
EPT_VIOLATION rip 0xe05b info 181 0
qemu-system-x86-13150 [000] ...1 185370.441765: kvm_page_fault:
address fd094 error_code 181
qemu-system-x86-13150 [000] d..2 185370.441766: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441767: kvm_exit: reason
EPT_VIOLATION rip 0xc45e info 184 0
qemu-system-x86-13150 [000] ...1 185370.441767: kvm_page_fault:
address fc45e error_code 184
qemu-system-x86-13150 [000] d..2 185370.441768: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441769: kvm_exit: reason
EPT_VIOLATION rip 0xc469 info 181 0
qemu-system-x86-13150 [000] ...1 185370.441769: kvm_page_fault:
address feffd066 error_code 181
qemu-system-x86-13150 [000] d..2 185370.441771: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441772: kvm_exit: reason
IO_INSTRUCTION rip 0xc469 info 700040 0
qemu-system-x86-13150 [000] ...1 185370.441773: kvm_pio: pio_write at
0x70 size 1 count 1
qemu-system-x86-13150 [000] ...1 185370.441775: kvm_userspace_exit:
reason KVM_EXIT_IO (2)
qemu-system-x86-13150 [000] ...2 185370.441776: kvm_fpu: unload
qemu-system-x86-13150 [000] d..2 185370.441787: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441788: kvm_exit: reason
IO_INSTRUCTION rip 0xc46b info 710048 0
qemu-system-x86-13150 [000] ...1 185370.441794: kvm_emulate_insn:
f0000:c46b:e4 71 (real)
qemu-system-x86-13150 [000] ...1 185370.441796: kvm_pio: pio_read at
0x71 size 1 count 1
qemu-system-x86-13150 [000] ...1 185370.441797: kvm_userspace_exit:
reason KVM_EXIT_IO (2)
qemu-system-x86-13150 [000] d..2 185370.441804: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441805: kvm_exit: reason
IO_INSTRUCTION rip 0xc46d info 920048 0
qemu-system-x86-13150 [000] ...1 185370.441806: kvm_emulate_insn:
f0000:c46d:e4 92 (real)
qemu-system-x86-13150 [000] ...1 185370.441807: kvm_pio: pio_read at
0x92 size 1 count 1
qemu-system-x86-13150 [000] ...1 185370.441807: kvm_userspace_exit:
reason KVM_EXIT_IO (2)
qemu-system-x86-13150 [000] d..2 185370.441810: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441811: kvm_exit: reason
IO_INSTRUCTION rip 0xc471 info 920040 0
qemu-system-x86-13150 [000] ...1 185370.441811: kvm_pio: pio_write at
0x92 size 1 count 1
qemu-system-x86-13150 [000] ...1 185370.441811: kvm_userspace_exit:
reason KVM_EXIT_IO (2)
qemu-system-x86-13150 [000] d..2 185370.441813: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441814: kvm_exit: reason
EXCEPTION_NMI rip 0xc473 info 0 80000b0d
qemu-system-x86-13150 [000] ...1 185370.441817: kvm_emulate_insn:
f0000:c473:2e 0f 01 1e e0 d3 (real)
qemu-system-x86-13150 [000] d..2 185370.441819: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441820: kvm_exit: reason
EXCEPTION_NMI rip 0xc479 info 0 80000b0d
qemu-system-x86-13150 [000] ...1 185370.441821: kvm_emulate_insn:
f0000:c479:2e 0f 01 16 a0 d3 (real)
qemu-system-x86-13150 [000] d..2 185370.441822: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441823: kvm_exit: reason
EXCEPTION_NMI rip 0xc47f info 0 80000b0d
qemu-system-x86-13150 [000] ...1 185370.441824: kvm_emulate_insn:
f0000:c47f:0f 20 c0 (real)
qemu-system-x86-13150 [000] d..2 185370.441825: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] d..2 185370.441826: kvm_exit: reason
EXCEPTION_NMI rip 0xc486 info 0 80000b0d
qemu-system-x86-13150 [000] ...1 185370.441826: kvm_emulate_insn:
f0000:c486:0f 22 c0 (real)
qemu-system-x86-13150 [000] d..2 185370.441829: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] ...1 185370.441830: kvm_emulate_insn:
f0000:c489:66 ea 91 c4 0f 00 08 00 (prot16)
qemu-system-x86-13150 [000] d..2 185370.441833: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] ...1 185370.441833: kvm_emulate_insn:
f0000:c489:66 ea 91 c4 0f 00 08 00 (prot16)
qemu-system-x86-13150 [000] d..2 185370.441834: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] ...1 185370.441835: kvm_emulate_insn:
f0000:c489:66 ea 91 c4 0f 00 08 00 (prot16)
qemu-system-x86-13150 [000] d..2 185370.441835: kvm_entry: vcpu 0
qemu-system-x86-13150 [000] ...1 185370.441836: kvm_emulate_insn:
f0000:c489:66 ea 91 c4 0f 00 08 00 (prot16)
qemu-system-x86-13150 [000] d..2 185370.441836: kvm_entry: vcpu 0
[...]
Alex