From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v5 16/17] VT-d: Dump the posted format IRTE Date: Wed, 12 Aug 2015 13:14:18 -0400 Message-ID: <20150812171418.GO17650@l.oracle.com> References: <1439346938-31824-1-git-send-email-feng.wu@intel.com> <1439346938-31824-17-git-send-email-feng.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1439346938-31824-17-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 Cc: Yang Zhang , Kevin Tian , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Aug 12, 2015 at 10:35:37AM +0800, Feng Wu wrote: > Add the utility to dump the posted format IRTE. > > CC: Yang Zhang > CC: Kevin Tian > Signed-off-by: Feng Wu > --- > v4: > - Newly added > > xen/drivers/passthrough/vtd/utils.c | 41 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 40 insertions(+), 1 deletion(-) > > diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c > index 9d556da..1848385 100644 > --- a/xen/drivers/passthrough/vtd/utils.c > +++ b/xen/drivers/passthrough/vtd/utils.c > @@ -203,6 +203,9 @@ static void dump_iommu_info(unsigned char key) > ecap_intr_remap(iommu->ecap) ? "" : "not ", > (status & DMA_GSTS_IRES) ? " and enabled" : "" ); > > + printk(" Interrupt Posting: %ssupported.\n", > + cap_intr_post(iommu->ecap) ? "" : "not "); > + > if ( status & DMA_GSTS_IRES ) > { > /* Dump interrupt remapping table. */ > @@ -213,6 +216,7 @@ static void dump_iommu_info(unsigned char key) > > printk(" Interrupt remapping table (nr_entry=%#x. " > "Only dump P=1 entries here):\n", nr_entry); > + printk ("Entries for remapped format:\n"); > printk(" SVT SQ SID DST V AVL DLM TM RH DM " > "FPD P\n"); > for ( i = 0; i < nr_entry; i++ ) > @@ -230,7 +234,7 @@ static void dump_iommu_info(unsigned char key) > else > p = &iremap_entries[i % (1 << IREMAP_ENTRY_ORDER)]; > > - if ( !p->remap.p ) > + if ( !p->remap.p || p->remap.im ) > continue; > printk(" %04x: %x %x %04x %08x %02x %x %x %x %x %x" > " %x %x\n", i, > @@ -239,6 +243,41 @@ static void dump_iommu_info(unsigned char key) > p->remap.rh, p->remap.dm, p->remap.fpd, p->remap.p); > print_cnt++; > } > + > + if ( iremap_entries ) > + unmap_vtd_domain_page(iremap_entries); > + > + iremap_entries = NULL; > + printk ("\nEntries for posted format:\n"); > + printk(" SVT SQ SID PDA V URG AVL FPD P\n"); > + for ( i = 0; i < nr_entry; i++ ) > + { > + struct iremap_entry *p; > + if ( i % (1 << IREMAP_ENTRY_ORDER) == 0 ) > + { > + /* This entry across page boundry */ Missing full stop, and s/boundry/boundary/ > + if ( iremap_entries ) > + unmap_vtd_domain_page(iremap_entries); > + > + GET_IREMAP_ENTRY(iremap_maddr, i, > + iremap_entries, p); > + } > + else > + p = &iremap_entries[i % (1 << IREMAP_ENTRY_ORDER)]; > + > + if ( !p->post.p || !p->post.im ) > + continue; > + > + printk(" %04x: %x %x %04x %16lx %02x %x %x %x %x\n", > + i, > + p->post.svt, p->post.sq, p->post.sid, > + ((u64)p->post.pda_h << 32) | (p->post.pda_l << 6), > + p->post.vector, p->post.urg, p->post.avail, p->post.fpd, > + p->post.p); > + > + print_cnt++; > + } > + > if ( iremap_entries ) > unmap_vtd_domain_page(iremap_entries); > if ( iommu_ir_ctrl(iommu)->iremap_num != print_cnt ) > -- > 2.1.0 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel