]> git.ipfire.org Git - thirdparty/qemu.git/commit - Makefile.target
kvmvapic: Introduce TPR access optimization for Windows guests
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 17 Feb 2012 17:31:19 +0000 (18:31 +0100)
committerAvi Kivity <avi@redhat.com>
Sat, 18 Feb 2012 10:15:59 +0000 (12:15 +0200)
commite5ad936b0fd7dfd7fd7908be6f9f1ca88f63b96b
tree59a8f25d1499d8978945e6dbf651eb18f1332688
parent2a2af967b0bc601c9b450c72b95104e67222e5b2
kvmvapic: Introduce TPR access optimization for Windows guests

This enables acceleration for MMIO-based TPR registers accesses of
32-bit Windows guest systems. It is mostly useful with KVM enabled,
either on older Intel CPUs (without flexpriority feature, can also be
manually disabled for testing) or any current AMD processor.

The approach introduced here is derived from the original version of
qemu-kvm. It was refactored, documented, and extended by support for
user space APIC emulation, both with and without KVM acceleration. The
VMState format was kept compatible, so was the ABI to the option ROM
that implements the guest-side para-virtualized driver service. This
enables seamless migration from qemu-kvm to upstream or, one day,
between KVM and TCG mode.

The basic concept goes like this:
 - VAPIC PV interface consisting of I/O port 0x7e and (for KVM in-kernel
   irqchip) a vmcall hypercall is registered
 - VAPIC option ROM is loaded into guest
 - option ROM activates TPR MMIO access reporting via port 0x7e
 - TPR accesses are trapped and patched in the guest to call into option
   ROM instead, VAPIC support is enabled
 - option ROM TPR helpers track state in memory and invoke hypercall to
   poll for pending IRQs if required

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Makefile.target
hw/apic.c
hw/apic_common.c
hw/apic_internal.h
hw/kvm/apic.c
hw/kvmvapic.c [new file with mode: 0644]