if (!mca_cfg.bios_cmci_threshold) {
val &= ~MCI_CTL2_CMCI_THRESHOLD_MASK;
val |= CMCI_THRESHOLD;
} elseif (!(val & MCI_CTL2_CMCI_THRESHOLD_MASK)) { /* *Ifbios_cmci_thresholdbootoptionwasspecified *butthethresholdiszero,we'lltrytoinitialize *itto1.
*/
*bios_zero_thresh = 1;
val |= CMCI_THRESHOLD;
}
return val;
}
/* *Trytoclaimownershipofabank.
*/ staticvoid cmci_claim_bank(int bank, u64 val, int bios_zero_thresh, int *bios_wrong_thresh)
{ struct mca_storm_desc *storm = this_cpu_ptr(&storm_desc);
val |= MCI_CTL2_CMCI_EN;
wrmsrq(MSR_IA32_MCx_CTL2(bank), val);
rdmsrq(MSR_IA32_MCx_CTL2(bank), val);
/* If the enable bit did not stick, this bank should be polled. */ if (!(val & MCI_CTL2_CMCI_EN)) {
WARN_ON(!test_bit(bank, this_cpu_ptr(mce_poll_banks)));
storm->banks[bank].poll_only = true; return;
}
/* This CPU successfully set the enable bit. */
set_bit(bank, (void *)this_cpu_ptr(&mce_banks_owned));
/* Save default threshold for each bank */ if (cmci_threshold[bank] == 0)
cmci_threshold[bank] = val & MCI_CTL2_CMCI_THRESHOLD_MASK;
}
/* *EnableCMCI(CorrectedMachineCheckInterrupt)foravailableMCEbanks *onthisCPU.UsethealgorithmrecommendedintheSDMtodiscovershared *banks.Calledduringinitialbootstrap,andalsoforhotplugCPUoperations *torediscover/reassignmachinecheckbanks.
*/ staticvoid cmci_discover(int banks)
{ int bios_wrong_thresh = 0; unsignedlong flags; int i;
raw_spin_lock_irqsave(&cmci_discover_lock, flags); for (i = 0; i < banks; i++) {
u64 val; int bios_zero_thresh = 0;
if (cmci_skip_bank(i, &val)) continue;
val = cmci_pick_threshold(val, &bios_zero_thresh);
cmci_claim_bank(i, val, bios_zero_thresh, &bios_wrong_thresh);
}
raw_spin_unlock_irqrestore(&cmci_discover_lock, flags); if (mca_cfg.bios_cmci_threshold && bios_wrong_thresh) {
pr_info_once( "bios_cmci_threshold: Some banks do not have valid thresholds set\n");
pr_info_once( "bios_cmci_threshold: Make sure your BIOS supports this boot option\n");
}
}
/* Caller must hold the lock on cmci_discover_lock */ staticvoid __cmci_disable_bank(int bank)
{
u64 val;
if (!test_bit(bank, this_cpu_ptr(mce_banks_owned))) return;
rdmsrq(MSR_IA32_MCx_CTL2(bank), val);
val &= ~MCI_CTL2_CMCI_EN;
wrmsrq(MSR_IA32_MCx_CTL2(bank), val);
__clear_bit(bank, this_cpu_ptr(mce_banks_owned));
if ((val & MCI_CTL2_CMCI_THRESHOLD_MASK) == CMCI_STORM_THRESHOLD)
cmci_storm_end(bank);
}
/* *DisableCMCIonthisCPUforallbanksitownswhenitgoesdown. *ThisallowsotherCPUstoclaimthebanksonrediscovery.
*/ void cmci_clear(void)
{ unsignedlong flags; int i; int banks;
if (!cmci_supported(&banks)) return;
raw_spin_lock_irqsave(&cmci_discover_lock, flags); for (i = 0; i < banks; i++)
__cmci_disable_bank(i);
raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
}
staticvoid cmci_rediscover_work_func(void *arg)
{ int banks;
/* Recheck banks in case CPUs don't all have the same */ if (cmci_supported(&banks))
cmci_discover(banks);
}
/* After a CPU went down cycle through all the others and rediscover */ void cmci_rediscover(void)
{ int banks;
/* Bank polling function when CMCI is disabled. */ staticvoid cmci_mc_poll_banks(void)
{
spin_lock(&cmci_poll_lock);
machine_check_poll(0, this_cpu_ptr(&mce_poll_banks));
spin_unlock(&cmci_poll_lock);
}
void intel_init_cmci(void)
{ int banks;
if (!cmci_supported(&banks)) {
mc_poll_banks = cmci_mc_poll_banks; return;
}
if (MCI_MISC_ADDR_LSB(m->misc) > PAGE_SHIFT) returnfalse;
if (MCI_MISC_ADDR_MODE(m->misc) != MCI_MISC_ADDR_PHYS) returnfalse;
returntrue;
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.18Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.