mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: torvalds@linux-foundation.org, peterz@infradead.org,
	bp@alien8.de, luto@kernel.org, dvlasenk@redhat.com,
	tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com,
	brgerst@gmail.com, luto@amacapital.net, shuahkh@osg.samsung.com,
	linux-kernel@vger.kernel.org
Subject: [tip:x86/asm] selftests/x86/vm86: Fix entry_from_vm86 test on 64-bit kernels
Date: Fri, 31 Jul 2015 07:02:45 -0700	[thread overview]
Message-ID: <tip-e800eb39e3f586e46a2007f72d3b609f6e3b888d@git.kernel.org> (raw)
In-Reply-To: <502c8bef877b33fe4943885ded6125dfcc7892db.1438205722.git.luto@kernel.org>

Commit-ID:  e800eb39e3f586e46a2007f72d3b609f6e3b888d
Gitweb:     http://git.kernel.org/tip/e800eb39e3f586e46a2007f72d3b609f6e3b888d
Author:     Andy Lutomirski <luto@kernel.org>
AuthorDate: Wed, 29 Jul 2015 14:35:43 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 31 Jul 2015 13:31:07 +0200

selftests/x86/vm86: Fix entry_from_vm86 test on 64-bit kernels

The test failed due to an oversight on my part when run on a
64-bit kernel.  vm86 isn't expected to work at all, and I
mistakenly failed one part of the test because no signal was
delivered.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/502c8bef877b33fe4943885ded6125dfcc7892db.1438205722.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 tools/testing/selftests/x86/entry_from_vm86.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/x86/entry_from_vm86.c b/tools/testing/selftests/x86/entry_from_vm86.c
index f004b2a..9a43a59 100644
--- a/tools/testing/selftests/x86/entry_from_vm86.c
+++ b/tools/testing/selftests/x86/entry_from_vm86.c
@@ -105,7 +105,8 @@ extern unsigned char vmcode[], end_vmcode[];
 extern unsigned char vmcode_bound[], vmcode_sysenter[], vmcode_syscall[],
 	vmcode_sti[], vmcode_int3[], vmcode_int80[];
 
-static void do_test(struct vm86plus_struct *v86, unsigned long eip,
+/* Returns false if the test was skipped. */
+static bool do_test(struct vm86plus_struct *v86, unsigned long eip,
 		    unsigned int rettype, unsigned int retarg,
 		    const char *text)
 {
@@ -117,7 +118,7 @@ static void do_test(struct vm86plus_struct *v86, unsigned long eip,
 
 	if (ret == -1 && errno == ENOSYS) {
 		printf("[SKIP]\tvm86 not supported\n");
-		return;
+		return false;
 	}
 
 	if (VM86_TYPE(ret) == VM86_INTx) {
@@ -154,6 +155,8 @@ static void do_test(struct vm86plus_struct *v86, unsigned long eip,
 		printf("[FAIL]\tIncorrect return reason\n");
 		nerrs++;
 	}
+
+	return true;
 }
 
 int main(void)
@@ -219,8 +222,8 @@ int main(void)
 	v86.regs.ss = 0;
 	sethandler(SIGSEGV, sighandler, 0);
 	got_signal = 0;
-	do_test(&v86, 0, VM86_SIGNAL, 0, "Execute null pointer");
-	if (!got_signal) {
+	if (do_test(&v86, 0, VM86_SIGNAL, 0, "Execute null pointer") &&
+	    !got_signal) {
 		printf("[FAIL]\tDid not receive SIGSEGV\n");
 		nerrs++;
 	}

      reply	other threads:[~2015-07-31 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 21:35 [PATCH] selftests/x86: " Andy Lutomirski
2015-07-31 14:02 ` tip-bot for Andy Lutomirski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-e800eb39e3f586e46a2007f72d3b609f6e3b888d@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=shuahkh@osg.samsung.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome