From nobody Wed Apr 24 15:46:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1565630342; cv=none; d=zoho.com; s=zohoarc; b=JaOP+Zmu4LkXOZDZyQ6bBikeAFG/Ag/tDPzQg5IRHOso0lGNkW6l7q92XiWC8K47K1l1+Lhv0Q8SVXjQc5R9QXDKL3xWWTObsept1/wU+hhJiP2rkO273X0hCZ9xDEzPr7qcmKYO5VHNvYaIWyMtS8TDbbEWpxjLz9q3Z+Uq1cg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565630342; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=2g7at7W+ApPuEZAAJInVUtHgVZvxcEoJQ30jqXBzSfI=; b=VCyw6mVACiI2rXoaNtCCinBaEL7gujr93GlziGBrsFTnk/aWosmBezznHwkZmhVwaZtTFljSjyQInyxC2/KyhDTec2TFskbQ0O+7lb5qitZ1pxjWzOU7JZDir9IdPD1+vuYc88fttO2pSq1D6EDXOfmkjbC36EjSTyo3d/r6I4Y= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1565630342648770.8754736444574; Mon, 12 Aug 2019 10:19:02 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxDwv-0005Bi-Db; Mon, 12 Aug 2019 17:17:37 +0000 Received: from [172.99.69.81] (helo=us1-rack-iad1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxDwu-0005Bd-3V for xen-devel@lists.xenproject.org; Mon, 12 Aug 2019 17:17:36 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1273b48e-bd25-11e9-9cfd-9fa67abaf090; Mon, 12 Aug 2019 17:17:34 +0000 (UTC) X-Inumbo-ID: 1273b48e-bd25-11e9-9cfd-9fa67abaf090 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1565630253; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=15oOx+kRR9kNeM4bgwzmh56Ql+RJzLZVepT7/OR4WbY=; b=AC1ZbQoAlc7WwEFZDeMeFBl3077ClhUVIxkMpn1BmxbBKQ1LVStVrvfZ OY8XPbGRP03dAwTjEdqn5Smdt3BMvLD85Oqyiu6orSHG2C7km/wV/6vnP dPmNz6np60nXboSCnQN0pOgibyCpNvUXxJERHY9e6zoslMyyjuYGU5e6V E=; Authentication-Results: esa4.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 (zoho.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 ~all" Received-SPF: None (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: AhH+NDXUSmcC5hxKxpJ3c2hu9IxEFkn1b/j/ySNo0uNeZZJ/yeD/tJ4GT+/XLfJ8NguxO30ZSZ im4xzy9E+adteypK/m/58382a84lS+x7JnymWTx4tMPc5RuKe0oqgrXInyBZcxWVf9sfEMr7hO D7zRL/4Shi3rgXaxEfi88QTYxXsq7nqvbsla9Ih+Z+q5u3EN6F5EAEBdkJ05THv/UrjnBkUCr6 uMx6QRcF3x176fj/iT7UVn7hz8LVNWkyDcSrGzf3SluAcL0V/9KfTd/nMJDZ7l8R8tafTs4iul c/c= X-SBRS: 2.7 X-MesageID: 4368646 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,378,1559534400"; d="scan'208";a="4368646" From: Andrew Cooper To: Xen-devel Date: Mon, 12 Aug 2019 18:17:29 +0100 Message-ID: <20190812171729.4984-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/vtd: Fix S3 resume following c/s 650c31d3af 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: Kevin Tian , Jan Beulich , Wei Liu , Andrew Cooper , Jun Nakajima , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= 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) c/s 650c31d3af "x86/IRQ: fix locking around vector management" adjusted the locking in adjust_irq_affinity(). The S3 path ends up here via iommu_resume() before interrupts are enabled, = at which point spin_lock_irq() which fail ASSERT(local_irq_is_enabled()); but with no working console. Use spin_lock_irqsave() instead to cope with interrupts already being disabled. Signed-off-by: Andrew Cooper Reviewed-by: Kevin Tian --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Jun Nakajima CC: Kevin Tian I'm fairly confident that the AMD side of things is fine, because enable_iommu() is encompased by a spin_lock_irqsave() block. --- xen/drivers/passthrough/vtd/iommu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/= vtd/iommu.c index 5d72270c5b..defa74fae3 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -2135,15 +2135,16 @@ static void adjust_irq_affinity(struct acpi_drhd_un= it *drhd) : NUMA_NO_NODE; const cpumask_t *cpumask =3D NULL; struct irq_desc *desc; + unsigned long flags; =20 if ( node < MAX_NUMNODES && node_online(node) && cpumask_intersects(&node_to_cpumask(node), &cpu_online_map) ) cpumask =3D &node_to_cpumask(node); =20 desc =3D irq_to_desc(drhd->iommu->msi.irq); - spin_lock_irq(&desc->lock); + spin_lock_irqsave(&desc->lock, flags); dma_msi_set_affinity(desc, cpumask); - spin_unlock_irq(&desc->lock); + spin_unlock_irqrestore(&desc->lock, flags); } =20 static int adjust_vtd_irq_affinities(void) --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel