From patchwork Tue Aug 29 12:15:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13368926 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24FD9C6FA8F for ; Tue, 29 Aug 2023 12:16:04 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.592149.924777 (Exim 4.92) (envelope-from ) id 1qaxdM-0004HN-DX; Tue, 29 Aug 2023 12:15:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 592149.924777; Tue, 29 Aug 2023 12:15:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qaxdM-0004HG-9y; Tue, 29 Aug 2023 12:15:48 +0000 Received: by outflank-mailman (input) for mailman id 592149; Tue, 29 Aug 2023 12:15:46 +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 1qaxdK-0004H8-QK for xen-devel@lists.xenproject.org; Tue, 29 Aug 2023 12:15:46 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0623.outbound.protection.outlook.com [2a01:111:f400:fe0c::623]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c7ce8479-4665-11ee-8783-cb3800f73035; Tue, 29 Aug 2023 14:15:45 +0200 (CEST) Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by PAXPR04MB8607.eurprd04.prod.outlook.com (2603:10a6:102:21a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.34; Tue, 29 Aug 2023 12:15:44 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654%5]) with mapi id 15.20.6699.035; Tue, 29 Aug 2023 12:15:44 +0000 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: c7ce8479-4665-11ee-8783-cb3800f73035 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mhB02qnKHgjXbFIjQdzgZpJVdR8I2qepqGYJJDl0erwphCiULLihTekfFDjyDV2wb+bqS5iXyyWsEfSVHkrGh7vJZfMuUSE/9mh6Q+/JVfdYaOi5UvYGA5C0r/wpIHbjYFGAh4sGO3AuMzdwRhSzg3Mtm9t9vQhyVsXT+pmMs2Irx5Sz6qTKEj9dymzcxQQbiX1UVDjDQACnpXQvAhHIMwpggX4BfRulZQLz7sjE/9eprpkQ//MyDkawduLCVAK8LmwYssvRGM1fRwS4wq6z+NHB/KvzPClJVFtkVKsAro/NWLaK/1oSBdXgfGQn5c/8CCq6NGQWYyTeA1a94Np6JA== 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=3kOaYSK1aU6BycTvCRMwKPEsD3WbAgMeYjultb2R0/4=; b=ldhmHd/q0JUoK/lY9A3FEKMyRLaM2zjEg0/R+EShMcQvzuYGUNaPM9krOx5jHUvSdDtxmzX6huRotqEy+klaGBEnZ8n79D2Y4kQbfCW2RIzuA5q2uTlekmS9j487eFPlAGT/AW88ObTA0cpZJXXUu+uFaTDXU8PuArRN+vdplZ0Pr8xfwY0VvjHG11MtL8d0AaqWmzr+7EZBWo4p99PnaQxyt/D7aUk22gDfsJXepm5ERavKkUQ4P8eq8goSkoJInfR8cQoImlxhCO9rqx0p1OyOe1dALQ6cHIxRhG9pI9DtOWfT/PUmZvUNPKkfefsCqIufTyrww0cAs9aE3MJlbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3kOaYSK1aU6BycTvCRMwKPEsD3WbAgMeYjultb2R0/4=; b=aMqQ8dK9pTxpu2XrGq5SdMS4VpxV4tDkRhevu1ryrL1EaqQwKCJkVeBpIdx8EePzx04PMoPPNzFxvhm/gpUcLJDK3CQzb5ViGB88cgsOVVtcS+pdf5Ai2xAKXhMNdHwYxsqCI4CeN1ku+AL/nTX7SfyUMouHZ2jmvhsbxXOFq1RqXJGugKZDZBD98uMfqp+GYOBKmfzL45wvO5M1pTBKouopYk7O3Vq2upuWXYGCXx2044H0cvhzu+LFPQDETuOpi09tH2RidgebUbIWgi6NSdUjWv10I3GPXzFBcUGSRF3d+2J2HiyMATP3Nnxl3dxMaxqI44GGvJlmVcTXKs2vjw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Tue, 29 Aug 2023 14:15:42 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: [PATCH 1/2] x86/cpu-policy: add (another) size check of deep_features[] Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <647aa53f-9b2f-df38-6de4-3e407f34f7f5@suse.com> In-Reply-To: <647aa53f-9b2f-df38-6de4-3e407f34f7f5@suse.com> X-ClientProxiedBy: FR0P281CA0164.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b3::6) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8607:EE_ X-MS-Office365-Filtering-Correlation-Id: 0253f620-667b-4bd7-fb5d-08dba889ab5b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cCw93K/9MrQ29s8grr7kAOXBG03fCa2aejX5qG3X1odhGpIXWRsY5+5/kNIYntL/bkOmpdecwkyhPrw7HNQzuR8+c9vDoF1Dk4u7bTe1Jc936Af5o6+e4WIY6FvryE/l19InZoko9DTI4CtfFL+0cy+sxSyL14mC3W73z8rTZpGHZR4HBFv7lCUuIhMc7ceXqbmUgAGvzYf+mnqOPgUrYHfb7c0Eizf778esPSQJDUHAhL7rDugRK7sT5+0KR73xtgu08hpCWe94/Lm4NeGDBYfG2pEu9VjqbaXsMab7rT0x024aSOYaZUILRh1cPvp3K76ce9/h5QMl0ItniMRKIhMpDcqwc5BVwLIv5WhZ9RNhgpuKJm+sWwiSUbKSrC+h5SSaZf6qBSf0bZkcJxKDHplHJ6Qj5FKv/7CE3Jp85zcW7wHBfPjmhB0yhSl70AdmuaQKOBsie3BSsBumKwxk8PAYo6LNTdLk+RidX6g4FuUw9wQuGxJd0pAAD6z+ha+MOEeOunvQqJY9SiwKrW0lgiE0ixEU+aZ4lE7k0ZtF65xk3dqCRwp5EtPnZnod1cGAJxz3cnCZPqH/nqTwgeiEa/+O8AhC26oBRWomrfNJQ7m6AoENGyNLihPOQC0piDP+e6OhTmnJ0uC2DT8S2yRFOQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(346002)(39860400002)(376002)(396003)(186009)(1800799009)(451199024)(6506007)(6486002)(86362001)(31696002)(36756003)(26005)(2616005)(6512007)(316002)(6916009)(5660300002)(66946007)(66556008)(41300700001)(66476007)(38100700002)(54906003)(31686004)(2906002)(478600001)(8936002)(4744005)(8676002)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?VZbeAOG40MCcr0EiFUslb2EHyy1A?= =?utf-8?q?VeDBHruONHnOQzGc4ed4pqd9BCiLep7ujDYqulFD5ngiSVueh+jb2tokqLyrC1B1b?= =?utf-8?q?7k3MxT3Q9GUp9lle81Wn2+ZHJko5yG8RKWFuRkusf7MDYMfy+HNr6iy5CxryVu9gC?= =?utf-8?q?FmFcLZ+cN+8a0ruvCZawXZspIELTTJcglhzjK3FPdQWe8M5WWt7bh6bsDWP2u3wJI?= =?utf-8?q?RLWNN0N/S4TyTzDmAi4nvWeC8rhz3r4Do4god65Cw3IbEIm09MrC1ewc1DwWi/Gtp?= =?utf-8?q?5cL0vksxmxaj6ccE+5o+/yXEkbYb+jtqusRU8lFrqZPdaTJMi1Htj4+boXWJdtoPC?= =?utf-8?q?RCjtwJ/RMBWucdJzDhYKxMi4Y/PNec3qhGN3Zyaw0rtSJ8SmNiJZas+/u0yqnU4EM?= =?utf-8?q?CsXO4vZDxOLFM/DNF4vf3uqIdHNRTkFBbeKZPD7/gHSYyDmsRyztipxLSEet7jF6Q?= =?utf-8?q?lfV5DSQ3/bFwLnge4jP2JlMTrlcxb7nToZbnrH4S2KZgHJ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xBWM2LsS/MqTho4hcpW2yr?= =?utf-8?q?qUOAH0simDHFDgtWEan0fKqZhoCFoZj5aiin+SjS8YLJKxGTQxnKFbjm/rnxPheTS?= =?utf-8?q?QFbHRkvTjToLX29He3s7PabG4oTjx/qYZqn/aO8+XhMBTiLS1xPqFwr5uKMXAD8S5?= =?utf-8?q?llXij0//Qyom?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0253f620-667b-4bd7-fb5d-08dba889ab5b X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2023 12:15:44.3165 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ROtCMdfk7qT1nOBG4Ic7ltVoNMEziFWw6Zgcphvda/TVJMNL67HTvWUNW6OPt+Xijbeu36RIEO/clqztCf0B6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8607 Having this check in library code guarantees that the tool stack use(s) will also be covered. Signed-off-by: Jan Beulich --- Dropping the check from arch/x86/cpu-policy.c:build_assertions() in exchange may be an option. While there checking is against FSCAPINTS, the difference is only on the surface: That's a #define resolving to FEATURESET_NR_ENTRIES. Really the duplication of deep_features[] itself is also somewhat odd. While not quite as big as deep_deps[], both Xen and libxg could certainly get away with just a single instance each. --- a/xen/lib/x86/cpuid.c +++ b/xen/lib/x86/cpuid.c @@ -298,6 +298,7 @@ const uint32_t *x86_cpu_policy_lookup_de } deep_deps[] = INIT_DEEP_DEPS; unsigned int start = 0, end = ARRAY_SIZE(deep_deps); + BUILD_BUG_ON(ARRAY_SIZE(deep_features) != FEATURESET_NR_ENTRIES); BUILD_BUG_ON(ARRAY_SIZE(deep_deps) != NR_DEEP_DEPS); /* Fast early exit. */ From patchwork Tue Aug 29 12:16:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13368927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2361C83F12 for ; Tue, 29 Aug 2023 12:16:52 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.592155.924787 (Exim 4.92) (envelope-from ) id 1qaxeG-0004ti-Oy; Tue, 29 Aug 2023 12:16:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 592155.924787; Tue, 29 Aug 2023 12:16: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 1qaxeG-0004tb-MF; Tue, 29 Aug 2023 12:16:44 +0000 Received: by outflank-mailman (input) for mailman id 592155; Tue, 29 Aug 2023 12:16:44 +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 1qaxeG-0004tN-1P for xen-devel@lists.xenproject.org; Tue, 29 Aug 2023 12:16:44 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2045.outbound.protection.outlook.com [40.107.13.45]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e9e5bd83-4665-11ee-8783-cb3800f73035; Tue, 29 Aug 2023 14:16:42 +0200 (CEST) Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by PAXPR04MB8607.eurprd04.prod.outlook.com (2603:10a6:102:21a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.34; Tue, 29 Aug 2023 12:16:14 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654%5]) with mapi id 15.20.6699.035; Tue, 29 Aug 2023 12:16:14 +0000 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: e9e5bd83-4665-11ee-8783-cb3800f73035 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zr093Ac/ai/UHHUxClmI7wS5XPRAXYsSQqiPCUjQ8M74c2MGEz3ojE1wtxWcIj6CKcJsdmSCGvbAVNAyOPBLmrkrMOsNuh5C/qqH4dLm3LoOgP7pI7cUptRijCPNFBp3Ad5bIP5c78knIx+3z7EN2EsLB5pdp0uY61RPblI7HyWXifPcJlZWNv5tcH8d0T03j5FFmbbZI8a5sEM7f67UGRJP6VwtgG8NVceuO+J09HmR3vlFETk617pTVfopXitg2jGz8GZU9fKdKM1H/7owmjPwtBI99DJhH2EMtwmyC8jULKTUH3w9hzLRSA/m60Ej6rfUoIyr6X0zgudd4oJ8GQ== 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=byPlITSxbU6diXzkr7Yqb4ZAxb+D+Yzm0kXT6k472aI=; b=mVlevpvwK0Mpi3guA0HSMmjPL2FiE/2c5drXXVFhHZhynuU9GyfOVIrOysPb9/pJR6u0YFccn2P9bBcJrpHLB20BC/+/VdesdwepNfo1xqrEDx3yYKcSr8Ej5bpVv1x1V/VqKTtKLQL5EgTnjqfc1XZ4yS0AoE7qKCNJ/Zu7Ici5KnDqz+GhqQCCkz4bMRpdnwYS+Uqj5i74Lx6LRtIIEX2G8QFIQh92Y81KCkfU3YD//gtSLWISravON6rOjiD2fjZQ3DY3xPkMqUo2eBrJ2msqUP7jCROVKDmRHLVzzvyZh7s1jhl8AXoJ9OiQ3rZtsBdg/vYDisvNM75atD4IaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=byPlITSxbU6diXzkr7Yqb4ZAxb+D+Yzm0kXT6k472aI=; b=PD/cadMmtapkYdLto3ZbkCZHh8OIIMpnbfunAwYTkdgy5ZV0+t2ksmICIclE5giWoy2OfJdu6MBjCIEbzgd499PXIohNS48xUj2V65lWli8bBjiqfS1LrpSC3g7zHG6aMwuYP0y1swscaX0CF+P2JTsbIA23PED/uS7Jb6dgGUoNO6Zvn8Si+kyDYgbTSjqUQvVqQ2t2wWCrSpmL5u9CuW/1HuW3OhJHI9Qe0/gmSCHcNfFqFF1NhEbNkFdjpIwKSv0iqqsGtiXmfg3kv5idka4llPdxAwDa4saiKiAAB4mYJRCOCDZVU2PEAFD8QTFVjNSVlUfJO8tfzySs5lX3UQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <4e675365-4ca8-9e86-aed3-ab00571b0066@suse.com> Date: Tue, 29 Aug 2023 14:16:12 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: [PATCH 2/2] x86/cpu-policy: drop NR_DEEP_DEPS Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <647aa53f-9b2f-df38-6de4-3e407f34f7f5@suse.com> In-Reply-To: <647aa53f-9b2f-df38-6de4-3e407f34f7f5@suse.com> X-ClientProxiedBy: FR0P281CA0152.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b3::7) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8607:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c97185d-0f97-435a-912a-08dba889bd22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lIbVtjovJlQTOwX71qH0T5IqzrNn7UbjuuIao0wW1ZWeX3IjlbmPMCdpMC7uIBcibbCCzS0Xt2gY+OpjVTJmwdP9yXgPn33kVHGOogkWwxfAKdXYjjZoxXj0tNn4c8meJSBipptjiCex1oN9lXTLWPyP+NqWyKi2LPSjL9+cekFgKtnCshYMfDxHlJUMn5ITv1JUnecI97jlS3+/tGcDiYAocBzifCLhxoepFhUM7Ivlz3jhzY5uNqEbNmpO1V3xvHteUKVLvuI7+CU2D8/aeqA15WltDXG3pY+UtP/UgIYYUpcxw+U65BJIbAPRjddVFONtrbXdfTQEABKRPkoeARHpXbBDPDE4O9kC2uYc/RReKFkoVTWazU4QzbpBwaojeviKruUJeUve5BqBOibiClOoCcgS9ZoJrUcN3n4zwc6W3qoPw80fmju52M3XnvxXdUyd2l229yRfd7I6WBaWmpBMCnFHkpj22OOrf8DmqDnwHVKoqhT+XX0XR26KvWXxp4Kt08tK1/tCVWbTqghi8yhZulkKSnG64rtW2itMAtSf1ti12PsuLLPcuQPNcMBMshoPW5vELtkjXKAm2sCZAbTa5Su+qjQkfqPuDn/y4dZfQQAcYaHRn9qqaeHAWEB3Ey9zHtW22ueLM10Q0nHpTw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(346002)(39860400002)(376002)(396003)(186009)(1800799009)(451199024)(6506007)(6486002)(86362001)(31696002)(36756003)(26005)(2616005)(6512007)(316002)(6916009)(5660300002)(66946007)(66556008)(41300700001)(66476007)(38100700002)(54906003)(31686004)(2906002)(478600001)(8936002)(8676002)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?61nWuYEB7Nt0smicckNIaOifImpY?= =?utf-8?q?klmf60QAnZFdAfe5hVsia56E/w8A9uw3NMbzcmezKIVYx4Eu2E7y6UmQt7jnLD7oL?= =?utf-8?q?C1JtQRB1SqsuVHWkKllDEPeCdj6lwssqb9IG23EV/UwenDtYEh6H0SZkpLJpI0PMx?= =?utf-8?q?wmTqYkh3rOutgIEXxTSUg2JnUloQqnO5ZmZWvDH5uuoocP38Kj3WVQkrpDLa58EId?= =?utf-8?q?KfYjImKUU2W00/Bq6xL3s4Bjyy9lJSCFDq1shJZWkSYmSfQCftr6APLsw5EqQwqh6?= =?utf-8?q?w942oHKHlzJEU5Qq5qMxZ7nklE1+C3LO7zqsoNYG2KW0rd/FbyXmQyN90OFtxCh0R?= =?utf-8?q?41owH22oMlaWHwmNNFfRHb09rDSWLL8CyooTtc5TzvVzW5cjiz64b4TXT034oF3Y2?= =?utf-8?q?GBupVvi7EUEGXAXuqT4GMEYE8DFv0uEliohCf+JBz3hyiz9Sjqaqng5o97MkKnxiP?= =?utf-8?q?0M3Dk/FKJqxY6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40hepwmlsSCCPSb/sfHUMqNLAiSyN/M+uhNMnHMpT46FJEfKH+?= =?utf-8?q?/4Brw6a4Wv7tPi4+Mt7wr1x9YOke6V6lN3W1/HVom+2oJvU4Rdut4YZ9y4t0URIIZ?= =?utf-8?q?gmqEkndlcWL6pJFaiQt3281gl7CgL8kuQ+7Fr0Zm9tXaGpJc2bsF3tUjhJ86ZFAMj?= =?utf-8?q?lQ+SV8Z7Xcyc?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c97185d-0f97-435a-912a-08dba889bd22 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2023 12:16:14.1473 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +VNxT7r4ZuQn0ONG7MAGgkhsdq8j7J/6vJG90g63IhNUDnn/CO+LybCbpW2LG4NPCpdABaYFpnPV10AkjJD8Yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8607 The constant is solely used in a build time check of the array size of x86_cpu_policy_lookup_deep_deps():deep_deps[], thus merely proving that Python got its internal calculations right. There's no real dependency on this constant expressing the number of elements in INIT_DEEP_DEPS. Signed-off-by: Jan Beulich --- a/xen/lib/x86/cpuid.c +++ b/xen/lib/x86/cpuid.c @@ -299,7 +299,6 @@ const uint32_t *x86_cpu_policy_lookup_de unsigned int start = 0, end = ARRAY_SIZE(deep_deps); BUILD_BUG_ON(ARRAY_SIZE(deep_features) != FEATURESET_NR_ENTRIES); - BUILD_BUG_ON(ARRAY_SIZE(deep_deps) != NR_DEEP_DEPS); /* Fast early exit. */ if ( !test_bit(feature, deep_features) ) --- a/xen/tools/gen-cpuid.py +++ b/xen/tools/gen-cpuid.py @@ -37,7 +37,6 @@ class State(object): self.hvm_hap_max = set() # HVM HAP max features self.bitfields = [] # Text to declare named bitfields in C self.deep_deps = {} # { feature num => dependant features } - self.nr_deep_deps = 0 # Number of entries in deep_deps self.deep_features = set() # featureset of keys in deep_deps def parse_definitions(state): @@ -362,7 +361,6 @@ def crunch_numbers(state): state.deep_deps[feat] = seen[1:] state.deep_features = deps.keys() - state.nr_deep_deps = len(state.deep_deps.keys()) # Calculate the bitfield name declarations. Leave 4 placeholders on the end for word in range(state.nr_entries + 4): @@ -421,8 +419,6 @@ def write_results(state): #define INIT_HVM_HAP_MAX_FEATURES { \\\n%s\n} -#define NR_DEEP_DEPS %sU - #define INIT_DEEP_FEATURES { \\\n%s\n} #define INIT_DEEP_DEPS { \\ @@ -436,7 +432,6 @@ def write_results(state): format_uint32s(state, state.hvm_shadow_max, 4), format_uint32s(state, state.hvm_hap_def, 4), format_uint32s(state, state.hvm_hap_max, 4), - state.nr_deep_deps, format_uint32s(state, state.deep_features, 4), ))