@@ -200,7 +200,7 @@ static void init_or_livepatch _apply_alternatives(struct alt_instr *start,
BUG_ON(a->repl_len > total_len);
BUG_ON(total_len > sizeof(buf));
- BUG_ON(a->cpuid >= NCAPINTS * 32);
+ BUG_ON(a->cpuid >= X86_NR_CAPS * 32);
/*
* Detect sequences of alt_instr's patching the same origin site, and
@@ -55,8 +55,8 @@ unsigned int paddr_bits __read_mostly = 36;
unsigned int hap_paddr_bits __read_mostly = 36;
unsigned int vaddr_bits __read_mostly = VADDR_BITS;
-static unsigned int cleared_caps[NCAPINTS];
-static unsigned int forced_caps[NCAPINTS];
+static unsigned int cleared_caps[X86_NR_CAPS];
+static unsigned int forced_caps[X86_NR_CAPS];
DEFINE_PER_CPU(bool, full_gdt_loaded);
@@ -501,7 +501,7 @@ void identify_cpu(struct cpuinfo_x86 *c)
#ifdef NOISY_CAPS
printk(KERN_DEBUG "CPU: After vendor identify, caps:");
- for (i = 0; i < NCAPINTS; i++)
+ for (i = 0; i < X86_NR_CAPS; i++)
printk(" %08x", c->x86_capability[i]);
printk("\n");
#endif
@@ -530,7 +530,7 @@ void identify_cpu(struct cpuinfo_x86 *c)
for (i = 0; i < FSCAPINTS; ++i)
c->x86_capability[i] &= known_features[i];
- for (i = 0 ; i < NCAPINTS ; ++i) {
+ for (i = 0 ; i < X86_NR_CAPS ; ++i) {
c->x86_capability[i] |= forced_caps[i];
c->x86_capability[i] &= ~cleared_caps[i];
}
@@ -548,7 +548,7 @@ void identify_cpu(struct cpuinfo_x86 *c)
#ifdef NOISY_CAPS
printk(KERN_DEBUG "CPU: After all inits, caps:");
- for (i = 0; i < NCAPINTS; i++)
+ for (i = 0; i < X86_NR_CAPS; i++)
printk(" %08x", c->x86_capability[i]);
printk("\n");
#endif
@@ -585,7 +585,7 @@ void identify_cpu(struct cpuinfo_x86 *c)
*/
if ( c != &boot_cpu_data ) {
/* AND the already accumulated flags with these */
- for ( i = 0 ; i < NCAPINTS ; i++ )
+ for ( i = 0 ; i < X86_NR_CAPS ; i++ )
boot_cpu_data.x86_capability[i] &= c->x86_capability[i];
mcheck_init(c, false);
@@ -19,7 +19,7 @@ bool recheck_cpu_features(unsigned int cpu)
identify_cpu(&c);
- for ( i = 0; i < NCAPINTS; ++i )
+ for ( i = 0; i < X86_NR_CAPS; ++i )
{
if ( !(~c.x86_capability[i] & bsp->x86_capability[i]) )
continue;
@@ -26,7 +26,7 @@ struct cpuinfo_x86 {
unsigned char x86_mask;
int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */
unsigned int extended_cpuid_level; /* Maximum supported CPUID extended level */
- unsigned int x86_capability[NCAPINTS];
+ unsigned int x86_capability[X86_NR_CAPS];
char x86_vendor_id[16];
char x86_model_id[64];
unsigned int x86_cache_size; /* in KB - valid only when supported */
@@ -53,4 +53,4 @@ XEN_CPUFEATURE(IBPB_ENTRY_HVM, X86_SYNTH(29)) /* MSR_PRED_CMD used by Xen for
#define X86_BUG_IBPB_NO_RET X86_BUG( 3) /* IBPB doesn't flush the RSB/RAS */
/* Total number of capability words, inc synth and bug words. */
-#define NCAPINTS (FSCAPINTS + X86_NR_SYNTH + X86_NR_BUG) /* N 32-bit words worth of info */
+#define X86_NR_CAPS (FSCAPINTS + X86_NR_SYNTH + X86_NR_BUG) /* N 32-bit words worth of info */
The latter is more legible, and consistent with X86_NR_{SYNTH,BUG} which already exist. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- CC: Jan Beulich <JBeulich@suse.com> CC: Roger Pau Monné <roger.pau@citrix.com> CC: Wei Liu <wl@xen.org> --- xen/arch/x86/alternative.c | 2 +- xen/arch/x86/cpu/common.c | 12 ++++++------ xen/arch/x86/cpuid.c | 2 +- xen/arch/x86/include/asm/cpufeature.h | 2 +- xen/arch/x86/include/asm/cpufeatures.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-)