From: Greg Kroah-Hartman Date: Fri, 6 Nov 2009 21:48:22 +0000 (-0800) Subject: more .27 patches X-Git-Tag: v2.6.31.6~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68ed53f4d2dc15ad1964e230f52bba0c17170803;p=thirdparty%2Fkernel%2Fstable-queue.git more .27 patches --- diff --git a/queue-2.6.27/series b/queue-2.6.27/series index 0fb8d9940b8..b3e9d22ee0e 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -26,3 +26,5 @@ nfsv4-fix-a-problem-whereby-a-buggy-server-can-oops-the-kernel.patch nfsv4-the-link-operation-should-return-any-delegation-on-the-file.patch printk-robustify-printk.patch bonding-fix-a-race-condition-in-calls-to-slave-mii-ioctls.patch +x86-amd-iommu-un__init-function-required-on-shutdown.patch +x86-amd-iommu-workaround-for-erratum-63.patch diff --git a/queue-2.6.27/x86-amd-iommu-un__init-function-required-on-shutdown.patch b/queue-2.6.27/x86-amd-iommu-un__init-function-required-on-shutdown.patch new file mode 100644 index 00000000000..9c1af2ac3cc --- /dev/null +++ b/queue-2.6.27/x86-amd-iommu-un__init-function-required-on-shutdown.patch @@ -0,0 +1,32 @@ +From ca0207114f1708b563f510b7781a360ec5b98359 Mon Sep 17 00:00:00 2001 +From: Joerg Roedel +Date: Wed, 28 Oct 2009 18:02:26 +0100 +Subject: x86/amd-iommu: Un__init function required on shutdown + +From: Joerg Roedel + +commit ca0207114f1708b563f510b7781a360ec5b98359 upstream. + +The function iommu_feature_disable is required on system +shutdown to disable the IOMMU but it is marked as __init. +This may result in a panic if the memory is reused. This +patch fixes this bug. + +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/amd_iommu_init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kernel/amd_iommu_init.c ++++ b/arch/x86/kernel/amd_iommu_init.c +@@ -230,7 +230,7 @@ static void __init iommu_feature_enable( + writel(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET); + } + +-static void __init iommu_feature_disable(struct amd_iommu *iommu, u8 bit) ++static void iommu_feature_disable(struct amd_iommu *iommu, u8 bit) + { + u32 ctrl; + diff --git a/queue-2.6.27/x86-amd-iommu-workaround-for-erratum-63.patch b/queue-2.6.27/x86-amd-iommu-workaround-for-erratum-63.patch new file mode 100644 index 00000000000..aae1092b55d --- /dev/null +++ b/queue-2.6.27/x86-amd-iommu-workaround-for-erratum-63.patch @@ -0,0 +1,67 @@ +From joerg.roedel@amd.com Fri Nov 6 13:43:27 2009 +From: Joerg Roedel +Date: Fri, 6 Nov 2009 11:50:26 +0100 +Subject: x86/amd-iommu: Workaround for erratum 63 +To: Greg KH +Message-ID: <20091106105026.GD2799@amd.com> +Content-Disposition: inline + +From: Joerg Roedel + +commit c5cca146aa03e1f60fb179df65f0dbaf17bc64ed upstream. + +There is an erratum for IOMMU hardware which documents +undefined behavior when forwarding SMI requests from +peripherals and the DTE of that peripheral has a sysmgt +value of 01b. This problem caused weird IO_PAGE_FAULTS in my +case. +This patch implements the suggested workaround for that +erratum into the AMD IOMMU driver. The erratum is +documented with number 63. + +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/amd_iommu_init.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/arch/x86/kernel/amd_iommu_init.c ++++ b/arch/x86/kernel/amd_iommu_init.c +@@ -430,6 +430,27 @@ static void set_dev_entry_bit(u16 devid, + amd_iommu_dev_table[devid].data[i] |= (1 << _bit); + } + ++static int get_dev_entry_bit(u16 devid, u8 bit) ++{ ++ int i = (bit >> 5) & 0x07; ++ int _bit = bit & 0x1f; ++ ++ return (amd_iommu_dev_table[devid].data[i] & (1 << _bit)) >> _bit; ++} ++ ++ ++void amd_iommu_apply_erratum_63(u16 devid) ++{ ++ int sysmgt; ++ ++ sysmgt = get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT1) | ++ (get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT2) << 1); ++ ++ if (sysmgt == 0x01) ++ set_dev_entry_bit(devid, DEV_ENTRY_IW); ++} ++ ++ + /* Writes the specific IOMMU for a device into the rlookup table */ + static void __init set_iommu_for_device(struct amd_iommu *iommu, u16 devid) + { +@@ -458,6 +479,8 @@ static void __init set_dev_entry_from_ac + if (flags & ACPI_DEVFLAG_LINT1) + set_dev_entry_bit(devid, DEV_ENTRY_LINT1_PASS); + ++ amd_iommu_apply_erratum_63(devid); ++ + set_iommu_for_device(iommu, devid); + } +