[PATCH kvm-unit-tests 2/3] Allow emulation tests to trap exceptions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some instructions trap on execution, we need a way to see if they raise an
exception as expected.

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 config-x86-common.mak |    3 ++-
 x86/emulator.c        |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/config-x86-common.mak b/config-x86-common.mak
index 19bffd4..0ed13e4 100644
--- a/config-x86-common.mak
+++ b/config-x86-common.mak
@@ -45,7 +45,8 @@ $(TEST_DIR)/vmexit.flat: $(cstart.o) $(TEST_DIR)/vmexit.o
 $(TEST_DIR)/smptest.flat: $(cstart.o) $(TEST_DIR)/smptest.o
  
 $(TEST_DIR)/emulator.flat: $(cstart.o) $(TEST_DIR)/emulator.o \
-			   $(TEST_DIR)/vm.o $(TEST_DIR)/print.o
+			   $(TEST_DIR)/vm.o $(TEST_DIR)/print.o \
+			   $(TEST_DIR)/idt.o
 
 $(TEST_DIR)/port80.flat: $(cstart.o) $(TEST_DIR)/port80.o
 
diff --git a/x86/emulator.c b/x86/emulator.c
index b0d15c0..5d1659f 100644
--- a/x86/emulator.c
+++ b/x86/emulator.c
@@ -1,6 +1,7 @@
 #include "ioram.h"
 #include "vm.h"
 #include "libcflat.h"
+#include "idt.h"
 
 #define memset __builtin_memset
 #define TESTDEV_IO_PORT 0xe0
@@ -582,6 +583,7 @@ int main()
 	unsigned long t1, t2;
 
 	setup_vm();
+	setup_idt();
 	mem = vmap(IORAM_BASE_PHYS, IORAM_LEN);
 
 	// test mov reg, r/m and mov r/m, reg
-- 
1.7.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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux