Skip to content

Commit

Permalink
selftests/x86/syscall_nt: Add more flag combinations
Browse files Browse the repository at this point in the history
Add EFLAGS.AC to the mix.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/12924e2fe2c5826568b7fc9436d85ca7f5eb1743.1593191971.git.luto@kernel.org
  • Loading branch information
Andy Lutomirski authored and Thomas Gleixner committed Jul 1, 2020
1 parent ffae641 commit e4ef7de
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/testing/selftests/x86/syscall_nt.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,30 @@ int main(void)
printf("[RUN]\tSet NT and issue a syscall\n");
do_it(X86_EFLAGS_NT);

printf("[RUN]\tSet AC and issue a syscall\n");
do_it(X86_EFLAGS_AC);

printf("[RUN]\tSet NT|AC and issue a syscall\n");
do_it(X86_EFLAGS_NT | X86_EFLAGS_AC);

/*
* Now try it again with TF set -- TF forces returns via IRET in all
* cases except non-ptregs-using 64-bit full fast path syscalls.
*/

sethandler(SIGTRAP, sigtrap, 0);

printf("[RUN]\tSet TF and issue a syscall\n");
do_it(X86_EFLAGS_TF);

printf("[RUN]\tSet NT|TF and issue a syscall\n");
do_it(X86_EFLAGS_NT | X86_EFLAGS_TF);

printf("[RUN]\tSet AC|TF and issue a syscall\n");
do_it(X86_EFLAGS_AC | X86_EFLAGS_TF);

printf("[RUN]\tSet NT|AC|TF and issue a syscall\n");
do_it(X86_EFLAGS_NT | X86_EFLAGS_AC | X86_EFLAGS_TF);

return nerrs == 0 ? 0 : 1;
}

0 comments on commit e4ef7de

Please sign in to comment.