public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: bcrl@kvack.org, klibc@zytor.com, linux-kernel@vger.kernel.org
Subject: Re: sys_mmap2 on different architectures
Date: Wed, 22 Feb 2006 16:59:04 -0800	[thread overview]
Message-ID: <43FD08D8.70300@zytor.com> (raw)
In-Reply-To: <20060222.164347.12864037.davem@davemloft.net>

David S. Miller wrote:
> From: Benjamin LaHaise <bcrl@kvack.org>
> Date: Wed, 22 Feb 2006 19:14:11 -0500
> 
> 
>>The sys_mmap2() ABI is that the page shift is always fixed to whatever 
>>page size is reasonable for the architecture, typically 2^12.  The syscall 
>>should never be exposed as mmap2(), only as the large file size version 
>>of mmap() (aka mmap64()).  The other consideration is that it should not 
>>be implemented in 64 bit ABIs, as those machines should be using a 64 bit 
>>native mmap().  Does that clear things up a bit?  Cheers,
> 
> 
> Aha, that part I didn't catch.  Thanks for the clarification
> Ben.
> 
> I wonder why we did things that way with a fixed shift...

Except the above doesn't seem to match reality on anything other than 
SPARC, and the architectures where the shift is 12 anyway because that's 
the only pagesize supported.

On the other hand, sys32_mmap2 on SPARC64 matches the SPARC32 sys_mmap2 
in that the shift is hard-coded to 12:

         .globl          sys32_mmap2
sys32_mmap2:
         sethi           %hi(sys_mmap), %g1
         jmpl            %g1 + %lo(sys_mmap), %g0
          sllx           %o5, 12, %o5


At this point, I'm more than willing to treat SPARC as a special case, 
but I really want to know what the rules actually _ARE_ as opposed to 
what they are supposed to be (which they clearly are not.)

	-hpa

  reply	other threads:[~2006-02-23  0:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-22 21:45 sys_mmap2 on different architectures H. Peter Anvin
2006-02-22 21:54 ` David S. Miller
2006-02-22 22:00   ` H. Peter Anvin
2006-02-23  0:05   ` H. Peter Anvin
2006-02-23  0:40     ` David S. Miller
2006-02-23  0:41     ` David S. Miller
2006-02-23  0:14 ` Benjamin LaHaise
2006-02-23  0:22   ` H. Peter Anvin
2006-02-23  0:43   ` David S. Miller
2006-02-23  0:59     ` H. Peter Anvin [this message]
2006-02-23  1:03       ` David S. Miller
2006-02-23  1:06         ` H. Peter Anvin
2006-02-23 17:39     ` Benjamin LaHaise
2006-02-23 17:47       ` H. Peter Anvin
2006-02-23  2:56 ` Paul Mackerras
2006-02-23  3:35   ` H. Peter Anvin
2006-02-23 17:32     ` Ralf Baechle
2006-02-23 17:43       ` 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=43FD08D8.70300@zytor.com \
    --to=hpa@zytor.com \
    --cc=bcrl@kvack.org \
    --cc=davem@davemloft.net \
    --cc=klibc@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /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