* The MAX high_addr for `mmap` on PPC64
@ 2012-08-29 3:34 madper
2012-08-29 3:42 ` David Gibson
0 siblings, 1 reply; 4+ messages in thread
From: madper @ 2012-08-29 3:34 UTC (permalink / raw)
To: linuxppc-dev
Hi every one,
I use the ltp (Linux-Test-Project) and run it on both ppc64 and x86_64.
There is a code like follows in
`ltp/testcase/kernel/mem/hugetbl/hugemmap/hugemmap03.c`:
`code`
#define HIGH_ADDR (void *)(0x1000000000000)
/* Attempt to mmap into highmem addr, should get ENOMEM */
addr = mmap(HIGH_ADDR, map_sz, PROT_READ,
MAP_SHARED | MAP_FIXED, fildes, 0);
`code ends`
It return ENOMEM on x86_64 as well as we expected. But return EINVAL
on ppc64. So I want to know the MAX high addr for PPC64.
--
Thanks,
Madper Xie.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: The MAX high_addr for `mmap` on PPC64
2012-08-29 3:34 The MAX high_addr for `mmap` on PPC64 madper
@ 2012-08-29 3:42 ` David Gibson
2012-08-29 3:57 ` madper
0 siblings, 1 reply; 4+ messages in thread
From: David Gibson @ 2012-08-29 3:42 UTC (permalink / raw)
To: madper; +Cc: linuxppc-dev
On Wed, Aug 29, 2012 at 11:34:08AM +0800, madper wrote:
> Hi every one,
> I use the ltp (Linux-Test-Project) and run it on both ppc64 and x86_64.
> There is a code like follows in
> `ltp/testcase/kernel/mem/hugetbl/hugemmap/hugemmap03.c`:
> `code`
> #define HIGH_ADDR (void *)(0x1000000000000)
> /* Attempt to mmap into highmem addr, should get ENOMEM */
> addr = mmap(HIGH_ADDR, map_sz, PROT_READ,
> MAP_SHARED | MAP_FIXED, fildes, 0);
> `code ends`
> It return ENOMEM on x86_64 as well as we expected. But return
> EINVAL on ppc64. So I want to know the MAX high addr for PPC64.
That's a pretty bogus test, since the max address is not specified
strictly. It's currently 4T on ppc64, but patches that are in the
works will change it to 16T.
Also I'm not convinced that "highmem addr" has any meaning in the
context of userspace addresses.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: The MAX high_addr for `mmap` on PPC64
2012-08-29 3:42 ` David Gibson
@ 2012-08-29 3:57 ` madper
2012-08-29 23:39 ` David Gibson
0 siblings, 1 reply; 4+ messages in thread
From: madper @ 2012-08-29 3:57 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev@lists.ozlabs.org
On Wed, 29 Aug 2012 11:42:58 +0800, David Gibson
<david@gibson.dropbear.id.au> wrote:
> On Wed, Aug 29, 2012 at 11:34:08AM +0800, madper wrote:
>> Hi every one,
>> I use the ltp (Linux-Test-Project) and run it on both ppc64 and
>> x86_64.
>> There is a code like follows in
>> `ltp/testcase/kernel/mem/hugetbl/hugemmap/hugemmap03.c`:
>> `code`
>> #define HIGH_ADDR (void *)(0x1000000000000)
>> /* Attempt to mmap into highmem addr, should get ENOMEM */
>> addr = mmap(HIGH_ADDR, map_sz, PROT_READ,
>> MAP_SHARED | MAP_FIXED, fildes, 0);
>> `code ends`
>> It return ENOMEM on x86_64 as well as we expected. But return
>> EINVAL on ppc64. So I want to know the MAX high addr for PPC64.
>
> That's a pretty bogus test, since the max address is not specified
> strictly. It's currently 4T on ppc64, but patches that are in the
> works will change it to 16T.
>
Hi, I tested it for rhel6. Also I change the high_addr to `0x7ffffffffff`
but it got EINVAL again.
So, I nearly certain that rhel6 can only support for 4T.
So, do you think that I should change the high_addr to `0x3ffffffffff`?
> Also I'm not convinced that "highmem addr" has any meaning in the
> context of userspace addresses.
>
I think may be the coder want to test kernel by userspace program? :-(
Thank you very very much, David.
--
Thanks,
Madper Xie.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: The MAX high_addr for `mmap` on PPC64
2012-08-29 3:57 ` madper
@ 2012-08-29 23:39 ` David Gibson
0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2012-08-29 23:39 UTC (permalink / raw)
To: madper; +Cc: linuxppc-dev@lists.ozlabs.org
On Wed, Aug 29, 2012 at 11:57:06AM +0800, madper wrote:
> On Wed, 29 Aug 2012 11:42:58 +0800, David Gibson
> <david@gibson.dropbear.id.au> wrote:
>
> >On Wed, Aug 29, 2012 at 11:34:08AM +0800, madper wrote:
> >>Hi every one,
> >> I use the ltp (Linux-Test-Project) and run it on both ppc64
> >>and x86_64.
> >> There is a code like follows in
> >>`ltp/testcase/kernel/mem/hugetbl/hugemmap/hugemmap03.c`:
> >>`code`
> >> #define HIGH_ADDR (void *)(0x1000000000000)
> >> /* Attempt to mmap into highmem addr, should get ENOMEM */
> >> addr = mmap(HIGH_ADDR, map_sz, PROT_READ,
> >> MAP_SHARED | MAP_FIXED, fildes, 0);
> >>`code ends`
> >> It return ENOMEM on x86_64 as well as we expected. But return
> >>EINVAL on ppc64. So I want to know the MAX high addr for PPC64.
> >
> >That's a pretty bogus test, since the max address is not specified
> >strictly. It's currently 4T on ppc64, but patches that are in the
> >works will change it to 16T.
> >
> Hi, I tested it for rhel6. Also I change the high_addr to
> `0x7ffffffffff` but it got EINVAL again.
0x7ffffffffff is not page aligned, so it probably should get EINVAL.
That said, it wouldn't surprise me if we got the wront error code for
address space overflows.
> So, I nearly certain that rhel6 can only support for 4T.
> So, do you think that I should change the high_addr to `0x3ffffffffff`?
>
> >Also I'm not convinced that "highmem addr" has any meaning in the
> >context of userspace addresses.
> >
> I think may be the coder want to test kernel by userspace program? :-(
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-29 23:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-29 3:34 The MAX high_addr for `mmap` on PPC64 madper
2012-08-29 3:42 ` David Gibson
2012-08-29 3:57 ` madper
2012-08-29 23:39 ` David Gibson
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 NNTP newsgroup(s).