* [PATCH] Make IOMMU code safe for > 132 GB of memory
@ 2008-01-21 7:01 Michael Ellerman
2008-01-22 3:20 ` Jeremy Kerr
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2008-01-21 7:01 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Arnd Bergmann, Jeremy Kerr
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>
---
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 7f45d59..eb2a94b 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
{
struct page *page;
int ret, i;
- unsigned long reg, segments, pages_per_segment, ptab_size, n_pte_pages;
- unsigned long xlate_base;
+ unsigned long reg, segments, pages_per_segment, ptab_size, stab_size,
+ n_pte_pages, xlate_base;
unsigned int virq;
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
__FUNCTION__, iommu->nid, segments, pages_per_segment);
/* set up the segment table */
- page = alloc_pages_node(iommu->nid, GFP_KERNEL, 0);
+ stab_size = segments * sizeof(unsigned long);
+ page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(stab_size));
BUG_ON(!page);
iommu->stab = page_address(page);
clear_page(iommu->stab);
--
1.5.2.rc1.1884.g59b20
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Make IOMMU code safe for > 132 GB of memory
2008-01-21 7:01 [PATCH] Make IOMMU code safe for > 132 GB of memory Michael Ellerman
@ 2008-01-22 3:20 ` Jeremy Kerr
2008-01-22 4:42 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Kerr @ 2008-01-22 3:20 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Arnd Bergmann
> 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>
Can I have a Cell machine with > 132GB of RAM? :D
Jeremy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Make IOMMU code safe for > 132 GB of memory
2008-01-22 3:20 ` Jeremy Kerr
@ 2008-01-22 4:42 ` Michael Ellerman
0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2008-01-22 4:42 UTC (permalink / raw)
To: Jeremy Kerr; +Cc: linuxppc-dev, Arnd Bergmann
[-- Attachment #1: Type: text/plain, Size: 709 bytes --]
On Tue, 2008-01-22 at 14:20 +1100, Jeremy Kerr wrote:
> > 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>
>
> Can I have a Cell machine with > 132GB of RAM? :D
I have one under my desk, but I need it to warm my feet, otherwise I
could give it to you.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-22 4:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21 7:01 [PATCH] Make IOMMU code safe for > 132 GB of memory Michael Ellerman
2008-01-22 3:20 ` Jeremy Kerr
2008-01-22 4:42 ` Michael Ellerman
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).