cmd_cpuerr.c revision 60c45ed01d4f99571d468c42f609d11a099fab1e
/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Ereport-handling routines for CPU errors
*/
#include <cmd_cpu.h>
#include <cmd.h>
#include <strings.h>
#include <string.h>
#include <errno.h>
#ifdef sun4u
#include <cmd_Lxcache.h>
#include <cmd_opl.h>
#endif
/*
* tag events so we can have one common routine into which each handler
* calls. The two tests of (strcmp(serdnm, "") != 0) are used to eliminate
* the need for a separate macro for UEs which override SERD engine
* counting CEs leading to same fault.
*/
/*ARGSUSED9*/
static cmd_evdisp_t
{
const char *uuid;
return (CMD_EVD_REDUND);
&uuid);
serdnm);
}
}
return (CMD_EVD_OK); /* serd engine hasn't fired yet */
} else {
"destroying existing %s state for class %x\n",
}
}
return (CMD_EVD_OK);
}
#ifdef sun4u
{ \
\
clcode &= CMD_ERRCL_LEVEL_MASK; \
return (CMD_EVD_UNUSED); \
\
} \
}
#endif
{ \
\
clcode &= CMD_ERRCL_LEVEL_MASK; \
return (CMD_EVD_UNUSED); \
\
}
#ifdef sun4u
#else
#endif
"misc_regs", "misc_reg")
"", "misc_reg")
/*
* Fp-scrubber errors
*/
{
/*
* Ignore the event if resource FMRI is not present. Fp-Scrubber
* puts the indicted CPU in resource. If resource is not present,
* we cannot diagnose the ereport. It will simply get logged in
* errlog for manual analysis, if needed.
*/
return (CMD_EVD_UNUSED);
return (CMD_EVD_UNUSED);
}
#ifdef sun4u
/*
* The following macro handles UEs or CPU errors.
* It handles the error cases in which there is with or
* without "resource".
*
* If the "fltname" "core" is to be generated, the sibling CPUs
* within the core will be added to the suspect list.
* If the "fltname" "chip" is to be generated, the sibling CPUs
* within the chip will be added to the suspect list.
* If the "fltname" "strand" is to be generated, the strand
* itself will be in the suspect list.
*/
{ \
cmd_case_t *cc; \
cmd_evdisp_t rc; \
\
fmd_hdl_debug(hdl, \
"Enter cmd_opl_ue_cpu for class %x\n", clcode); \
\
if (lookup_rsrc) { \
if (nvlist_lookup_nvlist(nvl, \
FM_EREPORT_PAYLOAD_NAME_RESOURCE, &rsrc) != 0) \
return (CMD_EVD_BAD); \
\
CMD_CPU_LEVEL_THREAD)) == NULL || \
cpu->cpu_faulting) \
return (CMD_EVD_UNUSED); \
} else { \
return (CMD_EVD_UNUSED); \
\
(void) nvlist_lookup_nvlist(nvl, \
FM_EREPORT_DETECTOR, &rsrc); \
} \
\
version > FM_CPU_SCHEME_VERSION || \
return (CMD_EVD_BAD); \
\
return (rc); \
}
/*
* CPU errors without resource
*/
"core", 0)
/*
* UEs with resource
*/
"core", 1)
#endif /* sun4u */
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static void
{
cmd_case_t *cc;
const char *uuid;
if (cpu->cpu_faulting) {
return;
}
return;
}
return;
}
#ifdef sun4u
/*
* UE cache needed for sun4u only, because sun4u doesn't poison
*/
return;
}
#endif /* sun4u */
/*
* We didn't match in the UE cache. We don't need to sleep for UE
* arrival, as we've already slept once for the train match.
*/
&uuid);
}
&rsrc, 0) != 0) {
}
}
static void
{
cmd_case_t *cc;
const char *uuid;
#ifdef sun4u
return;
}
#endif
return;
&uuid);
}
return; /* serd engine hasn't fired yet */
&rsrc, 0) != 0) {
}
}
/*
* We're back from the timeout. Check to see if this event was part of a train.
* If it was, make sure to only process the cause of the train. If not,
* process the event directly.
*/
static void
{
return;
}
/*
* In sun4v, the matching train rule is changed. It matches only
* a portion of the train mask, so can't discard the rest of
* the error in the train mask.
*/
#ifdef sun4u
goto done;
}
#endif
/*
* We didn't match in a train, so we're going to process each
* event individually.
*/
goto done;
}
/*
* We've got a train match. If this event is the cause of the train,
* process it.
*/
}
done:
}
void
{
}
void
{
}
void
{
}
{
cmd_case_t *cc;
return (CMD_EVD_UNUSED);
return (CMD_EVD_REDUND);
} else {
}
goto redeliver;
}
}
goto redeliver;
return (CMD_EVD_UNUSED);
}
return (CMD_EVD_BAD);
}
}
{
}
{
}
{
}
{
}
void
{
}