Lines Matching refs:bank

85 static inline bool is_shared_bank(int bank)  in is_shared_bank()  argument
88 return (bank == 4); in is_shared_bank()
111 static bool lvt_interrupt_supported(unsigned int bank, u32 msr_high_bits) in lvt_interrupt_supported() argument
116 if (bank == 4) in lvt_interrupt_supported()
133 b->bank, b->block, b->address, hi, lo); in lvt_off_valid()
140 b->cpu, apic, b->bank, b->block, b->address, hi, lo); in lvt_off_valid()
256 unsigned int bank, block; in mce_amd_feature_init() local
259 for (bank = 0; bank < mca_cfg.banks; ++bank) { in mce_amd_feature_init()
262 address = MSR_IA32_MCx_MISC(bank); in mce_amd_feature_init()
283 per_cpu(bank_map, cpu) |= (1 << bank); in mce_amd_feature_init()
287 b.bank = bank; in mce_amd_feature_init()
290 b.interrupt_capable = lvt_interrupt_supported(bank, high); in mce_amd_feature_init()
312 static void __log_error(unsigned int bank, bool threshold_err, u64 misc) in __log_error() argument
317 rdmsrl(MSR_IA32_MCx_STATUS(bank), status); in __log_error()
324 m.bank = bank; in __log_error()
330 rdmsrl(MSR_IA32_MCx_ADDR(bank), m.addr); in __log_error()
333 wrmsrl(MSR_IA32_MCx_STATUS(bank), 0); in __log_error()
362 unsigned int bank; in amd_deferred_error_interrupt() local
364 for (bank = 0; bank < mca_cfg.banks; ++bank) { in amd_deferred_error_interrupt()
365 rdmsrl(MSR_IA32_MCx_STATUS(bank), status); in amd_deferred_error_interrupt()
371 __log_error(bank, false, 0); in amd_deferred_error_interrupt()
390 unsigned int bank, block; in amd_threshold_interrupt() local
393 for (bank = 0; bank < mca_cfg.banks; ++bank) { in amd_threshold_interrupt()
394 if (!(per_cpu(bank_map, cpu) & (1 << bank))) in amd_threshold_interrupt()
398 address = MSR_IA32_MCx_MISC(bank); in amd_threshold_interrupt()
433 __log_error(bank, true, ((u64)high << 32) | low); in amd_threshold_interrupt()
568 static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank, in allocate_threshold_blocks() argument
575 if ((bank >= mca_cfg.banks) || (block >= NR_BLOCKS)) in allocate_threshold_blocks()
597 b->bank = bank; in allocate_threshold_blocks()
601 b->interrupt_capable = lvt_interrupt_supported(bank, high); in allocate_threshold_blocks()
613 if (per_cpu(threshold_banks, cpu)[bank]->blocks) { in allocate_threshold_blocks()
615 &per_cpu(threshold_banks, cpu)[bank]->blocks->miscj); in allocate_threshold_blocks()
617 per_cpu(threshold_banks, cpu)[bank]->blocks = b; in allocate_threshold_blocks()
621 per_cpu(threshold_banks, cpu)[bank]->kobj, in allocate_threshold_blocks()
622 (bank == 4 ? bank4_names(b) : th_names[bank])); in allocate_threshold_blocks()
635 err = allocate_threshold_blocks(cpu, bank, ++block, address); in allocate_threshold_blocks()
677 static int threshold_create_bank(unsigned int cpu, unsigned int bank) in threshold_create_bank() argument
682 const char *name = th_names[bank]; in threshold_create_bank()
685 if (is_shared_bank(bank)) { in threshold_create_bank()
696 per_cpu(threshold_banks, cpu)[bank] = b; in threshold_create_bank()
717 per_cpu(threshold_banks, cpu)[bank] = b; in threshold_create_bank()
719 if (is_shared_bank(bank)) { in threshold_create_bank()
729 err = allocate_threshold_blocks(cpu, bank, 0, MSR_IA32_MCx_MISC(bank)); in threshold_create_bank()
743 unsigned int bank; in threshold_create_device() local
754 for (bank = 0; bank < mca_cfg.banks; ++bank) { in threshold_create_device()
755 if (!(per_cpu(bank_map, cpu) & (1 << bank))) in threshold_create_device()
757 err = threshold_create_bank(cpu, bank); in threshold_create_device()
766 unsigned int bank) in deallocate_threshold_block() argument
770 struct threshold_bank *head = per_cpu(threshold_banks, cpu)[bank]; in deallocate_threshold_block()
781 kfree(per_cpu(threshold_banks, cpu)[bank]->blocks); in deallocate_threshold_block()
782 per_cpu(threshold_banks, cpu)[bank]->blocks = NULL; in deallocate_threshold_block()
796 static void threshold_remove_bank(unsigned int cpu, int bank) in threshold_remove_bank() argument
801 b = per_cpu(threshold_banks, cpu)[bank]; in threshold_remove_bank()
808 if (is_shared_bank(bank)) { in threshold_remove_bank()
811 per_cpu(threshold_banks, cpu)[bank] = NULL; in threshold_remove_bank()
823 deallocate_threshold_block(cpu, bank); in threshold_remove_bank()
829 per_cpu(threshold_banks, cpu)[bank] = NULL; in threshold_remove_bank()
834 unsigned int bank; in threshold_remove_device() local
836 for (bank = 0; bank < mca_cfg.banks; ++bank) { in threshold_remove_device()
837 if (!(per_cpu(bank_map, cpu) & (1 << bank))) in threshold_remove_device()
839 threshold_remove_bank(cpu, bank); in threshold_remove_device()