Skip to content

kvm-unittests: add pci PORT IO and MMIO speed tests

Michael S. Tsirkin kvm 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5kvm-unittest: add printf %c supportlib/printf.c+3 -00 replies
2/5kvm-unittest: libcflat: add offsetoflib/libcflat.h+2 -00 replies
3/5libcflat.h: define NULLlib/libcflat.h+1 -00 replies
4/5lib: add pci bus scan supportconfig-x86-common.mak lib/x86/pci.c lib/x86/pci.h+72 -00 replies
5/5vmexit: add pci io and memory speed testsx86-run x86/vmexit.c+224 -150 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] kvm-unittests: add pci PORT IO and MMIO speed tests

These patches add ability to measure speed of MMIO versus PIO, in different configurations. As I didn't want to reserve a hardcoded range of memory, I added pci bus scan support instead. Used together with the new pci-testdev backend. When not present, the new tests are skipped.

Example output:

	mmio-no-eventfd:pci-mem 8796
	mmio-wildcard-eventfd:pci-mem 3609
	mmio-datamatch-eventfd:pci-mem 3685
	portio-no-eventfd:pci-io 5287
	portio-wildcard-eventfd:pci-io 1762
	portio-datamatch-eventfd:pci-io 1777

First interesting conclusion is that the overhead of MMIO exit to QEMU as compared to PIO is double that of
MMIO ioeventfd as compared to PIO eventfd. Is this a known fact?

Michael S. Tsirkin (5):
kvm-unittest: add printf %c support
kvm-unittest: libcflat: add offsetof
libcflat.h: define NULL
lib: add pci bus scan support
vmexit: add pci io and memory speed tests

 config-x86-common.mak |   1 +
 lib/libcflat.h        |   3 +
 lib/printf.c          |   3 +
 lib/x86/pci.c         |  55 ++++++++++++
 lib/x86/pci.h         |  16 ++++
 x86-run               |  13 ++-
 x86/vmexit.c          | 226 +++++++++++++++++++++++++++++++++++++++++++++++---
 7 files changed, 302 insertions(+), 15 deletions(-)
 create mode 100644 lib/x86/pci.c
 create mode 100644 lib/x86/pci.h
Signature · 1 line
MST