From: Avi Kivity <a...@redhat.com>

Wait for 2000 cycles after the IPI to allow the host to schedule out.
Measures wake-from-idle overhead.

Signed-off-by: Avi Kivity <a...@redhat.com>

diff --git a/kvm/user/test/x86/vmexit.c b/kvm/user/test/x86/vmexit.c
index 29bb32a..5088dc9 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)
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to