diff mbox series

[kvm-unit-tests,3/3] x86: realmode: fix lss test

Message ID 20200626092333.2830-4-namit@vmware.com (mailing list archive)
State New, archived
Headers show
Series x86: realmode: fixes | expand

Commit Message

Nadav Amit June 26, 2020, 9:23 a.m. UTC
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 mbox series

Patch

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 &&