From: Peng Hao <peng.hao2@zte.com.cn> To: pbonzini@redhat.com, rkrcmar@redhat.com, mst@redhat.com, ehabkost@redhat.com Cc: Peng Hao <peng.hao2@zte.com.cn>, zhong.weidong@zte.com.cn, qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [PATCH V5 0/4] introduce coalesced pio support Date: Thu, 30 Aug 2018 23:50:12 +0800 [thread overview] Message-ID: <1535644216-111422-1-git-send-email-peng.hao2@zte.com.cn> (raw) Coalesced pio is base on coalesced mmio and can be used for some port like rtc port, pci-host config port, virtio-pci 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 (4): target-i386: introduce coalesced_pio kvm header update target-i386: add coalesced_pio API target-i386: add rtc 0x70 port as coalesced_pio target-i386: add i440fx 0xcf8 port as coalesced_pio accel/kvm/kvm-all.c | 61 ++++++++++++++++++++++++++++++++++++++++++----- hw/pci-host/piix.c | 4 ++++ hw/timer/mc146818rtc.c | 8 +++++++ include/exec/memory.h | 4 ++-- linux-headers/linux/kvm.h | 11 +++++++-- memory.c | 4 ++-- 6 files changed, 80 insertions(+), 12 deletions(-) -- 1.8.3.1
WARNING: multiple messages have this Message-ID (diff)
From: Peng Hao <peng.hao2@zte.com.cn> To: pbonzini@redhat.com, rkrcmar@redhat.com, mst@redhat.com, ehabkost@redhat.com Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, zhong.weidong@zte.com.cn, Peng Hao <peng.hao2@zte.com.cn> Subject: [Qemu-devel] [PATCH V5 0/4] introduce coalesced pio support Date: Thu, 30 Aug 2018 23:50:12 +0800 [thread overview] Message-ID: <1535644216-111422-1-git-send-email-peng.hao2@zte.com.cn> (raw) Coalesced pio is base on coalesced mmio and can be used for some port like rtc port, pci-host config port, virtio-pci 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 (4): target-i386: introduce coalesced_pio kvm header update target-i386: add coalesced_pio API target-i386: add rtc 0x70 port as coalesced_pio target-i386: add i440fx 0xcf8 port as coalesced_pio accel/kvm/kvm-all.c | 61 ++++++++++++++++++++++++++++++++++++++++++----- hw/pci-host/piix.c | 4 ++++ hw/timer/mc146818rtc.c | 8 +++++++ include/exec/memory.h | 4 ++-- linux-headers/linux/kvm.h | 11 +++++++-- memory.c | 4 ++-- 6 files changed, 80 insertions(+), 12 deletions(-) -- 1.8.3.1
next reply other threads:[~2018-08-30 15:50 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-08-30 15:50 Peng Hao [this message] 2018-08-30 15:50 ` [Qemu-devel] [PATCH V5 0/4] introduce coalesced pio support Peng Hao 2018-08-30 15:50 ` [PATCH V5 1/4] target-i386: introduce coalesced_pio kvm header update Peng Hao 2018-08-30 15:50 ` [Qemu-devel] " Peng Hao 2018-08-30 19:04 ` Eduardo Habkost 2018-08-30 19:04 ` [Qemu-devel] " Eduardo Habkost 2018-08-30 15:50 ` [PATCH V5 2/4] target-i386:add coalesced_pio API Peng Hao 2018-08-30 15:50 ` [Qemu-devel] " Peng Hao 2018-08-30 15:50 ` [PATCH V5 3/4] target-i386: add rtc 0x70 port as coalesced_pio Peng Hao 2018-08-30 15:50 ` [Qemu-devel] " Peng Hao 2018-08-30 19:05 ` Eduardo Habkost 2018-08-30 19:05 ` [Qemu-devel] " Eduardo Habkost 2018-08-30 15:50 ` [PATCH V5 4/4] target-i386: add i440fx 0xcf8 " Peng Hao 2018-08-30 15:50 ` [Qemu-devel] " Peng Hao 2018-08-30 19:05 ` Eduardo Habkost 2018-08-30 19:05 ` [Qemu-devel] " Eduardo Habkost 2018-08-31 9:05 [PATCH V5 0/4] introduce coalesced pio support Peng Hao
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1535644216-111422-1-git-send-email-peng.hao2@zte.com.cn \ --to=peng.hao2@zte.com.cn \ --cc=ehabkost@redhat.com \ --cc=kvm@vger.kernel.org \ --cc=mst@redhat.com \ --cc=pbonzini@redhat.com \ --cc=qemu-devel@nongnu.org \ --cc=rkrcmar@redhat.com \ --cc=zhong.weidong@zte.com.cn \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.