px_err.c revision 8bc7d88a7ed8565440a3cb4d316b626938433668
/*
* 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"
/*
* sun4v Fire Error Handling
*/
#include "px_obj.h"
#include "px_err.h"
/*
* px_err_cb_intr:
* Interrupt handler for the Host Bus Block.
*/
{
}
return (DDI_INTR_UNCLAIMED);
}
/*
* px_err_dmc_pec_intr:
*/
{
}
return (DDI_INTR_UNCLAIMED);
}
/*
* px_err_handle:
* Common function called by trap, mondo and fabric intr.
* This function is more meaningful in sun4u implementation. Kept
* to mirror sun4u call stack.
* o check for safe access
*
* @param px_p leaf in which to check access
* @param derr fm err data structure to be updated
* @param caller PX_TRAP_CALL | PX_INTR_CALL
* @param chkjbc whether to handle hostbus registers (ignored)
* @return err PX_OK | PX_NONFATAL |
* PX_FATAL_GOS | PX_FATAL_HW | PX_STUCK_FATAL
*/
/* ARGSUSED */
int
{
/* check for safe access */
return (DDI_FM_OK);
}
/*
* px_err_common_intr:
* o lock
* o create derr
* o check safe access
* o px_err_check_severiy(epkt)
* o dispatch
* o Idle intr state
* o unlock
* o handle error: fatal? fm_panic() : return INTR_CLAIMED)
*/
static uint_t
{
/* Create the derr */
/* Basically check for safe access */
/* Check the severity of this error */
/* check for error severity */
/* Set the intr state to idle for the leaf that received the mondo */
INTR_IDLE_STATE) != DDI_SUCCESS) {
return (DDI_INTR_UNCLAIMED);
}
fm_panic("Fatal System Bus Error has occurred\n");
return (DDI_INTR_CLAIMED);
}
/*
* px_err_check_severity:
* Check the severity of the fire error based the epkt received
*
* @param px_p leaf in which to take the snap shot.
* @param derr fm err in which the ereport is to be based on
* @param epkt epkt recevied from HV
*/
static int
int caller)
{
int err = 0;
/* Cautious access error handling */
if (caller == PX_TRAP_CALL) {
/*
* for ddi_caut_get treat all events as nonfatal
* The trampoline will set err_ena = 0,
* err_status = NONFATAL.
*/
} else {
/*
* For ddi_caut_put treat all events as nonfatal. Here
* we have the handle and can call ndi_fm_acc_err_set().
*/
}
}
case BLOCK_HOSTBUS:
break;
case BLOCK_MMU:
break;
case BLOCK_INTR:
err = PX_NONFATAL;
break;
case BLOCK_PCIE:
break;
default:
}
return (err);
}
/* ARGSUSED */
static int
{
(fme_flag == DDI_FM_ERR_PEEK) ||
(fme_flag == DDI_FM_ERR_POKE);
case OP_PIO:
err |= PX_NONFATAL;
/* check handle if affected memory address is captured */
}
if (ret == DDI_FM_FATAL)
err |= PX_FATAL_SW;
break;
case OP_DMA:
case PH_ADDR:
err |= PX_FATAL_GOS;
break;
case PH_DATA:
err |= PX_FATAL_GOS;
break;
}
err |= PX_NONFATAL;
if (ret == DDI_FM_FATAL)
err |= PX_FATAL_SW;
}
break;
default:
err |= PX_ERR_UNKNOWN;
break;
}
break;
case OP_UNKNOWN:
err |= PX_NONFATAL;
err |= PX_FATAL_SW;
}
break;
case OP_RESERVED:
default:
err |= PX_ERR_UNKNOWN;
break;
}
/*
* For protected safe access, consider PX_FATAL_GOS as the only
* exception for px to take immediate panic, else, treat errors
* as nonfatal.
*/
if (is_safeacc) {
if (err & PX_FATAL_GOS)
err = PX_FATAL_GOS;
else
err = PX_NONFATAL;
}
return (err);
}
/* ARGSUSED */
static int
{
case OP_BYPASS: /* nonfatal */
case OP_XLAT: /* nonfatal, stuck-fatal, fatal-reset */
case OP_TBW: /* nonfatal, stuck-fatal */
err = PX_NONFATAL;
break;
default:
break;
}
}
if (ret == DDI_FM_FATAL)
err = PX_FATAL_SW;
err = PX_NONFATAL;
return (err);
}
/* ARGSUSED */
static int
{
int ret = PX_NONFATAL;
case DIR_INGRESS:
case DIR_EGRESS:
case DIR_LINK:
break;
default:
break;
}
return (ret);
}