[PATCH kvm-unit-tests] realmode: test that stack operations ignore the high word of %esp if ss.b is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 x86/realmode.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/x86/realmode.c b/x86/realmode.c
index 710a06b..82a66b3 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -554,6 +554,11 @@ void test_push_pop()
 			     "mov %fs, %ebx\n\t"
 			     "pop %fs\n\t"
 			);
+	MK_INSN(push_pop_high_esp_bits,
+		"xor $0x12340000, %esp \n\t"
+		"push %ax; \n\t"
+		"xor $0x12340000, %esp \n\t"
+		"pop %bx");
 
 	inregs = (struct regs){ 0 };
 
@@ -577,6 +582,11 @@ void test_push_pop()
 
 	exec_in_big_real_mode(&insn_push_pop_fs);
 	report("push/pop 6", R_AX|R_BX, outregs.ebx == outregs.eax);
+
+	inregs.eax = 0x9977;
+	inregs.ebx = 0x7799;
+	exec_in_big_real_mode(&insn_push_pop_high_esp_bits);
+	report("push/pop with high bits set in %esp", R_BX, outregs.ebx == 0x9977);
 }
 
 void test_null(void)
-- 
1.7.11.3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux