diff options
author | Avi Kivity <avi@redhat.com> | 2009-09-17 10:59:47 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-22 11:57:14 +0300 |
commit | ebd40de4c3d6cf91c530e91c86ed2e340360f2c3 (patch) | |
tree | 51cb904827210195e474fd41a37975a3546f6b9e /kvm | |
parent | test: add ipi latency test (diff) | |
download | qemu-kvm-ebd40de4c3d6cf91c530e91c86ed2e340360f2c3.tar.gz qemu-kvm-ebd40de4c3d6cf91c530e91c86ed2e340360f2c3.tar.bz2 qemu-kvm-ebd40de4c3d6cf91c530e91c86ed2e340360f2c3.zip |
test: Add ipi_halt benchmark
Wait for 2000 cycles after the IPI to allow the host to schedule out.
Measures wake-from-idle overhead.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'kvm')
-rw-r--r-- | kvm/user/test/x86/vmexit.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kvm/user/test/x86/vmexit.c b/kvm/user/test/x86/vmexit.c index 29bb32a11..5088dc92d 100644 --- a/kvm/user/test/x86/vmexit.c +++ b/kvm/user/test/x86/vmexit.c @@ -66,6 +66,16 @@ static void ipi(void) on_cpu(1, nop, 0); } +static void ipi_halt(void) +{ + unsigned long long t; + + on_cpu(1, nop, 0); + t = rdtsc() + 2000; + while (rdtsc() < t) + ; +} + static struct test { void (*func)(void); const char *name; @@ -76,6 +86,7 @@ static struct test { { mov_from_cr8, "mov_from_cr8" }, { mov_to_cr8, "mov_to_cr8" }, { ipi, "ipi", is_smp }, + { ipi_halt, "ipi+halt", is_smp }, }; static void do_test(struct test *test) |