From nobody Thu Nov 14 17:48:41 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=1690290433; cv=pass; d=zohomail.com; s=zohoarc; b=jkvqxjo7zFNQYNX07k4dN4SzRyeN2tKVTepOODTr/OrdIBo2bQnCGofePpbZo4G08PZEFWz7b/GvjylKlsSGGFOTqzcHv3YbKC24GkNdYH3N9GAd12Lg6mYOQ4JDbKA/ojUdx9JlPNFtbLwdAuJXco7Th0jWCG6JEXmoUyle9/w= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690290433; 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=IkXSjb3Rn7PBge9Ur09P08ZeEBi8VRA2CbzLrLn2KAg=; b=BerlbuEAiTnoYE06EOvF1sme2WIJ6TZSC4wnlvbRxTBF2xdTE9mZdB5/p+d+t9o57oqqkevMZZRlLJT28MsbGj2HgMNObkfnMZNy6wSTUzdi5wGQNtyxlOH6cGcUXzws21CGOOWpn9JwjC7l7kmBJzSVKyXHxShVPiEbYONMFGU= 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 1690290433345834.5872441588293; Tue, 25 Jul 2023 06:07:13 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.569675.890611 (Exim 4.92) (envelope-from ) id 1qOHkd-0005f8-Md; Tue, 25 Jul 2023 13:06:55 +0000 Received: by outflank-mailman (output) from mailman id 569675.890611; Tue, 25 Jul 2023 13:06:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qOHkd-0005ez-Ja; Tue, 25 Jul 2023 13:06:55 +0000 Received: by outflank-mailman (input) for mailman id 569675; Tue, 25 Jul 2023 13:06:54 +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 1qOHkc-0003uq-9c for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:54 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1f372882-2aec-11ee-b23f-6b7b168915f2; Tue, 25 Jul 2023 15:06:53 +0200 (CEST) Received: from mail-co1nam11lp2175.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.175]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 25 Jul 2023 09:06:51 -0400 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) by SA1PR03MB6516.namprd03.prod.outlook.com (2603:10b6:806:1c7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul 2023 13:06:49 +0000 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023 13:06:49 +0000 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: 1f372882-2aec-11ee-b23f-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1690290413; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=8h94lYnckg0tD+pN5EVmt3fI//N3Vydy/cqPpyKBrQo=; b=hLZFRLreukjkjmYEWIMxHGqfiAgCPjLQ7+9NvCyrMQHU5Zs91OQhq8yG S/ytbkDO6LohsErBh1E3F/RHnPli+kmHL6RuGH2jbZmLE3JDAuLA00uzN FzoOB/1o71ZJnMb6sb/mL5BzEbfdQSHHWSdtXJ8kgZuHVUvEVH6Ttjn9O s=; X-IronPort-RemoteIP: 104.47.56.175 X-IronPort-MID: 117381056 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:cGTcoK3T0sBB2+9Io/bD5fdwkn2cJEfYwER7XKvMYLTBsI5bpzUBz WJKCz/XO/iONGKmeIx2Otvj8EpTuJbRmoVlGgA/pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNkOKgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IO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Port-AV: E=Sophos;i="6.01,230,1684814400"; d="scan'208";a="117381056" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XdFIcAWrIrreNII2IBy/vsOV4e6ygiJo3meTf5PdODv2bAD9bvZaoBlGhCbThEx/f9T1AxTqv8M7lU4pCLza/3+WDlNCpHzvbUsqmDD+eckqjFT801+2D4/tyRh2NKRVPOhcZqpH8OZbnAsntdtlCoq5S9X+tzOFMBMhG6Ijcn9jQcjPMsfPEWtcXHVMeE8SFrMGCALHVr+EspJsf0/ku6wr/GaL3lkvyOo2q5HK2YnsuIGcTrp/gqI5GPt5Ps/CfZNf5Eq98HP1SZzQEGcpbvr7Ejo6jBcpoFOeq5gEnrYVckiBbB00AhWw3XhFsRsqMTqzN1IlE7Hhotz/arAnvQ== 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=IkXSjb3Rn7PBge9Ur09P08ZeEBi8VRA2CbzLrLn2KAg=; b=fTlP60mScZM/FOJl/eSxo1k09CrSYsRjth07E5GXFpsGa2p2TX7vQoD623rBU87uOzgDxo2QssSY/CwXyF0vqVeHUH1NnLycwLtiIWUuMIcJBoHnyuDMCjFXivIUcFACS2+1Gi4nO90JMR/AqeHrDczE0NsGilIX4c+V8WfXHVFTpbuJyZZTZ9fuLjR6ebldNSMyQEbayWyNUVmOOI4AZk8nJv/cyhhLNOeB1/sNyuAGAV3umGi6OhscpB/PsL/YmmjJsABx19V8dluqGc9xmPjrMUzXWQkdcQPhJQgwM7WwWOej89ggEs3nKSBeFPlOmh3Oh2u1lg1ZIsynRKkR0Q== 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=IkXSjb3Rn7PBge9Ur09P08ZeEBi8VRA2CbzLrLn2KAg=; b=XZ/7p1Pi6PXpxBFCIZKyNukTXmN6X4gKWIgmNWEF8c308GpdmWfZYAmmxamLyATl3DkNxqj4eGURk0XCIPARPZave06Kei2SJ5eeZVuG1JbPps2Nhw/OOrQ8TtlDZm2FlmpLU360lWfIqZqxhv+S070UEmsz47MDm1MOvdsD7/U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Wei Liu , Anthony PERARD , Juergen Gross Subject: [PATCH v4 6/6] libxl: add support for parsing MSR features Date: Tue, 25 Jul 2023 15:05:58 +0200 Message-ID: <20230725130558.58094-7-roger.pau@citrix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725130558.58094-1-roger.pau@citrix.com> References: <20230725130558.58094-1-roger.pau@citrix.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO2P265CA0468.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a2::24) To SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6516:EE_ X-MS-Office365-Filtering-Correlation-Id: d2b71db7-93f5-46de-11ec-08db8d10014d X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pdC8HJ24MckIsjVkpCU3dR8pauJH4DDum1JnCrj24clURoVopgExhMe65UNFFnQGVlk6sbCcXUnlUN9gvnq+UWn3t/MYCpp3d6qPoINcMpfiU9stj8cfEWelckzDZD/nigZTAsDAMoFRj1LJ5FyS9c8g5+JjfJDpCzbx9Z+dy1GTIoiFRGKhKLp65XTdy1fBOx1E4VQ6c1x4f+Qmel8325VHzpHzKRbtkC0RqAEFLttf9Hwu6VkAXHtZTHpIX0rSetwkZmUJ1gr3YcmiXN9YPOOgE/1xqa6f2nI0cFfKxqTMVAtZk7qUjrBgOH5Y4919zQpNRZv0FkXMNa7d3/U5XJzsQ0q+QqenV1AzUsZ0lsoZXQOf1O4Npd/LXkbTG+VcAkPAL9xFC3TFZWY/Cg95woy9frBfEF1ADU7qQgK+js0/OEY20maThBHMsW1q3cs0noQARZl1n2aGwXlbThnJWmjYQ1Oswgrsn5cnKr1Mll3RjfoluLo99vcQUs8JVg03rqCsiZ35ujzqU2OgLtqEddg9UhZ02OArFfybOHw/CMcibCMzvyy1DQyMFR7UWnIQ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(82960400001)(478600001)(83380400001)(8936002)(1076003)(26005)(6512007)(6506007)(66946007)(38100700002)(66556008)(54906003)(6916009)(4326008)(66476007)(186003)(2616005)(5660300002)(8676002)(2906002)(316002)(41300700001)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NytuRnB6cUhEZCtBODZBa0VSR2VOU3dRcG9KSFJBQUZXUndnVmh1elBHU3lE?= =?utf-8?B?YVA5SGZYTE5tTFRCdnJtWlBKMWhTdnlXZEpwVllLU3dUNHR5a3hIR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kCNRWJVT5xIfkvC2eViwxeMdRU1CgzH9xwOLpIIhOC/wAq0phnzfzEfFTXioxt9t/iOgUq5Chjyd5kEExvYYdtPcwgoObDN5WbzkV/80886tE+27Yb5gng0i0qoQgOvZcAPssZK3pmAKu2rySttK2kWQ+Rhvkwrvv X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2b71db7-93f5-46de-11ec-08db8d10014d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:06:48.6637 (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: xamPO9QI13iSAP66uF7DBsx8p2If9I1fdT1qK/gTq60bJF9d89n5J5P/CclpymQBpYDtl9gJez0AOxzbLGZTrg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516 X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1690290492792100001 Introduce support for handling MSR features in libxl_cpuid_parse_config(). The MSR policies are added to the libxl_cpuid_policy like the CPUID one, which gets passed to xc_cpuid_apply_policy(). This allows existing users of libxl to provide MSR related features as key=3Dvalue pairs to libxl_cpuid_parse_config() without requiring the usage of a different API. Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Anthony PERARD --- Changes since v2: - Add some braces. --- tools/libs/light/libxl_cpuid.c | 64 +++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c index 0daa564abb81..46dd2ce5f9e3 100644 --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/libs/light/libxl_cpuid.c @@ -157,6 +157,60 @@ static int cpuid_add(libxl_cpuid_policy_list *policy, return 0; } =20 +static struct xc_msr *msr_find_match(libxl_cpuid_policy_list *pl, uint32_t= index) +{ + unsigned int i =3D 0; + libxl_cpuid_policy_list policy =3D *pl; + + if (policy =3D=3D NULL) + policy =3D *pl =3D calloc(1, sizeof(*policy)); + + if (policy->msr !=3D NULL) { + for (i =3D 0; policy->msr[i].index !=3D XC_MSR_INPUT_UNUSED; i++) { + if (policy->msr[i].index =3D=3D index) { + return &policy->msr[i]; + } + } + } + + policy->msr =3D realloc(policy->msr, sizeof(struct xc_msr) * (i + 2)); + policy->msr[i].index =3D index; + memset(policy->msr[i].policy, 'x', ARRAY_SIZE(policy->msr[0].policy) -= 1); + policy->msr[i].policy[ARRAY_SIZE(policy->msr[0].policy) - 1] =3D '\0'; + policy->msr[i + 1].index =3D XC_MSR_INPUT_UNUSED; + + return &policy->msr[i]; +} + +static int msr_add(libxl_cpuid_policy_list *policy, uint32_t index, unsign= ed int bit, + const char *val) +{ + struct xc_msr *entry =3D msr_find_match(policy, index); + + /* Only allow options taking a character for MSRs, no values allowed. = */ + if (strlen(val) !=3D 1) + return 3; + + switch (val[0]) { + case '0': + case '1': + case 'x': + case 'k': + entry->policy[63 - bit] =3D val[0]; + break; + + case 's': + /* Translate s -> k as xc_msr doesn't support the deprecated 's'. = */ + entry->policy[63 - bit] =3D 'k'; + break; + + default: + return 3; + } + + return 0; +} + struct feature_name { const char *name; unsigned int bit; @@ -336,7 +390,15 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *= policy, const char* str) } =20 case FEAT_MSR: - return 2; + { + unsigned int bit =3D feat->bit % 32; + + if (feature_to_policy[feat->bit / 32].msr.reg =3D=3D CPUID_REG_EDX) + bit +=3D 32; + + return msr_add(policy, feature_to_policy[feat->bit / 32].msr.index, + bit, val); + } } =20 return 2; --=20 2.41.0