From nobody Fri May 3 06:09:48 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=1583259864; cv=none; d=zohomail.com; s=zohoarc; b=RM4n/kecIQp9/wjDFERCqrl8IVqBQZ4jo42yy3rTi4htS16warBMTpZ7D/kxJv140m+iH7yjoFW6rRHOOUYQ9hnb09aVbiESavVDK21ZnBTWKRIg3zXMHAvKLrMjETRvAsolI6MRbcmRWVXKvoPsPdtgilGy9lf/x7rHQ6M0ZYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583259864; 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=5ADnElygJITIJMpqRy2QhBjsMWh9RS9dkLYXnMwmxBo=; b=l7u9rAIHGcxbrTWNC0W4G4HWQT89LArToe4WS7cerro4IW6KkdKvZ634pk+K/VgQfUiGJ2pyEFCg+xU5Lyj3Eyb3UpEpTMBuxr9zYShGtRCyV4pjJOoaNDUzEkP407lsDcniCaMj2lriV9TS+Bpk+P4wlxtzi3cgdR6nKrvU0eE= 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 1583259864212227.18810861921202; Tue, 3 Mar 2020 10:24:24 -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 1j9CCg-0004vR-Um; Tue, 03 Mar 2020 18:23:38 +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 1j9CCf-0004vM-UJ for xen-devel@lists.xenproject.org; Tue, 03 Mar 2020 18:23:37 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 18a48390-5d7c-11ea-a1fa-12813bfff9fa; Tue, 03 Mar 2020 18:23:36 +0000 (UTC) X-Inumbo-ID: 18a48390-5d7c-11ea-a1fa-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1583259816; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0h/qH1+t9GAT/XGzup1z/T3pD9MWaTUONZ3bhNc4CCs=; b=Ue+nHVkZRmD2z+jUing9vox9WlE8xI7SZN0CiP410HykniqYihA4tMCb qu51H/mrYfJFVaQb2t5zw0tIUS0wkH3z1b5SYaF8y8met7Sc2YMe8Sx4g +njucxRliRSRFLdrNecS8GCs3fsXkl1/FQC6qQZSWrPQ9wb2gHzLrxeon 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: ILYE7caKpX0uQD4MpcLmttzm7pRYTl7gYVwFOYtRD9JslRemYQaLsUBj8e0FDFe56f21D46Q5N GX3ERb5+qb2kNn2WN+Y00H40MVkSUPWQ6axDBB5CTrhQqqigbICzibZtwDC4dhgcLR3DSe9cfO bnNbqPma65GGilwSOztVk6z+jDVG0/4QqqVWXpBujkiL3yF/pMJTOcnYsLxXV9Moh9sGGc70R3 /oPSGAqKQcD+Pmbup6unO5KdDOFTn+PfxaASpFivXAJcrnkPly+X/XJcQfKJebMQSeuQqdVT2b v0s= X-SBRS: 2.7 X-MesageID: 13330916 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.70,511,1574139600"; d="scan'208";a="13330916" From: Andrew Cooper To: Xen-devel Date: Tue, 3 Mar 2020 18:23:26 +0000 Message-ID: <20200303182326.16739-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] tools/libxc: Reduce feature handling complexity 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) xc_cpuid_apply_policy() is gaining extra parameters to untangle CPUID complexity in Xen. While an improvement in general, it does have the unfortunate side effect of duplicating some settings across muliple parameters. Rearrange the logic to only consider 'pae' if no explicit featureset is provided. This reduces the complexity for callers who have already provide= d a pae setting in the featureset. Signed-off-by: Andrew Cooper Acked-by: Wei Liu --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Ian Jackson --- tools/libxc/include/xenctrl.h | 6 ++++++ tools/libxc/xc_cpuid_x86.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index fc6e57a1a0..8d13a7e20b 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1798,6 +1798,12 @@ int xc_cpuid_set(xc_interface *xch, const unsigned int *input, const char **config, char **config_transformed); +/* + * Make adjustments to the CPUID settings for a domain. + * + * Either pass a full new @featureset (and @nr_features), or adjust indivi= dual + * features (@pae). + */ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, const uint32_t *featureset, diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index 5ced6d18b9..f045b03223 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -532,6 +532,11 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t = domid, =20 cpuid_featureset_to_policy(feat, p); } + else + { + if ( di.hvm ) + p->basic.pae =3D pae; + } =20 if ( !di.hvm ) { @@ -615,8 +620,6 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t d= omid, break; } =20 - p->basic.pae =3D pae; - /* * These settings are necessary to cause earlier HVM_PARAM_NESTEDH= VM / * XEN_DOMCTL_disable_migrate settings to be reflected correctly in --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel