diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-01-21 02:01:43 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-25 06:52:54 -0500 |
commit | 3ca6644e5cc6ee7700b158fd5b4e8c48899118c6 (patch) | |
tree | 69a1e3f2840324d5e1b69c93423c195e7ebf2503 | |
parent | bd83fbde5b87ba230db2ffdc70af563719792db1 (diff) |
[POWERPC] Make IOMMU code safe for > 132 GB of memory
Currently the IOMMU code allocates one page for the segment table, that
isn't safe if we have more than 132 GB of RAM.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index 7f45d59cdf2a..eb2a94b0dc4c 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -310,8 +310,8 @@ static void cell_iommu_setup_hardware(struct cbe_iommu *iommu, unsigned long siz | |||
310 | { | 310 | { |
311 | struct page *page; | 311 | struct page *page; |
312 | int ret, i; | 312 | int ret, i; |
313 | unsigned long reg, segments, pages_per_segment, ptab_size, n_pte_pages; | 313 | unsigned long reg, segments, pages_per_segment, ptab_size, stab_size, |
314 | unsigned long xlate_base; | 314 | n_pte_pages, xlate_base; |
315 | unsigned int virq; | 315 | unsigned int virq; |
316 | 316 | ||
317 | if (cell_iommu_find_ioc(iommu->nid, &xlate_base)) | 317 | if (cell_iommu_find_ioc(iommu->nid, &xlate_base)) |
@@ -328,7 +328,8 @@ static void cell_iommu_setup_hardware(struct cbe_iommu *iommu, unsigned long siz | |||
328 | __FUNCTION__, iommu->nid, segments, pages_per_segment); | 328 | __FUNCTION__, iommu->nid, segments, pages_per_segment); |
329 | 329 | ||
330 | /* set up the segment table */ | 330 | /* set up the segment table */ |
331 | page = alloc_pages_node(iommu->nid, GFP_KERNEL, 0); | 331 | stab_size = segments * sizeof(unsigned long); |
332 | page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(stab_size)); | ||
332 | BUG_ON(!page); | 333 | BUG_ON(!page); |
333 | iommu->stab = page_address(page); | 334 | iommu->stab = page_address(page); |
334 | clear_page(iommu->stab); | 335 | clear_page(iommu->stab); |