mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nadav Amit <namit@cs.technion.ac.il>
To: pbonzini@redhat.com
Cc: gleb@kernel.org, tglx@linutronix.de, mingo@redhat.com,
	hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, Nadav Amit <namit@cs.technion.ac.il>
Subject: [PATCH kvm-unit-tests 5/5] x86: Test monitor and mwait on real-mode
Date: Wed, 18 Jun 2014 17:19:54 +0300	[thread overview]
Message-ID: <1403101194-23707-6-git-send-email-namit@cs.technion.ac.il> (raw)
In-Reply-To: <1403101194-23707-1-git-send-email-namit@cs.technion.ac.il>

monitor and mwait are now considered to behave as nop.  New patch enables
monitor and mwait in realmode as well.  This test checks whether they are
handled as nop in realmode as well.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
---
 x86/realmode.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/x86/realmode.c b/x86/realmode.c
index 10c3e03..0a62b5d 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1671,6 +1671,16 @@ void test_xadd(void)
 	report("xadd", R_AX, outregs.eax == inregs.eax * 2);
 }
 
+void test_monitor_mwait(void)
+{
+	MK_INSN(monitor, "monitor\n\t"
+			 "mwait\n\t");
+	inregs.ecx = 0;
+	inregs.eax = 0;
+	exec_in_big_real_mode(&insn_monitor);
+	report("monitor", 0, 1);
+}
+ 
 
 void realmode_start(void)
 {
@@ -1721,6 +1731,7 @@ void realmode_start(void)
 	test_smsw();
 	test_nopl();
 	test_xadd();
+	test_monitor_mwait();
 	test_perf_loop();
 	test_perf_mov();
 	test_perf_arith();
-- 
1.9.1


      parent reply	other threads:[~2014-06-18 14:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 14:19 [PATCH kvm-unit-tests 0/5] x86: Tests for recent emulator bugs Nadav Amit
2014-06-18 14:19 ` [PATCH kvm-unit-tests 1/5] x86: Testing nop instruction on 64-bit Nadav Amit
2014-06-18 14:19 ` [PATCH kvm-unit-tests 2/5] x86: test xadd with two identical operands Nadav Amit
2014-06-18 14:19 ` [PATCH kvm-unit-tests 3/5] x86: Test btcq with operand larger than 64 Nadav Amit
2014-06-18 14:19 ` [PATCH kvm-unit-tests 4/5] x86: check cmov instruction on 64-bit Nadav Amit
2014-06-18 14:19 ` Nadav Amit [this message]

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=1403101194-23707-6-git-send-email-namit@cs.technion.ac.il \
    --to=namit@cs.technion.ac.il \
    --cc=gleb@kernel.org \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®