* [PATCH] ppc64: Add iommu=on for enabling DART on small-mem machines
@ 2004-02-27 21:51 olof
[not found] ` <Pine.A41.4.44.0402271524190.43108-100000@forte.austin.ibm.com.suse.lists.linux.kernel>
0 siblings, 1 reply; 5+ messages in thread
From: olof @ 2004-02-27 21:51 UTC (permalink / raw)
To: torvalds; +Cc: benh, linux-kernel, linuxppc64-dev
Linus,
Below patch makes it possible for people like me with a small-mem G5 to
enable the DART. I see two reasons for wanting to do so:
1. To debug/test DART/iommu code itself (small audience, including
myself).
2. To debug drivers on small-mem machines, since bad pci_map*() usage will
be punished (possibly larger audience).
Thanks,
-Olof
===== arch/ppc64/kernel/prom.c 1.56 vs edited =====
--- 1.56/arch/ppc64/kernel/prom.c Fri Feb 27 16:44:57 2004
+++ edited/arch/ppc64/kernel/prom.c Fri Feb 27 15:48:10 2004
@@ -516,6 +516,9 @@
return mem;
}
+#ifdef CONFIG_PMAC_DART
+static int dart_force_on;
+#endif
static unsigned long __init
prom_initialize_lmb(unsigned long mem)
@@ -539,10 +542,12 @@
prom_print(opt);
prom_print(RELOC("\n"));
opt += 6;
- while(*opt && *opt == ' ')
+ while (*opt && *opt == ' ')
opt++;
if (!strncmp(opt, RELOC("off"), 3))
nodart = 1;
+ else if (!strncmp(opt, RELOC("on"), 2))
+ RELOC(dart_force_on) = 1;
}
#else
nodart = 1;
@@ -763,8 +768,10 @@
extern unsigned long dart_tablebase;
extern unsigned long dart_tablesize;
- /* Only reserve DART space if machine has more than 2Gb of RAM */
- if (lmb_end_of_DRAM() <= 0x80000000ull)
+ /* Only reserve DART space if machine has more than 2GB of RAM
+ * or if requested with iommu=on on cmdline.
+ */
+ if (lmb_end_of_DRAM() <= 0x80000000ull && !RELOC(dart_force_on))
return;
/* 512 pages is max DART tablesize. */
Olof Johansson Office: 4E002/905
Linux on Power Development IBM Systems Group
Email: olof@austin.ibm.com Phone: 512-838-9858
All opinions are my own and not those of IBM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ppc64: Add iommu=on for enabling DART on small-mem machines
[not found] ` <Pine.A41.4.44.0402271524190.43108-100000@forte.austin.ibm.com.suse.lists.linux.kernel>
@ 2004-02-28 12:52 ` Andi Kleen
2004-02-28 14:19 ` Olof Johansson
0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2004-02-28 12:52 UTC (permalink / raw)
To: olof; +Cc: torvalds, benh, linux-kernel, linuxppc64-dev
olof@austin.ibm.com writes:
> Linus,
>
> Below patch makes it possible for people like me with a small-mem G5 to
> enable the DART. I see two reasons for wanting to do so:
Could you call it iommu=force ?
It would be the same name as on x86-64 for the same thing then and
a consistent name may be easier to get to driver developers.
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ppc64: Add iommu=on for enabling DART on small-mem machines
2004-02-28 12:52 ` Andi Kleen
@ 2004-02-28 14:19 ` Olof Johansson
2004-02-29 5:53 ` Mike Fedyk
0 siblings, 1 reply; 5+ messages in thread
From: Olof Johansson @ 2004-02-28 14:19 UTC (permalink / raw)
To: Andi Kleen; +Cc: torvalds, benh, linux-kernel, linuxppc64-dev
On 28 Feb 2004, Andi Kleen wrote:
> olof@austin.ibm.com writes:
>
> > Below patch makes it possible for people like me with a small-mem G5 to
> > enable the DART. I see two reasons for wanting to do so:
>
> Could you call it iommu=force ?
>
> It would be the same name as on x86-64 for the same thing then and
> a consistent name may be easier to get to driver developers.
Ack! I was wavering between the two options and finally went with =on. :)
Either way is fine with me.
-Olof
Olof Johansson Office: 4E002/905
Linux on Power Development IBM Systems Group
Email: olof@austin.ibm.com Phone: 512-838-9858
All opinions are my own and not those of IBM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ppc64: Add iommu=on for enabling DART on small-mem machines
2004-02-28 14:19 ` Olof Johansson
@ 2004-02-29 5:53 ` Mike Fedyk
2004-02-29 6:26 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 5+ messages in thread
From: Mike Fedyk @ 2004-02-29 5:53 UTC (permalink / raw)
To: Olof Johansson; +Cc: Andi Kleen, torvalds, benh, linux-kernel, linuxppc64-dev
Olof Johansson wrote:
> On 28 Feb 2004, Andi Kleen wrote:
>
>
>>olof@austin.ibm.com writes:
>>
>>
>>>Below patch makes it possible for people like me with a small-mem G5 to
>>>enable the DART. I see two reasons for wanting to do so:
>>
>>Could you call it iommu=force ?
>>
>>It would be the same name as on x86-64 for the same thing then and
>>a consistent name may be easier to get to driver developers.
>
>
>
> Ack! I was wavering between the two options and finally went with =on. :)
> Either way is fine with me.
And maybe even some generic code? :-D
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ppc64: Add iommu=on for enabling DART on small-mem machines
2004-02-29 5:53 ` Mike Fedyk
@ 2004-02-29 6:26 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2004-02-29 6:26 UTC (permalink / raw)
To: Mike Fedyk
Cc: Olof Johansson, Andi Kleen, Linus Torvalds, Linux Kernel list,
linuxppc64-dev
> And maybe even some generic code? :-D
No. It's not possible, at least not at this point. The decision of
allocating the DART space or not (and thus eventually stripping the
max available memory) is done very early. So early that the kernel
isn't yet running at it's link location ;) So the kind of code we
can actually run at this point is limited, with various tweaks to
deal with the relocation issue.
It's not very pretty, I hope we can improve that later, but that
is not something that will happen in the upcoming weeks .
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-02-29 6:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-27 21:51 [PATCH] ppc64: Add iommu=on for enabling DART on small-mem machines olof
[not found] ` <Pine.A41.4.44.0402271524190.43108-100000@forte.austin.ibm.com.suse.lists.linux.kernel>
2004-02-28 12:52 ` Andi Kleen
2004-02-28 14:19 ` Olof Johansson
2004-02-29 5:53 ` Mike Fedyk
2004-02-29 6:26 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox