7bebe46c240b554f47faeed19186123896281967jc * CDDL HEADER START
7bebe46c240b554f47faeed19186123896281967jc * The contents of this file are subject to the terms of the
7bebe46c240b554f47faeed19186123896281967jc * Common Development and Distribution License (the "License").
7bebe46c240b554f47faeed19186123896281967jc * You may not use this file except in compliance with the License.
7bebe46c240b554f47faeed19186123896281967jc * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7bebe46c240b554f47faeed19186123896281967jc * See the License for the specific language governing permissions
7bebe46c240b554f47faeed19186123896281967jc * and limitations under the License.
7bebe46c240b554f47faeed19186123896281967jc * When distributing Covered Code, include this CDDL HEADER in each
7bebe46c240b554f47faeed19186123896281967jc * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7bebe46c240b554f47faeed19186123896281967jc * If applicable, add the following below this CDDL HEADER, with the
7bebe46c240b554f47faeed19186123896281967jc * fields enclosed by brackets "[]" replaced with your own identifying
7bebe46c240b554f47faeed19186123896281967jc * information: Portions Copyright [yyyy] [name of copyright owner]
7bebe46c240b554f47faeed19186123896281967jc * CDDL HEADER END
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
7bebe46c240b554f47faeed19186123896281967jc * Use is subject to license terms.
7bebe46c240b554f47faeed19186123896281967jc/* ARGSUSED 4 */
7bebe46c240b554f47faeed19186123896281967jccma_cache_way_retire(fmd_hdl_t *hdl, nvlist_t *nvl, nvlist_t *asru,
7bebe46c240b554f47faeed19186123896281967jc fmd_hdl_debug(hdl, "cpu cache *line* fault processing\n");
7bebe46c240b554f47faeed19186123896281967jc * This added expansion is needed to cover the situation where a
7bebe46c240b554f47faeed19186123896281967jc * cpu fault from the resource cache is replayed at fmd restart,
7bebe46c240b554f47faeed19186123896281967jc * and the cpu resource has been remapped or replaced. The stored
7bebe46c240b554f47faeed19186123896281967jc * FMRI is expanded, but may have stale data.
7bebe46c240b554f47faeed19186123896281967jc if (nvlist_lookup_uint32(asru, FM_FMRI_CPU_ID, &cpuid) != 0) {
7bebe46c240b554f47faeed19186123896281967jc if (nvlist_lookup_uint32(asru, FM_FMRI_CPU_CACHE_INDEX, &index) != 0) {
7bebe46c240b554f47faeed19186123896281967jc if (nvlist_lookup_uint32(asru, FM_FMRI_CPU_CACHE_WAY, &way) != 0) {
7bebe46c240b554f47faeed19186123896281967jc if (nvlist_lookup_uint8(asru, FM_FMRI_CPU_CACHE_TYPE, &type) != 0) {
7bebe46c240b554f47faeed19186123896281967jc * Tag faults will use it to set the bit to a stable state
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian if (nvlist_lookup_uint16(asru, FM_FMRI_CPU_CACHE_BIT, &bit) != 0) {
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian fmd_hdl_debug(hdl, "cpu cache fault missing '%s'\n",
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian cma_stats.bad_flts.fmds_value.ui64++;
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian "cpu %d: Unretire for index %d, way %d\n bit %d"
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian " type 0x%02x is being called now. We will not unretire"
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian " cacheline. This message is for information.\n",
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian * The DE will do the actual unretire.
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian * The agent is called because the DE informs the fmd
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian * that the resource is repaired.
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian "cpu %d: Retiring index %d, way %d\n bit %d"
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian " type 0x%02x", cpuid, index, way, bit, type);
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian ret = ioctl(fd, MEM_CACHE_RETIRE, &cache_info);
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian * save errno before we call close.
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian * Need errno to display the error if ioctl fails.
a62774df315360f02521d6470eab7d5080137dadSinanallur Balasubramanian fmd_hdl_debug(hdl, "Driver call failed errno = %d\n", err);