public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: hegdesmailbox@gmail.com, Cary Coutant <ccoutant@gmail.com>,
	       James Y Knight <jyknight@google.com>
Cc: gnu-gabi@sourceware.org
Subject: Re: gABI extension proposal: PT_SHMMAP
Date: Sun, 01 Jan 2017 00:00:00 -0000	[thread overview]
Message-ID: <491ac00d-e12b-746a-7b31-27726d659d8e@zytor.com> (raw)
In-Reply-To: <c10ad93c-2c5a-9c9b-c28a-899e76c7ae91@gmail.com>

On 06/08/17 09:19, Suprateeka R Hegde wrote:
> On 07-Jun-2017 10:40 PM, H. Peter Anvin wrote:
>> Any particular reason that you feel this is not generally useful?
> 
> 1. The use case provided looks extremely specific to Linux. AFAIK, none
> of the unix like HP-UX, Solaris or AIX need this requirement.
> 
> 2. This looks so specific to a runtime loader that it can be as well
> handled as a special case in GNU mmap system (may be in ld.so).
> 
> 3. Assuming Cary is right in understanding that you want a writable but
> still sharable page, such features are not even provided by some of the
> legacy unix kernels.
> 
> 4. Eventually there can be many such flags if we start going with
> specific claims. For instance there was a request for
> PF_NOREAD/SHF_NOREAD that would help some archs (STM?) to protect code
> from being read.
> 

SHF_NOREAD makes total sense - there is no real reason for the current
asymmetry
between the SHF and the PF flags -- you don't need PF_NOREAD because you
already
have PF_R, but there is no SHF_ flag to indicate that a the resulting
segment
should be linked to be !PF_R.

My proposal is also missing that aspect (see below.)


> 5. Why dont we try to fit this proposal under the bigger one - program
> properties - proposed by H.J. ? The theme there is to pass such
> information to runtime.

I think this is completely orthogonal - that would be a program property
rather than a per-segment property?

> 6. Lastly, the proposal looks incomplete:
> 5-a. The hex value for the proposed flag is missing
> 5-b. The proposal should be sent to Generic SYS-V ABI group and not
> GNU-GABI alone.

That is certainly true, but H.J. suggested vetting it here first,
exactly to get the t's crossed and the i's dotted first.  The PT_ vs PF_
question was one.

> 5-c. The complete semantics of this flag in a standard form. The
> semantics should talk about what is mandatory, what is optional. Is the
> current/existing UNIX should be changed to honor this flag or is this
> optional?

So, a slightly refined proposal (if these numbers conflict with newer
allocations/proposals please let me know):


0x00000008 (2^3) - PF_SHARED

	This segment MUST be memory-mapped using MAP_SHARED.  Not
	all operating systems need to support this capability.  If this
	is not possible due to lack of operating system support or
 	because the underlying image is not possible to memory-map,
	the loading of the image should be aborted with an error.

0x00001000 (2^12) - SHF_SHARED

	This section MUST be made part of a PF_SHARED segment when
	linked.

OPTIONALLY, new reserved section names:

	.shrodata	- readonly data section to be mapped shared
	.shdata		- writable data section to be mapped shared
	.shbss		- zerofill section to be mapped shared

  reply	other threads:[~2017-06-08 21:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01  0:00 H. Peter Anvin
2017-01-01  0:00 ` James Y Knight via gnu-gabi
2017-01-01  0:00   ` Cary Coutant
2017-01-01  0:00     ` Suprateeka R Hegde
2017-01-01  0:00       ` H. Peter Anvin [this message]
2017-01-01  0:00         ` Suprateeka R Hegde
2017-01-01  0:00     ` H. Peter Anvin
2017-01-01  0:00 ` Cary Coutant
2017-01-01  0:00   ` hpa
2017-01-01  0:00     ` Suprateeka R Hegde
2017-01-01  0:00       ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=491ac00d-e12b-746a-7b31-27726d659d8e@zytor.com \
    --to=hpa@zytor.com \
    --cc=ccoutant@gmail.com \
    --cc=gnu-gabi@sourceware.org \
    --cc=hegdesmailbox@gmail.com \
    --cc=jyknight@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).