[PATCH] [kvm-unit-tests] realmode: test SAHF instruction

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

 



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

diff --git a/x86/realmode.c b/x86/realmode.c
index 3546771..b9cb634 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1409,6 +1409,15 @@ static void test_sgdt_sidt(void)
     report("sidt", 0, x == y);
 }
 
+static void test_sahf(void)
+{
+    MK_INSN(sahf, "sahf; pushfw; mov (%esp), %al; popfw");
+
+    inregs.eax = 0xfd00;
+    exec_in_big_real_mode(&insn_sahf);
+    report("sahf", R_AX, outregs.eax == (inregs.eax | 0xd7));
+}
+
 static void test_lahf(void)
 {
     MK_INSN(lahf, "pushfw; mov %al, (%esp); popfw; lahf");
@@ -1554,6 +1563,7 @@ void realmode_start(void)
 	test_ss_base_for_esp_ebp();
 	test_sgdt_sidt();
 	test_lahf();
+	test_sahf();
 	test_movzx_movsx();
 	test_bswap();
 	test_aad();
-- 
1.8.3.1

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