From patchwork Fri Dec 30 08:55:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 709675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tqgTj2hsmz9ssP for ; Fri, 30 Dec 2016 20:02:33 +1100 (AEDT) Received: from localhost ([::1]:38964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMt55-0004ja-8J for incoming@patchwork.ozlabs.org; Fri, 30 Dec 2016 04:02:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMszK-0008Ud-Q1 for qemu-devel@nongnu.org; Fri, 30 Dec 2016 03:56:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMszJ-0008LR-Ux for qemu-devel@nongnu.org; Fri, 30 Dec 2016 03:56:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33492) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMszJ-0008Kv-P5 for qemu-devel@nongnu.org; Fri, 30 Dec 2016 03:56:33 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2FA44E4CF; Fri, 30 Dec 2016 08:56:32 +0000 (UTC) Received: from pxdev.xzpeter.org (vpn1-4-51.pek2.redhat.com [10.72.4.51]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBU8u2Lv011949; Fri, 30 Dec 2016 03:56:27 -0500 From: Peter Xu To: qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Fri, 30 Dec 2016 16:55:57 +0800 Message-Id: <1483088160-6714-6-git-send-email-peterx@redhat.com> In-Reply-To: <1483088160-6714-1-git-send-email-peterx@redhat.com> References: <1483088160-6714-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 30 Dec 2016 08:56:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [kvm-unit-tests PATCH 5/8] intel-iommu: add report prefixes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jones , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , peterx@redhat.com, agordeev@redhat.com, Jan Kiszka , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Peter Xu --- x86/intel-iommu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/x86/intel-iommu.c b/x86/intel-iommu.c index 753f90e..59171a1 100644 --- a/x86/intel-iommu.c +++ b/x86/intel-iommu.c @@ -21,6 +21,8 @@ void vtd_test_dmar(struct pci_edu_dev *dev) { void *page = alloc_page(); + report_prefix_push("vtd_dmar"); + #define DMA_TEST_WORD (0x12345678) /* Modify the first 4 bytes of the page */ *(uint32_t *)page = DMA_TEST_WORD; @@ -51,6 +53,8 @@ void vtd_test_dmar(struct pci_edu_dev *dev) report(VTD_TEST_DMAR_4B, *((uint32_t *)page + 1) == DMA_TEST_WORD); free_page(page); + + report_prefix_pop(); } static volatile bool edu_intr_recved; @@ -64,6 +68,8 @@ static void edu_isr(isr_regs_t *regs) static void vtd_test_ir(struct pci_edu_dev *dev) { #define VTD_TEST_VECTOR (0xee) + report_prefix_push("vtd_ir"); + /* * Setup EDU PCI device MSI, using interrupt remapping. By * default, EDU device is using INTx. @@ -88,6 +94,8 @@ static void vtd_test_ir(struct pci_edu_dev *dev) /* We are good as long as we reach here */ report(VTD_TEST_IR_MSI, true); + + report_prefix_pop(); } int main(int argc, char *argv[]) @@ -96,6 +104,8 @@ int main(int argc, char *argv[]) vtd_init(); + report_prefix_push("vtd_init"); + report("fault status check", vtd_readl(DMAR_FSTS_REG) == 0); report("QI enablement", vtd_readl(DMAR_GSTS_REG) & VTD_GCMD_QI); report("DMAR table setup", vtd_readl(DMAR_GSTS_REG) & VTD_GCMD_ROOT); @@ -106,6 +116,8 @@ int main(int argc, char *argv[]) vtd_readq(DMAR_CAP_REG) & VTD_CAP_SAGAW); report("DMAR support huge pages", vtd_readq(DMAR_CAP_REG) & VTD_CAP_SLLPS); + report_prefix_pop(); + if (!edu_init(&dev)) { printf("Please specify \"-device edu\" to do " "further IOMMU tests.\n");