From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753808AbeCPLC0 (ORCPT ); Fri, 16 Mar 2018 07:02:26 -0400 Received: from mail-vk0-f68.google.com ([209.85.213.68]:41628 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753534AbeCPLCY (ORCPT ); Fri, 16 Mar 2018 07:02:24 -0400 X-Google-Smtp-Source: AG47ELsT0ZpCx1G2XsCB9d6peyTT97znSIluTWvWz5/q4F7n4iGkCTHsbAhm3x8dswQauDiOxhWuFk5+6dPdHi0PEtI= MIME-Version: 1.0 In-Reply-To: <1521196416-18157-1-git-send-email-linuxram@us.ibm.com> References: <1521196416-18157-1-git-send-email-linuxram@us.ibm.com> From: Balbir Singh Date: Fri, 16 Mar 2018 22:02:22 +1100 Message-ID: Subject: Re: [PATCH v4] mm, pkey: treat pkey-0 special To: Ram Pai Cc: Michael Ellerman , Ingo Molnar , "akpm@linux-foundation.org" , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , linux-mm , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , linux-arch , "linux-kernel@vger.kernel.org" , Dave Hansen , Benjamin Herrenschmidt , Paul Mackerras , Anshuman Khandual , Aneesh Kumar KV , "Haren Myneni/Beaverton/IBM" , Michal Hocko , Thiago Jung Bauermann , "Eric W. Biederman" , Jonathan Corbet , Arnd Bergmann , fweimer@redhat.com, msuchanek@suse.com, Thomas Gleixner , Ulrich.Weigand@de.ibm.com, Ram Pai Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 16, 2018 at 9:33 PM, Ram Pai wrote: > Applications need the ability to associate an address-range with some > key and latter revert to its initial default key. Pkey-0 comes close to > providing this function but falls short, because the current > implementation disallows applications to explicitly associate pkey-0 to > the address range. > > Clarify the semantics of pkey-0 and provide the corresponding > implementation. > > Pkey-0 is special with the following semantics. > (a) it is implicitly allocated and can never be freed. It always exists. > (b) it is the default key assigned to any address-range. > (c) it can be explicitly associated with any address-range. > > Tested on powerpc only. Could not test on x86. Ram, I was wondering if we should check the AMOR values on the ppc side to make sure that pkey0 is indeed available for use as default. I am still of the opinion that we should consider non-0 default pkey in the long run. I'm OK with the patches for now, but really 0 is not special except for it being the default bit values present in the PTE. The patches themselves look OK to me Balbir Singh.