From nobody Mon May 6 18:37:59 2024 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=1579273869; cv=none; d=zohomail.com; s=zohoarc; b=YFLyObJaQe/K+f6iE7AO1UfJkHPoGGi51BnaELE66wW+DIRy0qzJhKkRHl4XRemwklXgqmdsN11FyjzjmGd8gcOcMEK6FJYu2Wn2qQmPijbv1md1MO2EP2dqvs4aAJBfH42fyLn2e9OBb1gPOooo5ct5V9pZWOPhk9Bh6Tj1h88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579273869; 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; bh=6KrbGoOk/k2WOVXugSEWDgxpaNwpuBQxlYXoXge6pNQ=; b=fUksY4QoTAZuzPJnzqE8hIU0EP3nocQG4Ih1f3p1RNi6I4AdMjTjzD1QHwLhFQ/h0HhEf0RVF0dg+tU8GtHHCmvmYiUTC6G8l5n8KCc+xeuMLTAdNNF1xo7/ehPLw+JjbuvpDbsJmjWXKpCQCY0rIjUZEnweeg7Onw+NdF0ED5I= 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 1579273869775845.4098917616788; Fri, 17 Jan 2020 07:11:09 -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 1isTGI-0006xj-8X; Fri, 17 Jan 2020 15:10:14 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1isTGH-0006xe-D5 for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 15:10:13 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 703fe186-393b-11ea-8e9a-bc764e2007e4; Fri, 17 Jan 2020 15:10:04 +0000 (UTC) X-Inumbo-ID: 703fe186-393b-11ea-8e9a-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579273804; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=pDEzXjk8T3Mot5vZPKOuArJvhoR2GxZqK07xT2q5ZKM=; b=DuRsgnl/z9U3LC/65FUv7uK2cTzv2Y206oXQe1xXLY/eCteVKZyTBNLJ 1CXKUIwF8rryn5k5SimdXhSDH3+FhLrIt6VOQVpkEEECpLvszuF00RFGn P9cTkVxueJBgx+juNSVwwVHaFKaMroMd71T03PQy6fHWACne/D15ITkT0 k=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@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 (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: yMRduJW8mOGgptSXa0F7/Yi3gGbD0IM1qwo6E2KAa5oE9+poVuJacbLn7kR+DRRmCngQRC7tGJ acL6kja4n9xjKdVcFa/sS8m8E96N4YmtyWJV7C8Xq1j7S3oPDiJeKl5UTbiEoYDb75eXyZbOie w96y8fyZsd4pUqhBkB8bTTAVUufd4xEDph2PKAvztSY7VPE9NcokkDTaDbzTPAfXJn95ORZHYT eGMjnrWIxMFcX1j8UqCAiF+1dOhRtBe/8abI5SdjU7C0n8pdpdiRBvcOtkyBgwJzOePGpp1Ve3 w0c= X-SBRS: 2.7 X-MesageID: 11247065 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,330,1574139600"; d="scan'208";a="11247065" From: Roger Pau Monne To: Date: Fri, 17 Jan 2020 16:09:48 +0100 Message-ID: <20200117150948.45014-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/apic: fix disabling LVT0 in disconnect_bsp_APIC 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: Andrew Cooper , Wei Liu , Jan Beulich , Roger Pau Monne 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) The Intel SDM states: "When an illegal vector value (0 to 15) is written to a LVT entry and the delivery mode is Fixed (bits 8-11 equal 0), the APIC may signal an illegal vector error, without regard to whether the mask bit is set or whether an interrupt is actually seen on the input." And that's exactly what's currently done in disconnect_bsp_APIC when virt_wire_setup is true and LVT LINT0 is being masked. By writing only APIC_LVT_MASKED Xen is actually setting the vector to 0 and the delivery mode to Fixed (0), and hence it triggers an APIC error even when the LVT entry is masked. This would usually manifest when Xen is being shut down, as that's where disconnect_bsp_APIC is called: (XEN) APIC error on CPU0: 40(00) Fix this by reusing the current LVT LINT0 value and just adding the mask bit to it. Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monn=C3=A9 --- xen/arch/x86/apic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index a6a7754d77..e4363639bd 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -281,7 +281,8 @@ void disconnect_bsp_APIC(int virt_wire_setup) } else { /* Disable LVT0 */ - apic_write(APIC_LVT0, APIC_LVT_MASKED); + value =3D apic_read(APIC_LVT0); + apic_write(APIC_LVT0, value | APIC_LVT_MASKED); } =20 /* For LVT1 make it edge triggered, active high, nmi and enabled */ --=20 2.25.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel