[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 2/6] x86/cpuid: Rename NCAPINTS to X86_NR_CAPS
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@xxxxxxxxxx> --- CC: Jan Beulich <JBeulich@xxxxxxxx> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx> CC: Wei Liu <wl@xxxxxxx> --- 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(-) diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c index 99482766b51f..0434030693a9 100644 --- a/xen/arch/x86/alternative.c +++ b/xen/arch/x86/alternative.c @@ -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 diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c index edc4db1335eb..1be049e332ce 100644 --- a/xen/arch/x86/cpu/common.c +++ b/xen/arch/x86/cpu/common.c @@ -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); diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c index 455a09b2dd22..fd8021c6f16c 100644 --- a/xen/arch/x86/cpuid.c +++ b/xen/arch/x86/cpuid.c @@ -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; diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h index 4140ec0938b2..66bd4e296a18 100644 --- a/xen/arch/x86/include/asm/cpufeature.h +++ b/xen/arch/x86/include/asm/cpufeature.h @@ -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 */ diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h index da0593de8542..e982ee920ce1 100644 --- a/xen/arch/x86/include/asm/cpufeatures.h +++ b/xen/arch/x86/include/asm/cpufeatures.h @@ -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 */ -- 2.30.2
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |