From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbeCJGui (ORCPT ); Sat, 10 Mar 2018 01:50:38 -0500 Received: from mga18.intel.com ([134.134.136.126]:54367 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750735AbeCJGuh (ORCPT ); Sat, 10 Mar 2018 01:50:37 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,449,1515484800"; d="scan'208";a="210417997" Subject: Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0 To: Ram Pai References: <1520583161-11741-1-git-send-email-linuxram@us.ibm.com> <60886e4a-59d4-541a-a6af-d4504e6719ad@intel.com> <20180310055544.GU1060@ram.oc3035372033.ibm.com> Cc: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com, corbet@lwn.net, arnd@arndb.de, fweimer@redhat.com, msuchanek@suse.com, Ulrich.Weigand@de.ibm.com From: Dave Hansen Message-ID: <842bd8a3-d869-f796-32ea-831427fefe4d@intel.com> Date: Fri, 9 Mar 2018 22:50:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180310055544.GU1060@ram.oc3035372033.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/09/2018 09:55 PM, Ram Pai wrote: > On Fri, Mar 09, 2018 at 02:40:32PM -0800, Dave Hansen wrote: >> On 03/09/2018 12:12 AM, Ram Pai wrote: >>> Once an address range is associated with an allocated pkey, it cannot be >>> reverted back to key-0. There is no valid reason for the above behavior. On >>> the contrary applications need the ability to do so. >> Why don't we just set pkey 0 to be allocated in the allocation bitmap by >> default? > ok. that will make it allocatable. But it will not be associatable, > given the bug in the current code. And what will be the > default key associated with a pte? zero? or something else? I'm just saying that I think we should try to keep from making it special as much as possible. Let's fix the bug that keeps it from being associatable.