public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nadav Amit <namit@vmware.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: <kvm@vger.kernel.org>, Nadav Amit <namit@vmware.com>
Subject: [kvm-unit-tests PATCH 3/3] x86: realmode: fix lss test
Date: Fri, 26 Jun 2020 02:23:33 -0700	[thread overview]
Message-ID: <20200626092333.2830-4-namit@vmware.com> (raw)
In-Reply-To: <20200626092333.2830-1-namit@vmware.com>

Running lss with some random descriptor and then performing pop does not
work so well. Use mov instructions instead of push/pop pair.

Signed-off-by: Nadav Amit <namit@vmware.com>
---
 x86/realmode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/x86/realmode.c b/x86/realmode.c
index 301b013..90ecd13 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1378,10 +1378,10 @@ static void test_lds_lss(void)
 		outregs.eax == (unsigned long)desc.address &&
 		outregs.ebx == desc.sel);
 
-	MK_INSN(lss, "pushl %ss\n\t"
+	MK_INSN(lss, "mov %ss, %dx\n\t"
 		     "lss (%ebx), %eax\n\t"
 		     "mov %ss, %ebx\n\t"
-		     "popl %ss\n\t");
+		     "mov %dx, %ss\n\t");
 	exec_in_big_real_mode(&insn_lss);
 	report("lss", R_AX | R_BX,
 		outregs.eax == (unsigned long)desc.address &&
-- 
2.20.1


  parent reply	other threads:[~2020-06-26  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  9:23 [kvm-unit-tests PATCH 0/3] x86: realmode: fixes Nadav Amit
2020-06-26  9:23 ` [kvm-unit-tests PATCH 1/3] x86: realmode: initialize idtr Nadav Amit
2020-06-26 10:41   ` Paolo Bonzini
2020-06-26  9:23 ` [kvm-unit-tests PATCH 2/3] x86: realmode: hlt loop as fallback on exit Nadav Amit
2020-06-26  9:23 ` Nadav Amit [this message]
2020-06-26 10:43 ` [kvm-unit-tests PATCH 0/3] x86: realmode: fixes Paolo Bonzini

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=20200626092333.2830-4-namit@vmware.com \
    --to=namit@vmware.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox