Signed-off-by: Avi Kivity <avi@xxxxxxxxxx> --- kvm/user/test/x86/vmexit.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/vmexit.c b/kvm/user/test/x86/vmexit.c index 76f676d..29bb32a 100644 --- a/kvm/user/test/x86/vmexit.c +++ b/kvm/user/test/x86/vmexit.c @@ -1,5 +1,6 @@ #include "libcflat.h" +#include "smp.h" static inline unsigned long long rdtsc() { @@ -51,6 +52,20 @@ static void mov_to_cr8(void) asm volatile ("mov %0, %%cr8" : : "r"(cr8)); } +static int is_smp(void) +{ + return cpu_count() > 1; +} + +static void nop(void *junk) +{ +} + +static void ipi(void) +{ + on_cpu(1, nop, 0); +} + static struct test { void (*func)(void); const char *name; @@ -60,6 +75,7 @@ static struct test { { vmcall, "vmcall", }, { mov_from_cr8, "mov_from_cr8" }, { mov_to_cr8, "mov_to_cr8" }, + { ipi, "ipi", is_smp }, }; static void do_test(struct test *test) @@ -86,6 +102,8 @@ int main(void) { int i; + smp_init(); + for (i = 0; i < ARRAY_SIZE(tests); ++i) do_test(&tests[i]); -- 1.6.4.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html