From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 2/4] VT-d: drop redundant calls to invalidate_sync() Date: Mon, 16 Jun 2014 14:08:58 +0100 Message-ID: <539EEC6A.4070203@citrix.com> References: <539F025A020000780001AA25@mail.emea.novell.com> <539F03AF020000780001AA38@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8818795875535716573==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwWem-0000pf-0o for xen-devel@lists.xenproject.org; Mon, 16 Jun 2014 13:09:04 +0000 In-Reply-To: <539F03AF020000780001AA38@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Yang Z Zhang , xen-devel , xiantao.zhang@intel.com List-Id: xen-devel@lists.xenproject.org --===============8818795875535716573== Content-Type: multipart/alternative; boundary="------------080200060405030305040305" --------------080200060405030305040305 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 16/06/14 13:48, Jan Beulich wrote: > The call tree iommu_flush_iec_index() -> __iommu_flush_iec() already > invokes invalidate_sync(). Removing the superfluous instances at once > allows the function to become static. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper > > --- a/xen/drivers/passthrough/vtd/extern.h > +++ b/xen/drivers/passthrough/vtd/extern.h > @@ -48,7 +48,6 @@ int queue_invalidate_iotlb(struct iommu > u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr); > int queue_invalidate_iec(struct iommu *iommu, > u8 granu, u8 im, u16 iidx); > -int invalidate_sync(struct iommu *iommu); > int iommu_flush_iec_global(struct iommu *iommu); > int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx); > void clear_fault_bits(struct iommu *iommu); > --- a/xen/drivers/passthrough/vtd/intremap.c > +++ b/xen/drivers/passthrough/vtd/intremap.c > @@ -358,7 +358,6 @@ static int ioapic_rte_to_remap_entry(str > memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry)); > iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry)); > iommu_flush_iec_index(iommu, 0, index); > - invalidate_sync(iommu); > > unmap_vtd_domain_page(iremap_entries); > spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags); > @@ -643,7 +642,6 @@ static int msi_msg_to_remap_entry( > memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry)); > iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry)); > iommu_flush_iec_index(iommu, 0, index); > - invalidate_sync(iommu); > > unmap_vtd_domain_page(iremap_entries); > spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags); > --- a/xen/drivers/passthrough/vtd/qinval.c > +++ b/xen/drivers/passthrough/vtd/qinval.c > @@ -228,7 +228,7 @@ static int queue_invalidate_wait(struct > return ret; > } > > -int invalidate_sync(struct iommu *iommu) > +static int invalidate_sync(struct iommu *iommu) > { > int ret = -1; > struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu); > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------080200060405030305040305 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
On 16/06/14 13:48, Jan Beulich wrote:
The call tree iommu_flush_iec_index() -> __iommu_flush_iec() already
invokes invalidate_sync(). Removing the superfluous instances at once
allows the function to become static.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -48,7 +48,6 @@ int queue_invalidate_iotlb(struct iommu 
     u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr);
 int queue_invalidate_iec(struct iommu *iommu,
     u8 granu, u8 im, u16 iidx);
-int invalidate_sync(struct iommu *iommu);
 int iommu_flush_iec_global(struct iommu *iommu);
 int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);
 void clear_fault_bits(struct iommu *iommu);
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -358,7 +358,6 @@ static int ioapic_rte_to_remap_entry(str
     memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry));
     iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
-    invalidate_sync(iommu);
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
@@ -643,7 +642,6 @@ static int msi_msg_to_remap_entry(
     memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry));
     iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
-    invalidate_sync(iommu);
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -228,7 +228,7 @@ static int queue_invalidate_wait(struct 
     return ret;
 }
 
-int invalidate_sync(struct iommu *iommu)
+static int invalidate_sync(struct iommu *iommu)
 {
     int ret = -1;
     struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--------------080200060405030305040305-- --===============8818795875535716573== 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 --===============8818795875535716573==--