kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shih-Wei Li <shihwei@cs.columbia.edu>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Cc: marc.zyngier@arm.com, pbonzini@redhat.com,
	Shih-Wei Li <shihwei@cs.columbia.edu>
Subject: [kvm-unit-tests PATCH V2 0/2] Support micro operation measurement on arm64
Date: Tue, 19 Dec 2017 20:34:43 -0500	[thread overview]
Message-ID: <1513733685-32573-1-git-send-email-shihwei@cs.columbia.edu> (raw)

The patch provides support for quantifying the cost of micro level
operations on arm64 hardware. The supported operations include hypercall,
mmio accesses, EOI virtual interrupt, and IPI send. Measurements are
currently obtained using timer counters. Further modifications in KVM
will be required to support timestamping using cycle counters, as KVM
now disables accesses to the PMU counters from the VM.

We iterate each of the tests for millions of times and output their
average, minimum and maximum cost in timer counts. Instruction barriers
were used before and after taking timestamps to avoid out-of-order
execution or pipelining from skewing our measurements.

To improve precision in the measurements, one should consider pinning
each VCPU to a specific physical CPU (PCPU) and ensure no other task
could run on that PCPU to skew the results. This can be achieved by
enabling QMP server in the QEMU command in unittest.cfg for micro test,
allowing a client program to get the thread_id for each VCPU thread
from the QMP server. Based on the information, the client program can
then pin the corresponding VCPUs to dedicated PCPUs and isolate
interrupts and tasks from those PCPUs.

The patch has been tested on arm64 hardware including AMD Seattle and
ThunderX2, which has GICv2 and GICv3 respectively.

Shih-Wei Li (2):
  arm/arm64: add GICD_IIDR definition
  arm64: add micro test

 arm/Makefile.common |   1 +
 arm/micro-test.c    | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 arm/unittests.cfg   |   7 ++
 lib/arm/asm/gic.h   |   1 +
 4 files changed, 228 insertions(+)
 create mode 100644 arm/micro-test.c

-- 
1.9.1

             reply	other threads:[~2017-12-20  1:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20  1:34 Shih-Wei Li [this message]
2017-12-20  1:34 ` [kvm-unit-tests PATCH V2 1/2] arm/arm64: add GICD_IIDR definition Shih-Wei Li
2017-12-20  1:34 ` [kvm-unit-tests PATCH V2 2/2] arm64: add micro test Shih-Wei Li
2017-12-20 16:41   ` Andrew Jones
2017-12-20 21:41     ` Shih-Wei Li
2017-12-21  9:21       ` Andrew Jones
2017-12-21 11:28         ` Christoffer Dall
2017-12-21 16:26           ` Shih-Wei Li
2017-12-21 16:12         ` Shih-Wei Li
2017-12-21 16:57           ` Andrew Jones
2017-12-22  6:07   ` Yury Norov
2017-12-22  7:26     ` Shih-Wei Li
2017-12-22 12:44       ` Yury Norov
2018-01-17 21:49         ` Shih-Wei Li

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=1513733685-32573-1-git-send-email-shihwei@cs.columbia.edu \
    --to=shihwei@cs.columbia.edu \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=marc.zyngier@arm.com \
    --cc=pbonzini@redhat.com \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).