Lines Matching refs:bank
76 static inline bool is_shared_bank(int bank) in is_shared_bank() argument
79 return (bank == 4); in is_shared_bank()
102 static bool lvt_interrupt_supported(unsigned int bank, u32 msr_high_bits) in lvt_interrupt_supported() argument
107 if (bank == 4) in lvt_interrupt_supported()
124 b->bank, b->block, b->address, hi, lo); in lvt_off_valid()
131 b->cpu, apic, b->bank, b->block, b->address, hi, lo); in lvt_off_valid()
214 unsigned int bank, block; in mce_amd_feature_init() local
217 for (bank = 0; bank < mca_cfg.banks; ++bank) { in mce_amd_feature_init()
220 address = MSR_IA32_MCx_MISC(bank); in mce_amd_feature_init()
241 per_cpu(bank_map, cpu) |= (1 << bank); in mce_amd_feature_init()
245 b.bank = bank; in mce_amd_feature_init()
248 b.interrupt_capable = lvt_interrupt_supported(bank, high); in mce_amd_feature_init()
280 unsigned int bank, block; in amd_threshold_interrupt() local
284 for (bank = 0; bank < mca_cfg.banks; ++bank) { in amd_threshold_interrupt()
285 if (!(per_cpu(bank_map, cpu) & (1 << bank))) in amd_threshold_interrupt()
289 address = MSR_IA32_MCx_MISC(bank); in amd_threshold_interrupt()
325 rdmsrl(MSR_IA32_MCx_STATUS(bank), m.status); in amd_threshold_interrupt()
329 m.bank = bank; in amd_threshold_interrupt()
332 wrmsrl(MSR_IA32_MCx_STATUS(bank), 0); in amd_threshold_interrupt()
467 static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank, in allocate_threshold_blocks() argument
474 if ((bank >= mca_cfg.banks) || (block >= NR_BLOCKS)) in allocate_threshold_blocks()
496 b->bank = bank; in allocate_threshold_blocks()
500 b->interrupt_capable = lvt_interrupt_supported(bank, high); 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()
521 (bank == 4 ? bank4_names(b) : th_names[bank])); 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
581 const char *name = th_names[bank]; in threshold_create_bank()
584 if (is_shared_bank(bank)) { 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()
618 if (is_shared_bank(bank)) { in threshold_create_bank()
628 err = allocate_threshold_blocks(cpu, bank, 0, MSR_IA32_MCx_MISC(bank)); in threshold_create_bank()
642 unsigned int bank; in threshold_create_device() local
653 for (bank = 0; bank < mca_cfg.banks; ++bank) { 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()
665 unsigned int bank) 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()
707 if (is_shared_bank(bank)) { in threshold_remove_bank()
710 per_cpu(threshold_banks, cpu)[bank] = NULL; 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()
733 unsigned int bank; in threshold_remove_device() local
735 for (bank = 0; bank < mca_cfg.banks; ++bank) { in threshold_remove_device()
736 if (!(per_cpu(bank_map, cpu) & (1 << bank))) in threshold_remove_device()
738 threshold_remove_bank(cpu, bank); in threshold_remove_device()