From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751882AbdIVGAp (ORCPT ); Fri, 22 Sep 2017 02:00:45 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:37451 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbdIVGAh (ORCPT ); Fri, 22 Sep 2017 02:00:37 -0400 X-Google-Smtp-Source: AOwi7QBC5g1Ms+UpMffvV7AUWtkbjVJTyyPRXto4Ajsz74fPMIL4vUW5Vxt0qgY+4c0aXcGWzOAoBg== Date: Fri, 22 Sep 2017 16:00:19 +1000 From: Balbir Singh To: Ram Pai Cc: mpe@ellerman.id.au, 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, arnd@arndb.de, akpm@linux-foundation.org, corbet@lwn.net, mingo@redhat.com, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com Subject: Re: [PATCH 4/6] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface Message-ID: <20170922160019.0d6d1eae@firefly.ozlabs.ibm.com> In-Reply-To: <1505524870-4783-5-git-send-email-linuxram@us.ibm.com> References: <1505524870-4783-1-git-send-email-linuxram@us.ibm.com> <1505524870-4783-5-git-send-email-linuxram@us.ibm.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Sep 2017 18:21:08 -0700 Ram Pai wrote: > From: Thiago Jung Bauermann > > Expose useful information for programs using memory protection keys. > Provide implementation for powerpc and x86. > > On a powerpc system with pkeys support, here is what is shown: > > $ head /sys/kernel/mm/protection_keys/* > ==> /sys/kernel/mm/protection_keys/disable_access_supported <== > true > > ==> /sys/kernel/mm/protection_keys/disable_execute_supported <== > true > > ==> /sys/kernel/mm/protection_keys/disable_write_supported <== > true > > ==> /sys/kernel/mm/protection_keys/total_keys <== > 32 > > ==> /sys/kernel/mm/protection_keys/usable_keys <== > 29 > > And on an x86 without pkeys support: > > $ head /sys/kernel/mm/protection_keys/* > ==> /sys/kernel/mm/protection_keys/disable_access_supported <== > false > > ==> /sys/kernel/mm/protection_keys/disable_execute_supported <== > false > > ==> /sys/kernel/mm/protection_keys/disable_write_supported <== > false > > ==> /sys/kernel/mm/protection_keys/total_keys <== > 1 > > ==> /sys/kernel/mm/protection_keys/usable_keys <== > 0 > > Signed-off-by: Ram Pai > Signed-off-by: Thiago Jung Bauermann > --- Just curious, how do you see this being used? For debugging or will applications parse these properties and use them? It's hard for an application to partition its address space among keys at runtime, would you agree? Balbir Singh.