From: "Jan Beulich" Subject: AMD/IOMMU: revert "SR56x0 Erratum 64 - Reset all head & tail pointers" Date: Mon, 03 Jun 2013 08:12:13 +0100 Message-ID: <51AC5DED02000078000DA6F4@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part0939F9DD.2__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Andrew Cooper , suravee.suthikulpanit@amd.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part0939F9DD.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline The code this patch added is redundant with already present code in set_iommu_{command_buffer,{event,ppr}_log}_control(). Just switch those ones from using writel() to writeq() for consistency. Signed-off-by: Jan Beulich --- a/xen/drivers/passthrough/amd/iommu_init.c +++ b/xen/drivers/passthrough/amd/iommu_init.c @@ -154,11 +154,6 @@ static void register_iommu_cmd_buffer_in IOMMU_CMD_BUFFER_LENGTH_MASK, IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry); writel(entry, iommu->mmio_base+IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET); - - /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not = happen - * automatically for us. */ - writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET); - writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET); } =20 static void register_iommu_event_log_in_mmio_space(struct amd_iommu = *iommu) @@ -187,11 +182,6 @@ static void register_iommu_event_log_in_ IOMMU_EVENT_LOG_LENGTH_MASK, IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry); writel(entry, iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET); - - /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not = happen - * automatically for us. */ - writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET); - writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET); } =20 static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu) @@ -220,9 +210,6 @@ static void register_iommu_ppr_log_in_mm IOMMU_PPR_LOG_LENGTH_MASK, IOMMU_PPR_LOG_LENGTH_SHIFT, &entry); writel(entry, iommu->mmio_base + IOMMU_PPR_LOG_BASE_HIGH_OFFSET); - - writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET); - writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET); } =20 =20 @@ -267,8 +254,8 @@ static void set_iommu_command_buffer_con /*reset head and tail pointer manually before enablement */ if ( enable ) { - writel(0x0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET); - writel(0x0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET); + writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET); + writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET); =20 iommu_set_bit(&entry, IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_SHIFT); } @@ -326,8 +313,8 @@ static void set_iommu_event_log_control( /*reset head and tail pointer manually before enablement */ if ( enable ) { - writel(0x0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET); - writel(0x0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET); + writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET); + writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET); =20 iommu_set_bit(&entry, IOMMU_CONTROL_EVENT_LOG_INT_SHIFT); iommu_set_bit(&entry, IOMMU_CONTROL_EVENT_LOG_ENABLE_SHIFT); @@ -353,8 +340,8 @@ static void set_iommu_ppr_log_control(st /*reset head and tail pointer manually before enablement */ if ( enable ) { - writel(0x0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET); - writel(0x0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET); + writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET); + writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET); =20 iommu_set_bit(&entry, IOMMU_CONTROL_PPR_ENABLE_SHIFT); iommu_set_bit(&entry, IOMMU_CONTROL_PPR_INT_SHIFT); --=__Part0939F9DD.2__= Content-Type: text/plain; name="AMD-IOMMU-erratum-64-revert.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="AMD-IOMMU-erratum-64-revert.patch" AMD/IOMMU: revert "SR56x0 Erratum 64 - Reset all head & tail pointers"=0A= =0AThe code this patch added is redundant with already present code = in=0Aset_iommu_{command_buffer,{event,ppr}_log}_control(). Just switch = those=0Aones from using writel() to writeq() for consistency.=0A=0ASigned-o= ff-by: Jan Beulich =0A=0A--- a/xen/drivers/passthrough/a= md/iommu_init.c=0A+++ b/xen/drivers/passthrough/amd/iommu_init.c=0A@@ = -154,11 +154,6 @@ static void register_iommu_cmd_buffer_in=0A = IOMMU_CMD_BUFFER_LENGTH_MASK,=0A = IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry);=0A writel(entry, iommu->mmio_ba= se+IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET);=0A-=0A- /* Reset head/tail = pointer. SR56x0 Erratum 64 means this might not happen=0A- * automatica= lly for us. */=0A- writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OF= FSET);=0A- writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET);= =0A }=0A =0A static void register_iommu_event_log_in_mmio_space(struct = amd_iommu *iommu)=0A@@ -187,11 +182,6 @@ static void register_iommu_event_l= og_in_=0A IOMMU_EVENT_LOG_LENGTH_MASK,=0A = IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry);=0A writel(entry, = iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET);=0A-=0A- /* Reset = head/tail pointer. SR56x0 Erratum 64 means this might not happen=0A- * = automatically for us. */=0A- writeq(0, iommu->mmio_base + IOMMU_EVENT_LO= G_HEAD_OFFSET);=0A- writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OF= FSET);=0A }=0A =0A static void register_iommu_ppr_log_in_mmio_space(struct = amd_iommu *iommu)=0A@@ -220,9 +210,6 @@ static void register_iommu_ppr_log_= in_mm=0A IOMMU_PPR_LOG_LENGTH_MASK,=0A = IOMMU_PPR_LOG_LENGTH_SHIFT, &entry);=0A writel(entry, = iommu->mmio_base + IOMMU_PPR_LOG_BASE_HIGH_OFFSET);=0A-=0A- writeq(0, = iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET);=0A- writeq(0, iommu->mmio= _base + IOMMU_PPR_LOG_TAIL_OFFSET);=0A }=0A =0A =0A@@ -267,8 +254,8 @@ = static void set_iommu_command_buffer_con=0A /*reset head and tail = pointer manually before enablement */=0A if ( enable )=0A {=0A- = writel(0x0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET);=0A- = writel(0x0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET);=0A+ = writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET);=0A+ = writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET);=0A =0A = iommu_set_bit(&entry, IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_SHIFT);=0A = }=0A@@ -326,8 +313,8 @@ static void set_iommu_event_log_control(=0A = /*reset head and tail pointer manually before enablement */=0A if ( = enable )=0A {=0A- writel(0x0, iommu->mmio_base + IOMMU_EVENT_LOG= _HEAD_OFFSET);=0A- writel(0x0, iommu->mmio_base + IOMMU_EVENT_LOG_TA= IL_OFFSET);=0A+ writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OF= FSET);=0A+ writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET)= ;=0A =0A iommu_set_bit(&entry, IOMMU_CONTROL_EVENT_LOG_INT_SHIFT);= =0A iommu_set_bit(&entry, IOMMU_CONTROL_EVENT_LOG_ENABLE_SHIFT);=0A= @@ -353,8 +340,8 @@ static void set_iommu_ppr_log_control(st=0A = /*reset head and tail pointer manually before enablement */=0A if ( = enable )=0A {=0A- writel(0x0, iommu->mmio_base + IOMMU_PPR_LOG_H= EAD_OFFSET);=0A- writel(0x0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_O= FFSET);=0A+ writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET);= =0A+ writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET);=0A = =0A iommu_set_bit(&entry, IOMMU_CONTROL_PPR_ENABLE_SHIFT);=0A = iommu_set_bit(&entry, IOMMU_CONTROL_PPR_INT_SHIFT);=0A --=__Part0939F9DD.2__= 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.xen.org http://lists.xen.org/xen-devel --=__Part0939F9DD.2__=--