From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753062AbcGGPmZ (ORCPT ); Thu, 7 Jul 2016 11:42:25 -0400 Received: from www.sr71.net ([198.145.64.142]:35866 "EHLO blackbird.sr71.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752060AbcGGPmQ (ORCPT ); Thu, 7 Jul 2016 11:42:16 -0400 Subject: Re: [PATCH 1/9] x86, pkeys: add fault handling for PF_PK page fault bit To: Mel Gorman References: <20160707124719.3F04C882@viggo.jf.intel.com> <20160707124720.6E0DC397@viggo.jf.intel.com> <20160707144027.GX11498@techsingularity.net> Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, dave.hansen@linux.intel.com, arnd@arndb.de, hughd@google.com, viro@zeniv.linux.org.uk From: Dave Hansen Message-ID: <577E7848.3060908@sr71.net> Date: Thu, 7 Jul 2016 08:42:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160707144027.GX11498@techsingularity.net> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/07/2016 07:40 AM, Mel Gorman wrote: > On Thu, Jul 07, 2016 at 05:47:20AM -0700, Dave Hansen wrote: >> From: Dave Hansen >> PF_PK means that a memory access violated the protection key >> access restrictions. It is unconditionally an access_error() >> because the permissions set on the VMA don't matter (the PKRU >> value overrides it), and we never "resolve" PK faults (like >> how a COW can "resolve write fault). >> >> Signed-off-by: Dave Hansen > > An access fault gets propgated as SEGV_PKUERR. What happens if glibc > does not recognise it? It passes it through to the handler without any side-effects. I don't think it does anything differently with SEGV_* codes that it knows about vs. unknown ones. The only negative side-effect that I can think of is that it won't have a nice error message for it.