From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755552AbbE2HxG (ORCPT ); Fri, 29 May 2015 03:53:06 -0400 Received: from terminus.zytor.com ([198.137.202.10]:57438 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751933AbbE2Hw4 (ORCPT ); Fri, 29 May 2015 03:52:56 -0400 Date: Fri, 29 May 2015 00:51:42 -0700 From: tip-bot for Jan Beulich Message-ID: Cc: luto@kernel.org, dvlasenk@redhat.com, mingo@kernel.org, JBeulich@suse.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, jbeulich@suse.com, hpa@zytor.com, luto@amacapital.net, brgerst@gmail.com, bp@alien8.de Reply-To: luto@kernel.org, dvlasenk@redhat.com, mingo@kernel.org, JBeulich@suse.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, hpa@zytor.com, jbeulich@suse.com, bp@alien8.de, brgerst@gmail.com, luto@amacapital.net In-Reply-To: <5566EB0D020000780007E655@mail.emea.novell.com> References: <5566EB0D020000780007E655@mail.emea.novell.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/asm/entry/32: Really make user_mode() work correctly for VM86 mode Git-Commit-ID: 7ba554b5ac69e5f3edac9ce3233beb5acd480878 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7ba554b5ac69e5f3edac9ce3233beb5acd480878 Gitweb: http://git.kernel.org/tip/7ba554b5ac69e5f3edac9ce3233beb5acd480878 Author: Jan Beulich AuthorDate: Thu, 28 May 2015 09:16:45 +0100 Committer: Ingo Molnar CommitDate: Fri, 29 May 2015 09:46:40 +0200 x86/asm/entry/32: Really make user_mode() work correctly for VM86 mode 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 Acked-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/5566EB0D020000780007E655@mail.emea.novell.com Signed-off-by: Ingo Molnar --- arch/x86/include/asm/ptrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index 19507ff..5fabf13 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h @@ -107,7 +107,7 @@ static inline unsigned long regs_return_value(struct pt_regs *regs) 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