From nobody Mon Feb 9 23:39:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1574780558; cv=none; d=zohomail.com; s=zohoarc; b=OuDz//JILlRJoOH8y+g4+rqd3pKEbwdOJ+OdhGJJ7RdyIyZd0G3d027zYroh2t+3s6DbzYqVPFf/cLPYSNBvtl0u49/mRq2c93z7BPjt1hULL7ILLlIishcI1ocHkPkiP8LZiV889COtlpoSa7cAp7ffQonzZPAO8K0vwdqqBIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574780558; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Huf3oYT0winuU63N4Ps4el5HpV0XoXb2yznc6VS6ib4=; b=JZPRYy8zibW0Ax+csKlKBmvVtd6+/opVS210Lg9BjCDBbahRb5RvxE45S8Ozc18oBPu3Qph3B39SBaj/yIoBL3KGrAdkb3i+TBGeOWHoiss+GoWie/7dyTDsP3Nqtk+H+QJLVNPysUnSNfhBA01qlNY8D/SJjGRxu3Dk6Hxz35c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1574780558401250.0338333554231; Tue, 26 Nov 2019 07:02:38 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iZcLD-0004eR-OA; Tue, 26 Nov 2019 15:01:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iZcLC-0004dt-EV for xen-devel@lists.xenproject.org; Tue, 26 Nov 2019 15:01:22 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 99f68856-105d-11ea-b155-bc764e2007e4; Tue, 26 Nov 2019 15:01:19 +0000 (UTC) X-Inumbo-ID: 99f68856-105d-11ea-b155-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1574780479; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=XTpne13jZyXChoxke6JgMqInbZkzpylkc23MV2INAss=; b=KdwGcSfJ/wKb6lHUTrPlJZ0621D4au3b5AgnnZQPIi6+sm6sk5mlrkz/ Cj+k6JCRo0iGeUTW3qaV7+G/jA13JFfMuZz26xqE8mvsUSN3lZ27Sme7i TPD9XQJLb9St9IWjlMRDWx3/k/l+nfHBqBDyZZ6iEuAmauDNv//fqQUaj E=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 5H1qi8+vzRiB0AjznJwlApghEBYmPG75kJlGZ17I/wJBLgx1sI3GFWtAsYr5q+4bmlmSMLWHzK al1I/bMedh952yYX49qCpS+mEhJNBKbdx6VNqbFX6A5MJwlaF97j52u/yFGjIofjm45vAcgWfk t7ZqqxSpDrnoz440sP3DGxoALW6vDwj5sYoowGSP2hEBYl7DGACrfs1H+b0nIW6MqUMGPkfVkI /NtiuIYMUas/NJOJ0quvhExIz5tQfM2ZwHSF59mUQajlYXf+AIgwKPhzUg3pPqSAJn5jvpRgem 3jg= X-SBRS: 2.7 X-MesageID: 9263889 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,246,1571716800"; d="scan'208";a="9263889" From: Andrew Cooper To: Xen-devel Date: Tue, 26 Nov 2019 15:01:11 +0000 Message-ID: <20191126150112.12704-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191126150112.12704-1-andrew.cooper3@citrix.com> References: <20191126150112.12704-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/2] AMD/IOMMU: Always print IOMMU errors X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Andrew Cooper , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Unhandled IOMMU errors (i.e. not IO_PAGE_FAULT) should still be printed, and not hidden behind iommu=3Ddebug. While adjusting this, factor out the symbolic name handling to just one location exposing its off-by-one nature. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Juergen Gross --- xen/drivers/passthrough/amd/iommu_init.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthr= ough/amd/iommu_init.c index 16e84d43d4..8aa8788797 100644 --- a/xen/drivers/passthrough/amd/iommu_init.c +++ b/xen/drivers/passthrough/amd/iommu_init.c @@ -530,6 +530,7 @@ static void parse_event_log_entry(struct amd_iommu *iom= mu, u32 entry[]) EVENT_STR(INVALID_DEV_REQUEST) #undef EVENT_STR }; + const char *code_str =3D "event"; =20 code =3D get_field_from_reg_u32(entry[1], IOMMU_EVENT_CODE_MASK, IOMMU_EVENT_CODE_SHIFT); @@ -553,6 +554,10 @@ static void parse_event_log_entry(struct amd_iommu *io= mmu, u32 entry[]) IOMMU_EVENT_CODE_SHIFT); } =20 + /* Look up the symbolic name for code. */ + if ( code <=3D ARRAY_SIZE(event_str) ) + code_str =3D event_str[code - 1]; + if ( code =3D=3D IOMMU_EVENT_IO_PAGE_FAULT ) { device_id =3D iommu_get_devid_from_event(entry[0]); @@ -566,7 +571,7 @@ static void parse_event_log_entry(struct amd_iommu *iom= mu, u32 entry[]) printk(XENLOG_ERR "AMD-Vi: " "%s: domain =3D %d, device id =3D %#x, " "fault address =3D %#"PRIx64", flags =3D %#x\n", - event_str[code-1], domain_id, device_id, *addr, flags); + code_str, domain_id, device_id, *addr, flags); =20 for ( bdf =3D 0; bdf < ivrs_bdf_entries; bdf++ ) if ( get_dma_requestor_id(iommu->seg, bdf) =3D=3D device_id ) @@ -574,12 +579,8 @@ static void parse_event_log_entry(struct amd_iommu *io= mmu, u32 entry[]) PCI_DEVFN2(bdf)); } else - { - AMD_IOMMU_DEBUG("%s %08x %08x %08x %08x\n", - code <=3D ARRAY_SIZE(event_str) ? event_str[code -= 1] - : "event", - entry[0], entry[1], entry[2], entry[3]); - } + printk(XENLOG_ERR "%s %08x %08x %08x %08x\n", + code_str, entry[0], entry[1], entry[2], entry[3]); =20 memset(entry, 0, IOMMU_EVENT_LOG_ENTRY_SIZE); } --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel