From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-x244.google.com (mail-vk0-x244.google.com [IPv6:2607:f8b0:400c:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 402jGV2xv1zDqwR for ; Fri, 16 Mar 2018 22:02:26 +1100 (AEDT) Received: by mail-vk0-x244.google.com with SMTP id p189so6033720vkd.10 for ; Fri, 16 Mar 2018 04:02:26 -0700 (PDT) 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" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.