All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: [PATCH kvm-unit-tests 2/3] Allow emulation tests to trap exceptions
Date: Tue, 24 Aug 2010 14:01:10 +0300	[thread overview]
Message-ID: <1282647671-18367-3-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1282647671-18367-1-git-send-email-avi@redhat.com>

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

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 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


  parent reply	other threads:[~2010-08-24 11:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 11:01 [PATCH kvm-unit-tests 0/3] DIV exception tests Avi Kivity
2010-08-24 11:01 ` [PATCH kvm-unit-tests 1/3] Support #DE (divide error) exception handlers Avi Kivity
2010-08-24 11:01 ` Avi Kivity [this message]
2010-08-24 11:01 ` [PATCH kvm-unit-tests 3/3] Add DIV tests Avi Kivity
2010-08-25 20:23 ` [PATCH kvm-unit-tests 0/3] DIV exception tests Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282647671-18367-3-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.