From: Josh Boyer <jwboyer@linux.vnet.ibm.com>
To: vb <vb@vsbe.com>
Cc: Roland Dreier <rdreier@cisco.com>, Arnd Bergmann <arnd@arndb.de>,
linuxppc-embedded@ozlabs.org
Subject: Re: mmap and ppc460gt
Date: Thu, 28 Aug 2008 06:36:44 -0400 [thread overview]
Message-ID: <20080828063644.2ee4cf7c@zod.rchland.ibm.com> (raw)
In-Reply-To: <f608b67d0808272047i1c455c8bsb820d61bd8051bcf@mail.gmail.com>
On Wed, 27 Aug 2008 20:47:24 -0700
vb <vb@vsbe.com> wrote:
> On Wed, Aug 27, 2008 at 8:12 PM, Roland Dreier <rdreier@cisco.com> wrote:
> > OK, please try this and let me know if it helps:
> >
> > diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> > index 1c93c25..98d7bf9 100644
> > --- a/arch/powerpc/mm/mem.c
> > +++ b/arch/powerpc/mm/mem.c
> > @@ -75,11 +75,10 @@ static inline pte_t *virt_to_kpte(unsigned long vaddr)
> >
> > int page_is_ram(unsigned long pfn)
> > {
> > - unsigned long paddr = (pfn << PAGE_SHIFT);
> > -
> > #ifndef CONFIG_PPC64 /* XXX for now */
> > - return paddr < __pa(high_memory);
> > + return pfn < max_pfn;
> > #else
> > + unsigned long paddr = (pfn << PAGE_SHIFT);
> > int i;
> > for (i=0; i < lmb.memory.cnt; i++) {
> > unsigned long base;
> >
>
> Ronald, thank you for the hint, I actually tried something slightly different:
>
> return pfn < (__pa(high_memory) >> PAGE_SHIFT);
>
> and it worked. I guess your fix is faster, I'll try it tomorrow.
>
> I also checked that the problem is there in the top of the tree in
> Linus' git - isn't it amazing - I guess very few people use mmap()
> nowadays, everybody must be using UIO device :-)
No, most people use device drivers in the kernel.
josh
next prev parent reply other threads:[~2008-08-28 10:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 2:26 mmap and ppc460gt vb
2008-08-27 3:24 ` Roland Dreier
2008-08-27 8:13 ` Arnd Bergmann
2008-08-27 23:13 ` vb
2008-08-28 0:11 ` Roland Dreier
2008-08-28 0:21 ` vb
2008-08-28 3:12 ` Roland Dreier
2008-08-28 3:47 ` vb
2008-08-28 10:36 ` Josh Boyer [this message]
2008-08-30 3:39 ` [PATCH] powerpc: Avoid integer overflow in page_is_ram() Roland Dreier
2008-09-01 0:27 ` Benjamin Herrenschmidt
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=20080828063644.2ee4cf7c@zod.rchland.ibm.com \
--to=jwboyer@linux.vnet.ibm.com \
--cc=arnd@arndb.de \
--cc=linuxppc-embedded@ozlabs.org \
--cc=rdreier@cisco.com \
--cc=vb@vsbe.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 NNTP newsgroup(s).