Received: by 10.223.185.111 with SMTP id b44csp828918wrg; Fri, 9 Mar 2018 14:41:48 -0800 (PST) X-Google-Smtp-Source: AG47ELvfzo0pjZVLMdvYknxsvuPE0Ei9kiKmMXmQUuaWAYDjJwJYBcw8x0UNplI44XjgVbbnK4Ba X-Received: by 10.99.110.133 with SMTP id j127mr69240pgc.79.1520635308364; Fri, 09 Mar 2018 14:41:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520635308; cv=none; d=google.com; s=arc-20160816; b=khyfx66pNki+dvprn2Z3Y7Fp5jSVSXHG+j09+KCkInzObxSsPc3SSCe0727M6IFGkN 9MOsUFTNyJ00/F0TakabvTRSTP20lVgsGy7aL5rDwWQYCkNCvxvQlKUXHzPKkTxkCsnw H+gCH20VOu62PnoZ2cSqvnNl9sgiXuzrnufcpgqKqxByMUYNZxc30ghDQ+nv5PfHUqEu ceIh2HMJCM0dbDisHSmpg+mKOpRto9F3cmwEOWyRZhlDBBtlUPuiwtqdbHby/w1uDsUm qcRA6krjgdckslHlhpDHrQCY7YeyIQ7vWC6gHtCIvLyUacPsuFys7Bs2l/Lv8VEw4Mt1 evgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:arc-authentication-results; bh=c8sYr3wwvuBcGTGy3/qZr1n01mwIBnvAtloavJ9Y+NQ=; b=NEyXlPAgOydwOX23K/loijUxzrD6N613518Mcw9W+z6WV5RzMiZOw21uLsE2qHu22n w0bZatPXtB2fyXsyAeDGzfqrukGyjkp1/s2Mkifm5EHM8zoMMhpC2SEe2CB9cShbXWwE 3r4O39RW+g53n7okYHFKMgU2ScKkh9wF4pe+XJxwBg9y3r30aOq2Idsy0wNP2JXufDRh 47koYHTxy/BX6Jy5rR09/jcTH5NYDsK53C5dFWEJ0eUAeZE0//Mu55IgIbW0zs0xXAOr zQ9JvY9GV1NLmyA4Q4O9bLZkAJ3tgDO5WbrKLuIQhgZz2QhQWGMkRISpssRis+EkYtCy y4+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si1591194pfb.377.2018.03.09.14.41.33; Fri, 09 Mar 2018 14:41:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932638AbeCIWkj (ORCPT + 99 others); Fri, 9 Mar 2018 17:40:39 -0500 Received: from mga01.intel.com ([192.55.52.88]:53360 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932520AbeCIWki (ORCPT ); Fri, 9 Mar 2018 17:40:38 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2018 14:40:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,447,1515484800"; d="scan'208";a="206964608" Received: from drzang-mobl1.amr.corp.intel.com (HELO [10.252.132.7]) ([10.252.132.7]) by orsmga005.jf.intel.com with ESMTP; 09 Mar 2018 14:40:33 -0800 Subject: Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0 To: Ram Pai , mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org References: <1520583161-11741-1-git-send-email-linuxram@us.ibm.com> Cc: 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: <60886e4a-59d4-541a-a6af-d4504e6719ad@intel.com> Date: Fri, 9 Mar 2018 14:40:32 -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: <1520583161-11741-1-git-send-email-linuxram@us.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? We *could* also just not let it be special and let it be freed. An app could theoretically be careful and make sure nothing is using it.