Commit 2566557b authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Greg Kroah-Hartman

selftests/x86/syscall_nt: Clear weird flags after each test

[ Upstream commit a61fa279 ]

Clear the weird flags before logging to improve strace output --
logging results while, say, TF is set does no one any favors.
Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/907bfa5a42d4475b8245e18b67a04b13ca51ffdb.1593191971.git.luto@kernel.orgSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d1a2a1c9
...@@ -67,6 +67,7 @@ static void do_it(unsigned long extraflags) ...@@ -67,6 +67,7 @@ static void do_it(unsigned long extraflags)
set_eflags(get_eflags() | extraflags); set_eflags(get_eflags() | extraflags);
syscall(SYS_getpid); syscall(SYS_getpid);
flags = get_eflags(); flags = get_eflags();
set_eflags(X86_EFLAGS_IF | X86_EFLAGS_FIXED);
if ((flags & extraflags) == extraflags) { if ((flags & extraflags) == extraflags) {
printf("[OK]\tThe syscall worked and flags are still set\n"); printf("[OK]\tThe syscall worked and flags are still set\n");
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment