[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] x86/cpu-policy: drop NR_DEEP_DEPS


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 29 Aug 2023 14:16:12 +0200
  • 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
  • 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-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zr093Ac/ai/UHHUxClmI7wS5XPRAXYsSQqiPCUjQ8M74c2MGEz3ojE1wtxWcIj6CKcJsdmSCGvbAVNAyOPBLmrkrMOsNuh5C/qqH4dLm3LoOgP7pI7cUptRijCPNFBp3Ad5bIP5c78knIx+3z7EN2EsLB5pdp0uY61RPblI7HyWXifPcJlZWNv5tcH8d0T03j5FFmbbZI8a5sEM7f67UGRJP6VwtgG8NVceuO+J09HmR3vlFETk617pTVfopXitg2jGz8GZU9fKdKM1H/7owmjPwtBI99DJhH2EMtwmyC8jULKTUH3w9hzLRSA/m60Ej6rfUoIyr6X0zgudd4oJ8GQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 29 Aug 2023 12:16:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <jbeulich@xxxxxxxx>

--- 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),
        ))
 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.