[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1405942794-22681-2-git-send-email-namit@cs.technion.ac.il>
Date: Mon, 21 Jul 2014 14:39:52 +0300
From: Nadav Amit <namit@...technion.ac.il>
To: pbonzini@...hat.com
Cc: tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, gleb@...nel.org, linux-kernel@...r.kernel.org,
Nadav Amit <namit@...technion.ac.il>
Subject: [PATCH kvm-unit-tests 1/3] x86: Check rflags.rf is cleared after emulation
RFLAGS.RF should be cleared after every instruction emulation. Recently
discovered bug indicated this is not the case. This patch adds a test to check
this behavior. It is done by setting RF, executing IRET and checking whether
the saved RF is cleared. Since the flags are saved several instructions after
IRET is executed, RF should be cleared.
Signed-off-by: Nadav Amit <namit@...technion.ac.il>
---
x86/realmode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/x86/realmode.c b/x86/realmode.c
index 10c3e03..09e6aa7 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -744,7 +744,7 @@ void test_iret()
MK_INSN(iret_flags32, "pushfl\n\t"
"popl %eax\n\t"
"andl $~0x2, %eax\n\t"
- "orl $0xffc08028, %eax\n\t"
+ "orl $0xffc18028, %eax\n\t"
"pushl %eax\n\t"
"pushl %cs\n\t"
"call 1f\n\t"
@@ -773,6 +773,7 @@ void test_iret()
exec_in_big_real_mode(&insn_iret_flags32);
report("iret 3", R_AX, 1);
+ report("rflags.rf", ~0, !(outregs.eflags & (1 << 16)));
exec_in_big_real_mode(&insn_iret_flags16);
report("iret 4", R_AX, 1);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists