vga slow with -enable-kvm
Hi,
The vga display is very slow when using latest svn with kvm enabled. Just try to boot any linux kernel with vesafb enabled (vga=0x314 for 800x600@16), enjoy watching the boot messages scroll. Booting without kvm enabled is *faster*.
Feels like every single screen access is trapped or something like that. kvm_stat confirms that, there are tons of mmio exits:
[root@zweiblum ~]# kvm_stat -1efer_reload 0 0
exits 98234706 132054
fpu_reload 6330433 0 halt_exits 104372 0 halt_wakeup 0 0 host_state_reload 96499874 132038 hypercalls 0 0 insn_emulation 94632076 129954 insn_emulation_fail 0 0 invlpg 0 0
io_exits 2627489 1653irq_exits 239675 397irq_window 11138 14
largepages 0 0mmio_exits 93583132 129946
mmu_cache_miss 38079 0 mmu_flooded 37708 0 mmu_pde_zapped 35810 0 mmu_pte_updated 588299 0 mmu_pte_write 647324 0 mmu_recycled 0 0 mmu_shadow_zapped 48191 0 pf_fixed 1211070 1 pf_guest 109462 0 remote_tlb_flush 0 0 request_irq 0 0
signal_exits 164181 402tlb_flush 728218 44
cheers,
Gerd
Quoted 9 lines · Gerd Hoffmann
Hi,
The vga display is very slow when using latest svn with kvm enabled. Just try to boot any linux kernel with vesafb enabled (vga=0x314 for 800x600@16), enjoy watching the boot messages scroll. Booting without kvm enabled is *faster*.
Feels like every single screen access is trapped or something like that.
kvm_statconfirms that, there are tons of mmio exits:
The vga optimization is supposed to fix this. I noticed this too, and maybe there's something
wrong per se. But since the result with the optimization was pretty decent, I honestly didn't cared.
Quoted 36 lines
[root@zweiblum ~]#
kvm_stat-1efer_reload0 0
exits 98234706 132054fpu_reload 6330433 0 halt_exits 104372 0 halt_wakeup 0 0 host_state_reload 96499874 132038 hypercalls 0 0 insn_emulation 94632076 129954 insn_emulation_fail 0 0 invlpg 0 0
io_exits2627489 1653irq_exits239675 397irq_window11138 14
largepages 0 0mmio_exits93583132 129946mmu_cache_miss 38079 0 mmu_flooded 37708 0 mmu_pde_zapped 35810 0 mmu_pte_updated 588299 0 mmu_pte_write 647324 0 mmu_recycled 0 0 mmu_shadow_zapped 48191 0 pf_fixed 1211070 1 pf_guest 109462 0 remote_tlb_flush 0 0 request_irq 0 0
signal_exits164181 402tlb_flush728218 44cheers,
Gerd
Signature · 5 lines
Glauber Costa. "Free as in Freedom" http://glommer.net "The less confident you are, the more serious you have to act."
Quoted 7 lines · Gerd Hoffmann
Hi,
The vga display is very slow when using latest svn with kvm enabled. Just try to boot any linux kernel with vesafb enabled (vga=0x314 for 800x600@16), enjoy watching the boot messages scroll. Booting without kvm enabled is *faster*.
Yeah, this is why we need the VGA optimization. A tight MMIO loop in QEMU is actually pretty efficient. No code translation is needed so it ends up being a pretty straight forward set of calls to the MMIO handler function.
It's hugely expensive in KVM though because you have to take a huge number of vmexits and they're pretty expensive. Anyway, the VGA optimization will fix this nicely.
Regards,
Anthony Liguori