And yet another qemu-kvm piece: Windows 32-bit guests make heavy use of the MMIO-based TPR register. On older Intel CPUs and current AMDs, this causes significant KVM vmexit rates as the register needs to be trapped by the hypervisor. This series introduces a workaround for this hardware limitation: A paravirtual APIC extension, based on guest extension using an options ROM and a special VAPIC device that patches TPR accesses of Windows to call into the option ROM instead. See patch 3 for details. The speedup is noteworthy: I measured 15 vs. 45 s XP bootup time (disk cached) with the VAPIC enabled vs. disabled on an Intel CPU with flexpriority=0. Therefore, the VAPI is enabled by default, even in TCG mode. Here, no speedup can be achieved as the emulation overhead of the TPR register is marginal compared to instruction emulation. On the other hand, enabling the optimization causes not measurable slowdown of Windows guests. The patches depend on the follow upstream or uq/master patches: - kvm: Implement kvm_irqchip_in_kernel http://thread.gmane.org/gmane.comp.emulators.qemu/134399 - KVM: Fix breakages of QOM conversion http://permalink.gmane.org/gmane.comp.emulators.qemu/134844 It is based on upstream commit cb437e48ab (before the VGA breakage). The series plus dependencies is also available at git://git.kiszka.org/qemu-kvm.git queues/kvm-tpr Please review carefully. Jan Kiszka (6): target-i386: Add infrastructure for reporting TPR MMIO accesses kvmvapic: Add option ROM kvmvapic: Introduce TPR access optimization for Windows guests kvmvapic: Simplify mp/up_set_tpr optionsrom: Reserve space for checksum kvmvapic: Use optionrom helpers .gitignore | 1 + Makefile | 2 +- Makefile.target | 3 +- cpu-all.h | 3 +- hw/apic.c | 126 +++++++- hw/apic.h | 2 + hw/apic_common.c | 68 ++++- hw/apic_internal.h | 27 ++ hw/kvm/apic.c | 32 ++ hw/kvmvapic.c | 738 +++++++++++++++++++++++++++++++++++++++++ pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/kvmvapic.S | 335 +++++++++++++++++++ pc-bios/optionrom/optionrom.h | 3 +- target-i386/cpu.h | 9 + target-i386/helper.c | 19 + target-i386/kvm.c | 24 ++- 16 files changed, 1374 insertions(+), 20 deletions(-) create mode 100644 hw/kvmvapic.c create mode 100644 pc-bios/optionrom/kvmvapic.S -- 1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html