Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753415AbdGJGGR (ORCPT ); Mon, 10 Jul 2017 02:06:17 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59524 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751045AbdGJGGO (ORCPT ); Mon, 10 Jul 2017 02:06:14 -0400 Date: Sun, 9 Jul 2017 23:05:44 -0700 From: Ram Pai To: Anshuman Khandual 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, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, dave.hansen@intel.com, hbabu@us.ibm.com, arnd@arndb.de, akpm@linux-foundation.org, corbet@lwn.net, mingo@redhat.com Subject: Re: [RFC v5 00/38] powerpc: Memory Protection Keys Reply-To: Ram Pai References: <1499289735-14220-1-git-send-email-linuxram@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 17071006-0036-0000-0000-000002447800 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007341; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00885407; UDB=6.00441874; IPR=6.00665565; BA=6.00005462; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016152; XFM=3.00000015; UTC=2017-07-10 06:05:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071006-0037-0000-0000-000041096CAA Message-Id: <20170710060544.GF5713@ram.oc3035372033.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-10_03:,, 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-1703280000 definitions=main-1707100108 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2214 Lines: 60 On Mon, Jul 10, 2017 at 11:13:23AM +0530, Anshuman Khandual wrote: > On 07/06/2017 02:51 AM, Ram Pai wrote: > > Memory protection keys enable applications to protect its > > address space from inadvertent access or corruption from > > itself. > > > > The overall idea: > > > > A process allocates a key and associates it with > > an address range within its address space. > > The process then can dynamically set read/write > > permissions on the key without involving the > > kernel. Any code that violates the permissions > > of the address space; as defined by its associated > > key, will receive a segmentation fault. > > > > This patch series enables the feature on PPC64 HPTE > > platform. > > > > ISA3.0 section 5.7.13 describes the detailed specifications. > > > > > > Testing: > > This patch series has passed all the protection key > > tests available in the selftests directory. > > The tests are updated to work on both x86 and powerpc. > > > > version v5: > > (1) reverted back to the old design -- store the > > key in the pte, instead of bypassing it. > > The v4 design slowed down the hash page path. > > (2) detects key violation when kernel is told to > > access user pages. > > (3) further refined the patches into smaller consumable > > units > > (4) page faults handlers captures the faulting key > > from the pte instead of the vma. This closes a > > race between where the key update in the vma and > > a key fault caused cause by the key programmed > > in the pte. > > (5) a key created with access-denied should > > also set it up to deny write. Fixed it. > > (6) protection-key number is displayed in smaps > > the x86 way. > > Hello Ram, > > This patch series has now grown a lot. Do you have this > hosted some where for us to pull and test it out ? BTW https://github.com/rampai/memorykeys.git branch memkey.v5.3 > do you have data points to show the difference in > performance between this version and the last one where > we skipped the bits from PTE and directly programmed the > HPTE entries looking into VMA bits. No. I dont. I am hoping you can help me out with this. RP