diff mbox

[3/3] test: vmexit: inl from pmtimer

Message ID 20091006005603.GA8408@amt.cnet (mailing list archive)
State New, archived
Headers show

Commit Message

Marcelo Tosatti Oct. 6, 2009, 12:56 a.m. UTC
None
diff mbox

Patch

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, },
 };