From nobody Mon Apr 29 19:19:49 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=1577453984; cv=none; d=zohomail.com; s=zohoarc; b=LsynJWsKnuu5CqULDZYzlHnQOPvRc4WUkQ8tXMvWusAUWwMKj5Rnv8HmXt/FTEYQ0SUNkHlsgxQ8hDUiGRDVY8h4uObny8MRvunsnF/dKD/ZxFbYdqU8ptS/O2k2ooMP1Avu/0vLq/ybsZkpYqlfXJya7WBXQDPA/PvExkTkr7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577453984; 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=z2ccX4M01Ca9kaX3lpj0EuxwdKTvYRM+0VPSSPUjKB4=; b=PY8M9qeNEib2dYLoOijnc+ZSGO9i2kv+MhC3xyykmLwTjJ1lIzWdRmwExSSKyEYTCNXiK7QhTGCFwpw/V4rcY5pq3I4H3YZNBF4JiZLf5IiUa/X7fad+HP1WvScWKxrf3KDW68afWA05cey2JThi9MfUERjDy0ycTqu5sSCrjok= 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 1577453984658191.0871232505648; Fri, 27 Dec 2019 05:39:44 -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 1ikppV-0002Pj-H1; Fri, 27 Dec 2019 13:39:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ikppV-0002Pe-67 for xen-devel@lists.xenproject.org; Fri, 27 Dec 2019 13:39:01 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 37f05538-28ae-11ea-b6f1-bc764e2007e4; Fri, 27 Dec 2019 13:38:52 +0000 (UTC) X-Inumbo-ID: 37f05538-28ae-11ea-b6f1-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1577453932; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GCXU2Yyuvbz6RFIhxpRcUmiPImEjBeeQBy4zXJV5RcU=; b=OzuP60YiYwL6d0fp5Z4XRa0NMtfAj4XnE0BP4RG2I4oGr5GrXmupiV2b cVdFo0TsFD2OP4np015pB3KvpjpdRo8FbLAeLa3uMCMGxMbmRH8Bu6GTv QoklEZh3Rf8Nmzna01pQI1zRZhIqgSt0vmOx0lRwce/N6psqhhi9/IgyS w=; Authentication-Results: esa3.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 (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.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=esa3.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 (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: VsohBkw9k+r2wF9z1A0329308tu0qm4/iM4uA4u9SqIOZNaAxHXglDABTDKRpTwkOTR5+XkjKn b78xbKMw+6tDyRgyj9payOqdzLQBCflO0MY1Ytif15cTfe2KEXqwVXaGLIcahQ36LmRhimJxWg FR+i8fIkg+M4Ja/2nxfkvNxd1luWWjxuM4P2OcRKHpgdqk0odB6nieNCx5CWuHsJtDqOSnfjok YjH0pyM1ktuPpvF091qkj9JhMIZ1TjtAKQ4K5gNExGw6d1BW8AV7CmkNoqufNb6xESdMt7Srqo afY= X-SBRS: 2.7 X-MesageID: 10179017 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,363,1571716800"; d="scan'208";a="10179017" From: Andrew Cooper To: Xen-devel Date: Fri, 27 Dec 2019 13:38:48 +0000 Message-ID: <20191227133848.9776-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] tools/libxc: Fix HVM_PARAM_PAE_ENABLED handling in xc_cpuid_apply_policy() 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 , Ian Jackson , Wei Liu , Jan Beulich , =?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) Despite as suggested in c/s 685e922d6f3, not all HVM_PARAMs are handled in the same way. HVM_PARAM_PAE_ENABLED is a toolstack-only value, and the xc_cpuid_apply_policy() used to be the only consumer. Reinstate the old behaviour (mad as it is) to avoid regressions. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Ian Jackson Spotted while trying to come up with a less mad behaviour, and wondering where the consumer had disappaered to. This needs backporting to 4.13. I was tempted to not fix it for the general security betterness of the world (disabling PAE disables NX and 64bit), and while I could probably get away with it, it would a little rude to do so. --- tools/libxc/xc_cpuid_x86.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index 519d6d8bd0..2540aa1e1c 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -579,6 +579,8 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t d= omid, } else { + uint64_t val; + /* * Topology for HVM guests is entirely controlled by Xen. For now= , we * hardcode APIC_ID =3D vcpu_id * 2 to give the illusion of no SMT. @@ -633,6 +635,16 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t = domid, } =20 /* + * HVM_PARAM_PAE_ENABLED is a parameter to this function, stashed = in + * Xen. Nothing else has ever taken notice of the value. + */ + rc =3D xc_hvm_param_get(xch, domid, HVM_PARAM_PAE_ENABLED, &val); + if ( rc ) + goto out; + + p->basic.pae =3D val; + + /* * These settings are necessary to cause earlier HVM_PARAM_NESTEDH= VM / * XEN_DOMCTL_disable_migrate settings to be reflected correctly in * CPUID. Xen will discard these bits if configuration hasn't been --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel