From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [v3 10/15] vt-d: Add API to update IRTE when VT-d PI is used Date: Mon, 29 Jun 2015 17:22:56 +0100 Message-ID: <559170E0.2000002@citrix.com> References: <1435123109-10481-1-git-send-email-feng.wu@intel.com> <1435123109-10481-11-git-send-email-feng.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1435123109-10481-11-git-send-email-feng.wu@intel.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: Feng Wu , xen-devel@lists.xen.org Cc: yang.z.zhang@intel.com, george.dunlap@eu.citrix.com, kevin.tian@intel.com, keir@xen.org, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org On 24/06/15 06:18, Feng Wu wrote: > This patch adds an API which is used to update the IRTE > for posted-interrupt when guest changes MSI/MSI-X information. > > Signed-off-by: Feng Wu > --- > v3: > - Remove "adding PDA_MASK()" when updating 'pda_l' and 'pda_h' for IRTE. > - Change the return type of pi_update_irte() to int. > - Remove some pointless printk message in pi_update_irte(). > - Use structure assignment instead of memcpy() for irte copy. > > xen/drivers/passthrough/vtd/intremap.c | 98 ++++++++++++++++++++++++++++++++++ > xen/drivers/passthrough/vtd/iommu.h | 2 + > xen/include/asm-x86/iommu.h | 2 + > 3 files changed, 102 insertions(+) > > diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c > index b7a42f6..401a9d1 100644 > --- a/xen/drivers/passthrough/vtd/intremap.c > +++ b/xen/drivers/passthrough/vtd/intremap.c > @@ -900,3 +900,101 @@ void iommu_disable_x2apic_IR(void) > for_each_drhd_unit ( drhd ) > disable_qinval(drhd->iommu); > } > + > +static inline void setup_posted_irte( No need for "inline" here. > + struct iremap_entry *new_ire, struct pi_desc *pi_desc, uint8_t gvec) const struct pi_desc *pi_desc > +{ > + new_ire->post.urg = 0; I would start by memset()ing the entire structure to 0, then filling in the non-zero bits. ~Andrew