From nobody Fri Nov 29 14:41:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=citrix.com); dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=2; a=rsa-sha256; t=1638200167; cv=pass; d=zohomail.com; s=zohoarc; b=E7uQmH1iOTXvHiVAx+bKV3taPnOdKxbwoI3J62NDP1y6iK6jrfQc63LIRVZ5gRXGmzC830SroTYG6WYV7G8x8Vc7b+28DHeVr4NUfyRhSUn9CtPY9eDVpNLosSMO8XYzBMAR6/FFXfiR8P2XeR2isoDqE9MlMxTHm2uRBl0l/Fw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638200167; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pRaYIUfkMkzZXE8d3moJMkHiUafesA///nNUwZGhtBY=; b=kOZjwxXWYrRq0w42zUB5B8ShOGkD91xv4QOZXKHZPkmslMVAHnTmAxuYjhj5M/8q05AO2hCUQhXIs9BIjIOXiX6DIreJpVSv8+eH/FQE+9/f0CEJw+aU82jXskXZ/f9oTAOfrJH/IFEm0fQqsql3WNBuDXrqr5WK2TdKZT2MBR4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=citrix.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1638200167506883.7593219576564; Mon, 29 Nov 2021 07:36:07 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.234638.407226 (Exim 4.92) (envelope-from ) id 1mrigy-0005xK-9w; Mon, 29 Nov 2021 15:35:44 +0000 Received: by outflank-mailman (output) from mailman id 234638.407226; Mon, 29 Nov 2021 15:35:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mrigy-0005x8-6L; Mon, 29 Nov 2021 15:35:44 +0000 Received: by outflank-mailman (input) for mailman id 234638; Mon, 29 Nov 2021 15:35:42 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mrigw-0004Rj-BF for xen-devel@lists.xenproject.org; Mon, 29 Nov 2021 15:35:42 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 018cf07c-512a-11ec-976b-d102b41d0961; Mon, 29 Nov 2021 16:35:41 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 018cf07c-512a-11ec-976b-d102b41d0961 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1638200142; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=LhjyiDF5LKmTNDh163h1NmBaoZfFCmFl7Wc/SQikn0I=; b=UAM7ph+FJIJSK4oXCjsPHTMMWazyJftZurjhvxReXSQxy3Pc6TSrN7cp 2NMBPMx2S2sxBPpLzDSkPV3eTruhWF9hAAbyT9svRr6a8jZRXCrQ8QloV BxADZN8DhogfeIkKYXab6ukzEbGETNk5MjE1xVy3FI7Cq7gDGe1wlRoav k=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: xHD3hhj+UiJhUNcAMyQWh+LDAKPr0F4m4CZbU+qxvnr9rkTweD99LLn8BgQ9In7wABF/Q6vFky gh5yEG45JDUKV/7omeNXXVW55fxgs2//Bqec4CAGZvvzO/nftgl48mHEuU++fxI0UmYeC3cj+A YUFEbuP3lgqjbH9GDcIqKzTlWc2C/6uLkW8+bl3RZr76Pb/pvo5hIKP9eOhpH1DHBadBMKBmxd OaqnOrj+KU5B/gwHYQmwVIICpFw7xn9arLHjxWS0iEpLOitA3inUhLvmfIaQQKG4jR7XDsi3GZ uZ14+M14+H3en7Anp+hSDotL X-SBRS: 5.1 X-MesageID: 58333467 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:sEYrqaj7KaYYKaZorcB8sEh7X161gxcKZh0ujC45NGQN5FlHY01je htvUGmPOv+LZWH1fdl1Ydi/8kgFv8OBx9ZiHgVuqC9jQSwb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oAMKRCQ7InQLlbGILes1htZGEk0F0/NtTo5w7Rg29cy0IDga++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /1Mm77pciAJb5HVv/g2Wj1JNh5nMpJZreqvzXiX6aR/zmXDenrohf5vEFs3LcsT/eMf7WNmr KJCbmpXN1ba2rzwkOnTpupE36zPKOHxO4wSoDd4xCzxBvc6W5HTBa7N4Le02R9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/0TnzDT69UzIVn7u3ArrObWDx0KMknekjFZIZt0LJghk LUot8Mh4gCijgYnb4SdhSdO+mXQdnENXs3LbH3B7FMHXubz9mx/XA== IronPort-HdrOrdr: A9a23:3TrL6K4J4XkQ8uh1OAPXwVKBI+orL9Y04lQ7vn2ZFiY7TiXIra yTdaoguCMc6AxxZJkh8erwXJVoJkmsiaKdgLNhQItKOTOJhILGFvAF0WKP+UyDJ8S6zJ8n6U 4CSdkONDSTNykCsS+S2mDReLxBsbr3gJxAx92utUuFJTsaFZ2IhD0JbTpzfHcGITWvUvECZe WhD4d81nCdUEVSSv7+KmgOXuDFqdGOvJX6YSQeDxpizAWVlzun5JPzDhDdh34lIn9y6IZn1V KAvx3y562lvf3+4hjA11XL55ATvNf60NNMCOGFl8BQADTxjQSDYphnRtS5zX0IidDqzGxvvM jHoh8mMcg2w3TNflutqR+o4AXk2CZG0Q6q9XaoxV/Y5eDpTjMzDMRMwahDdAHC1kYmtNZglI pWwmOwrfNsfFL9tRW4w+KNewBhl0Kyr3Znu/UUlWZjXYwXb6IUhZAD/XlSDIwLEEvBmc4a+d FVfYLhDcttABGnhyizhBgr/DXsZAV9Iv6+eDlDhiTPuAIm2EyQzCMjtboidzk7hdUAoqJ/lp b525JT5cZzp/8tHNFA7dg6ML6K4xT2MGrx2UKpUBza/fI8SjnwQ6Ce2sRA2AjtQu1P8KcP X-IronPort-AV: E=Sophos;i="5.87,273,1631592000"; d="scan'208";a="58333467" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eRKdf7KKkrxDGMwsu5FSTEHYAtfqQdnkVt065obFHAna4G2DD7WoQe6BjMdHo3KRNCko9Lq490YvTSElJwVlp2RnzF3cLgE3pElH7XhEYvmT8dDwkttrLEQxykDyLiTKcdwo3P2TBo+PYXkGFhevVSKY+O19rpfqunxtlG2wrO8oA0i6KotvbFKQ7IBdKtai89X6D0LMDf2JDVBttrcaRs3zCYQ/vDaeeiXtUWmuRIr/KqFWLHxhSAs+ULbrjrCpZ9Ue4BRCzuwfLzz9g/G94KlGaTAelYXEDyVYwJTyE3GflOEDuRUocpzY/EvKdXGaiqrUwzkHuo9SHg36i45MUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pRaYIUfkMkzZXE8d3moJMkHiUafesA///nNUwZGhtBY=; b=BZxhq1icNMM1CoGq/O/DCn/hcTQR1pjO1jIeglGADsUqvHWg3Omi160fA+6TiucuqhwBRmNYBT8CXFD+XsMhDWS5DX1BpPAwk1JUmDwecxsptfVqS4+UeZoaT7lDFnsd69RG0GL3zZzyRbpD8BMy4/O7+64XzJovUDoAWBD74flrj7mc07H4qatuQX8XnttbhLabxEWrCHt9ulaLyVhjvE2LJX/eCw6ncGmLOiVpUd04wpDfgUtz0edtqzBJw4/LKS5fh53+br+NtBiGoIThbOuJihG9kml7ioQQoMfaCP2WFhvzYJnLAyjm7tbSm0MdV5XeaK3RC1Mm1eH1kYEg/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pRaYIUfkMkzZXE8d3moJMkHiUafesA///nNUwZGhtBY=; b=Zl3VgODgX/KHkMVJjwOWxmUPcOkM1NySylF7FVh4sQFggYd7HsiHoW02cHKvTTq9Ppgt0z+9XVc7PGL1m/KZpy74qcTJ21oPsdL436C3gP15sQfjmWeMpG6YPhupYCWIMBKbiVy18L74NfdbUIZuhsnZeAki/i7iapbh2MMYC8g= From: Roger Pau Monne To: CC: Roger Pau Monne , Ian Jackson , Wei Liu , Juergen Gross Subject: [PATCH v5 06/12] libs/guest: make a cpu policy compatible with older Xen versions Date: Mon, 29 Nov 2021 16:33:49 +0100 Message-ID: <20211129153355.60338-7-roger.pau@citrix.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211129153355.60338-1-roger.pau@citrix.com> References: <20211129153355.60338-1-roger.pau@citrix.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MR2P264CA0079.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:32::19) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5d34d6d2-74ea-4534-dd15-08d9b34de3f4 X-MS-TrafficTypeDiagnostic: DM5PR03MB2842: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rqLlYHxjwOY6uVrO6MpidNNOA3iK1YoGdzwGYezHdQATvewCg8COK9yHDRcEH5hbY7UrRc0hIpuG3xJr1qzQ8IKCKxVduGj3yQOZWHOjSc5uswIBuEaxLG+9TKmbKRp2NslTL++p7FrgVgWNT3MdSCCBGGbJfeyOTlexb7JhlhDtfSOW3pJ/OSeF1LP7PLcG4WV0B+I1/knzPFVKeidKZ53aKw6hCmF7D5a+joLEAHwnal1cARragB11ffqYgBYJhuEw5lgXbpk2In40fP0fKG+Qq9wbTZK89CHBvnYIAb7XCs7HFB8JfN6eghf82YAzH7GVGqL98le11/Tz/a5grnOBRoRoMUmjP0Iv4eHt70CJE8K8IIErh7NzmJytmwwUNqzW0+jJKWq7+BomBYL28+TvzAmT63/wAkrZRRMokuDvH6N/31VAxltYEi29xgJJOwJuQodik6VTj0dqN48VDV3sl8W+IMlxoE8W10O7nTP+F1KF9J0UJUm43K3HLSG+p8JGTjFVb+z+kAab9TJBeL9c0fw2TNAudgZQhNwjuH9J0OjOzka3t4Uc7BYieZ0kyCMHlI8FuPk76yXOAn0aNcEGhNjEid1WYRW3YGu9+LdP0zaQ0XUz4DKW3cvU2qI03IKAtmNODhnJzD0hS5EBiQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(5660300002)(86362001)(54906003)(8936002)(2906002)(66946007)(6486002)(316002)(8676002)(956004)(6916009)(82960400001)(4326008)(6666004)(66476007)(66556008)(186003)(83380400001)(38100700002)(2616005)(26005)(508600001)(1076003)(36756003)(6496006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?THp5d0VmT01ydXJZS0RqTUkybTVQT244UFJRdFc2c2hLZzVkcHV0cXFTby9v?= =?utf-8?B?K3hUZ0ZkZTZsd3NsZEZoSGZKTkZxSmIyckg5OWxlWkNvaE1lUHg2c2dmMm1T?= =?utf-8?B?ZjJaODB4VnhsWjQxRlpaZlp6aHJwSkM3UVRZQUhJbXUwNE9HUW9BSWFBL3NC?= =?utf-8?B?M0R3WGttWCtpODZ5M0dBQlFDUnFtcEFORFFHdlFoSUZLZFRLRVpuWXQ3bERq?= =?utf-8?B?TllkYVBDOXlua2tISmgxSkpTUFpqYkVLRldielF4RExTSlNXUGFlWUwyZm1m?= =?utf-8?B?Y0JWVCtOSjhYVXZBTTFIZlhYMFU2SHY5YTZuTWRtYmcwa0VKekN1WDZIRDJr?= =?utf-8?B?YXN4cjBBaCtZbm42aDRxM3dqVlpyaVRUR3Z6RktjZTJSZFNrdVdrY2ZKdFR3?= =?utf-8?B?T2F2MH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Message-Id: 5d34d6d2-74ea-4534-dd15-08d9b34de3f4 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2021 15:35:36.8970 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xrFhBO2QQDJEnBWb2kj+0W0Y94+fxmzgwMQv3ks6wVhWSfReDrXdb0v9Ybf2vZSTPrYCPOPfZ8wMZvIgHYDxmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2842 X-OriginatorOrg: citrix.com X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1638200168212100003 Older Xen versions used to expose some CPUID bits which are no longer exposed by default. In order to keep a compatible behavior with guests migrated from versions of Xen that don't encode the CPUID data on the migration stream introduce a function that sets the same bits as older Xen versions. This is pulled out from xc_cpuid_apply_policy which already has this logic present. No functional change intended. Signed-off-by: Roger Pau Monn=C3=A9 --- Changes since v3: - Rename function to xc_cpu_policy_make_compat_4_12. Changes since v1: - Move comments and explicitly mention pre-4.13 Xen. --- tools/include/xenguest.h | 4 +++ tools/libs/guest/xg_cpuid_x86.c | 62 ++++++++++++++++++++++++--------- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h index 2672fd043c..281454dc60 100644 --- a/tools/include/xenguest.h +++ b/tools/include/xenguest.h @@ -817,6 +817,10 @@ int xc_cpu_policy_get_msr(xc_interface *xch, const xc_= cpu_policy_t *policy, bool xc_cpu_policy_is_compatible(xc_interface *xch, xc_cpu_policy_t *host, xc_cpu_policy_t *guest); =20 +/* Make a policy compatible with pre-4.13 Xen versions. */ +int xc_cpu_policy_make_compat_4_12(xc_interface *xch, xc_cpu_policy_t *pol= icy, + bool hvm); + int xc_get_cpu_levelling_caps(xc_interface *xch, uint32_t *caps); int xc_get_cpu_featureset(xc_interface *xch, uint32_t index, uint32_t *nr_features, uint32_t *featureset); diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x8= 6.c index 859c885c15..bcbf9576c4 100644 --- a/tools/libs/guest/xg_cpuid_x86.c +++ b/tools/libs/guest/xg_cpuid_x86.c @@ -432,6 +432,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t d= omid, bool restore, unsigned int i, nr_leaves, nr_msrs; xen_cpuid_leaf_t *leaves =3D NULL; struct cpuid_policy *p =3D NULL; + struct xc_cpu_policy policy =3D { }; uint32_t err_leaf =3D -1, err_subleaf =3D -1, err_msr =3D -1; uint32_t host_featureset[FEATURESET_NR_ENTRIES] =3D {}; uint32_t len =3D ARRAY_SIZE(host_featureset); @@ -496,23 +497,9 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t = domid, bool restore, =20 if ( restore ) { - /* - * Account for feature which have been disabled by default since X= en 4.13, - * so migrated-in VM's don't risk seeing features disappearing. - */ - p->basic.rdrand =3D test_bit(X86_FEATURE_RDRAND, host_featureset); - p->feat.hle =3D test_bit(X86_FEATURE_HLE, host_featureset); - p->feat.rtm =3D test_bit(X86_FEATURE_RTM, host_featureset); - - if ( di.hvm ) - { - p->feat.mpx =3D test_bit(X86_FEATURE_MPX, host_featureset); - } - - /* Clamp maximum leaves to the ones supported on 4.12. */ - p->basic.max_leaf =3D min(p->basic.max_leaf, 0xdu); - p->feat.max_subleaf =3D 0; - p->extd.max_leaf =3D min(p->extd.max_leaf, 0x8000001c); + policy.cpuid =3D *p; + xc_cpu_policy_make_compat_4_12(xch, &policy, di.hvm); + *p =3D policy.cpuid; } =20 if ( featureset ) @@ -916,3 +903,44 @@ bool xc_cpu_policy_is_compatible(xc_interface *xch, xc= _cpu_policy_t *host, =20 return false; } + +int xc_cpu_policy_make_compat_4_12(xc_interface *xch, xc_cpu_policy_t *pol= icy, + bool hvm) +{ + xc_cpu_policy_t *host; + int rc; + + host =3D xc_cpu_policy_init(); + if ( !host ) + { + errno =3D ENOMEM; + return -1; + } + + rc =3D xc_cpu_policy_get_system(xch, XEN_SYSCTL_cpu_policy_host, host); + if ( rc ) + { + ERROR("Failed to get host policy"); + goto out; + } + + /* + * Account for features which have been disabled by default since Xen = 4.13, + * so migrated-in VM's don't risk seeing features disappearing. + */ + policy->cpuid.basic.rdrand =3D host->cpuid.basic.rdrand; + policy->cpuid.feat.hle =3D host->cpuid.feat.hle; + policy->cpuid.feat.rtm =3D host->cpuid.feat.rtm; + + if ( hvm ) + policy->cpuid.feat.mpx =3D host->cpuid.feat.mpx; + + /* Clamp maximum leaves to the ones supported on pre-4.13. */ + policy->cpuid.basic.max_leaf =3D min(policy->cpuid.basic.max_leaf, 0xd= u); + policy->cpuid.feat.max_subleaf =3D 0; + policy->cpuid.extd.max_leaf =3D min(policy->cpuid.extd.max_leaf, 0x800= 0001c); + + out: + xc_cpu_policy_destroy(host); + return rc; +} --=20 2.33.0