qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/6] uq/master: TPR access optimization for Windows guests
@ 2012-02-05 12:39 Jan Kiszka
  2012-02-05 12:39 ` [Qemu-devel] [PATCH 1/6] target-i386: Add infrastructure for reporting TPR MMIO accesses Jan Kiszka
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Jan Kiszka @ 2012-02-05 12:39 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti
  Cc: Anthony Liguori, qemu-devel, kvm, Gleb Natapov

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-02-09 18:02 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-05 12:39 [Qemu-devel] [PATCH 0/6] uq/master: TPR access optimization for Windows guests Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 1/6] target-i386: Add infrastructure for reporting TPR MMIO accesses Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 2/6] kvmvapic: Add option ROM Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests Jan Kiszka
2012-02-09  8:35   ` [Qemu-devel] subpages with memory region aliases (was: [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests) Jan Kiszka
2012-02-09  9:32     ` [Qemu-devel] subpages with memory region aliases Avi Kivity
2012-02-09 14:23       ` Jan Kiszka
2012-02-09 15:05         ` Avi Kivity
2012-02-09 15:18   ` [Qemu-devel] [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests Avi Kivity
2012-02-09 15:39     ` Jan Kiszka
2012-02-09 16:00       ` Avi Kivity
2012-02-09 16:32         ` Jan Kiszka
2012-02-09 16:47           ` Avi Kivity
2012-02-09 17:24             ` Jan Kiszka
2012-02-09 17:20           ` Paolo Bonzini
2012-02-09 18:01             ` Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 4/6] kvmvapic: Simplify mp/up_set_tpr Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 5/6] optionsrom: Reserve space for checksum Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 6/6] kvmvapic: Use optionrom helpers Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).