From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751325AbdE0EQ7 (ORCPT ); Sat, 27 May 2017 00:16:59 -0400 Received: from mga06.intel.com ([134.134.136.31]:63322 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727AbdE0EIG (ORCPT ); Sat, 27 May 2017 00:08:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,400,1491289200"; d="scan'208";a="106015708" Message-ID: <1495856426.24288.47.camel@ranerica-desktop> Subject: Re: [PATCH v7 02/26] x86/mm: Relocate page fault error codes to traps.h From: Ricardo Neri To: Borislav Petkov Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , 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, "Kirill A. Shutemov" , Josh Poimboeuf Date: Fri, 26 May 2017 20:40:26 -0700 In-Reply-To: <20170521142330.GC5676@nazgul.tnic> References: <20170505181724.55000-1-ricardo.neri-calderon@linux.intel.com> <20170505181724.55000-3-ricardo.neri-calderon@linux.intel.com> <20170521142330.GC5676@nazgul.tnic> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2017-05-21 at 16:23 +0200, Borislav Petkov wrote: > On Fri, May 05, 2017 at 11:17:00AM -0700, Ricardo Neri wrote: > > Up to this point, only fault.c used the definitions of the page fault error > > codes. Thus, it made sense to keep them within such file. Other portions of > > code might be interested in those definitions too. For instance, the User- > > Mode Instruction Prevention emulation code will use such definitions to > > emulate a page fault when it is unable to successfully copy the results > > of the emulated instructions to user space. > > > > While relocating the error code enumeration, the prefix X86_ is used to > > make it consistent with the rest of the definitions in traps.h. Of course, > > code using the enumeration had to be updated as well. No functional changes > > were performed. > > > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: "H. Peter Anvin" > > Cc: Andy Lutomirski > > Cc: "Kirill A. Shutemov" > > Cc: Josh Poimboeuf > > Cc: Dave Hansen > > Cc: Paul Gortmaker > > Cc: x86@kernel.org > > Reviewed-by: Andy Lutomirski > > Signed-off-by: Ricardo Neri > > --- > > arch/x86/include/asm/traps.h | 18 +++++++++ > > arch/x86/mm/fault.c | 88 +++++++++++++++++--------------------------- > > 2 files changed, 52 insertions(+), 54 deletions(-) > > ... > > > @@ -1382,7 +1362,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code, > > * space check, thus avoiding the deadlock: > > */ > > if (unlikely(!down_read_trylock(&mm->mmap_sem))) { > > - if ((error_code & PF_USER) == 0 && > > + if ((error_code & X86_PF_USER) == 0 && > > if (!(error_code & X86_PF_USER)) This change was initially intended to only rename the error codes, without functional changes. Would making change be considered a change in functionality? The behavior would be preserved, though. Thanks and BR, Ricardo > > With that fixed: > > Reviewed-by: Borislav Petkov Thank you for your review! BR, Ricardo > > -- > Regards/Gruss, > Boris. > > SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)