diff mbox series

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

Message ID 4e675365-4ca8-9e86-aed3-ab00571b0066@suse.com (mailing list archive)
State New, archived
Headers show
Series x86/cpu-policy: minor adjustments | expand

Commit Message

Jan Beulich Aug. 29, 2023, 12:16 p.m. UTC
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@suse.com>
diff mbox series

Patch

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