From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756745AbbJARTF (ORCPT ); Thu, 1 Oct 2015 13:19:05 -0400 Received: from www.sr71.net ([198.145.64.142]:42291 "EHLO blackbird.sr71.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753294AbbJARTD (ORCPT ); Thu, 1 Oct 2015 13:19:03 -0400 Subject: Re: [PATCH 07/25] x86, pkeys: new page fault error code bit: PF_PK To: Thomas Gleixner References: <20150928191817.035A64E2@viggo.jf.intel.com> <20150928191820.BF4CBF05@viggo.jf.intel.com> Cc: borntraeger@de.ibm.com, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, dave.hansen@linux.intel.com From: Dave Hansen Message-ID: <560D6B06.6040505@sr71.net> Date: Thu, 1 Oct 2015 10:19:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/01/2015 04:54 AM, Thomas Gleixner wrote: > On Mon, 28 Sep 2015, Dave Hansen wrote: >> > >> > /* >> > @@ -916,7 +918,10 @@ static int spurious_fault_check(unsigned >> > >> > if ((error_code & PF_INSTR) && !pte_exec(*pte)) >> > return 0; >> > - >> > + /* >> > + * Note: We do not do lazy flushing on protection key >> > + * changes, so no spurious fault will ever set PF_PK. >> > + */ > It might be a bit more clear to have: > > /* Comment .... */ > if ((error_code & PF_PK)) > return 1; > > return 1; > > That way the comment is associated to obviously redundant code, but > it's easier to read, especially if we add some new PF_ thingy after > that. Agreed, that's a nicer way to do it. I'll fix it up.