gmem_memerr.c revision 1529f529004c61fcfd0d95ab79b0f257d6ad4451
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Ereport-handling routines for memory errors
*/
#include <gmem_mem.h>
#include <gmem_dimm.h>
#include <gmem_page.h>
#include <gmem.h>
#include <strings.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <sys/errclassify.h>
struct ce_name2type {
const char *name;
};
static ce_dispact_t
gmem_mem_name2type(const char *name)
{
static const struct ce_name2type new[] = {
{ "mem-unk", CE_DISP_UNKNOWN },
{ "mem-is", CE_DISP_INTERMITTENT },
{ "mem-cs", CE_DISP_PERS },
{ "mem-ss", CE_DISP_STICKY },
{ NULL }
};
const struct ce_name2type *tp;
}
return (CE_DISP_UNKNOWN);
}
static void
{
fmd_case_t *cp;
/* We've already complained about this DIMM */
return;
}
/*
* fault the dimm if number retired page >= max_retired_pages
*/
return;
}
/*
* Create a fresh index block for MQSC CE correlation.
*/
{
/*
* Create SERD to keep this event from being removed
* by fmd which may not know there is an event pointer
* saved here. This SERD is *never* meant to fire.
*/
return (cp);
}
{
}
return (jp);
}
/*
* Add an index block for a new CE, sorted
* a) by ascending unit position
* b) order of arrival (~= time order)
*/
void
{
/* list is in unit position order */
break;
/*
* Found a duplicate cw, unit_position, and afar.
* Delete this node, to be superseded by the new
* node added below.
*/
} else {
}
}
else
}
/*
* Prune the MQSC index lists (one for each checkword), by deleting
* outdated index blocks from each list.
*/
void
{
int cw;
/*
* This event has timed out - delete the
* mq block as well as serd for the event.
*/
} else {
/* tstamp < now - ce_t */
}
} /* per checkword */
} /* cw = 0...3 */
}
/*
* Check the MQSC index lists (one for each checkword) by making a
* complete pass through each list, checking if the criteria for either
* Rule 4A or 4B have been met. Rule 4A checking is done for each checkword;
* 4B check is done at end.
*
* Rule 4A: fault a DIMM "whenever Solaris reports two or more CEs from
* two or more different physical addresses on each of two or more different
* bit positions from the same DIMM within 72 hours of each other, and all
* the addresses are in the same relative checkword (that is, the AFARs
* are all the same modulo 64). [Note: This means at least 4 CEs; two
* from one bit position, with unique addresses, and two from another,
* also with unique addresses, and the lower 6 bits of all the addresses
* are the same."
*
* Rule 4B: fault a DIMM "whenever Solaris reports two or more CEs from
* two or more different physical addresses on each of three or more
* different outputs from the same DRAM within 72 hours of each other, as
* long as the three outputs do not all correspond to the same relative
* bit position in their respective checkwords. [Note: This means at least
* 6 CEs; two from one DRAM output signal, with unique addresses, two from
* another output from the same DRAM, also with unique addresses, and two
* more from yet another output from the same DRAM, again with unique
* addresses, as long as the three outputs do not all correspond to the
* same relative bit position in their respective checkwords.]"
*/
void
{
typedef struct upos_pair {
int upos;
int dram;
} upos_pair_t;
/*
* Each upos_array[] member represents a pair of CEs for the same
* unit position (symbol) which is a 4 bit nibble.
* MQSC rule 4 requires pairs of CEs from the same symbol (same DIMM
* for rule 4A, and same DRAM for rule 4B) for a violation - this
* is why CE pairs are tracked.
*/
upos_pairs = 0;
i = upos_pairs;
curr_upos = -1;
/*
* mq_root[] is an array of cumulative lists of CEs
* indexed by checkword where the list is in unit position
* order. Loop through checking for duplicate unit position
* entries (filled in at mq_create()).
* The upos_array[] is filled in each time a duplicate
* unit position is found; the first time through the loop
* of a unit position sets curr_upos but does not fill in
* upos_array[] until the second symbol is found.
*/
/* Set initial current position */
} else if (i > upos_pairs &&
/*
* Only keep track of CE pairs; skip
* triples, quads, etc...
*/
continue;
/* Have a pair. Add to upos_array[] */
}
}
if (i - upos_pairs >= 2) {
/* Rule 4A violation */
for (j = upos_pairs; j < i; j++) {
}
return;
}
upos_pairs = i;
}
return; /* 4B violation needs at least 3 pairs */
}
/*
* Walk through checking for a rule 4B violation.
* Since we only keep track of two CE pairs per CW we'll only have
* a max of potentially 16 lements in the array. So as not to run
* off the end of the array, need to be careful with i and j indexes.
*/
for (i = 0; i < (upos_pairs - 2); i++) {
/*
* These two pairs aren't the same dram;
* continue looking for pairs that are.
*/
continue;
for (k = j+1; k < upos_pairs; k++) {
/*
* DRAMs must be the same for a rule
* 4B violation. Continue looking for
* pairs that have the same DRAMs.
*/
continue;
if ((upos_array[i].upos !=
upos_array[j].upos) ||
(upos_array[j].upos !=
upos_array[k].upos)) {
dimm->dimm_serial);
return;
}
}
}
}
}
/*ARGSUSED*/
{
uint32_t filter_ratio = 0;
const char *uuid;
char *sn;
&diagnose);
return (GMEM_EVD_UNUSED);
&phyaddr) != 0) ||
&offset) != 0)) {
return (GMEM_EVD_BAD);
}
return (GMEM_EVD_REDUND);
&rsrc) != 0 ||
return (GMEM_EVD_BAD);
}
/*
* Find dimm fru by serial number.
*/
return (GMEM_EVD_UNUSED);
}
return (GMEM_EVD_UNUSED);
}
}
/*
* Add to MQSC correlation lists all CEs which pass validity
* checks above. If there is no symbol_pos & relative ckword
* in the ereport, skip rules 4A & 4B checking.
* If there is no dram in the ereport, skip the rule 4B checking.
*/
dram = INVALID_DRAM;
else
&symbol_pos);
if (err == 0)
}
}
switch (type) {
case CE_DISP_UNKNOWN:
return (GMEM_EVD_UNUSED);
case CE_DISP_INTERMITTENT:
return (GMEM_EVD_UNUSED);
case CE_DISP_PERS:
break;
case CE_DISP_STICKY:
break;
default:
return (GMEM_EVD_BAD);
}
return (GMEM_EVD_UNUSED);
}
}
}
switch (type) {
case CE_DISP_PERS:
return (GMEM_EVD_OK); /* engine hasn't fired */
}
break; /* to retire */
case CE_DISP_STICKY:
break; /* to retire */
}
if (rc) {
dimm->dimm_nretired++;
}
return (GMEM_EVD_OK);
}
void
{
}