From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Alex Williamson <alex.williamson@hp.com>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
Andi Kleen <ak@suse.de>,
linux-kernel@vger.kernel.org, discuss@x86-64.org,
tglx@linutronix.de, shai@scalex86.org, y-goto@jp.fujitsu.com
Subject: Re: [discuss] Re: x86_64: 2.6.14-rc4 swiotlb broken
Date: Tue, 18 Oct 2005 16:22:03 -0700 [thread overview]
Message-ID: <20051018232203.GB4535@localhost.localdomain> (raw)
In-Reply-To: <1129675023.17545.41.camel@lts1.fc.hp.com>
On Tue, Oct 18, 2005 at 04:37:03PM -0600, Alex Williamson wrote:
> On Tue, 2005-10-18 at 16:04 -0600, Alex Williamson wrote:
>
> Nope, it breaks with a current git-2.6.14. Here's what my extra
> printk says:
>
> Node 0: 0xe000074104e67200
> Node 1: 0xe000082080722000
> Node 2: 0xe000000101532000
> Placing software IO TLB between 0x74108e68000 - 0x7410ce68000
>
Hope the following works. Using __alloc_bootmem_node now with a hard coded
goal to avoid 16MB DMA zone. It is ugly :( and hope it works this time
<fingers crossed>.
--
Patch to ensure low32 mem allocation for x86_64 swiotlb
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Index: linux-2.6.14-rc4/arch/ia64/lib/swiotlb.c
===================================================================
--- linux-2.6.14-rc4.orig/arch/ia64/lib/swiotlb.c 2005-10-18 14:14:12.000000000 -0700
+++ linux-2.6.14-rc4/arch/ia64/lib/swiotlb.c 2005-10-18 16:09:51.000000000 -0700
@@ -106,6 +106,8 @@
__setup("swiotlb=", setup_io_tlb_npages);
/* make io_tlb_overflow tunable too? */
+#define IS_LOWPAGES(paddr, size) ((paddr < 0xffffffff) && ((paddr+size) < 0xffffffff))
+
/*
* Statically reserve bounce buffer space and initialize bounce buffer data
* structures for the software IO TLB used to implement the PCI DMA API.
@@ -114,17 +116,46 @@
swiotlb_init_with_default_size (size_t default_size)
{
unsigned long i;
+ unsigned long iotlbsz;
+ int node;
if (!io_tlb_nslabs) {
io_tlb_nslabs = (default_size >> IO_TLB_SHIFT);
io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
}
+ iotlbsz = io_tlb_nslabs * (1 << IO_TLB_SHIFT);
+
/*
- * Get IO TLB memory from the low pages
+ * Get IO TLB memory from the 0-4G range
*/
- io_tlb_start = alloc_bootmem_low_pages(io_tlb_nslabs *
- (1 << IO_TLB_SHIFT));
+
+ for_each_online_node(node) {
+ /* Ugly, hate it. To be gone post 2.6.14 */
+ io_tlb_start = __alloc_bootmem_node(NODE_DATA(node),
+ iotlbsz, PAGE_SIZE,
+ 0x1000000);
+ if (io_tlb_start) {
+ if (IS_LOWPAGES(virt_to_phys(io_tlb_start), iotlbsz))
+ break;
+ free_bootmem_node(NODE_DATA(node),
+ virt_to_phys(io_tlb_start), iotlbsz);
+ io_tlb_start = NULL;
+ }
+ }
+
+ /*
+ * FIXME: This should go away when the bootmem allocator is fixed to
+ * guarantee lowmem32 allocations somehow, and the swiotlb mess is
+ * cleaned. The alloc_bootmem_low_pages fall back is to ensure
+ * boxes like amd64 which donot use swiotlb but still have
+ * swiotlb compiled in, falls back to the 2.6.13 behaviour instead
+ * of panicking, when proper low32 pages are not available
+ */
+ if (!io_tlb_start)
+ io_tlb_start = alloc_bootmem_low_pages(io_tlb_nslabs *
+ (1 << IO_TLB_SHIFT));
+
if (!io_tlb_start)
panic("Cannot allocate SWIOTLB buffer");
io_tlb_end = io_tlb_start + io_tlb_nslabs * (1 << IO_TLB_SHIFT);
next prev parent reply other threads:[~2005-10-18 23:22 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-17 9:36 Ravikiran G Thirumalai
2005-10-17 9:50 ` Andrew Morton
2005-10-17 9:53 ` Andi Kleen
2005-10-17 10:54 ` Yasunori Goto
2005-10-17 15:27 ` Linus Torvalds
2005-10-17 15:37 ` Ravikiran G Thirumalai
2005-10-17 15:40 ` Andi Kleen
2005-10-17 15:56 ` Muli Ben-Yehuda
2005-10-17 16:02 ` Andi Kleen
2005-10-17 18:53 ` [discuss] " Russell King
2005-10-17 16:02 ` Linus Torvalds
2005-10-17 16:26 ` Andi Kleen
2005-10-17 16:42 ` Linus Torvalds
2005-10-17 17:09 ` Andi Kleen
2005-10-17 17:52 ` Ravikiran G Thirumalai
2005-10-17 18:08 ` [discuss] " Andi Kleen
2005-10-17 18:27 ` Muli Ben-Yehuda
2005-10-17 18:32 ` Andi Kleen
2005-10-17 18:45 ` Muli Ben-Yehuda
2005-10-17 19:04 ` Linus Torvalds
2005-10-17 19:09 ` Andi Kleen
2005-10-17 19:15 ` Arjan van de Ven
2005-10-17 19:47 ` Ravikiran G Thirumalai
2005-10-17 23:50 ` David Lang
2005-10-18 2:29 ` Yasunori Goto
2005-10-18 3:20 ` Ravikiran G Thirumalai
2005-10-18 4:28 ` Yasunori Goto
2005-10-18 6:13 ` Ravikiran G Thirumalai
2005-10-18 10:09 ` Yasunori Goto
2005-10-18 18:51 ` Ravikiran G Thirumalai
2005-10-19 17:18 ` Jon Mason
2005-10-20 7:27 ` Andi Kleen
2005-10-17 18:38 ` Ravikiran G Thirumalai
2005-10-17 18:20 ` Christoph Lameter
2005-10-17 19:04 ` Alex Williamson
2005-10-17 19:26 ` Ravikiran G Thirumalai
2005-10-17 19:52 ` Alex Williamson
2005-10-17 15:30 ` Ravikiran G Thirumalai
2005-10-17 15:43 ` Andi Kleen
2005-10-17 20:44 ` Andrew Morton
2005-10-17 21:11 ` Linus Torvalds
2005-10-18 0:16 ` Ravikiran G Thirumalai
2005-10-18 8:23 ` Andi Kleen
2005-10-18 19:07 ` [discuss] " Ravikiran G Thirumalai
2005-10-18 15:48 ` Linus Torvalds
2005-10-18 15:50 ` Linus Torvalds
2005-10-18 19:54 ` [discuss] " Ravikiran G Thirumalai
2005-10-18 21:28 ` Alex Williamson
2005-10-18 21:53 ` Ravikiran G Thirumalai
2005-10-18 22:04 ` Alex Williamson
2005-10-18 22:37 ` Alex Williamson
2005-10-18 23:22 ` Ravikiran G Thirumalai [this message]
2005-10-19 1:22 ` Alex Williamson
2005-10-19 2:02 ` Alex Williamson
2005-10-19 12:47 ` Yasunori Goto
2005-10-19 14:19 ` Alex Williamson
2005-10-19 18:07 ` Ravikiran G Thirumalai
2005-10-19 20:45 ` Linus Torvalds
2005-10-19 22:52 ` Ravikiran G Thirumalai
2005-10-20 0:51 ` Yasunori Goto
2005-10-20 7:45 ` Andi Kleen
2005-10-18 22:47 ` Ravikiran G Thirumalai
2005-10-17 10:02 ` Muli Ben-Yehuda
2005-10-17 19:07 ` Tony Luck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051018232203.GB4535@localhost.localdomain \
--to=kiran@scalex86.org \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=alex.williamson@hp.com \
--cc=discuss@x86-64.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shai@scalex86.org \
--cc=tglx@linutronix.de \
--cc=torvalds@osdl.org \
--cc=y-goto@jp.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome