Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbdG2WnT convert rfc822-to-8bit (ORCPT ); Sat, 29 Jul 2017 18:43:19 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41310 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752485AbdG2WnR (ORCPT ); Sat, 29 Jul 2017 18:43:17 -0400 Date: Sat, 29 Jul 2017 15:43:05 -0700 From: Ram Pai To: Thiago Jung Bauermann Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, arnd@arndb.de, corbet@lwn.net, mhocko@kernel.org, dave.hansen@intel.com, mingo@redhat.com, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, akpm@linux-foundation.org, khandual@linux.vnet.ibm.com Subject: Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys Reply-To: Ram Pai References: <1500177424-13695-1-git-send-email-linuxram@us.ibm.com> <1500177424-13695-14-git-send-email-linuxram@us.ibm.com> <87eft23rnb.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <87eft23rnb.fsf@linux.vnet.ibm.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 17072922-0016-0000-0000-000007443860 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007449; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00894781; UDB=6.00447444; IPR=6.00674948; BA=6.00005499; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016445; XFM=3.00000015; UTC=2017-07-29 22:43:15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17072922-0017-0000-0000-00003ACFFABD Message-Id: <20170729224305.GE5664@ram.oc3035372033.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-29_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707290380 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1662 Lines: 52 On Thu, Jul 27, 2017 at 11:01:44AM -0300, Thiago Jung Bauermann wrote: > > Hello Ram, > > I'm still going through the patches and haven't formed a full picture of > the feature in my mind yet, so my comments today won't be particularly > insightful... > > But hopefully the comments that I currently have will be helpful anyway. sure. thanx for taking the time to look through the patches. > > Ram Pai writes: > > diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h > > index 203d7de..09b268e 100644 > > --- a/arch/powerpc/include/asm/pkeys.h > > +++ b/arch/powerpc/include/asm/pkeys.h > > @@ -2,21 +2,87 @@ > > #define _ASM_PPC64_PKEYS_H > > > > extern bool pkey_inited; > > -#define ARCH_VM_PKEY_FLAGS 0 > > +#define arch_max_pkey() 32 > > +#define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2 | \ > > + VM_PKEY_BIT3 | VM_PKEY_BIT4) > > +/* > > + * Bits are in BE format. > > + * NOTE: key 31, 1, 0 are not used. > > + * key 0 is used by default. It give read/write/execute permission. > > + * key 31 is reserved by the hypervisor. > > + * key 1 is recommended to be not used. > > + * PowerISA(3.0) page 1015, programming note. > > + */ > > +#define PKEY_INITIAL_ALLOCAION 0xc0000001 > > There's a typo in the macro name, should be "ALLOCATION". Thanks fixed it. The new version of the code, calculates the allocation_mask at runtime, depending on the number of keys specified by the device tree as well as other factors. So the above macro is replaced by a variable 'initial_allocation_mask'. RP > > -- > Thiago Jung Bauermann > IBM Linux Technology Center -- Ram Pai