All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: avi@redhat.com
Cc: kvm@vger.kernel.org
Subject: [PATCH] test long JMP emulation
Date: Sun, 5 Apr 2009 10:05:16 +0300	[thread overview]
Message-ID: <20090405070515.GI4013@redhat.com> (raw)

Goes on top of Jcc tests patch.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/user/test/x86/realmode.c b/user/test/x86/realmode.c
index 336ba1c..755b5d1 100644
--- a/user/test/x86/realmode.c
+++ b/user/test/x86/realmode.c
@@ -451,6 +451,23 @@ void test_jcc_near(void)
 		print_serial("JMP near Test 1: FAIL\n");
 }
 
+void test_long_jmp()
+{
+	struct regs inregs = { 0 }, outregs;
+	u32 esp[16];
+
+	inregs.esp = (u32)esp;
+	MK_INSN(long_jmp, "call 1f\n\t"
+			  "jmp 2f\n\t"
+			  "1: jmp $0, $test_function\n\t"
+		          "2:\n\t");
+	exec_in_big_real_mode(&inregs, &outregs,
+			      insn_long_jmp,
+			      insn_long_jmp_end - insn_long_jmp);
+	if(!regs_equal(&inregs, &outregs, R_AX) || outregs.eax != 0x1234)
+		print_serial("Long JMP Test: FAIL\n");
+}
+
 void test_null(void)
 {
 	struct regs inregs = { 0 }, outregs;
@@ -473,6 +490,8 @@ void start(void)
 	test_jcc_near();
 	/* test_call() uses short jump so call it after testing jcc */
 	test_call();
+	/* long jmp test uses call near so test it after testing call */
+	test_long_jmp();
 
 	exit(0);
 }
--
			Gleb.

             reply	other threads:[~2009-04-05  7:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-05  7:05 Gleb Natapov [this message]
2009-04-05 12:44 ` [PATCH] test long JMP emulation Avi Kivity

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=20090405070515.GI4013@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /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.