Received: by 10.223.185.111 with SMTP id b44csp1144775wrg; Fri, 9 Mar 2018 22:51:54 -0800 (PST) X-Google-Smtp-Source: AG47ELvg0vAl1WJhSvqtPBVhBW5ZT6x0dEZX0SaMq4YbMDzV1mI8Xl7B3xaxkEC1m4Vc2u6TLFEw X-Received: by 2002:a17:902:6b04:: with SMTP id o4-v6mr1181262plk.201.1520664714162; Fri, 09 Mar 2018 22:51:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520664714; cv=none; d=google.com; s=arc-20160816; b=qh9oqVk894PstLPa6i3+WgWI2Zh8QHPIRsm7qCiRlkRW/xm0Pqyu0Usrk+UKW01X/0 lryhy8N99ERRL5MieWgSYk8M9rmIBBorFTXXnmalJMBzwDJ658pQpud4NnlOeDyshBvn kuLo6z8GCzjdPgQxsTYWhOn0C2jTAoubsutYyDRbyv67pARWFftInKTQ7D2Bbv8KR/yK netKvIpNaXKV8IrMCXSEPMKk0P9w4GXCyQlRpOuWh2Y8oVkUafJiNv3YOJnxdvZdjLu0 D9ONSe8Me5zmV+2Eh0K8cxbvbcn/EuP5Z1S/nRvrvUwkwGJvydUh0IcXuXb+fbk30AbP o1yQ== 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=X8kG2UrZL96mAUUhJdwzV7NVrkIkLLInK6aDRz2NAvQ=; b=nVrdkljXV2jdtSadSphMYYGKlnMt9bRV9dbmbWbLXBpjwm6lnrg3m8JPPl6AYzjSe1 LGVWxWEx7odSK31CIE1UMF2OSx9a/SciOsc+WRKiqubnHT4Q3Lg7xQsV4UFa8CtOtFn3 OhPd5gbU9PJmj48tJFY5rbLXEVeYxBcL5fL0ZzTKU8zZ310wxq5u9mnKJ4QOn/D/rfh0 l5LXGEMqNDEatYczjA1/jHhfURIqfWN7lWRUsO5r870nsuwWwmg7JvFpTxwoY0lS6WRC Feq4jnHEpHA4it6HmKOi9sd9AV8wT84WKBHsRMgXnU03ciofTDzAyrlhi5H5WFe3wM3v cyyA== 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 f1-v6si2293248plb.73.2018.03.09.22.51.37; Fri, 09 Mar 2018 22:51:54 -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 S1751373AbeCJGui (ORCPT + 99 others); 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 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2018 22:50:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,449,1515484800"; d="scan'208";a="210417997" Received: from jyang75-mobl1.amr.corp.intel.com (HELO [10.255.228.233]) ([10.255.228.233]) by fmsmga006.fm.intel.com with ESMTP; 09 Mar 2018 22:50:33 -0800 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 Precedence: bulk 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.