public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Chris Wright <chrisw@redhat.com>,
	tony.luck@intel.com, linux-ia64@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	iommu@lists.linux-foundation.org, akpm@linux-foundation.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v2] IA64 Compilation Error Fix for Intel IOMMU Identity Mapping Support
Date: Fri, 26 Jun 2009 17:03:47 -0700	[thread overview]
Message-ID: <20090627000347.GH6729@sequoia.sous-sol.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0906261213400.6967@twosheds.infradead.org>

* David Woodhouse (dwmw2@infradead.org) wrote:
> On Thu, 25 Jun 2009, Chris Wright wrote:
> 
> > * Linus Torvalds (torvalds@linux-foundation.org) wrote:
> >> Ok. Sounds like what I want is to get this patch through the ia64 people,
> >> after it has gotten some testing there. Since ia64 is where the current
> >> kernel fails anyway, that sounds like the motivation will be there too.
> >
> > Yup, I agree.
> 
> Tony, please could you test what's in git://git.infradead.org/iommu-2.6.git
> 
> It builds, but we'd like to check that it works correctly with iommu=pt on 
> IA64.

In the meantime, I booted this on an IA-64 box (w/out VT-d), forced it
to call intel_iommu_init() as if it had an IOMMU, and added a small bit
of debugging.  Looks like it's doing the right thing.

efi based
e000000001000000-e000000078000000
e00000007c000000-e00000007e990000
e00000007f300000-e00000007fda0000
e000000100000000-e00000047b7f0000
e00000047f800000-e00000047fdc0000
e00000047fe80000-e00000047ffb0000
zone based
1000000-100000000
100000000-47ffb0000
online node based
1000000-78000000
7c000000-7e990000
7f300000-7fda0000
100000000-47b7f0000
47f800000-47fdc0000
47fe80000-47ffb0000

The efi based mem walker is returning virtual addresses, Fenghua did
you test that one?  I'm surprised it worked.

This is quite similar to the type of output I see on x86_64 (except the
e820 map gives phys addrs, of course).

e820 based
10000-9d800
100000-bf341000
bf67e000-bf800000
100000000-340000000
zone based
10000-1000000
1000000-100000000
100000000-1c0000000
1c0000000-340000000
online node based
10000-9d000
100000-bf341000
bf67e000-bf800000
100000000-1c0000000
1c0000000-340000000

thanks,
-chris
---
debug patch for the really bored...

Index: linus-2.6/drivers/pci/intel-iommu.c
===================================================================
--- linus-2.6.orig/drivers/pci/intel-iommu.c
+++ linus-2.6/drivers/pci/intel-iommu.c
@@ -3110,10 +3110,66 @@ static int __init init_iommu_sysfs(void)
 }
 #endif	/* CONFIG_PM */
 
