From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751357AbdBXTrh convert rfc822-to-8bit (ORCPT ); Fri, 24 Feb 2017 14:47:37 -0500 Received: from terminus.zytor.com ([65.50.211.136]:47346 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbdBXTre (ORCPT ); Fri, 24 Feb 2017 14:47:34 -0500 From: "H. Peter Anvin" Message-Id: <201702241945.v1OJjDKZ011535@mail.zytor.com> Date: Fri, 24 Feb 2017 11:45:05 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <1487964979.115017.11.camel@ranerica-desktop> 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> <1487888144.115017.3.camel@ranerica-desktop> <1487964979.115017.11.camel@ranerica-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults caused by UMIP To: Ricardo Neri , Andy Lutomirski CC: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , 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 ML , linux-msdos@vger.kernel.org, wine-devel@winehq.org, Tony@zytor.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Luck From: hpa@zytor.com Message-ID: On February 24, 2017 11:36:19 AM PST, Ricardo Neri wrote: >On Fri, 2017-02-24 at 11:11 -0800, Andy Lutomirski wrote: >> > 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. >> >> I think == true is silly :) > >Then I'll make the change. > >Thanks and BR, >Ricardo It's worse than silly, it is potentially toxic. true is a macro which it's defined as 1. Thus foo == true ... doesn't actually mean what people *think* it does, which is roughly the same thing as !!foo However, if foo is not a boolean, this is *very* different; consider if foo is 2. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.