From mboxrd@z Thu Jan 1 00:00:00 1970 From: Feng Wu Subject: [v4 17/17] VT-d: Dump the posted format IRTE Date: Thu, 23 Jul 2015 19:35:53 +0800 Message-ID: <1437651353-5275-18-git-send-email-feng.wu@intel.com> References: <1437651353-5275-1-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: <1437651353-5275-1-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: xen-devel@lists.xen.org Cc: Yang Zhang , Kevin Tian , Feng Wu List-Id: xen-devel@lists.xenproject.org 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 a5fe237..7f73a84 100644 --- a/xen/drivers/passthrough/vtd/utils.c +++ b/xen/drivers/passthrough/vtd/utils.c @@ -211,6 +211,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. */ @@ -221,6 +224,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++ ) @@ -238,7 +242,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, @@ -248,6 +252,41 @@ static void dump_iommu_info(unsigned char key) (u32)p->remap.dm, (u32)p->remap.fpd, (u32)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 */ + 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, + (u32)p->post.svt, (u32)p->post.sq, (u32)p->post.sid, + (((u64)p->post.pda_h << 32) | (p->post.pda_l << 6)), + (u32)p->post.vector, (u32)p->post.urg, + (u32)p->post.avail, (u32)p->post.fpd, (u32)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