From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753372AbbI1UmD (ORCPT ); Mon, 28 Sep 2015 16:42:03 -0400 Received: from www.sr71.net ([198.145.64.142]:37195 "EHLO blackbird.sr71.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070AbbI1UmB (ORCPT ); Mon, 28 Sep 2015 16:42:01 -0400 Subject: Re: [PATCH 25/25] x86, pkeys: Documentation To: Andi Kleen References: <20150928191817.035A64E2@viggo.jf.intel.com> <20150928191827.0BDF3C64@viggo.jf.intel.com> <874miez3jz.fsf@tassilo.jf.intel.com> Cc: borntraeger@de.ibm.com, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, dave.hansen@linux.intel.com From: Dave Hansen Message-ID: <5609A615.1000302@sr71.net> Date: Mon, 28 Sep 2015 13:41:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <874miez3jz.fsf@tassilo.jf.intel.com> Content-Type: multipart/mixed; boundary="------------090305070201060607020807" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------090305070201060607020807 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 09/28/2015 01:34 PM, Andi Kleen wrote: > Do you have a manpage for the new syscall too? Yep, I just added it to the mprotect() manpage. --------------090305070201060607020807 Content-Type: text/x-patch; name="mprotect_key.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mprotect_key.patch" diff --git a/man2/mprotect.2 b/man2/mprotect.2 index ae305f6..5ba6c58 100644 --- a/man2/mprotect.2 +++ b/man2/mprotect.2 @@ -38,16 +38,19 @@ .\" .TH MPROTECT 2 2015-07-23 "Linux" "Linux Programmer's Manual" .SH NAME -mprotect \- set protection on a region of memory +mprotect, mprotect_key \- set protection on a region of memory .SH SYNOPSIS .nf .B #include .sp .BI "int mprotect(void *" addr ", size_t " len ", int " prot ); +.BI "int mprotect_key(void *" addr ", size_t " len ", int " prot , " unsigned long " key); .fi .SH DESCRIPTION .BR mprotect () -changes protection for the calling process's memory page(s) +and +.BR mprotect_key () +change protection for the calling process's memory page(s) containing any part of the address range in the interval [\fIaddr\fP,\ \fIaddr\fP+\fIlen\fP\-1]. .I addr @@ -74,10 +77,18 @@ The memory can be modified. .TP .B PROT_EXEC The memory can be executed. +.PP +.I key +is the protection or storage key to assign to the memory. +The number of keys supported is dependent on the architecture +and is always at least one. +The default key is 0. .SH RETURN VALUE On success, .BR mprotect () -returns zero. +and +.BR mprotect_key () +return zero. On error, \-1 is returned, and .I errno is set appropriately. --------------090305070201060607020807--