From: Wei Wang2 Subject: [PATCH] AMD IOMMU: Reset tail and head pointer of cmd buffer and event log Date: Tue, 13 Jan 2009 16:11:18 +0100 Message-ID: <1231859478.3380.287.camel@gran.amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-JEQzTz3TGFl0ehcn8BtY" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org --=-JEQzTz3TGFl0ehcn8BtY Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Reset the tail and the head pointers of command buffer and event log to zero in case that iommu does not reset them after the base addresses of those buffers are updated.=20 Thanks, Wei Signed-off-by: Wei Wang --=20 AMD GmbH, Germany Operating System Research Center Legal Information: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34 85609 Dornach b. M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Jochen Polster, Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis M=C3=BCnchen Registergericht M=C3=BCnchen, HRB Nr. 43632 --=-JEQzTz3TGFl0ehcn8BtY Content-Disposition: attachment; filename="mmio.patch" Content-Type: text/x-patch; name="mmio.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit diff -r 95d8788bf4be xen/drivers/passthrough/amd/iommu_init.c --- a/xen/drivers/passthrough/amd/iommu_init.c Mon Jan 12 10:23:55 2009 +0000 +++ b/xen/drivers/passthrough/amd/iommu_init.c Tue Jan 13 13:45:08 2009 +0100 @@ -195,6 +195,10 @@ static void __init set_iommu_command_buf IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_MASK, IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_SHIFT, &entry); writel(entry, iommu->mmio_base+IOMMU_CONTROL_MMIO_OFFSET); + + /*reset head and tail pointer */ + writel(0x0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET); + writel(0x0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET); } static void __init register_iommu_exclusion_range(struct amd_iommu *iommu) @@ -259,6 +263,10 @@ static void __init set_iommu_event_log_c IOMMU_CONTROL_COMP_WAIT_INT_MASK, IOMMU_CONTROL_COMP_WAIT_INT_SHIFT, &entry); writel(entry, iommu->mmio_base+IOMMU_CONTROL_MMIO_OFFSET); + + /*reset head and tail pointer */ + writel(0x0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET); + writel(0x0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET); } static int amd_iommu_read_event_log(struct amd_iommu *iommu, u32 event[]) --=-JEQzTz3TGFl0ehcn8BtY Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-JEQzTz3TGFl0ehcn8BtY--