From: Gleb Natapov <gleb@redhat.com>
To: kvm@vger.kernel.org
Cc: mtosatti@redhat.com
Subject: [PATCH kvm-unit-test]: test fninit/fnstsw/fnstcw instructions emulation
Date: Thu, 20 Dec 2012 17:00:56 +0200 [thread overview]
Message-ID: <20121220150056.GJ17584@redhat.com> (raw)
Add test for fninit/fnstsw/fnstcw instructions emulation. This exact
code sequence is executed by Linux kernel during boot and sometimes gets
emulated by KVM.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/x86/realmode.c b/x86/realmode.c
index 549b36a..f5426e0 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1384,6 +1384,18 @@ static void test_aad(void)
report("aad", R_AX, outregs.eax == 0x123400d4);
}
+static void test_fninit(void)
+{
+ u16 fcw = -1, fsw = -1;
+ MK_INSN(fninit, "fninit ; fnstsw (%eax) ; fnstcw (%ebx)");
+
+ inregs.eax = (u32)&fsw;
+ inregs.ebx = (u32)&fcw;
+
+ exec_in_big_real_mode(&insn_fninit);
+ report("fninit", 0, fsw == 0 && (fcw & 0x103f) == 0x003f);
+}
+
void realmode_start(void)
{
test_null();
@@ -1424,6 +1436,7 @@ void realmode_start(void)
test_movzx_movsx();
test_bswap();
test_aad();
+ test_fninit();
exit(0);
}
--
Gleb.
reply other threads:[~2012-12-20 15:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20121220150056.GJ17584@redhat.com \
--to=gleb@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.