From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751409AbdBWWPs (ORCPT ); Thu, 23 Feb 2017 17:15:48 -0500 Received: from mga05.intel.com ([192.55.52.43]:33371 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbdBWWPq (ORCPT ); Thu, 23 Feb 2017 17:15:46 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,198,1484035200"; d="scan'208";a="937443019" Message-ID: <1487888144.115017.3.camel@ranerica-desktop> Subject: Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults caused by UMIP From: Ricardo Neri To: Peter Zijlstra Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Borislav Petkov , Andrew Morton , Brian Gerst , Chris Metcalf , Dave Hansen , Paolo Bonzini , Liang Z Li , Masami Hiramatsu , Huang Rui , Jiri Slaby , Jonathan Corbet , "Michael S. Tsirkin" , Paul Gortmaker , Vlastimil Babka , Chen Yucong , Alexandre Julliard , Stas Sergeev , Fenghua Yu , "Ravi V. Shankar" , Shuah Khan , linux-kernel@vger.kernel.org, x86@kernel.org, linux-msdos@vger.kernel.org, wine-devel@winehq.org, Tony Luck Date: Thu, 23 Feb 2017 14:15:44 -0800 In-Reply-To: <20170223092724.GZ6515@twins.programming.kicks-ass.net> References: <20170223063706.71554-1-ricardo.neri-calderon@linux.intel.com> <20170223063706.71554-16-ricardo.neri-calderon@linux.intel.com> <20170223092724.GZ6515@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-02-23 at 10:27 +0100, Peter Zijlstra wrote: > On Wed, Feb 22, 2017 at 10:37:04PM -0800, Ricardo Neri wrote: > > @@ -492,6 +493,9 @@ do_general_protection(struct pt_regs *regs, long error_code) > > RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU"); > > cond_local_irq_enable(regs); > > > > + if (user_mode(regs) && (fixup_umip_exception(regs) == true)) > > + return; > > I'm thinking > > if (user_mode(regs) && fixup_umip_exception(regs)) > return; > > is actually easier to read. In a previous version Andy Lutomirsky suggested that if (user_mode(regs) && (fixup_umip_exception(regs) == 0)) was easier to read :). Although at the time fixup_umip_exception returned a numeric value. Now it only returns true/false for successful/failed emulation. If with true/false not comparing to true makes it easier to read, I will make the change. Thanks and BR, Ricardo