Lines Matching refs:cpu

123 		       "for bank %d, block %d (MSR%08X=0x%x%08x)\n", b->cpu,  in lvt_off_valid()
131 b->cpu, apic, b->bank, b->block, b->address, hi, lo); in lvt_off_valid()
212 unsigned int cpu = smp_processor_id(); in mce_amd_feature_init() local
241 per_cpu(bank_map, cpu) |= (1 << bank); in mce_amd_feature_init()
244 b.cpu = cpu; in mce_amd_feature_init()
279 int cpu = smp_processor_id(); in amd_threshold_interrupt() local
285 if (!(per_cpu(bank_map, cpu) & (1 << bank))) in amd_threshold_interrupt()
370 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1); in SHOW_FIELDS()
394 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1); in store_threshold_limit()
403 rdmsr_on_cpu(b->cpu, b->address, &lo, &hi); in show_error_count()
467 static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank, in allocate_threshold_blocks() argument
477 if (rdmsr_safe_on_cpu(cpu, address, &low, &high)) in allocate_threshold_blocks()
497 b->cpu = cpu; in allocate_threshold_blocks()
512 if (per_cpu(threshold_banks, cpu)[bank]->blocks) { in allocate_threshold_blocks()
514 &per_cpu(threshold_banks, cpu)[bank]->blocks->miscj); in allocate_threshold_blocks()
516 per_cpu(threshold_banks, cpu)[bank]->blocks = b; in allocate_threshold_blocks()
520 per_cpu(threshold_banks, cpu)[bank]->kobj, in allocate_threshold_blocks()
534 err = allocate_threshold_blocks(cpu, bank, ++block, address); in allocate_threshold_blocks()
576 static int threshold_create_bank(unsigned int cpu, unsigned int bank) in threshold_create_bank() argument
578 struct device *dev = per_cpu(mce_device, cpu); in threshold_create_bank()
585 nb = node_to_amd_nb(amd_get_nb_id(cpu)); in threshold_create_bank()
595 per_cpu(threshold_banks, cpu)[bank] = b; in threshold_create_bank()
616 per_cpu(threshold_banks, cpu)[bank] = b; in threshold_create_bank()
628 err = allocate_threshold_blocks(cpu, bank, 0, MSR_IA32_MCx_MISC(bank)); in threshold_create_bank()
640 static int threshold_create_device(unsigned int cpu) in threshold_create_device() argument
651 per_cpu(threshold_banks, cpu) = bp; in threshold_create_device()
654 if (!(per_cpu(bank_map, cpu) & (1 << bank))) in threshold_create_device()
656 err = threshold_create_bank(cpu, bank); in threshold_create_device()
664 static void deallocate_threshold_block(unsigned int cpu, in deallocate_threshold_block() argument
669 struct threshold_bank *head = per_cpu(threshold_banks, cpu)[bank]; in deallocate_threshold_block()
680 kfree(per_cpu(threshold_banks, cpu)[bank]->blocks); in deallocate_threshold_block()
681 per_cpu(threshold_banks, cpu)[bank]->blocks = NULL; in deallocate_threshold_block()
695 static void threshold_remove_bank(unsigned int cpu, int bank) in threshold_remove_bank() argument
700 b = per_cpu(threshold_banks, cpu)[bank]; in threshold_remove_bank()
710 per_cpu(threshold_banks, cpu)[bank] = NULL; in threshold_remove_bank()
717 nb = node_to_amd_nb(amd_get_nb_id(cpu)); in threshold_remove_bank()
722 deallocate_threshold_block(cpu, bank); in threshold_remove_bank()
728 per_cpu(threshold_banks, cpu)[bank] = NULL; in threshold_remove_bank()
731 static void threshold_remove_device(unsigned int cpu) in threshold_remove_device() argument
736 if (!(per_cpu(bank_map, cpu) & (1 << bank))) in threshold_remove_device()
738 threshold_remove_bank(cpu, bank); in threshold_remove_device()
740 kfree(per_cpu(threshold_banks, cpu)); in threshold_remove_device()
745 amd_64_threshold_cpu_callback(unsigned long action, unsigned int cpu) in amd_64_threshold_cpu_callback() argument
750 threshold_create_device(cpu); in amd_64_threshold_cpu_callback()
754 threshold_remove_device(cpu); in amd_64_threshold_cpu_callback()