[lkml]   [2009]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[patch 18/21] AMD IOMMU: reset command buffer pointers manually
2.6.27-stable review patch.  If anyone has any objections, please let us know.


From: Joerg Roedel <>

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 <>
Signed-off-by: Greg Kroah-Hartman <>

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;

 \ /
  Last update: 2009-01-13 02:39    [W:0.648 / U:0.584 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site