From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [patch 3/3] test: vmexit: inl from pmtimer Date: Mon, 5 Oct 2009 21:56:03 -0300 Message-ID: <20091006005603.GA8408@amt.cnet> References: <20091005130735.194554408@redhat.com> <20091005130809.472219074@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55444 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754345AbZJFA5Y (ORCPT ); Mon, 5 Oct 2009 20:57:24 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n960uwmq023359 for ; Mon, 5 Oct 2009 20:56:58 -0400 Content-Disposition: inline In-Reply-To: <20091005130809.472219074@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Add inl(ACPI_PMTIMER_PORT) test. Signed-off-by: Marcelo Tosatti Index: qemu-kvm-parallel-vmexit/kvm/user/test/x86/vmexit.c =================================================================== --- qemu-kvm-parallel-vmexit.orig/kvm/user/test/x86/vmexit.c +++ qemu-kvm-parallel-vmexit/kvm/user/test/x86/vmexit.c @@ -17,6 +17,13 @@ static inline unsigned long long rdtsc() return r; } +static unsigned int inl(unsigned short port) +{ + unsigned int val; + asm volatile("inl %w1, %0" : "=a"(val) : "Nd"(port)); + return val; +} + #define GOAL (1ull << 30) #ifdef __x86_64__ @@ -76,6 +83,11 @@ static void ipi_halt(void) ; } +static void inl_pmtimer(void) +{ + inl(0xb008); +} + static struct test { void (*func)(void); const char *name; @@ -86,6 +98,7 @@ static struct test { { vmcall, "vmcall", .parallel = 1, }, { mov_from_cr8, "mov_from_cr8", .parallel = 1, }, { mov_to_cr8, "mov_to_cr8" , .parallel = 1, }, + { inl_pmtimer, "inl_from_pmtimer", .parallel = 1, }, { ipi, "ipi", is_smp, .parallel = 0, }, { ipi_halt, "ipi+halt", is_smp, .parallel = 0, }, };