From nobody Fri Apr 19 09:18:41 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=1567699574; cv=none; d=zoho.com; s=zohoarc; b=OgOc3ifijN6J3b9yU+kIaz1j0A+nQqEDIzSCZnArsivdJTci78RoIl4yuji9GIBN20TLfiyR9XG7P6ifwelllhQzD/ORuVm04ST72csQxHF/MsdcrDjlvkrNot+Pfx34ptRzb5aC8T4SVCzbvFNq9nh/N9uVnnEsWaPQmdgrdXk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567699574; 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=yYtd0GGG2Mws9XbIpEo4q/aESrOfP2wxdeJ7329hrbw=; b=opkYJMC3V4gmkNYVorch8XKB9GovfxD1FdxTGth7ZeyDPPCJJUiY4B25WBo52ou0yEygkb2HptxQVVk/WLEVDlvcZyCsT9nz2FFRrLABgzQC1jKvcGLo2+jcgFyFTJ/nnPOMA3Yr+ZqNhs7tpaot5zTb6C7rwqYdl/LHZ3FkuXU= 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 1567699574144886.0116128241199; Thu, 5 Sep 2019 09:06:14 -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 1i5uFM-0003wu-RI; Thu, 05 Sep 2019 16:04:32 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i5uFL-0003wp-W5 for xen-devel@lists.xenproject.org; Thu, 05 Sep 2019 16:04:32 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d7d7b62e-cff6-11e9-abd4-12813bfff9fa; Thu, 05 Sep 2019 16:04:30 +0000 (UTC) X-Inumbo-ID: d7d7b62e-cff6-11e9-abd4-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1567699470; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WltwFT22+xXaN0wbWq6MqUS8hNMMvE6LsSITdqH2cBU=; b=IyNWSzuRNHaF11sjvFiNtqH/abNT8j+xMxc4fke1iSzadR6gpqOvA7mg B7WXYdBwWsQ6Oi5YRlNzl3WqfKXrwSLIuPxhht6HQQ9ELUMMoemu21qx3 cdu1sJxKEbAy4rCCuaGFaddskaicMtNYIbQQ0/aIS6TwSzrIGwt2MUhFL c=; Authentication-Results: esa4.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 (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 roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 ~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="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: jU263I5OMh4HHq3tjpAUSHvJRy31I4uVwFbBH92E9DUGimdqDxBOCy/gzuV+h5KSWQZ22mJjJk 0GxhSWUQcaasuD3SPCwjdW4XXRzXdrpVeF3rUZyjMmJ4wu3cNB79FhpWTWuoqC19cL6ODlMliV J/am3a4IQXQgN7KnOF3Uq144kCwXH4R/J8xsi1JBrtdU7OyC8U1OdCq73kIA6ry9CcfQ909ThD X/uArAyFOgiQtWjHoVf5rmzooIaagU5GGb5jKXslfzueOaq4kP5j5nS7NQTsDa5+vL2MaeQzJY gno= X-SBRS: 2.7 X-MesageID: 5465982 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,470,1559534400"; d="scan'208";a="5465982" From: Roger Pau Monne To: Date: Thu, 5 Sep 2019 18:04:24 +0200 Message-ID: <20190905160424.6686-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2] xstate: make use_xsave non-init 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) LLVM code generation can attempt to load from a variable in the next condition of an expression under certain circumstances, thus attempting to load use_xsave regardless of the value of the bsp variable, which leads to a page fault when the init section has already been unmapped. Fix this by making use_xsave non-init, thus preventing the page fault. The LLVM bug with the discussion about this issue can be found at: https://bugs.llvm.org/show_bug.cgi?id=3D39707 Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Jan Beulich --- xen/arch/x86/xstate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c index 3293ef834f..1dddda2818 100644 --- a/xen/arch/x86/xstate.c +++ b/xen/arch/x86/xstate.c @@ -577,7 +577,11 @@ unsigned int xstate_ctxt_size(u64 xcr0) /* Collect the information of processor's extended state */ void xstate_init(struct cpuinfo_x86 *c) { - static bool __initdata use_xsave =3D true; + /* + * NB: use_xsave cannot live in initdata because llvm might optimize + * reading it, see: https://bugs.llvm.org/show_bug.cgi?id=3D39707 + */ + static bool use_xsave =3D true; boolean_param("xsave", use_xsave); =20 bool bsp =3D c =3D=3D &boot_cpu_data; --=20 2.22.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel