All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ix86: really make user_mode() work correctly for VM86 mode
@ 2015-05-28  8:16 Jan Beulich
  2015-05-28 17:33 ` Andy Lutomirski
  2015-05-29  7:51 ` [tip:x86/urgent] x86/asm/entry/32: Really " tip-bot for Jan Beulich
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2015-05-28  8:16 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: luto, linux-kernel

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-29  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28  8:16 [PATCH] ix86: really make user_mode() work correctly for VM86 mode Jan Beulich
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.