AMD IOMMU: initialize phys_addr correctly in iommu_page_map
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 19 Dec 2008 13:42:14 +0000 (14:42 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 14 Jan 2009 17:44:08 +0000 (09:44 -0800)
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

index 042fdc2..a1493bb 100644 (file)
@@ -235,7 +235,7 @@ static int iommu_map(struct protection_domain *dom,
        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))