函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:arch\x86\kernel\cpu\mce\core.c Create Date:2022-07-27 09:01:10
首页 Copyright©Brick

802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
/*
 * Do a quick check if any of the events requires a panic.
 * This decides if we keep the events around or clear them.
 */
static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp,
              struct pt_regs *regs)
{
    char *tmp;
    int i;
 
    for (i = 0; i < this_cpu_read(mce_num_banks); i++) {
        m->status = mce_rdmsrl(msr_ops.status(i));
        if (!(m->status & MCI_STATUS_VAL))
            continue;
 
        __set_bit(i, validp);
        if (quirk_no_way_out)
            quirk_no_way_out(i, m, regs);
 
        m->bank = i;
        if (mce_severity(m, mca_cfg.tolerant, &tmp, true) >= MCE_PANIC_SEVERITY) {
            mce_read_aux(m, i);
            *msg = tmp;
            return 1;
        }
    }
    return 0;
}