selftests/x86/entry_from_vm86: Add test cases for POPF
authorAndy Lutomirski <[email protected]>
Wed, 14 Mar 2018 05:03:11 +0000 (22:03 -0700)
committerIngo Molnar <[email protected]>
Wed, 14 Mar 2018 08:21:01 +0000 (09:21 +0100)
commit78393fdde2a456cafa414b171c90f26a3df98b20
treef46a9175e49de0f87b10994dd0c04c5dc758b2fa
parent327d53d005ca47b10eae940616ed11c569f75a9b
selftests/x86/entry_from_vm86: Add test cases for POPF

POPF is currently broken -- add tests to catch the error.  This
results in:

   [RUN] POPF with VIP set and IF clear from vm86 mode
   [INFO] Exited vm86 mode due to STI
   [FAIL] Incorrect return reason (started at eip = 0xd, ended at eip = 0xf)

because POPF currently fails to check IF before reporting a pending
interrupt.

This patch also makes the FAIL message a bit more informative.

Reported-by: Bart Oldeman <[email protected]>
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stas Sergeev <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/a16270b5cfe7832d6d00c479d0f871066cbdb52b.1521003603.git.luto@kernel.org
Signed-off-by: Ingo Molnar <[email protected]>
tools/testing/selftests/x86/entry_from_vm86.c