Re: [PATCH 14 of 33] IB/ipath - fix port sharing on powerpc

From: Roland Dreier
Date: Mon Mar 19 2007 - 17:27:46 EST


> The port sharing feature mixed kernel virtual addresses as well as
> physical addresses for the offset used to describe the mmap address to map
> the InfiniPath hardware into user space. This had a conflict on powerpc.
> The new scheme converts it to a physical address so it doesn't conflict
> with chip addresses and yet still fits in 40/44 bits so it isn't truncated
> by 32-bit applications calling mmap64().

> +/*
> + * Convert kernel virtual addresses to physical addresses so they don't
> + * potentially conflict with the chip addresses used as mmap offsets.
> + * It doesn't really matter what mmap offset we use as long as we can
> + * interpret it correctly.
> + */

> + paddr = page_to_pfn(page) << PAGE_SHIFT;
> +
> + return paddr;

what guarantee is there that physical addresses fit into any number
of bits? Couldn't I have a NUMA system or something that puts
physical memory starting at an offset of 1 << 48 or whatever?

- R.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/