Skip to content

Commit d346415

Browse files
committed
Merge tag 'ras_core_for_v6.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RAS updates from Borislav Petkov: - Just cleanups and fixes this time around: make threshold_ktype const, an objtool fix and use proper size for a bitmap * tag 'ras_core_for_v6.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/MCE/AMD: Use an u64 for bank_map x86/mce: Always inline old MCA stubs x86/MCE/AMD: Make kobj_type structure constant
2 parents e94ee64 + 4c1cdec commit d346415

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

arch/x86/kernel/cpu/mce/amd.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ static DEFINE_PER_CPU(struct threshold_bank **, threshold_banks);
235235
* A list of the banks enabled on each logical CPU. Controls which respective
236236
* descriptors to initialize later in mce_threshold_create_device().
237237
*/
238-
static DEFINE_PER_CPU(unsigned int, bank_map);
238+
static DEFINE_PER_CPU(u64, bank_map);
239239

240240
/* Map of banks that have more than MCA_MISC0 available. */
241-
static DEFINE_PER_CPU(u32, smca_misc_banks_map);
241+
static DEFINE_PER_CPU(u64, smca_misc_banks_map);
242242

243243
static void amd_threshold_interrupt(void);
244244
static void amd_deferred_error_interrupt(void);
@@ -267,7 +267,7 @@ static void smca_set_misc_banks_map(unsigned int bank, unsigned int cpu)
267267
return;
268268

269269
if (low & MASK_BLKPTR_LO)
270-
per_cpu(smca_misc_banks_map, cpu) |= BIT(bank);
270+
per_cpu(smca_misc_banks_map, cpu) |= BIT_ULL(bank);
271271

272272
}
273273

@@ -530,7 +530,7 @@ static u32 smca_get_block_address(unsigned int bank, unsigned int block,
530530
if (!block)
531531
return MSR_AMD64_SMCA_MCx_MISC(bank);
532532

533-
if (!(per_cpu(smca_misc_banks_map, cpu) & BIT(bank)))
533+
if (!(per_cpu(smca_misc_banks_map, cpu) & BIT_ULL(bank)))
534534
return 0;
535535

536536
return MSR_AMD64_SMCA_MCx_MISCy(bank, block - 1);
@@ -574,7 +574,7 @@ prepare_threshold_block(unsigned int bank, unsigned int block, u32 addr,
574574
int new;
575575

576576
if (!block)
577-
per_cpu(bank_map, cpu) |= (1 << bank);
577+
per_cpu(bank_map, cpu) |= BIT_ULL(bank);
578578

579579
memset(&b, 0, sizeof(b));
580580
b.cpu = cpu;
@@ -878,7 +878,7 @@ static void amd_threshold_interrupt(void)
878878
return;
879879

880880
for (bank = 0; bank < this_cpu_read(mce_num_banks); ++bank) {
881-
if (!(per_cpu(bank_map, cpu) & (1 << bank)))
881+
if (!(per_cpu(bank_map, cpu) & BIT_ULL(bank)))
882882
continue;
883883

884884
first_block = bp[bank]->blocks;
@@ -1029,7 +1029,7 @@ static const struct sysfs_ops threshold_ops = {
10291029

10301030
static void threshold_block_release(struct kobject *kobj);
10311031

1032-
static struct kobj_type threshold_ktype = {
1032+
static const struct kobj_type threshold_ktype = {
10331033
.sysfs_ops = &threshold_ops,
10341034
.default_groups = default_groups,
10351035
.release = threshold_block_release,
@@ -1356,7 +1356,7 @@ int mce_threshold_create_device(unsigned int cpu)
13561356
return -ENOMEM;
13571357

13581358
for (bank = 0; bank < numbanks; ++bank) {
1359-
if (!(this_cpu_read(bank_map) & (1 << bank)))
1359+
if (!(this_cpu_read(bank_map) & BIT_ULL(bank)))
13601360
continue;
13611361
err = threshold_create_bank(bp, cpu, bank);
13621362
if (err) {

arch/x86/kernel/cpu/mce/internal.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ noinstr void pentium_machine_check(struct pt_regs *regs);
244244
noinstr void winchip_machine_check(struct pt_regs *regs);
245245
static inline void enable_p5_mce(void) { mce_p5_enabled = 1; }
246246
#else
247-
static inline void intel_p5_mcheck_init(struct cpuinfo_x86 *c) {}
248-
static inline void winchip_mcheck_init(struct cpuinfo_x86 *c) {}
249-
static inline void enable_p5_mce(void) {}
250-
static inline void pentium_machine_check(struct pt_regs *regs) {}
251-
static inline void winchip_machine_check(struct pt_regs *regs) {}
247+
static __always_inline void intel_p5_mcheck_init(struct cpuinfo_x86 *c) {}
248+
static __always_inline void winchip_mcheck_init(struct cpuinfo_x86 *c) {}
249+
static __always_inline void enable_p5_mce(void) {}
250+
static __always_inline void pentium_machine_check(struct pt_regs *regs) {}
251+
static __always_inline void winchip_machine_check(struct pt_regs *regs) {}
252252
#endif
253253

254254
noinstr u64 mce_rdmsrl(u32 msr);

0 commit comments

Comments
 (0)