powerpc: Record vma->phys_addr in ioremap()
authorMichael Ellerman <michael@ellerman.id.au>
Sun, 28 Nov 2010 18:26:36 +0000 (18:26 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 9 Dec 2010 04:35:32 +0000 (15:35 +1100)
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?

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/pgtable_32.c
arch/powerpc/mm/pgtable_64.c

index a87ead0..71932d0 100644 (file)
@@ -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);
index 21d6dfa..88927a0 100644 (file)
@@ -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);