ecc.c revision db874c57ae335a07060499f1492b0d0e2593e26c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <sys/machparam.h>
#include <sys/machsystm.h>
#include <sys/machthread.h>
#include <vm/seg_kmem.h>
#include <sys/machtrap.h>
#include <sys/prom_plat.h>
#include <sys/cpu_module.h>
#define MAX_CE_FLTS 10
#define MAX_ASYNC_FLTS 6
/*
* ce_verbose_memory - covers CEs in DIMMs
* ce_verbose_other - covers "others" (ecache, IO, etc.)
*
* If the value is 0, nothing is logged.
* If the value is 1, the error is logged to the log file, but not console.
* If the value is 2, the error is logged to the log file and console.
*/
int ce_verbose_memory = 1;
int ce_verbose_other = 1;
int ce_show_data = 0;
int ce_debug = 0;
int ue_debug = 0;
int reset_debug = 0;
/*
* Tunables for controlling the handling of asynchronous faults (AFTs). Setting
* these to non-default values on a non-DEBUG kernel is NOT supported.
*/
int aft_verbose = 0; /* log AFT messages > 1 to log only */
int aft_panic = 0; /* panic (not reboot) on fatal usermode AFLT */
int aft_testfatal = 0; /* force all AFTs to panic immediately */
/*
* Panic_* variables specific to the AFT code. These are used to record
* information that the platform-specific code will need once we panic.
*/
struct async_flt panic_aflt;
/*
* Defined in bus_func.c but initialised in error_init
*/
/*
* Common bus driver async error logging routine. This routine can be shared
* by all sun4u CPUs (unlike cpu_async_log_err) because we are assuming that
* if an i/o bus error required a panic, the error interrupt handler will
* enqueue the error and call panic itself.
*/
void
{
char unum[UNUM_NAMLEN];
int len;
/*
* Call back into the processor specific routine
* to check for cpu related errors that may
* have resulted in this error. (E.g. copyout trap)
*/
if (aflt->flt_in_memory)
/*
* Note that aflt->flt_stat is not the CPU afsr.
*/
}
/*
* ecc_cpu_call called from bus drain functions to run cpu
* specific functions to check other cpus and get the unum.
*/
void
{
int len;
/*
* Call back into the processor
* specific routine to check for cpu related errors
* that may have resulted in this error.
* (E.g. copyout trap)
*/
if (ecc->flt_in_memory)
UNUM_NAMLEN, &len);
}
/*
* Handler to process a fatal error. This routine can be called from a
* softint, called from trap()'s AST handling, or called from the panic flow.
*/
/*ARGSUSED*/
static void
{
}
/*
* Handler to process a correctable error. This routine can be called from a
* softint. We just call the CPU module's logging routine.
*/
/*ARGSUSED*/
static void
{
}
/*
* Scrub a non-fatal correctable ecc error.
*/
void
{
if (aflt->flt_in_memory)
}
/*
* Allocate error queue sizes based on max_ncpus. max_ncpus is set just
* after ncpunode has been determined. ncpus is set in start_other_cpus
* which is called after error_init() but may change dynamically.
*/
void
error_init(void)
{
char tmp_name[MAXSYSNAME];
/*
* Initialize the correctable and uncorrectable error queues.
*/
panic("failed to create required system error queue");
/*
* Initialize the busfunc list mutex. This must be a PIL_15 spin lock
* because we will need to acquire it from cpu_async_error().
*/
node = prom_rootnode();
return;
}
(size <= MAXSYSNAME) &&
if (reset_debug) {
"System booting after fatal error %s\n", tmp_name);
}
}
if (&cpu_error_init) {
(max_ncpus + 1));
}
}
/*
* Flags for ecc_page_zero DTrace probe since ecc_page_zero() is called
* as a softint handler.
*/
#define PAGE_ZERO_SUCCESS 0
#define PAGE_ZERO_FAIL_NOLOCK 1
#define PAGE_ZERO_FAIL_ONTRAP 2
void
ecc_page_zero(void *arg)
{
int ret, success_flag;
return;
/*
* Must hold a lock on the page before calling pagezero()
*
* This will only fail if someone has or wants an exclusive lock on
* the page. Since it's a retired page, this shouldn't happen.
*/
if (ret > 0) {
/*
* Protect pagezero() from async faults
*/
} else {
}
no_trap();
} else {
}
}