--- /dev/null
+From joerg.roedel@amd.com Mon Jan 12 16:38:30 2009
+From: Joerg Roedel <joerg.roedel@amd.com>
+Date: Fri, 19 Dec 2008 14:42:13 +0100
+Subject: AMD IOMMU: allocate rlookup_table with __GFP_ZERO
+To: stable@kernel.org
+Cc: Joerg Roedel <joerg.roedel@amd.com>
+Message-ID: <1229694135-27157-3-git-send-email-joerg.roedel@amd.com>
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+Upstream commit 83fd5cc6481c6b7fa8b45f8a7e0aa7120213430b
+
+This is pointer list and if we dereference an uninitialized pointer
+later this results in a kernel crash at boot. Happens typically after
+3-5 hours of rebooting.
+
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/amd_iommu_init.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/amd_iommu_init.c
++++ b/arch/x86/kernel/amd_iommu_init.c
+@@ -930,7 +930,8 @@ int __init amd_iommu_init(void)
+ goto free;
+
+ /* IOMMU rlookup table - find the IOMMU for a specific device */
+- amd_iommu_rlookup_table = (void *)__get_free_pages(GFP_KERNEL,
++ amd_iommu_rlookup_table = (void *)__get_free_pages(
++ GFP_KERNEL | __GFP_ZERO,
+ get_order(rlookup_table_size));
+ if (amd_iommu_rlookup_table == NULL)
+ goto free;
--- /dev/null
+From joerg.roedel@amd.com Mon Jan 12 16:39:41 2009
+From: Joerg Roedel <joerg.roedel@amd.com>
+Date: Fri, 19 Dec 2008 14:42:15 +0100
+Subject: AMD IOMMU: fix wrong loop counter in free_pagetables
+To: stable@kernel.org
+Cc: Joerg Roedel <joerg.roedel@amd.com>
+Message-ID: <1229694135-27157-5-git-send-email-joerg.roedel@amd.com>
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+Upstream commit 3cc3d84bffbd93bdb671ac7961b12cd98fbb9266
+
+This fixes a bug which causes the driver to go in an endless loop if
+initialization fails and its resources are freed.
+
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/amd_iommu.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/amd_iommu.c
++++ b/arch/x86/kernel/amd_iommu.c
+@@ -487,7 +487,7 @@ static void dma_ops_free_pagetable(struc
+ continue;
+
+ p2 = IOMMU_PTE_PAGE(p1[i]);
+- for (j = 0; j < 512; ++i) {
++ for (j = 0; j < 512; ++j) {
+ if (!IOMMU_PTE_PRESENT(p2[j]))
+ continue;
+ p3 = IOMMU_PTE_PAGE(p2[j]);
--- /dev/null
+From joerg.roedel@amd.com Mon Jan 12 16:38:59 2009
+From: Joerg Roedel <joerg.roedel@amd.com>
+Date: Fri, 19 Dec 2008 14:42:14 +0100
+Subject: AMD IOMMU: initialize phys_addr correctly in iommu_page_map
+To: stable@kernel.org
+Cc: Joerg Roedel <joerg.roedel@amd.com>
+Message-ID: <1229694135-27157-4-git-send-email-joerg.roedel@amd.com>
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+Upstream commit bb9d4ff80bc032d7961815c2ff5eaf458ae3adff
+
+Due to this bug mappings for devices requested by the ACPI table are
+incorrect.
+
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/amd_iommu.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/amd_iommu.c
++++ b/arch/x86/kernel/amd_iommu.c
+@@ -235,7 +235,7 @@ static int iommu_map(struct protection_d
+ u64 __pte, *pte, *page;
+
+ bus_addr = PAGE_ALIGN(bus_addr);
+- phys_addr = PAGE_ALIGN(bus_addr);
++ phys_addr = PAGE_ALIGN(phys_addr);
+
+ /* only support 512GB address spaces for now */
+ if (bus_addr > IOMMU_MAP_SIZE_L3 || !(prot & IOMMU_PROT_MASK))
--- /dev/null
+From joerg.roedel@amd.com Mon Jan 12 16:37:00 2009
+From: Joerg Roedel <joerg.roedel@amd.com>
+Date: Fri, 19 Dec 2008 14:42:12 +0100
+Subject: AMD IOMMU: reset command buffer pointers manually
+To: stable@kernel.org
+Cc: Joerg Roedel <joerg.roedel@amd.com>
+Message-ID: <1229694135-27157-2-git-send-email-joerg.roedel@amd.com>
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+Upstream commit cf558d25e5c9f70fa0279c9b7b8b4aed7cae9bd4
+
+Under special circumstances the IOMMU does not reset the head and tail
+pointer of its command ringbuffer to zero when the command base is
+written. This causes the IOMMU to fetch random memory and executes it as
+an command. Since these commands are likely illegal IOMMU stops fetching
+further commands including IOTLB flushes. This leads to completion wait
+errors at boot and in some cases to data corruption and kernel crashes.
+
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/amd_iommu_init.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/x86/kernel/amd_iommu_init.c
++++ b/arch/x86/kernel/amd_iommu_init.c
+@@ -407,6 +407,10 @@ static u8 * __init alloc_command_buffer(
+ memcpy_toio(iommu->mmio_base + MMIO_CMD_BUF_OFFSET,
+ &entry, sizeof(entry));
+
++ /* set head and tail to zero manually */
++ writel(0x00, iommu->mmio_base + MMIO_CMD_HEAD_OFFSET);
++ writel(0x00, iommu->mmio_base + MMIO_CMD_TAIL_OFFSET);
++
+ iommu_feature_enable(iommu, CONTROL_CMDBUF_EN);
+
+ return cmd_buf;
alsa-hda-add-missing-terminators-in-patch_sigmatel.c.patch
parisc-disable-up-optimized-flush_tlb_mm.patch
drivers-net-starfire-fix-napi-poll-weight-handling.patch
+amd-iommu-reset-command-buffer-pointers-manually.patch
+amd-iommu-allocate-rlookup_table-with-__gfp_zero.patch
+amd-iommu-initialize-phys_addr-correctly-in-iommu_page_map.patch
+amd-iommu-fix-wrong-loop-counter-in-free_pagetables.patch