qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] target/i386: introduce coalesced pio
@ 2018-10-17 16:52 Peng Hao
  2018-10-17 16:52 ` [Qemu-devel] [PATCH V6 1/5] target/i386 : add coalesced pio support Peng Hao
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Peng Hao @ 2018-10-17 16:52 UTC (permalink / raw)
  To: pbonzini, rkrcmar, mst, ehabkost; +Cc: qemu-devel, kvm, Peng Hao

Coalesced pio is base on coalesced mmio and can be used for some port
like rtc port, pci-host config port and so on.

Specially in case of rtc as coalesced pio, some versions of windows guest
access rtc frequently because of rtc as system tick. guest access rtc like
this: write register index to 0x70, then write or read data from 0x71.
writing 0x70 port is just as index and do nothing else. So we can use
coalesced pio to handle this scene to reduce VM-EXIT time.

When it starts and closes the virtual machine, it will access pci-host config
port or virtio-pci config port frequently. So setting these port as
coalesced pio can reduce startup and shutdown time. In qemu I just realize
piixfx's pci-host, it is convenient for other pci-host type implementations.

without my patch, get the vm-exit time of accessing rtc 0x70 and piix 0xcf8
using perf tools: (guest OS : windows 7 64bit)
IO Port Access  Samples Samples%  Time%  Min Time  Max Time  Avg time
0x70:POUT        86     30.99%    74.59%   9us      29us    10.75us (+- 3.41%)
0xcf8:POUT     1119     2.60%     2.12%   2.79us    56.83us 3.41us (+- 2.23%)

with my patch
IO Port Access  Samples Samples%  Time%   Min Time  Max Time   Avg time
0x70:POUT       106    32.02%    29.47%    0us      10us     1.57us (+- 7.38%)
0xcf8:POUT      1065    1.67%     0.28%   0.41us    65.44us   0.66us (+- 10.55%)

These are just qemu's patches, another patches are for kernel.

Changes v4 --> v5:
    update kvm header, improve compatibility.

Changes v3 --> v4
    modify coalesced_mmio_{add|del} to coalesced_io_{add|del}
    delete unnecessary macro define

Peng Hao (5):
  target-i386: add rtc 0x70 port as coalesced_pio
  target-i386: add i440fx 0xcf8 port as coalesced_pio
  target-i386: add q35 0xcf8 port as coalesced_pio
  target/i386: add coalesced pio support
  target-i386: add coalesced_pio API

 accel/kvm/kvm-all.c       | 60 +++++++++++++++++++++++++++++++++++++++++++----
 hw/pci-host/piix.c        |  4 ++++
 hw/pci-host/q35.c         |  4 ++++
 hw/timer/mc146818rtc.c    |  8 +++++++
 include/exec/memory.h     |  4 ++--
 linux-headers/linux/kvm.h |  9 ++++++-
 memory.c                  |  4 ++--
 7 files changed, 83 insertions(+), 10 deletions(-)

-- 
1.8.3.1

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

end of thread, other threads:[~2018-10-18 10:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-17 16:52 [Qemu-devel] [PATCH 0/5] target/i386: introduce coalesced pio Peng Hao
2018-10-17 16:52 ` [Qemu-devel] [PATCH V6 1/5] target/i386 : add coalesced pio support Peng Hao
2018-10-17 15:04   ` Vitaly Kuznetsov
2018-10-17 17:05     ` Paolo Bonzini
2018-10-17 16:52 ` [Qemu-devel] [PATCH V6 2/5] target-i386 : add coalesced_pio API Peng Hao
2018-10-17 16:52 ` [Qemu-devel] [PATCH V6 3/5] target-i386: add rtc 0x70 port as coalesced_pio Peng Hao
2018-10-17 10:31   ` Paolo Bonzini
2018-10-18  8:03     ` peng.hao2
2018-10-18 10:13       ` Paolo Bonzini
2018-10-18 10:43         ` peng.hao2
2018-10-17 16:52 ` [Qemu-devel] [PATCH V6 4/5] target-i386: add i440fx 0xcf8 " Peng Hao
2018-10-17 16:52 ` [Qemu-devel] [PATCH V6 5/5] target-i386: add q35 " Peng Hao

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).