From: Andi Kleen <ak@suse.de>

Another x86-64 fix

VIA chipsets are broken and don't work with IOMMU enabled.  For some
mysterious reason (the IOMMU logic is actually in the CPU) they manage to
corrupt all data going through the aperture to PCI devices.

There was a workaround previously that enabled the slower softmmu when VIA
is detected on the normal IOMMU path (when there is more than 3GB of
memory).  But CONFIG_IOMMU_DEBUG took a short cut that was not handled,
which ended up with VIA systems not booting when this option is enabled.

This patch enables the workaround with CONFIG_IOMMU_DEBUG/iommu=force too.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/x86_64/kernel/io_apic.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN arch/x86_64/kernel/io_apic.c~fix-x86-64-via-systems-with-iommu-debug arch/x86_64/kernel/io_apic.c
--- 25/arch/x86_64/kernel/io_apic.c~fix-x86-64-via-systems-with-iommu-debug	2004-06-13 21:09:11.976458552 -0700
+++ 25-akpm/arch/x86_64/kernel/io_apic.c	2004-06-13 21:09:11.981457792 -0700
@@ -252,7 +252,8 @@ void __init check_ioapic(void) 
 				switch (vendor) { 
 				case PCI_VENDOR_ID_VIA:
 #ifdef CONFIG_GART_IOMMU
-					if (end_pfn >= (0xffffffff>>PAGE_SHIFT) &&
+					if ((end_pfn >= (0xffffffff>>PAGE_SHIFT) ||
+					     force_iommu) &&
 					    !iommu_aperture_allowed) {
 						printk(KERN_INFO
     "Looks like a VIA chipset. Disabling IOMMU. Overwrite with \"iommu=allowed\"\n");
_