+#ifdef CONFIG_X86
+#include <asm/e820.h>
+static void __init print_memmap(void)
+{
+	int i;
+	printk("e820 based\n");
+	for (i = 0; i < e820.nr_map; i++) {
+		struct e820entry *ei = &e820.map[i];
+
+		if (ei->type == E820_RAM)
+			printk("%llx-%llx\n", ei->addr, ei->addr + ei->size);
+	}
+}
+#elif CONFIG_IA64
+#include <linux/efi.h>
+static int __init efi_print_map(u64 start, u64 end, void *unused)
+{
+	printk("%llx-%llx\n", start, end);
+	return 0;
+}
+
+static void __init print_memmap(void)
+{
+	printk("efi based\n");
+	efi_memmap_walk(efi_print_map, NULL);
+}
+#endif
+
+static int __init print_region(unsigned long start_pfn, unsigned long end_pfn,
+			       void *unused)
+{
+	printk("%lx-%lx\n", start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT);
+	return 0;
+}
+
+static void __init show_mem_regions(void)
+{
+	int  nid;
+	struct zone *zone;
+
+	print_memmap();
+	printk("zone based\n");
+	for_each_populated_zone(zone) {
+		unsigned long zone_end_pfn = zone->zone_start_pfn +
+					     zone->spanned_pages;
+		printk("%lx-%lx\n", zone->zone_start_pfn << PAGE_SHIFT,
+				    zone_end_pfn << PAGE_SHIFT);
+	}
+
+	printk("online node based\n");
+	for_each_online_node(nid)
+		work_with_active_regions(nid, print_region, NULL);
+}
+
 int __init intel_iommu_init(void)
 {
 	int ret = 0;
 
+	show_mem_regions();
+
 	if (dmar_table_init())
 		return 	-ENODEV;
 
Index: linus-2.6/arch/ia64/kernel/pci-dma.c
===================================================================
--- linus-2.6.orig/arch/ia64/kernel/pci-dma.c
+++ linus-2.6/arch/ia64/kernel/pci-dma.c
@@ -47,7 +47,7 @@ extern struct dma_map_ops intel_dma_ops;
 
 static int __init pci_iommu_init(void)
 {
-	if (iommu_detected)
+//	if (iommu_detected)
 		intel_iommu_init();
 
 	return 0;

  reply	other threads:[~2009-06-27  0:05 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090327212241.234500000@intel.com>
2009-03-28 14:24 ` [patch 0/4] Intel IOMMU Supspend/Resume Support Andrew Lutomirski
2009-03-30 23:01 ` David Woodhouse
     [not found] ` <20090327212321.520992000@intel.com>
2009-04-03 12:37   ` [patch 4/4] Intel IOMMU Suspend/Resume Support - Code Clean Up David Woodhouse
     [not found] ` <20090327212321.070229000@intel.com>
2009-04-16  0:19   ` [PATCH] Intel IOMMU Pass Through Support Fenghua Yu
2009-04-16  2:13     ` Han, Weidong
2009-04-19 10:05     ` David Woodhouse
2009-04-20 17:27       ` Yu, Fenghua
2009-05-13 23:13         ` [PATCH] Fix Intel IOMMU Compilation Warnings on IA64 Fenghua Yu
2009-05-14 15:17           ` David Woodhouse
2009-05-14 15:31             ` Matthew Wilcox
2009-05-14 17:59             ` Fenghua Yu
2009-06-18 18:05               ` [PATCH 1/2] IOMMU Identity Mapping Support: iommu_identity_mapping definition Fenghua Yu
2009-06-18 18:08                 ` Muli Ben-Yehuda
2009-06-18 18:13                   ` Chris Wright
2009-06-18 18:14                   ` Yu, Fenghua
2009-06-18 18:25                     ` Muli Ben-Yehuda
2009-06-18 18:31                       ` Chris Wright
2009-06-18 18:41                         ` Muli Ben-Yehuda
2009-06-18 18:50                           ` Yu, Fenghua
2009-06-18 18:51                           ` Chris Wright
2009-06-18 19:09                             ` Yu, Fenghua
2009-06-25  0:38                     ` [PATCH] IA64 Compilation Error Fix for Intel IOMMU Identity Mapping Support Fenghua Yu
2009-06-25  1:00                       ` FUJITA Tomonori
2009-06-25  4:16                         ` [PATCH v2] " Fenghua Yu
2009-06-25  4:48                           ` FUJITA Tomonori
2009-06-25  7:11                             ` David Woodhouse
2009-06-25 21:52                               ` David Woodhouse
2009-06-25 21:56                                 ` Yu, Fenghua
2009-06-26 18:21                                   ` David Woodhouse
2009-06-25 22:00                                 ` Linus Torvalds
2009-06-25 22:46                                   ` Tony Luck
2009-06-25 23:43                                 ` Chris Wright
2009-06-26  1:35                                   ` Linus Torvalds
2009-06-26  1:52                                     ` Chris Wright
2009-06-26  2:00                                       ` Linus Torvalds
2009-06-26  2:08                                         ` Chris Wright
2009-06-26 11:15                                           ` David Woodhouse
2009-06-27  0:03                                             ` Chris Wright [this message]
2009-06-27 11:44                                         ` David Woodhouse
2009-06-18 18:13                 ` [PATCH 1/2] IOMMU Identity Mapping Support: iommu_identity_mapping definition Chris Wright
2009-06-18 18:28                   ` Yu, Fenghua
2009-06-18 18:34                     ` Chris Wright
2009-07-04 18:40                   ` David Woodhouse
2009-05-20 17:42         ` [PATCH] Time out for possible dead loops during queued invalidation wait Fenghua Yu
2009-05-27  5:51           ` Andrew Morton
2009-05-27 22:40             ` Yu, Fenghua
2009-05-27 22:48               ` Andrew Morton
2009-05-27 23:25                 ` Yu, Fenghua
2009-05-27 23:51                   ` Andrew Morton
2009-05-28  0:47                     ` Yu, Fenghua
2009-06-18 18:05               ` [PATCH 2/2] IOMMU Identity Mapping Support: Intel IOMMU implementation Fenghua Yu
2009-06-18 19:15                 ` Chris Wright
2009-06-18 19:40                   ` Yu, Fenghua
2009-06-18 20:02                     ` Chris Wright
2009-06-19 20:47                     ` [PATCH v2] IOMMU Identity Mapping Support (drivers/pci/intel_iommu.c) Fenghua Yu
2009-04-30 23:29     ` [PATCH] Intel IOMMU Pass Through Support Andrew Morton
2009-04-30 23:37       ` Randy Dunlap
2009-05-01  0:00         ` Andrew Morton
2009-05-01  0:57           ` Fenghua Yu
2009-05-01  0:05         ` Fenghua Yu
2009-05-01  0:14           ` Andrew Morton

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=20090627000347.GH6729@sequoia.sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=akpm@linux-foundation.org \
    --cc=chrisw@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    /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