diff mbox

[kvm-unit-tests,v2,1/3] realmode: restore DF at exit from exec_in_big_real_mode

Message ID 1368111305-9076-2-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini May 9, 2013, 2:55 p.m. UTC
Some tests fail if DF=1.  Restore it directly after executing the test,
do not do it "magically" in print_serial.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 x86/realmode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/x86/realmode.c b/x86/realmode.c
index 35ace08..71c8a7d 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -26,7 +26,7 @@  static void print_serial(const char *buf)
 {
 	unsigned long len = strlen(buf);
 
-	asm volatile ("cld; addr32/rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1));
+	asm volatile ("addr32/rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1));
 }
 
 static void exit(int code)
@@ -109,6 +109,8 @@  static void exec_in_big_real_mode(struct insn_desc *insn)
 		"pushfl \n\t"
 		"popl %[save]+36 \n\t"
 
+		/* Restore DF for the harness code */
+		"cld\n\t"
 		"xor %[tmp], %[tmp] \n\t"
 		"mov %[tmp], %%gs \n\t"
 		: [tmp]"=&r"(tmp), [save]"+m"(save)