diff mbox

[kvm-unit-tests] x86: vmx: test access to L1 MMIO-mapped device via EPT page tables

Message ID 1408619651-26369-1-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini Aug. 21, 2014, 11:14 a.m. UTC
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 x86/vmx_tests.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox

Patch

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 7594c03..5afc7e1 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -1036,6 +1036,8 @@  static int setup_ept()
 	return 0;
 }
 
+static int apic_version;
+
 static int ept_init()
 {
 	unsigned long base_addr1, base_addr2;
@@ -1071,6 +1073,8 @@  static int ept_init()
 			EPT_WA | EPT_RA | EPT_EA);
 	install_ept(pml4, (unsigned long)data_page1, (unsigned long)data_page2,
 			EPT_RA | EPT_WA | EPT_EA);
+
+	apic_version = *((u32 *)0xfee00030);
 	return VMX_TEST_START;
 }
 
@@ -1124,6 +1128,10 @@  t1:
 		report("EPT violation - paging structure", 1);
 	else
 		report("EPT violation - paging structure", 0);
+
+	// Test EPT access to L1 MMIO
+	vmx_set_test_stage(6);
+	report("EPT - MMIO access", *((u32 *)0xfee00030) == apic_version);
 }
 
 static int ept_exit_handler()