From: "Jan Beulich" <JBeulich@suse.com>
To: <mingo@elte.hu>, <tglx@linutronix.de>, <hpa@zytor.com>
Cc: <luto@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] ix86: really make user_mode() work correctly for VM86 mode
Date: Thu, 28 May 2015 09:16:45 +0100 [thread overview]
Message-ID: <5566EB0D020000780007E655@mail.emea.novell.com> (raw)
While commit efa7045103 ("x86/asm/entry: Make user_mode() work
correctly if regs came from VM86 mode") claims that "user_mode() is now
identical to user_mode_vm()", this wasn't actually the case - no prior
commit made it so.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Andy Lutomirski <luto@kernel.org>
---
arch/x86/include/asm/ptrace.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- 4.1-rc5/arch/x86/include/asm/ptrace.h
+++ 4.1-rc5-ix86-user_mode/arch/x86/include/asm/ptrace.h
@@ -107,7 +107,8 @@ static inline unsigned long regs_return_
static inline int user_mode(struct pt_regs *regs)
{
#ifdef CONFIG_X86_32
- return (regs->cs & SEGMENT_RPL_MASK) == USER_RPL;
+ return ((regs->cs & SEGMENT_RPL_MASK) | (regs->flags & X86_VM_MASK))
+ >= USER_RPL;
#else
return !!(regs->cs & 3);
#endif
next reply other threads:[~2015-05-28 8:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 8:16 Jan Beulich [this message]
2015-05-28 17:33 ` Andy Lutomirski
2015-05-29 7:49 ` Ingo Molnar
2015-05-29 7:51 ` [tip:x86/urgent] x86/asm/entry/32: Really " tip-bot for Jan Beulich
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=5566EB0D020000780007E655@mail.emea.novell.com \
--to=jbeulich@suse.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®