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/FKJqxY6WMJepsLFTMOqRQDaJXN+ZBBFuvm5FkEuzw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nHMpT46FJEfKH+?= =?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), ))