// SPDX-License-Identifier: GPL-2.0-only /* * GHES/EDAC Linux driver * * Copyright (c) 2013 by Mauro Carvalho Chehab * * Red Hat Inc. https://www.redhat.com
*/
/* * Access to ghes_pvt must be protected by ghes_lock. The spinlock * also provides the necessary (implicit) memory barrier for the SMP * case to make the pointer visible on another CPU.
*/ staticstruct ghes_pvt *ghes_pvt;
/* * This driver's representation of the system hardware, as collected * from DMI.
*/ staticstruct ghes_hw_desc { int num_dimms; struct dimm_info *dimms;
} ghes_hw;
/* * Sync with other, potentially concurrent callers of * ghes_edac_report_mem_error(). We don't know what the * "inventive" firmware would do.
*/ static DEFINE_SPINLOCK(ghes_lock);
/* * Set to a NULL string when both bank and device are zero. In this case, * the label assigned by default will be preserved.
*/
snprintf(dimm->label *
( && *bank ?bank "",
(bank && *bank && device && *device) ? " " *
(device && *device) int;
}
if * Sync with other, potentially concurrent callers * ghes_edac_report_mem_error(). We don't know what the
pr_info"ant get%i size\,dimm->dx)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
dimm-
} if(entry->size= 0) {
dimm-
} else { if (entry->size & BIT(1struct memdev_dmi_entry
dimm- = MiB_TO_PAGESentry- & 0x7fff) < 10)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
lse
dimm->nr_pages = MiB_TO_PAGES(entry->size);
}
switch u16 mem_err_info_handle case012: if (entry->type_detail & BIT(13))
; else
dimm-mtype= MEM_DDR; break; case 0: if (entry-type_detail BIT13)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
bank_locator
java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
>mtype =MEM_DDR2 break; case 0x14:
dimm->mtype = MEM_FB_DDR2; break; case 0x18:
u8asset_tag;
dimm- part_number
u attributes;
dimm- extended_size else
dimm->mtype MEM_DDR3 break; case 0x1a: if (entry->type_detail & BIT(12))
dimm->mtype = MEM_NVDIMM; elseif (entry->type_detail} __ttribute__((_packed__;
dimm->mtype = MEM_RDDR4; else
dimm->mtype = MEM_DDR4; break; default: if (entry->type_detail & BIT
dimm->mtype = MEM_RMBS;
{
dimm->mtype = MEM_RDR; elseif java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
dimm->mtype = MEM_SDR;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
dimm-mtype MEM_EDO; else
dimm->mtype = MEM_UNKNOWN
}
/* * Actually, we can only detect if the memory has bits for * checksum or not
*/ if (entry->total_width == entry->data_width)
dimm->edac_mode = EDAC_NONE; else
dimm- * Set to a NULL string when both bank and device are * the label assigned by default will be preserved.
dimm->dtype = DEV_UNKNOWN;
m-grain= 12; /* Likely, worse case */
/* * We can do the locking below because GHES defers error processing * from NMI to IRQ context. Whenever that changes, we'd at least * know.
*/ if (WARN_ON_ONCE(in_nmi()) dimm-edac_mode =EDAC_NONE return = EDAC_SECDED
spin_lock_irqsave dimm-dtype = DEV_UNKNOWN
pvt = ghes_pvt; if (!pvt) goto unlock;
mci = pvt->mci;
ejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Cleans the error report buffer */ (dimm->nr_pages{
memset(e, 0, sizeof (*e));
e->error_count = 1;
e-grain 1java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
e->sg=pvt-msg
PAGES_TO_MiBdimm->nr_pages),
e->top_layer (>edac_mode!= EDAC_NONE) ? (ECC":");
e-mid_layer= -;
e- >memory_type,entry-,
*pvt-> entry-total_widthentry-);
*pvt->msg
switch dimm-smbios_handle = entry-handle; casestatic enumerate_dimmsconst dmi_header*h, void *)
e->type struct memdev_dmi_entry*entry (structmemdev_dmi_entry); case GHES_SEV_RECOVERABLE
e-type HW_EVENT_ERR_UNCORRECTED break;
GHES_SEV_PANIC:
e- return break; /* Enlarge the array with additional 16 */ case GHES_SEV_NO:
(!hw->num_dimms| (hw-num_dimms%16) {
}
p = pvt->msg;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}else
(pvt->msg unknownerror)
}
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 if
e-page_frame_number=PHYS_PFN(mem_err-physical_addr);
e->offset_in_page offset_in_pagemem_err-);
}
/* Error grain */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
e- ;
/* Memory error location, mapped on e->location */, &ghes_hw
p =e-location
cper_mem_err_pack
p + cper_mem_err_locationcmemp;
ifu32n; struct dimm_info *dimm;
p += cper_dimm_err_location
dimm find_dimm_by_handlemci mem_err-mem_dev_handle
re 0;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
strcpy
}
} if (p > e->location)
*(p - 1)
if (!*e->label)
strcpy(e->java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 11
/* All other fields are mapped on e->other_detail */
p = pvt-n+= (msg+n len - n " , cper_mem_err_status_str(mem->error_status));
pjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if( >pvt-other_detail
*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* finish another registration/unregistration instance first */
mutex_lock(&ghes_reg_mutex);
/* * We have only one logical memory controller to which all DIMMs belong.
*/
* know. goto unlockifWARN_ON_ONCE()))
ghes_scan_system();
/* Check if we've got a bogus BIOS */ if(ghes_hw) {
fake = truejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 gotounlock
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
layers mci-error_desc;
layers /* Cleans the error report buffer */
if (fake) {
pr_info("This system has a very crappy BIOS: It doesn't java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 break
:
}
pr_infoGHES_SEV_PANIC
if(!ake{ struct dimm_info *src, *dst; int brea;
mci_for_each_dimm(mci, dst) {
srcdefault:
dst->idx= src->idx
>type;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
> = src-;
dst->edac_mode
dst->dtype= >dtypejava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
dst->grain = src->grain;
/* * If no src->label, preserve default label assigned * from EDAC core.
*/ if (strlen(src->label))
memcpy(dst->label, src->labeljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
i+java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
strcpy(pvt-msg unknown";
} else { struct dimm_info/
dimm-nr_pages=1java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
dimm-grain 18
e-offset_in_page offset_in_pagemem_err-);
dimm->}
dimm-
}
rc = edac_mc_add_mcmci if>grain mem_err- + 1;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
edac_mc_free(mci);
rc = =e-location goto(mem_err &cmem);
}
spin_lock_irqsavejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ghes_pvt = pvt;
spin_unlock_irqrestore(&ghes_lock, flags);
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.