From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: Record vma->phys_addr in ioremap()
Date: Mon, 29 Nov 2010 15:56:53 +1100 [thread overview]
Message-ID: <1291006613.32570.288.camel@pasglop> (raw)
In-Reply-To: <e4aea657faf920a0d207e582724ccd7ef08487f1.1291004790.git.michael@ellerman.id.au>
On Mon, 2010-11-29 at 15:26 +1100, Michael Ellerman wrote:
> The vmalloc code can track the physical address of a vma, when the
> vma is used for ioremap, if set it is displayed in /proc/vmallocinfo.
>
> Because get_vm_area_caller() doesn't know it's being called for
> ioremap() it's up to the arch code to set the phys_addr. A bunch
> of other arch's do this, I'm not sure why powerpc doesn't?
Because I never noticed ? :-)
Cheers,
Ben.
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> arch/powerpc/mm/pgtable_32.c | 1 +
> arch/powerpc/mm/pgtable_64.c | 2 ++
> 2 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
> index a87ead0..71932d0 100644
> --- a/arch/powerpc/mm/pgtable_32.c
> +++ b/arch/powerpc/mm/pgtable_32.c
> @@ -230,6 +230,7 @@ __ioremap_caller(phys_addr_t addr, unsigned long size, unsigned long flags,
> area = get_vm_area_caller(size, VM_IOREMAP, caller);
> if (area == 0)
> return NULL;
> + area->phys_addr = p;
> v = (unsigned long) area->addr;
> } else {
> v = (ioremap_bot -= size);
> diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
> index 21d6dfa..88927a0 100644
> --- a/arch/powerpc/mm/pgtable_64.c
> +++ b/arch/powerpc/mm/pgtable_64.c
> @@ -223,6 +223,8 @@ void __iomem * __ioremap_caller(phys_addr_t addr, unsigned long size,
> caller);
> if (area == NULL)
> return NULL;
> +
> + area->phys_addr = paligned;
> ret = __ioremap_at(paligned, area->addr, size, flags);
> if (!ret)
> vunmap(area->addr);
next prev parent reply other threads:[~2010-11-29 4:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-29 4:26 [PATCH] powerpc: Record vma->phys_addr in ioremap() Michael Ellerman
2010-11-29 4:56 ` Benjamin Herrenschmidt [this message]
2010-11-29 5:04 ` Michael Ellerman
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=1291006613.32570.288.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
/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).