diff options
Diffstat (limited to 'usr/src')
54 files changed, 1919 insertions, 700 deletions
diff --git a/usr/src/cmd/fm/dicts/Makefile b/usr/src/cmd/fm/dicts/Makefile index ca84d4bb55..3e2c670c1f 100644 --- a/usr/src/cmd/fm/dicts/Makefile +++ b/usr/src/cmd/fm/dicts/Makefile @@ -37,8 +37,9 @@ common_DCNAMES = \ SCA1000 sparc_DCNAMES = \ + SUN4 \ SUN4U \ - SUN4 + SUN4V DCNAMES = \ $(common_DCNAMES) \ diff --git a/usr/src/cmd/fm/dicts/SUN4V.dict b/usr/src/cmd/fm/dicts/SUN4V.dict new file mode 100644 index 0000000000..808e760743 --- /dev/null +++ b/usr/src/cmd/fm/dicts/SUN4V.dict @@ -0,0 +1,44 @@ +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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 +# +#ident "%Z%%M% %I% %E% SMI" +# +# DO NOT EDIT -- this file is generated by the Event Registry. +# + +FMDICT: name=SUN4V version=1 maxkey=1 + +fault.cpu.ultraSPARC-T1.ireg=1 +fault.cpu.ultraSPARC-T1.freg=2 +fault.cpu.ultraSPARC-T1.itlb=3 +fault.cpu.ultraSPARC-T1.dtlb=4 +fault.cpu.ultraSPARC-T1.icache=5 +fault.cpu.ultraSPARC-T1.dcache=6 +fault.cpu.ultraSPARC-T1.mau=7 +fault.cpu.ultraSPARC-T1.l2cachedata=8 +fault.cpu.ultraSPARC-T1.l2cachetag=9 +fault.cpu.ultraSPARC-T1.l2cachectl=10 +fault.memory.page=11 +fault.memory.dimm=12 +fault.memory.bank=13 diff --git a/usr/src/cmd/fm/dicts/SUN4V.po b/usr/src/cmd/fm/dicts/SUN4V.po new file mode 100644 index 0000000000..6acb149b2c --- /dev/null +++ b/usr/src/cmd/fm/dicts/SUN4V.po @@ -0,0 +1,236 @@ +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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 +# +#ident "%Z%%M% %I% %E% SMI" +# +# DO NOT EDIT -- this file is generated by the Event Registry. +# +# +# code: SUN4V-8000-1S +# keys: fault.cpu.ultraSPARC-T1.ireg +# +msgid "SUN4V-8000-1S.type" +msgstr "Fault" +msgid "SUN4V-8000-1S.severity" +msgstr "Minor" +msgid "SUN4V-8000-1S.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-1S.response" +msgstr "The fault manager will attempt to remove the affected CPU from service." +msgid "SUN4V-8000-1S.impact" +msgstr "System performance may be affected." +msgid "SUN4V-8000-1S.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-2A +# keys: fault.cpu.ultraSPARC-T1.freg +# +msgid "SUN4V-8000-2A.type" +msgstr "Fault" +msgid "SUN4V-8000-2A.severity" +msgstr "Major" +msgid "SUN4V-8000-2A.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-2A.response" +msgstr "None" +msgid "SUN4V-8000-2A.impact" +msgstr "System performance may be affected." +msgid "SUN4V-8000-2A.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-3P +# keys: fault.cpu.ultraSPARC-T1.itlb +# +msgid "SUN4V-8000-3P.type" +msgstr "Fault" +msgid "SUN4V-8000-3P.severity" +msgstr "Minor" +msgid "SUN4V-8000-3P.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-3P.response" +msgstr "The fault manager will attempt to remove the affected CPU from service." +msgid "SUN4V-8000-3P.impact" +msgstr "System performance may be affected.\n" +msgid "SUN4V-8000-3P.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-4D +# keys: fault.cpu.ultraSPARC-T1.dtlb +# +msgid "SUN4V-8000-4D.type" +msgstr "Fault" +msgid "SUN4V-8000-4D.severity" +msgstr "Minor" +msgid "SUN4V-8000-4D.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-4D.response" +msgstr "The fault manager will attempt to remove the affected CPU from service." +msgid "SUN4V-8000-4D.impact" +msgstr "System performance may be affected.\n" +msgid "SUN4V-8000-4D.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-5H +# keys: fault.cpu.ultraSPARC-T1.icache +# +msgid "SUN4V-8000-5H.type" +msgstr "Fault" +msgid "SUN4V-8000-5H.severity" +msgstr "Minor" +msgid "SUN4V-8000-5H.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-5H.response" +msgstr "The fault manager will attempt to remove the affected CPU from service." +msgid "SUN4V-8000-5H.impact" +msgstr "System performance may be affected.\n" +msgid "SUN4V-8000-5H.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-63 +# keys: fault.cpu.ultraSPARC-T1.dcache +# +msgid "SUN4V-8000-63.type" +msgstr "Fault" +msgid "SUN4V-8000-63.severity" +msgstr "Minor" +msgid "SUN4V-8000-63.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-63.response" +msgstr "The fault manager will attempt to remove the affected CPU from service." +msgid "SUN4V-8000-63.impact" +msgstr "System performance may be affected.\n" +msgid "SUN4V-8000-63.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-7Y +# keys: fault.cpu.ultraSPARC-T1.mau +# +msgid "SUN4V-8000-7Y.type" +msgstr "Fault" +msgid "SUN4V-8000-7Y.severity" +msgstr "Major" +msgid "SUN4V-8000-7Y.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-7Y.response" +msgstr "None" +msgid "SUN4V-8000-7Y.impact" +msgstr "System performance may be affected.\n" +msgid "SUN4V-8000-7Y.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-8Q +# keys: fault.cpu.ultraSPARC-T1.l2cachedata +# +msgid "SUN4V-8000-8Q.type" +msgstr "Fault" +msgid "SUN4V-8000-8Q.severity" +msgstr "Critical" +msgid "SUN4V-8000-8Q.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-8Q.response" +msgstr "None" +msgid "SUN4V-8000-8Q.impact" +msgstr "System performance may be affected.\n" +msgid "SUN4V-8000-8Q.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-9C +# keys: fault.cpu.ultraSPARC-T1.l2cachetag +# +msgid "SUN4V-8000-9C.type" +msgstr "Fault" +msgid "SUN4V-8000-9C.severity" +msgstr "Critical" +msgid "SUN4V-8000-9C.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-9C.response" +msgstr "None" +msgid "SUN4V-8000-9C.impact" +msgstr "System performance may be affected.\n" +msgid "SUN4V-8000-9C.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-AR +# keys: fault.cpu.ultraSPARC-T1.l2cachectl +# +msgid "SUN4V-8000-AR.type" +msgstr "Fault" +msgid "SUN4V-8000-AR.severity" +msgstr "Critical" +msgid "SUN4V-8000-AR.description" +msgstr "The number of errors associated with this CPU has exceeded \n acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-AR.response" +msgstr "None" +msgid "SUN4V-8000-AR.impact" +msgstr "System performance may be affected.\n" +msgid "SUN4V-8000-AR.action" +msgstr "Schedule a repair procedure to replace the affected CPU, the identity of which can be determined using fmdump -v -u <EVENT_ID>." +# +# code: SUN4V-8000-C4 +# keys: fault.memory.page +# +msgid "SUN4V-8000-C4.type" +msgstr "Fault" +msgid "SUN4V-8000-C4.severity" +msgstr "Minor" +msgid "SUN4V-8000-C4.description" +msgstr "The number of errors associated with this memory module continues to exceed acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-C4.response" +msgstr "An attempt will be made to remove this memory page from service." +msgid "SUN4V-8000-C4.impact" +msgstr "The performance of the system may be minimally impacted as a result of removing the memory page from operation." +msgid "SUN4V-8000-C4.action" +msgstr "No repair action is recommended at this time." +# +# code: SUN4V-8000-DX +# keys: fault.memory.dimm +# +msgid "SUN4V-8000-DX.type" +msgstr "Fault" +msgid "SUN4V-8000-DX.severity" +msgstr "Major" +msgid "SUN4V-8000-DX.description" +msgstr "The number of errors associated with this memory module has exceeded acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-DX.response" +msgstr "Pages of memory associated with this memory module are being removed from service as errors are reported." +msgid "SUN4V-8000-DX.impact" +msgstr "Total system memory capacity will be reduced as pages are retired." +msgid "SUN4V-8000-DX.action" +msgstr "Schedule a repair procedure to replace the affected memory module. Use fmdump -v -u <EVENT_ID> to identify the module." +# +# code: SUN4V-8000-E2 +# keys: fault.memory.bank +# +msgid "SUN4V-8000-E2.type" +msgstr "Fault" +msgid "SUN4V-8000-E2.severity" +msgstr "Critical" +msgid "SUN4V-8000-E2.description" +msgstr "The number of errors associated with this memory module has exceeded acceptable levels. Refer to %s for more information." +msgid "SUN4V-8000-E2.response" +msgstr "Pages of memory associated with this memory module are being removed from service as errors are reported." +msgid "SUN4V-8000-E2.impact" +msgstr "Total system memory capacity will be reduced as pages are retired." +msgid "SUN4V-8000-E2.action" +msgstr "Schedule a repair procedure to replace the affected memory module. Use fmdump -v -u <EVENT_ID> to identify the module." diff --git a/usr/src/cmd/fm/modules/common/cpumem-retire/Makefile b/usr/src/cmd/fm/modules/common/cpumem-retire/Makefile index b91da32a08..b2c8edd855 100644 --- a/usr/src/cmd/fm/modules/common/cpumem-retire/Makefile +++ b/usr/src/cmd/fm/modules/common/cpumem-retire/Makefile @@ -20,7 +20,7 @@ # CDDL HEADER END # # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -34,7 +34,7 @@ SRCS = \ include ../../Makefile.plugin -CMA_VERSION = "1.0" +CMA_VERSION = "1.1" INCDIRS = . diff --git a/usr/src/cmd/fm/modules/common/cpumem-retire/cma_cpu.c b/usr/src/cmd/fm/modules/common/cpumem-retire/cma_cpu.c index f0020591d4..e89f4e674d 100644 --- a/usr/src/cmd/fm/modules/common/cpumem-retire/cma_cpu.c +++ b/usr/src/cmd/fm/modules/common/cpumem-retire/cma_cpu.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -122,7 +122,19 @@ cpu_offline(fmd_hdl_t *hdl, const char *uuid, uint_t cpuid, int cpustate) void cma_cpu_retire(fmd_hdl_t *hdl, nvlist_t *nvl, nvlist_t *asru, const char *uuid) { - uint_t cpuid; + uint_t cpuid, cpuvid; + + /* + * This added expansion is needed to cover the situation where a + * cpu fault from the resource cache is replayed at fmd restart, + * and the cpu resource has been remapped or replaced. The stored + * FMRI is expanded, but may have stale data. + */ + if (fmd_nvl_fmri_expand(hdl, asru) < 0) { + fmd_hdl_debug(hdl, "failed to expand cpu asru\n"); + cma_stats.bad_flts.fmds_value.ui64++; + return; + } if (nvlist_lookup_uint32(asru, FM_FMRI_CPU_ID, &cpuid) != 0) { fmd_hdl_debug(hdl, "cpu fault missing '%s'\n", FM_FMRI_CPU_ID); @@ -130,6 +142,14 @@ cma_cpu_retire(fmd_hdl_t *hdl, nvlist_t *nvl, nvlist_t *asru, const char *uuid) return; } + /* + * If this asru's FMRI contains a virtual CPU id, use that value for + * p_online() call instead of (physical) cpu id. + */ + + if (nvlist_lookup_uint32(asru, FM_FMRI_CPU_VID, &cpuvid) == 0) + cpuid = cpuvid; + if (cma.cma_cpu_dooffline) { int cpustate = P_FAULTED; diff --git a/usr/src/cmd/fm/modules/common/cpumem-retire/cma_main.c b/usr/src/cmd/fm/modules/common/cpumem-retire/cma_main.c index 2008852d7b..5b48e4241f 100644 --- a/usr/src/cmd/fm/modules/common/cpumem-retire/cma_main.c +++ b/usr/src/cmd/fm/modules/common/cpumem-retire/cma_main.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -59,8 +59,6 @@ typedef struct cma_subscriber { } cma_subscriber_t; static const cma_subscriber_t cma_subrs[] = { - { "fault.cpu.*", FM_FMRI_SCHEME_CPU, FM_CPU_SCHEME_VERSION, - cma_cpu_retire }, { "fault.memory.page", FM_FMRI_SCHEME_MEM, FM_MEM_SCHEME_VERSION, cma_page_retire }, { "fault.memory.dimm", FM_FMRI_SCHEME_MEM, FM_MEM_SCHEME_VERSION, @@ -69,6 +67,24 @@ static const cma_subscriber_t cma_subrs[] = { NULL }, { "fault.memory.datapath", FM_FMRI_SCHEME_MEM, FM_MEM_SCHEME_VERSION, NULL }, + + /* + * The following ultraSPARC-T1 faults do NOT retire a cpu thread, + * and therefore must be intercepted before + * the default "fault.cpu.*" dispatch to cma_cpu_retire. + */ + { "fault.cpu.ultraSPARC-T1.freg", FM_FMRI_SCHEME_CPU, + FM_CPU_SCHEME_VERSION, NULL }, + { "fault.cpu.ultraSPARC-T1.l2cachedata", FM_FMRI_SCHEME_CPU, + FM_CPU_SCHEME_VERSION, NULL }, + { "fault.cpu.ultraSPARC-T1.l2cachetag", FM_FMRI_SCHEME_CPU, + FM_CPU_SCHEME_VERSION, NULL }, + { "fault.cpu.ultraSPARC-T1.l2cachectl", FM_FMRI_SCHEME_CPU, + FM_CPU_SCHEME_VERSION, NULL }, + { "fault.cpu.ultraSPARC-T1.mau", FM_FMRI_SCHEME_CPU, + FM_CPU_SCHEME_VERSION, NULL }, + { "fault.cpu.*", FM_FMRI_SCHEME_CPU, FM_CPU_SCHEME_VERSION, + cma_cpu_retire }, { NULL, NULL, 0, NULL } }; diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/Makefile.cpumem b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/Makefile.cpumem index 65f11a31d7..550e813436 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/Makefile.cpumem +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/Makefile.cpumem @@ -31,9 +31,9 @@ SUN4DIR = ../../sun4/$(MODULE) SRCS = \ cmd_bank.c \ cmd_cpu.c \ + cmd_cpu_arch.c \ cmd_cpuerr.c \ cmd_dimm.c \ - cmd_ecache.c \ cmd_fmri.c \ cmd_list.c \ cmd_main.c \ @@ -43,7 +43,8 @@ SRCS = \ cmd_page.c \ cmd_pageerr.c \ cmd_state.c \ - cmd_util.c + cmd_util.c \ + $($(ARCH)_SRCS) include ../../Makefile.plugin @@ -65,7 +66,3 @@ LDFLAGS += -lkstat %.ln: $(SUN4DIR)/%.c $(LINT.c) -c $< - -$(CONF): $(SUN4DIR)/$(CONF) - $(RM) $(CONF); $(CP) $(SUN4DIR)/$@ $@ - diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd.h b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd.h index 54f211ca69..3b55c3ad22 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd.h +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd.h @@ -46,7 +46,7 @@ extern "C" { * collisions with an earlier class code enum. While we have 64 bits available * to us, cmd_errcl_t's are saved in persistent buffers, and thus can't easily * grow beyond that size. As such, ereports should only be assigned class codes - * when needed. + * when needed. NEVER CHANGE the values of these constants once assigned. */ #define CMD_ERRCL_UCC 0x0000000000000008ULL #define CMD_ERRCL_UCU 0x0000000000000010ULL @@ -78,7 +78,16 @@ extern "C" { #define CMD_ERRCL_DSC 0x0002000000000000ULL #define CMD_ERRCL_DAU 0x0004000000000000ULL #define CMD_ERRCL_DSU 0x0008000000000000ULL - +#define CMD_ERRCL_LDAC 0x0010000000000000ULL +#define CMD_ERRCL_LDWC 0x0020000000000000ULL +#define CMD_ERRCL_LDRC 0x0040000000000000ULL +#define CMD_ERRCL_LDSC 0x0080000000000000ULL +#define CMD_ERRCL_LDAU 0x0100000000000000ULL +#define CMD_ERRCL_LDWU 0x0200000000000000ULL +#define CMD_ERRCL_LDRU 0x0400000000000000ULL +#define CMD_ERRCL_LDSU 0x0800000000000000ULL + +#ifdef sun4u #define CMD_ERRCL_ISL2XXCU(clcode) \ ((clcode) >= CMD_ERRCL_UCC && (clcode) <= CMD_ERRCL_EDU_BL) #define CMD_ERRCL_ISL3XXCU(clcode) \ @@ -86,6 +95,12 @@ extern "C" { #define CMD_ERRCL_ISIOXE(clcode) \ (((clcode) & (CMD_ERRCL_IOCE | CMD_ERRCL_IOUE)) != 0) +#else /* sun4u */ +#define CMD_ERRCL_ISL2XXCU(clcode) \ + ((clcode) >= CMD_ERRCL_LDAC && (clcode) <= CMD_ERRCL_LDSU) +#define CMD_ERRCL_ISL3XXCU(clcode) 0 + +#endif /* sun4u */ #define CMD_ERRCL_MATCH(clcode, mask) \ (((clcode) & (mask)) != 0) diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_bank.c b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_bank.c index 54ebfe4ca5..5afdce3faa 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_bank.c +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_bank.c @@ -38,7 +38,6 @@ #include <unistd.h> #include <fm/fmd_api.h> #include <sys/fm/protocol.h> -#include <sys/fm/cpu/UltraSPARC-III.h> #include <sys/mem.h> #include <sys/nvpair.h> diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpu.c b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpu.c index e0e3319aea..c7262b23a5 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpu.c +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpu.c @@ -31,7 +31,11 @@ */ #include <cmd_cpu.h> + +#ifdef sun4u #include <cmd_ecache.h> +#endif /* sun4u */ + #include <cmd_mem.h> #include <cmd.h> @@ -43,8 +47,6 @@ #include <fm/fmd_api.h> #include <sys/async.h> #include <sys/fm/protocol.h> -#include <sys/fm/cpu/UltraSPARC-III.h> -#include <sys/fm/cpu/UltraSPARC-T1.h> #define CMD_CPU_UEC_INCR 10 #define CPU_FRU_FMRI FM_FMRI_SCHEME_HC":///" \ @@ -90,6 +92,7 @@ cpu_nname2type(fmd_hdl_t *hdl, const char *name, size_t n) return (0); } +#ifdef sun4u static void cpu_uec_write(fmd_hdl_t *hdl, cmd_cpu_t *cpu, cmd_cpu_uec_t *uec) { @@ -305,8 +308,9 @@ cmd_cpu_uec_match(cmd_cpu_t *cpu, uint64_t pa) return (0); } +#endif /* sun4u */ -static void +void cmd_xr_write(fmd_hdl_t *hdl, cmd_xr_t *xr) { fmd_hdl_debug(hdl, "writing redelivery clcode %llx for case %s\n", @@ -343,17 +347,11 @@ cmd_xr_create(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, int err = 0; err |= nvlist_lookup_uint64(nvl, FM_EREPORT_ENA, &xr->xr_ena); - err |= nvlist_lookup_uint16(nvl, FM_EREPORT_PAYLOAD_NAME_SYND, - &xr->xr_synd); - err |= nvlist_lookup_uint8(nvl, FM_EREPORT_PAYLOAD_NAME_SYND_STATUS, - &xr->xr_synd_status); - err |= nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_NAME_AFAR, - &xr->xr_afar); - err |= nvlist_lookup_uint8(nvl, FM_EREPORT_PAYLOAD_NAME_AFAR_STATUS, - &xr->xr_afar_status); + + err |= cmd_xr_fill(hdl, nvl, xr, clcode); (void) nvlist_lookup_nvlist(nvl, FM_EREPORT_PAYLOAD_NAME_RESOURCE, - &rsrc); + &rsrc); if (err != 0) { fmd_hdl_free(hdl, xr, sizeof (cmd_xr_t)); @@ -470,6 +468,7 @@ typedef struct cmd_xxcu_train { #define CMD_TRAIN(cause, side_effects) { (cause) | (side_effects), (cause) } static const cmd_xxcu_train_t cmd_xxcu_trains[] = { +#ifdef sun4u CMD_TRAIN(CMD_ERRCL_UCC, CMD_ERRCL_WDC), CMD_TRAIN(CMD_ERRCL_UCU, CMD_ERRCL_WDU), CMD_TRAIN(CMD_ERRCL_UCU, CMD_ERRCL_L3_WDU | CMD_ERRCL_WDU), @@ -494,6 +493,14 @@ static const cmd_xxcu_train_t cmd_xxcu_trains[] = { CMD_TRAIN(CMD_ERRCL_L3_EDU_BL, CMD_ERRCL_L3_WDU | CMD_ERRCL_WDU), CMD_TRAIN(CMD_ERRCL_L3_CPC, CMD_ERRCL_L3_WDC), CMD_TRAIN(CMD_ERRCL_L3_CPU, CMD_ERRCL_L3_WDU), +#else /* sun4u */ + CMD_TRAIN(CMD_ERRCL_LDAC, CMD_ERRCL_LDWC), + CMD_TRAIN(CMD_ERRCL_LDRC, CMD_ERRCL_LDWC), + CMD_TRAIN(CMD_ERRCL_LDSC, CMD_ERRCL_LDWC), + CMD_TRAIN(CMD_ERRCL_LDAU, CMD_ERRCL_LDWU), + CMD_TRAIN(CMD_ERRCL_LDRU, CMD_ERRCL_LDWU), + CMD_TRAIN(CMD_ERRCL_LDSU, CMD_ERRCL_LDWU), +#endif /* sun4u */ CMD_TRAIN(0, 0) }; @@ -644,8 +651,10 @@ cmd_cpu_free(fmd_hdl_t *hdl, cmd_cpu_t *cpu, int destroy) } } +#ifdef sun4u cpu_uec_free(hdl, &cpu->cpu_uec, destroy); cpu_uec_free(hdl, &cpu->cpu_olduec, destroy); +#endif /* sun4u */ cmd_fmri_fini(hdl, &cpu->cpu_asru, destroy); cmd_fmri_fini(hdl, &cpu->cpu_fru, destroy); @@ -711,56 +720,61 @@ cpu_getfrustr(fmd_hdl_t *hdl, uint32_t cpuid) } static nvlist_t * -cpu_getfru(fmd_hdl_t *hdl, uint32_t cpuid) +cpu_mkfru(char *frustr) { - char *frustr, *comp; + char *comp; nvlist_t *fru, *hcelem; - if ((frustr = cpu_getfrustr(hdl, cpuid)) == NULL) { - fmd_hdl_abort(hdl, "failed to retrieve FRU string for CPU %d", - cpuid); - } - - if (strncmp(frustr, CPU_FRU_FMRI, sizeof (CPU_FRU_FMRI) - 1) != 0) { - fmd_hdl_strfree(hdl, frustr); + if (strncmp(frustr, CPU_FRU_FMRI, sizeof (CPU_FRU_FMRI) - 1) != 0) return (NULL); - } + comp = frustr + sizeof (CPU_FRU_FMRI) - 1; - if (nvlist_alloc(&hcelem, NV_UNIQUE_NAME, 0) != 0) { - fmd_hdl_strfree(hdl, frustr); + if (nvlist_alloc(&hcelem, NV_UNIQUE_NAME, 0) != 0) return (NULL); - } + if (nvlist_add_string(hcelem, FM_FMRI_HC_NAME, FM_FMRI_LEGACY_HC) != 0 || nvlist_add_string(hcelem, FM_FMRI_HC_ID, comp) != 0) { nvlist_free(hcelem); - fmd_hdl_strfree(hdl, frustr); return (NULL); } if (nvlist_alloc(&fru, NV_UNIQUE_NAME, 0) != 0) { nvlist_free(hcelem); - fmd_hdl_strfree(hdl, frustr); return (NULL); } + if (nvlist_add_uint8(fru, FM_VERSION, FM_HC_SCHEME_VERSION) != 0 || nvlist_add_string(fru, FM_FMRI_SCHEME, FM_FMRI_SCHEME_HC) != 0 || nvlist_add_string(fru, FM_FMRI_HC_ROOT, "") != 0 || nvlist_add_uint32(fru, FM_FMRI_HC_LIST_SZ, 1) != 0 || nvlist_add_nvlist_array(fru, FM_FMRI_HC_LIST, &hcelem, 1) != 0) { - fmd_hdl_strfree(hdl, frustr); nvlist_free(hcelem); nvlist_free(fru); return (NULL); } - fmd_hdl_strfree(hdl, frustr); nvlist_free(hcelem); return (fru); } +static nvlist_t * +cpu_getfru(fmd_hdl_t *hdl, uint32_t cpuid) +{ + char *frustr; + nvlist_t *nvlp; + + if ((frustr = cpu_getfrustr(hdl, cpuid)) == NULL) { + fmd_hdl_abort(hdl, "failed to retrieve FRU string for CPU %d", + cpuid); + } + nvlp = cpu_mkfru(frustr); + fmd_hdl_strfree(hdl, frustr); + return (nvlp); +} + static void cpu_buf_write(fmd_hdl_t *hdl, cmd_cpu_t *cpu) { @@ -812,6 +826,7 @@ cpu_create(fmd_hdl_t *hdl, nvlist_t *asru, uint32_t cpuid, cmd_cpu_type_t type) { cmd_cpu_t *cpu; nvlist_t *fru; + char *frustr; /* * No CPU state matches the CPU described in the ereport. Create a new @@ -829,13 +844,42 @@ cpu_create(fmd_hdl_t *hdl, nvlist_t *asru, uint32_t cpuid, cmd_cpu_type_t type) cmd_bufname(cpu->cpu_bufname, sizeof (cpu->cpu_bufname), "cpu_%d", cpu->cpu_cpuid); +#ifdef sun4u cpu_uec_create(hdl, cpu, &cpu->cpu_uec, "cpu_uec_%d", cpu->cpu_cpuid); cpu_uec_create(hdl, cpu, &cpu->cpu_olduec, "cpu_olduec_%d", cpu->cpu_cpuid); +#endif /* sun4u */ cmd_fmri_init(hdl, &cpu->cpu_asru, asru, "cpu_asru_%d", cpu->cpu_cpuid); - if ((fru = cpu_getfru(hdl, cpuid)) != NULL) { + /* + * If this ereport contains a 'cpufru' element, use it to construct + * the FRU FMRI instead of going to kstats. + * + * Unfortunately, the string associated with 'cpufru' is + * not in precisely the right form -- so the following code is + * written to adjust. + */ + if (nvlist_lookup_string(asru, FM_FMRI_CPU_CPUFRU, &frustr) == 0) { + char *s1, *s2; + size_t frustrlen = strlen(frustr) + sizeof (CPU_FRU_FMRI) + 1; + + s1 = fmd_hdl_zalloc(hdl, frustrlen, FMD_SLEEP); + s2 = strrchr(frustr, '/') + 1; + if (s2 == NULL) + s2 = "MB"; + + (void) snprintf(s1, frustrlen, "%s%s", + CPU_FRU_FMRI, s2); + + if ((fru = cpu_mkfru(s1)) != NULL) { + cmd_fmri_init(hdl, &cpu->cpu_fru, fru, "cpu_fru_%d", + cpu->cpu_cpuid); + nvlist_free(fru); + } + fmd_hdl_free(hdl, s1, frustrlen); + + } else if ((fru = cpu_getfru(hdl, cpuid)) != NULL) { cmd_fmri_init(hdl, &cpu->cpu_fru, fru, "cpu_fru_%d", cpu->cpu_cpuid); nvlist_free(fru); @@ -1061,13 +1105,13 @@ cmd_cpu_restore(fmd_hdl_t *hdl, fmd_case_t *cp, cmd_case_ptr_t *ptr) cmd_fmri_restore(hdl, &cpu->cpu_asru); cmd_fmri_restore(hdl, &cpu->cpu_fru); - +#ifdef sun4u cpu_uec_restore(hdl, &cpu->cpu_uec); cpu_uec_restore(hdl, &cpu->cpu_olduec); if (cpu->cpu_uec.uec_cache != NULL) cpu_uec_flush(hdl, cpu); - +#endif /* sun4u */ bzero(&cpu->cpu_xxu_retries, sizeof (cmd_list_t)); cmd_list_append(&cmd.cmd_cpus, cpu); @@ -1115,6 +1159,18 @@ cmd_cpu_restore(fmd_hdl_t *hdl, fmd_case_t *cp, cmd_case_ptr_t *ptr) case CMD_PTR_CPU_XR_RETRY: cmd_xr_restore(hdl, cpu, cp); break; + case CMD_PTR_CPU_IREG: + cpu_case_restore(hdl, cpu, &cpu->cpu_ireg, cp, "ireg"); + break; + case CMD_PTR_CPU_FREG: + cpu_case_restore(hdl, cpu, &cpu->cpu_freg, cp, "freg"); + break; + case CMD_PTR_CPU_MAU: + cpu_case_restore(hdl, cpu, &cpu->cpu_mau, cp, "mau"); + break; + case CMD_PTR_CPU_L2CTL: + cpu_case_restore(hdl, cpu, &cpu->cpu_l2ctl, cp, "l2ctl"); + break; default: fmd_hdl_abort(hdl, "invalid %s subtype %d\n", ptr->ptr_name, ptr->ptr_subtype); @@ -1168,9 +1224,11 @@ cmd_xxcu_timeout(fmd_hdl_t *hdl, id_t id) } } +/*ARGSUSED*/ static void cmd_xxu_flush_timeout(fmd_hdl_t *hdl, id_t id) { +#ifdef sun4u cmd_cpu_t *cpu; for (cpu = cmd_list_next(&cmd.cmd_cpus); cpu != NULL; @@ -1180,6 +1238,9 @@ cmd_xxu_flush_timeout(fmd_hdl_t *hdl, id_t id) return; } } +#else /* sun4u */ + return; +#endif /* sun4u */ } void @@ -1244,9 +1305,10 @@ cmd_cpu_gc(fmd_hdl_t *hdl) cpu->cpu_cpuid); continue; } - +#ifdef sun4u if (cpu->cpu_uec.uec_cache != NULL) cpu_uec_flush(hdl, cpu); +#endif /* sun4u */ cpu->cpu_uec_nflushes = 0; } } @@ -1277,10 +1339,10 @@ cpu_family(char *knsp) int j; for (j = 0; j < sizeof (famdata_tbl)/sizeof (famdata_t); j++) { - if (strncmp(knsp, famdata_tbl[j].fam_name, - strlen(famdata_tbl[j].fam_name)) == 0) { - return (famdata_tbl[j].fam_value); - } + if (strncmp(knsp, famdata_tbl[j].fam_name, + strlen(famdata_tbl[j].fam_name)) == 0) { + return (famdata_tbl[j].fam_value); + } } return (CMD_CPU_FAM_UNSUPPORTED); } diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpu.h b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpu.h index 3450918da9..cf12bc81c2 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpu.h +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpu.h @@ -52,6 +52,10 @@ * | | ,---------. CMD_PTR_CPU_L3DATA_UERETRY * | uec | ----> |UE cache | CMD_PTR_CPU_L3TAG * \________/ `---------' CMD_PTR_CPU_FPU + * CMD_PTR_CPU_IREG + * CMD_PTR_CPU_FREG + * CMD_PTR_CPU_MAU + * CMD_PTR_CPU_L2CTL * * ________ * / \ ,--------. @@ -79,6 +83,14 @@ #include <cmd_state.h> #include <cmd_fmri.h> +#ifdef sun4u +#include <sys/cheetahregs.h> +#include <sys/fm/cpu/UltraSPARC-III.h> +#else /* sun4u */ +#include <sys/niagararegs.h> +#include <sys/fm/cpu/UltraSPARC-T1.h> +#endif /* sun4u */ + #ifdef __cplusplus extern "C" { #endif @@ -106,6 +118,10 @@ typedef struct cmd_cpu_cases { cmd_case_t cpuc_l3data; /* All correctable L3$ data errors */ cmd_case_t cpuc_l3tag; /* All correctable L3$ tag errors */ cmd_case_t cpuc_fpu; /* FPU errors */ + cmd_case_t cpuc_ireg; /* Integer reg errors (IRC, IRU) */ + cmd_case_t cpuc_freg; /* Floatpnt reg errors (frc, fru) */ + cmd_case_t cpuc_mau; /* Modular arith errors (MAU) */ + cmd_case_t cpuc_l2ctl; /* L2$ directory, VUAD parity */ } cmd_cpu_cases_t; /* @@ -207,6 +223,11 @@ typedef struct cmd_xr cmd_xr_t; typedef void cmd_xr_hdlr_f(fmd_hdl_t *, cmd_xr_t *, fmd_event_t *); +/* + * For sun4v, the size of xr_synd is expanded to 32 bits in order to + * accomodate the Niagara L2 syndrome (4x7 bits). + */ + struct cmd_xr { cmd_list_t xr_list; id_t xr_id; /* ID of timer used for redelivery */ @@ -214,7 +235,11 @@ struct cmd_xr { uint32_t xr_cpuid; /* ID of detecting CPU */ uint64_t xr_ena; /* ENA from ereport */ uint64_t xr_afar; /* AFAR from ereport nvlist */ +#ifdef sun4u uint16_t xr_synd; /* syndrome from ereport nvlist */ +#else /* sun4u */ + uint32_t xr_synd; /* for Niagara, enlarged to 32 bits */ +#endif /* sun4u */ uint8_t xr_afar_status; /* AFAR status from ereport nvlist */ uint8_t xr_synd_status; /* syndrome status from ereport nvlist */ cmd_fmri_t xr_rsrc; /* resource from ereport nvlist */ @@ -231,6 +256,7 @@ extern cmd_xr_t *cmd_xr_create(fmd_hdl_t *, fmd_event_t *, nvlist_t *, cmd_cpu_t *, cmd_errcl_t); extern cmd_evdisp_t cmd_xr_reschedule(fmd_hdl_t *, cmd_xr_t *, uint_t); extern void cmd_xr_deref(fmd_hdl_t *, cmd_xr_t *); +extern void cmd_xr_write(fmd_hdl_t *, cmd_xr_t *); extern void cmd_xxc_resolve(fmd_hdl_t *, cmd_xr_t *, fmd_event_t *); extern void cmd_xxu_resolve(fmd_hdl_t *, cmd_xr_t *, fmd_event_t *); @@ -354,6 +380,11 @@ struct cmd_cpu { #define cpu_l3data cpu_cases.cpuc_l3data #define cpu_l3tag cpu_cases.cpuc_l3tag #define cpu_fpu cpu_cases.cpuc_fpu +#define cpu_ireg cpu_cases.cpuc_ireg +#define cpu_freg cpu_cases.cpuc_freg +#define cpu_mau cpu_cases.cpuc_mau +#define cpu_l2ctl cpu_cases.cpuc_l2ctl + #define cpu_asru_nvl cpu_asru.fmri_nvl #define cpu_fru_nvl cpu_fru.fmri_nvl @@ -397,6 +428,7 @@ extern cmd_evdisp_t cmd_xxu(fmd_hdl_t *, fmd_event_t *, nvlist_t *, * ------- ----------- ------------------------------- * TxCE l2cachetag fault.cpu.<cputype>.l2cachetag * L3_THCE l3cachetag fault.cpu.<cputype>.l3cachetag + * LTC l2cachetag fault.cpu.<cputype>.l2cachetag * * We'll never see the uncorrectable Tag errors - they'll cause the machine to * reset, and we'll be ne'er the wiser. @@ -467,6 +499,64 @@ extern cmd_evdisp_t cmd_fpu(fmd_hdl_t *, fmd_event_t *, nvlist_t *, const char *, cmd_errcl_t); /* + * ireg errors + * + * SERD name + * Type (if any) Fault + * ------ --------- ------------------------------- + * IRC ireg fault.cpu.<cputype>.ireg + * IRU - " + * + * The expected resolution of ireg faults is the disabling of the indicated CPU. + */ +extern cmd_evdisp_t cmd_irc(fmd_hdl_t *, fmd_event_t *, nvlist_t *, + const char *, cmd_errcl_t); +extern cmd_evdisp_t cmd_iru(fmd_hdl_t *, fmd_event_t *, nvlist_t *, + const char *, cmd_errcl_t); + +/* + * freg errors + * + * SERD name + * Type (if any) Fault + * ------ --------- ------------------------------- + * FRC freg fault.cpu.ultraSPARC-T1.frc + * FRU - " .fru + * + * The expected resolution of freg faults is the repair of the indicated CPU. + */ +extern cmd_evdisp_t cmd_frc(fmd_hdl_t *, fmd_event_t *, nvlist_t *, + const char *, cmd_errcl_t); +extern cmd_evdisp_t cmd_fru(fmd_hdl_t *, fmd_event_t *, nvlist_t *, + const char *, cmd_errcl_t); + +/* + * MAU errors + * + * SERD name + * Type (if any) Fault + * ------ --------- ------------------------------- + * MAU mau fault.cpu.<cputype>.mau + * + * The expected resolution of mau faults is the repair of the indicated CPU. + */ +extern cmd_evdisp_t cmd_mau(fmd_hdl_t *, fmd_event_t *, nvlist_t *, + const char *, cmd_errcl_t); + +/* + * L2CTL errors + * + * SERD name + * Type (if any) Fault + * ------ --------- ------------------------------- + * L2CTL - fault.cpu.<cputype>.l2ctl + * + * The expected resolution of l2ctl faults is the repair of the indicated CPU. + */ +extern cmd_evdisp_t cmd_l2ctl(fmd_hdl_t *, fmd_event_t *, nvlist_t *, + const char *, cmd_errcl_t); + +/* * CPUs are described by FMRIs. This routine will retrieve the CPU state * structure (creating a new one if necessary) described by the detector * FMRI in the passed ereport. @@ -493,6 +583,14 @@ typedef enum { extern cpu_family_t cmd_cpu_check_support(void); +extern int cmd_xr_fill(fmd_hdl_t *, nvlist_t *, cmd_xr_t *, cmd_errcl_t); + +#ifdef sun4u +extern int cmd_cpu_synd_check(uint16_t); +#else /* sun4u */ +extern int cmd_cpu_synd_check(uint32_t); +#endif /* sun4u */ + #ifdef __cplusplus } #endif diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpuerr.c b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpuerr.c index fe45bc84c2..14560b25b1 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpuerr.c +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpuerr.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -38,9 +38,7 @@ #include <errno.h> #include <fm/fmd_api.h> #include <sys/fm/protocol.h> -#include <sys/fm/cpu/UltraSPARC-III.h> #include <sys/async.h> -#include <sys/cheetahregs.h> /* * We follow the same algorithm for handling all L1$, TLB, and L2/L3 cache @@ -106,38 +104,63 @@ CMD_CPU_SIMPLEHANDLER(dcache, dcache, CMD_PTR_CPU_DCACHE, "dcache", "dcache") CMD_CPU_SIMPLEHANDLER(pcache, pcache, CMD_PTR_CPU_PCACHE, "pcache", "pcache") CMD_CPU_SIMPLEHANDLER(itlb, itlb, CMD_PTR_CPU_ITLB, "itlb", "itlb") CMD_CPU_SIMPLEHANDLER(dtlb, dtlb, CMD_PTR_CPU_DTLB, "dtlb", "dtlb") +CMD_CPU_SIMPLEHANDLER(irc, ireg, CMD_PTR_CPU_IREG, "ireg", "ireg") +CMD_CPU_SIMPLEHANDLER(frc, freg, CMD_PTR_CPU_FREG, "freg", "freg") +CMD_CPU_SIMPLEHANDLER(mau, mau, CMD_PTR_CPU_MAU, "mau", "mau") -/*ARGSUSED*/ -cmd_evdisp_t -cmd_fpu(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, - cmd_errcl_t clcode) -{ - const char *uuid; - cmd_cpu_t *cpu; - nvlist_t *flt; - - if ((cpu = cmd_cpu_lookup_from_detector(hdl, nvl, class)) == NULL || - cpu->cpu_faulting) - return (CMD_EVD_UNUSED); - - if (cpu->cpu_fpu.cc_cp != NULL && fmd_case_solved(hdl, - cpu->cpu_fpu.cc_cp)) - return (CMD_EVD_REDUND); - - /* - * Create a new case for FPU errors, add the ereport and fault - * and solve the case. - */ - cpu->cpu_fpu.cc_cp = cmd_case_create(hdl, &cpu->cpu_header, - CMD_PTR_CPU_FPU, &uuid); - fmd_case_add_ereport(hdl, cpu->cpu_fpu.cc_cp, ep); - flt = cmd_cpu_create_fault(hdl, cpu, "fpu", NULL, 100); - fmd_case_add_suspect(hdl, cpu->cpu_fpu.cc_cp, flt); - fmd_case_solve(hdl, cpu->cpu_fpu.cc_cp); +/* + * The following macro handles UE errors for CPUs. + * The UE may or may not share a fault with one or more + * CEs, but this doesn't matter. We look for existence of a + * SERD engine, blow it away if it exists, and close the case + * as solved. + */ - return (CMD_EVD_OK); +#define CMD_CPU_UEHANDLER(name, casenm, ptr, fltname) \ +cmd_evdisp_t \ +cmd_##name(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, \ + const char *class, cmd_errcl_t clcode) \ +{ \ + const char *uuid; \ + cmd_cpu_t *cpu; \ + nvlist_t *flt; \ + cmd_case_t *cc; \ + \ + if ((cpu = cmd_cpu_lookup_from_detector(hdl, nvl, class)) == \ + NULL || cpu->cpu_faulting) \ + return (CMD_EVD_UNUSED); \ + \ + cc = &cpu->cpu_##casenm; \ + if (cc->cc_cp != NULL && fmd_case_solved(hdl, cc->cc_cp)) \ + return (CMD_EVD_REDUND); \ + \ + if (cc->cc_cp == NULL) { \ + cc->cc_cp = cmd_case_create(hdl, &cpu->cpu_header, \ + ptr, &uuid); \ + } \ + \ + if (cc->cc_serdnm != NULL) { \ + fmd_hdl_debug(hdl, \ + "destroying existing %s state for class %x\n", \ + cc->cc_serdnm, clcode); \ + fmd_serd_destroy(hdl, cc->cc_serdnm); \ + fmd_hdl_strfree(hdl, cc->cc_serdnm); \ + cc->cc_serdnm = NULL; \ + fmd_case_reset(hdl, cc->cc_cp); \ + } \ + \ + fmd_case_add_ereport(hdl, cc->cc_cp, ep); \ + flt = cmd_cpu_create_fault(hdl, cpu, fltname, NULL, 100); \ + fmd_case_add_suspect(hdl, cc->cc_cp, flt); \ + fmd_case_solve(hdl, cc->cc_cp); \ + return (CMD_EVD_OK); \ } +CMD_CPU_UEHANDLER(fpu, fpu, CMD_PTR_CPU_FPU, "fpu") +CMD_CPU_UEHANDLER(l2ctl, l2ctl, CMD_PTR_CPU_L2CTL, "l2ctl") +CMD_CPU_UEHANDLER(iru, ireg, CMD_PTR_CPU_IREG, "ireg") +CMD_CPU_UEHANDLER(fru, freg, CMD_PTR_CPU_FREG, "freg") + typedef struct errdata { cmd_serd_t *ed_serd; const char *ed_fltnm; @@ -166,24 +189,27 @@ cmd_xxu_hdlr(fmd_hdl_t *hdl, cmd_xr_t *xr, fmd_event_t *ep) return; } - if (xr->xr_synd_status == AFLT_STAT_VALID && - (xr->xr_synd == CH_POISON_SYND_FROM_XXU_WRITE || - xr->xr_synd == CH_POISON_SYND_FROM_XXU_WRMERGE || - xr->xr_synd == CH_POISON_SYND_FROM_DSTAT23)) { - fmd_hdl_debug(hdl, "xxU dropped due to syndrome\n"); + if (xr->xr_afar_status != AFLT_STAT_VALID) { + fmd_hdl_debug(hdl, "xxU dropped, afar not VALID\n"); return; } - if (xr->xr_afar_status != AFLT_STAT_VALID) { - fmd_hdl_debug(hdl, "xxU dropped -- afar not VALID\n"); + if (cmd_cpu_synd_check(xr->xr_synd) < 0) { + fmd_hdl_debug(hdl, "xxU/LDxU dropped due to syndrome\n"); return; } +#ifdef sun4u + /* + * UE cache needed for sun4u only, because sun4u doesn't poison + * uncorrectable data loaded into L2/L3 cache. + */ if (cmd_cpu_uec_match(xr->xr_cpu, xr->xr_afar)) { fmd_hdl_debug(hdl, "ue matched in UE cache\n"); CMD_STAT_BUMP(xxu_ue_match); return; } +#endif /* sun4u */ /* * We didn't match in the UE cache. We don't need to sleep for UE diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_dimm.c b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_dimm.c index b789a91722..f53249a931 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_dimm.c +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_dimm.c @@ -42,7 +42,6 @@ #include <unistd.h> #include <fm/fmd_api.h> #include <sys/fm/protocol.h> -#include <sys/fm/cpu/UltraSPARC-III.h> #include <sys/mem.h> #include <sys/nvpair.h> diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_main.c b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_main.c index eac5f5244a..416340991a 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_main.c +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_main.c @@ -33,7 +33,11 @@ #include <cmd_state.h> #include <cmd_cpu.h> + +#ifdef sun4u #include <cmd_ecache.h> +#endif /* sun4u */ + #include <cmd_mem.h> #include <cmd_page.h> #include <cmd_dimm.h> @@ -47,7 +51,6 @@ #include <fm/fmd_api.h> #include <sys/fm/protocol.h> #include <sys/async.h> -#include <sys/cheetahregs.h> cmd_t cmd; @@ -68,6 +71,7 @@ cmd_nop(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, } static cmd_subscriber_t cmd_subscribers[] = { +#ifdef sun4u { "ereport.cpu.*.ucc", cmd_xxc, CMD_ERRCL_UCC }, { "ereport.cpu.*.ucu", cmd_xxu, CMD_ERRCL_UCU }, { "ereport.cpu.*.cpc", cmd_xxc, CMD_ERRCL_CPC }, @@ -108,13 +112,8 @@ static cmd_subscriber_t cmd_subscribers[] = { { "ereport.cpu.*.rce", cmd_rxe, CMD_ERRCL_RCE }, { "ereport.cpu.*.fru", cmd_frx, CMD_ERRCL_FRU }, { "ereport.cpu.*.rue", cmd_rxe, CMD_ERRCL_RUE }, - { "ereport.cpu.*.fpu.hwcopy", cmd_fpu }, { "ereport.cpu.*.eti", cmd_txce }, { "ereport.cpu.*.etc", cmd_txce }, - { "ereport.cpu.*.dac", cmd_ce, CMD_ERRCL_DAC }, - { "ereport.cpu.*.dsc", cmd_ce, CMD_ERRCL_DSC }, - { "ereport.cpu.*.dau", cmd_ue, CMD_ERRCL_DAU }, - { "ereport.cpu.*.dsu", cmd_ue, CMD_ERRCL_DSU }, { "ereport.io.*.ecc.drce", cmd_ioxe, CMD_ERRCL_IOCE }, { "ereport.io.*.ecc.dwce", cmd_ioxe, CMD_ERRCL_IOCE }, { "ereport.io.*.ecc.drue", cmd_ioxe, CMD_ERRCL_IOUE }, @@ -123,21 +122,38 @@ static cmd_subscriber_t cmd_subscribers[] = { { "ereport.io.*.ecc.s-dwce", cmd_ioxe_sec }, { "ereport.io.*.ecc.s-drue", cmd_ioxe_sec }, { "ereport.io.*.ecc.s-dwue", cmd_ioxe_sec }, - { "ereport.cpu.*.ddc", cmd_nop }, - { "ereport.cpu.*.dmdu", cmd_nop }, - { "ereport.cpu.*.dmsu", cmd_nop }, - { "ereport.cpu.*.dmtu", cmd_nop }, - { "ereport.cpu.*.dtc", cmd_nop }, - { "ereport.cpu.*.idc", cmd_nop }, - { "ereport.cpu.*.imdu", cmd_nop }, - { "ereport.cpu.*.imtu", cmd_nop }, - { "ereport.cpu.*.irc", cmd_nop }, - { "ereport.cpu.*.itc", cmd_nop }, - { "ereport.cpu.*.ldac", cmd_nop }, - { "ereport.cpu.*.ldrc", cmd_nop }, - { "ereport.cpu.*.ldsc", cmd_nop }, - { "ereport.cpu.*.ldwc", cmd_nop }, - { "ereport.cpu.*.ltc", cmd_nop }, +#else /* i.e. sun4v */ + { "ereport.cpu.*.irc", cmd_irc }, + { "ereport.cpu.*.iru", cmd_iru }, + { "ereport.cpu.*.frc", cmd_frc }, + { "ereport.cpu.*.fru", cmd_fru }, + { "ereport.cpu.*.mau", cmd_mau }, + { "ereport.cpu.*.imdu", cmd_itlb }, + { "ereport.cpu.*.dmdu", cmd_dtlb }, + { "ereport.cpu.*.dmsu", cmd_dtlb }, + { "ereport.cpu.*.imtu", cmd_itlb }, + { "ereport.cpu.*.dmtu", cmd_dtlb }, + { "ereport.cpu.*.itc", cmd_icache }, + { "ereport.cpu.*.idc", cmd_icache }, + { "ereport.cpu.*.dtc", cmd_dcache }, + { "ereport.cpu.*.ddc", cmd_dcache }, + { "ereport.cpu.*.ldac", cmd_xxc, CMD_ERRCL_LDAC }, + { "ereport.cpu.*.ldwc", cmd_xxc, CMD_ERRCL_LDWC }, + { "ereport.cpu.*.ldrc", cmd_xxc, CMD_ERRCL_LDRC }, + { "ereport.cpu.*.ldsc", cmd_xxc, CMD_ERRCL_LDSC }, + { "ereport.cpu.*.ltc", cmd_txce }, + { "ereport.cpu.*.ldau", cmd_xxu, CMD_ERRCL_LDAU }, + { "ereport.cpu.*.ldwu", cmd_xxu, CMD_ERRCL_LDWU }, + { "ereport.cpu.*.ldru", cmd_xxu, CMD_ERRCL_LDRU }, + { "ereport.cpu.*.ldsu", cmd_xxu, CMD_ERRCL_LDSU }, + { "ereport.cpu.*.lvu", cmd_l2ctl }, + { "ereport.cpu.*.lru", cmd_l2ctl }, + { "ereport.cpu.*.dac", cmd_ce, CMD_ERRCL_DAC }, + { "ereport.cpu.*.dsc", cmd_ce, CMD_ERRCL_DSC }, + { "ereport.cpu.*.dau", cmd_ue, CMD_ERRCL_DAU }, + { "ereport.cpu.*.dsu", cmd_ue, CMD_ERRCL_DSU }, +#endif /* sun4u */ + { "ereport.cpu.*.fpu.hwcopy", cmd_fpu }, { NULL, NULL } }; @@ -247,6 +263,12 @@ static const fmd_prop_t fmd_props[] = { { "l3data_t", FMD_TYPE_TIME, "12h" }, { "ce_n", FMD_TYPE_UINT32, "2" }, { "ce_t", FMD_TYPE_TIME, "72h" }, + { "ireg_n", FMD_TYPE_UINT32, "2" }, + { "ireg_t", FMD_TYPE_TIME, "168h" }, + { "freg_n", FMD_TYPE_UINT32, "2" }, + { "freg_t", FMD_TYPE_TIME, "168h" }, + { "mau_n", FMD_TYPE_UINT32, "2" }, + { "mau_t", FMD_TYPE_TIME, "168h" }, { "iorxefrx_window", FMD_TYPE_TIME, "3s" }, { "xxcu_trdelay", FMD_TYPE_TIME, "200ms" }, { "xxcu_restart_delay", FMD_TYPE_TIME, "1s" }, @@ -269,7 +291,7 @@ static const fmd_hdl_info_t fmd_info = { #ifdef sun4u "UltraSPARC-III/IV CPU/Memory Diagnosis", #else - "UltraSPARC-T1 Memory Diagnosis", + "UltraSPARC-T1 CPU/Memory Diagnosis", #endif CMD_VERSION, &fmd_ops, fmd_props }; @@ -318,26 +340,7 @@ _fmd_init(fmd_hdl_t *hdl) fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-IIIiplus.*"); fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-IV.*"); fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-IVplus.*"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.dac"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.dsc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.dau"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.dsu"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.ddc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.dmdu"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.dmsu"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.dmtu"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.dtc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.frc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.idc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.imdu"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.imtu"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.irc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.itc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.ldac"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.ldrc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.ldsc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.ldwc"); - fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.ltc"); + fmd_hdl_subscribe(hdl, "ereport.cpu.ultraSPARC-T1.*"); fmd_hdl_subscribe(hdl, "ereport.io.tom.ecc.drce"); fmd_hdl_subscribe(hdl, "ereport.io.tom.ecc.dwce"); @@ -387,6 +390,7 @@ _fmd_init(fmd_hdl_t *hdl) (void) snprintf(stat->fmds_name, sizeof (stat->fmds_name), cmd_evdisp_names[i].evn_name, type); + stat->fmds_type = FMD_TYPE_UINT64; (void) snprintf(stat->fmds_desc, sizeof (stat->fmds_desc), diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_mem.c b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_mem.c index 48d9106225..2251ce0089 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_mem.c +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_mem.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -42,7 +42,6 @@ #include <unistd.h> #include <fm/fmd_api.h> #include <sys/fm/protocol.h> -#include <sys/fm/cpu/UltraSPARC-III.h> #include <sys/mem.h> #include <sys/nvpair.h> diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_memerr.c b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_memerr.c index dd4b70588b..8c0e20f65f 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_memerr.c +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_memerr.c @@ -42,24 +42,9 @@ #include <errno.h> #include <fm/fmd_api.h> #include <sys/fm/protocol.h> -#include <sys/fm/cpu/UltraSPARC-III.h> -#include <sys/fm/io/sun4upci.h> #include <sys/async.h> -#include <sys/cheetahregs.h> -#include <sys/pci/pcisch.h> #include <sys/errclassify.h> -/* Jalapeno-specific values from cheetahregs.h */ -#define USIIIi_AFSR_AID 0x0000000000003e00ull /* AID causing UE/CE */ -#define USIIIi_AFSR_AID_SHIFT 9 -#define USIIIi_AFSR_JREQ 0x0000000007000000ull /* Active JBus req */ -#define USIIIi_AFSR_JREQ_SHIFT 24 -#define TOM_AID_MATCH_MASK 0xe - -typedef cmd_evdisp_t xe_handler_f(fmd_hdl_t *, fmd_event_t *, nvlist_t *, - const char *, uint64_t, uint8_t, uint16_t, uint8_t, ce_dispact_t, uint64_t, - nvlist_t *); - struct ce_name2type { const char *name; ce_dispact_t type; @@ -222,34 +207,6 @@ cmd_ce_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, CMD_STAT_BUMP(ce_leaky); break; case CE_DISP_POSS_STICKY: - - /* - * The following code is a workaround for a misfix of 6316055 - * error-type member of DAC ereports is often intermittent . - * The bug number for the workaround is 6326938. - * - * In sun4u, a memory CE ereport classified as PS (Possibly - * Sticky) is ignored, because it means that the ereport itself - * is possibly corrupted. - * - * In sun4v when this hv bug is present, a Possibly Sticky CE could be - * either Sticky or Persistent in reality. In this portion of the - * workaround, we first prevent the e-report from being discarded. - * In the second part of the workaround (subsequent #ifdef sun4v) - * we cause a Possibly Sticky ereport to be treated in the same way - * as a Persistent or Possibly Persistent ereport. - * If we are being too cautious (these ereports denote a truly stuck - * bit in memory), then page retirements will still happen, albeit - * more slowly than if we had treated these PS ereports as Sticky. - * - * After the hv bug is fixed, we should no longer receive any PS - * ereports, and this workaround is safe. - */ - -#ifdef sun4v - CMD_STAT_BUMP(ce_psticky_noptnr); - break; -#else { uchar_t ptnrinfo = CE_XDIAG_PTNRINFO(disp); @@ -272,7 +229,6 @@ cmd_ce_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, } return (CMD_EVD_UNUSED); } -#endif /* sun4v */ case CE_DISP_STICKY: CMD_STAT_BUMP(ce_sticky); break; @@ -288,9 +244,6 @@ cmd_ce_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, switch (type) { case CE_DISP_POSS_PERS: case CE_DISP_PERS: -#ifdef sun4v - case CE_DISP_POSS_STICKY: -#endif /* sun4v */ fmd_hdl_debug(hdl, "adding %sPersistent event to CE serd " "engine\n", type == CE_DISP_POSS_PERS ? "Possible-" : ""); @@ -366,8 +319,8 @@ cmd_ue_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, } if (synd_status != AFLT_STAT_VALID) { - fmd_hdl_debug(hdl, "cmd_ue_common: syndrome not valid\n"); - return (CMD_EVD_UNUSED); + fmd_hdl_debug(hdl, "cmd_ue_common: syndrome not valid\n"); + return (CMD_EVD_UNUSED); } if (cmd_mem_synd_check(hdl, afar, afar_status, synd, synd_status, @@ -443,317 +396,3 @@ cmd_bank_close(fmd_hdl_t *hdl, void *arg) { cmd_bank_destroy(hdl, arg); } - -/* - * When we complete an IOxE/RxE FRx pair, we have enough information to - * create either a CE or a UE, as appropriate. Before dispatching the - * joined event to the xE handler, we need to generate the FMRI for the - * named DIMM. While one of the events may already contain a resource FMRI, - * said FMRI is incomplete. The detector didn't have the necessary - * information (the AFAR, the AFSR, *and* the syndrome) needed to create - * a DIMM-level FMRI. - */ -static cmd_evdisp_t -iorxefrx_synthesize(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, - const char *class, uint64_t afar, uint8_t afar_status, uint64_t afsr, - uint16_t synd, uint8_t synd_status, ce_dispact_t type, uint64_t disp, - xe_handler_f *hdlr) -{ - nvlist_t *fmri; - int rc; - - if ((fmri = cmd_dimm_fmri_derive(hdl, afar, synd, afsr)) == NULL) - return (CMD_EVD_UNUSED); - - rc = hdlr(hdl, ep, nvl, class, afar, afar_status, synd, synd_status, - type, disp, fmri); - - nvlist_free(fmri); - - return (rc); -} - -static cmd_iorxefrx_t * -iorxefrx_match(fmd_hdl_t *hdl, cmd_errcl_t errcl, cmd_errcl_t matchmask, - uint_t det_agentid, uint_t afsr_agentid) -{ - cmd_iorxefrx_t *rf; - - for (rf = cmd_list_next(&cmd.cmd_iorxefrx); rf != NULL; - rf = cmd_list_next(rf)) { - - fmd_hdl_debug(hdl, "rf->rf_errcl = %llx, matchmask = %llx\n" - "rf->rf_det_agentid = %lx, afsr_agentid = %lx\n" - "rf->rf_afsr_agentid = %lx, det_agentid = %lx\n", - rf->rf_errcl, matchmask, rf->rf_det_agentid, afsr_agentid, - rf->rf_afsr_agentid, det_agentid); - - if ((rf->rf_errcl & matchmask) == 0) - continue; - - /* - * For IOxEs we are unable to match based on both the detector - * and the captured Agent Id in the AFSR, because the bridge - * captures it's own Agent Id instead of the remote CPUs. - * - * Also, the LSB of Tomatillo's jpid is aliased for each chip - * and therefore needs to be factored out of our matching. - */ - if ((CMD_ERRCL_ISIOXE(rf->rf_errcl) || - CMD_ERRCL_ISIOXE(errcl)) && - ((rf->rf_afsr_agentid & TOM_AID_MATCH_MASK) == - (afsr_agentid & TOM_AID_MATCH_MASK))) - return (rf); - - /* - * Check for both here since IOxE is not involved - */ - if ((rf->rf_afsr_agentid == det_agentid) && - (rf->rf_det_agentid == afsr_agentid)) - return (rf); - } - - return (NULL); -} - -/* - * Got an RxE or an FRx. FRx ereports can be matched with RxE ereports and - * vice versa. FRx ereports can also be matched with IOxE ereports. - */ -cmd_evdisp_t -cmd_rxefrx_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, - const char *class, cmd_errcl_t clcode, cmd_errcl_t matchmask) -{ - xe_handler_f *hdlr; - cmd_iorxefrx_t *rfmatch, *rferr; - cmd_cpu_t *cpu; - char *typenm; - int isrxe = CMD_ERRCL_MATCH(clcode, CMD_ERRCL_RCE | CMD_ERRCL_RUE); - int isce = CMD_ERRCL_MATCH(clcode, CMD_ERRCL_RCE | CMD_ERRCL_FRC); - int rc; - int minorvers = 1; - - rferr = fmd_hdl_zalloc(hdl, sizeof (cmd_iorxefrx_t), FMD_SLEEP); - - if (nvlist_lookup_pairs(nvl, 0, - FM_EREPORT_PAYLOAD_NAME_SYND, DATA_TYPE_UINT16, &rferr->rf_synd, - FM_EREPORT_PAYLOAD_NAME_SYND_STATUS, DATA_TYPE_UINT8, - &rferr->rf_synd_status, - FM_EREPORT_PAYLOAD_NAME_AFAR, DATA_TYPE_UINT64, &rferr->rf_afar, - FM_EREPORT_PAYLOAD_NAME_AFAR_STATUS, DATA_TYPE_UINT8, - &rferr->rf_afar_status, - FM_EREPORT_PAYLOAD_NAME_AFSR, DATA_TYPE_UINT64, &rferr->rf_afsr, - FM_EREPORT_PAYLOAD_NAME_ERR_TYPE, DATA_TYPE_STRING, &typenm, - NULL) != 0) { - fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); - return (CMD_EVD_BAD); - } - if (nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_NAME_ERR_DISP, - &rferr->rf_disp) != 0) - minorvers = 0; - - rferr->rf_type = cmd_mem_name2type(typenm, minorvers); - - if ((cpu = cmd_cpu_lookup_from_detector(hdl, nvl, class)) == NULL) { - fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); - return (CMD_EVD_UNUSED); - } - - if (!isrxe && rferr->rf_synd_status != AFLT_STAT_VALID) { - fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); - return (CMD_EVD_UNUSED); - } - - if (isrxe) { - rferr->rf_afsr_agentid = (rferr->rf_afsr & - USIIIi_AFSR_JREQ) >> USIIIi_AFSR_JREQ_SHIFT; - } else { - rferr->rf_afsr_agentid = (rferr->rf_afsr & - USIIIi_AFSR_AID) >> USIIIi_AFSR_AID_SHIFT; - } - - rferr->rf_errcl = clcode; - rferr->rf_det_agentid = cpu->cpu_cpuid; - - if ((rfmatch = iorxefrx_match(hdl, clcode, matchmask, - rferr->rf_det_agentid, rferr->rf_afsr_agentid)) == NULL) { - cmd_iorxefrx_queue(hdl, rferr); - return (CMD_EVD_OK); - } - - /* - * Found a match. Send a synthesized ereport to the appropriate - * routine. - */ - fmd_hdl_debug(hdl, "matched %cE %llx with %llx", "UC"[isce], - rferr->rf_errcl, rfmatch->rf_errcl); - - hdlr = (isce ? cmd_ce_common : cmd_ue_common); - if (isrxe) { - rc = iorxefrx_synthesize(hdl, ep, nvl, class, rferr->rf_afar, - rferr->rf_afar_status, rfmatch->rf_afsr, rfmatch->rf_synd, - rfmatch->rf_synd_status, rferr->rf_type, rferr->rf_disp, - hdlr); - } else { - rc = iorxefrx_synthesize(hdl, ep, nvl, class, rfmatch->rf_afar, - rfmatch->rf_afar_status, rferr->rf_afsr, rferr->rf_synd, - rferr->rf_synd_status, rfmatch->rf_type, rferr->rf_disp, - hdlr); - } - - cmd_iorxefrx_free(hdl, rfmatch); - fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); - - return (rc); -} - -/* This IOxE must be matched with an FRx before UE/CE processing is possible */ -static cmd_evdisp_t -cmd_ioxefrx_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, - const char *class, cmd_errcl_t errcl, cmd_errcl_t matchmask) -{ - xe_handler_f *hdlr; - cmd_iorxefrx_t *rfmatch, *rferr; - char *typenm; - int isce = CMD_ERRCL_MATCH(errcl, CMD_ERRCL_IOCE); - char *portid_str; - char *path = NULL; - nvlist_t *det = NULL; - int rc; - int minorvers = 1; - - rferr = fmd_hdl_zalloc(hdl, sizeof (cmd_iorxefrx_t), FMD_SLEEP); - - if (nvlist_lookup_pairs(nvl, 0, - PCI_ECC_AFAR, DATA_TYPE_UINT64, &rferr->rf_afar, - PCI_ECC_AFSR, DATA_TYPE_UINT64, &rferr->rf_afsr, - PCI_ECC_SYND, DATA_TYPE_UINT16, &rferr->rf_synd, - PCI_ECC_TYPE, DATA_TYPE_STRING, &typenm, - NULL) != 0) { - fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); - return (CMD_EVD_BAD); - } - - if (nvlist_lookup_uint64(nvl, PCI_ECC_DISP, &rferr->rf_disp) != 0) - minorvers = 0; - - rferr->rf_type = cmd_mem_name2type(typenm, minorvers); - rferr->rf_errcl = errcl; - - /* - * Lookup device path of host bridge. - */ - (void) nvlist_lookup_nvlist(nvl, FM_EREPORT_DETECTOR, &det); - (void) nvlist_lookup_string(det, FM_FMRI_DEV_PATH, &path); - - /* - * get Jbus port id from the device path - */ - portid_str = strrchr(path, '@') + 1; - rferr->rf_det_agentid = strtol(portid_str, NULL, 16); - - rferr->rf_afsr_agentid = (rferr->rf_afsr & - SCHIZO_ECC_UE_AFSR_AGENT_MID) >> SCHIZO_ECC_UE_AFSR_AGENT_MID_SHIFT; - - /* - * Only 4 bits of the Jbus AID are sent on the Jbus. MSB is the one - * that is chosen not to make the trip. This is not in any of the Jbus - * or Tomatillo documents and was discovered during testing and verified - * by Jalapeno H/W designer. - */ - rferr->rf_afsr_agentid &= 0xf; - rferr->rf_afar_status = AFLT_STAT_VALID; - rferr->rf_synd_status = AFLT_STAT_VALID; - - /* - * Need to send in the io_jpid that we get from the device path above - * for both the det_agentid and the afsr_agentid, since the CPU does not - * capture the same address as the bridge. The bridge has the LSB - * aliased and the CPU is missing the MSB. - */ - if ((rfmatch = iorxefrx_match(hdl, rferr->rf_errcl, matchmask, - rferr->rf_det_agentid, rferr->rf_afsr_agentid)) == NULL) { - cmd_iorxefrx_queue(hdl, rferr); - return (CMD_EVD_OK); - } - - /* Found a match. Synthesize an ereport for UE/CE processing. */ - fmd_hdl_debug(hdl, "matched %cE %llx with %llx\n", "UC"[isce], - rferr->rf_errcl, rfmatch->rf_errcl); - - hdlr = (isce ? cmd_ce_common : cmd_ue_common); - rc = iorxefrx_synthesize(hdl, ep, nvl, class, rferr->rf_afar, - rferr->rf_afar_status, rfmatch->rf_afsr, rfmatch->rf_synd, - rfmatch->rf_synd_status, rferr->rf_type, rferr->rf_disp, hdlr); - - cmd_iorxefrx_free(hdl, rfmatch); - fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); - - return (rc); -} - -/* IOxE ereports that don't need matching with FRx ereports */ -static cmd_evdisp_t -ioxe_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, - cmd_errcl_t clcode) -{ - int isce = CMD_ERRCL_MATCH(clcode, CMD_ERRCL_IOCE); - xe_handler_f *hdlr = isce ? cmd_ce_common : cmd_ue_common; - uint64_t afar; - uint16_t synd; - nvlist_t *rsrc; - char *typenm; - uint64_t disp; - int minorvers = 1; - - if (nvlist_lookup_pairs(nvl, 0, - PCI_ECC_AFAR, DATA_TYPE_UINT64, &afar, - PCI_ECC_SYND, DATA_TYPE_UINT16, &synd, - PCI_ECC_TYPE, DATA_TYPE_STRING, &typenm, - PCI_ECC_RESOURCE, DATA_TYPE_NVLIST, &rsrc, - NULL) != 0) - return (CMD_EVD_BAD); - - if (nvlist_lookup_uint64(nvl, PCI_ECC_DISP, &disp) != 0) - minorvers = 0; - - return (hdlr(hdl, ep, nvl, class, afar, AFLT_STAT_VALID, synd, - AFLT_STAT_VALID, cmd_mem_name2type(typenm, minorvers), disp, - rsrc)); -} - -cmd_evdisp_t -cmd_rxe(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, - cmd_errcl_t clcode) -{ - cmd_errcl_t matchmask = (clcode == CMD_ERRCL_RCE ? CMD_ERRCL_FRC : - CMD_ERRCL_FRU); - - return (cmd_rxefrx_common(hdl, ep, nvl, class, clcode, matchmask)); -} - -cmd_evdisp_t -cmd_ioxe(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, - cmd_errcl_t clcode) -{ - cmd_errcl_t matchmask = (clcode == CMD_ERRCL_IOCE ? CMD_ERRCL_FRC : - CMD_ERRCL_FRU); - - if (fmd_nvl_class_match(hdl, nvl, "ereport.io.tom.*")) { - return (cmd_ioxefrx_common(hdl, ep, nvl, class, clcode, - matchmask)); - } else - return (ioxe_common(hdl, ep, nvl, class, clcode)); -} - -/*ARGSUSED*/ -cmd_evdisp_t -cmd_ioxe_sec(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, - cmd_errcl_t clcode) -{ - /* - * Secondary IOxE's can't be used to identify failed or failing - * resources, as they don't contain enough information. Ignore them. - */ - return (CMD_EVD_OK); -} diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_state.c b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_state.c index abfd396bee..5c6ae59305 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_state.c +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_state.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -59,7 +59,11 @@ static cmd_case_closer_f *const cmd_case_closers[] = { cmd_bank_close, /* CMD_PTR_BANK_CASE */ cmd_page_close, /* CMD_PTR_PAGE_CASE */ cmd_cpuerr_close, /* CMD_PTR_CPU_FPU */ - NULL /* CMD_PTR_CPU_XR_RETRY */ + NULL, /* CMD_PTR_CPU_XR_RETRY */ + cmd_cpuerr_close, /* CMD_PTR_CPU_IREG */ + cmd_cpuerr_close, /* CMD_PTR_CPU_FREG */ + cmd_cpuerr_close, /* CMD_PTR_CPU_MAU */ + cmd_cpuerr_close /* CMD_PTR_CPU_L2CTL */ }; fmd_case_t * diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_state.h b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_state.h index d35ac45432..8e884a59fd 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_state.h +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_state.h @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -95,7 +95,11 @@ typedef enum cmd_ptrsubtype { CMD_PTR_BANK_CASE, CMD_PTR_PAGE_CASE, CMD_PTR_CPU_FPU, - CMD_PTR_CPU_XR_RETRY + CMD_PTR_CPU_XR_RETRY, + CMD_PTR_CPU_IREG, + CMD_PTR_CPU_FREG, + CMD_PTR_CPU_MAU, + CMD_PTR_CPU_L2CTL } cmd_ptrsubtype_t; /* diff --git a/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile index 81bcd18c52..83bf1dae07 100644 --- a/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile +++ b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile @@ -27,6 +27,8 @@ ARCH = sun4u +sun4u_SRCS = cmd_ecache.c + INCDIRS = $(SRC)/uts/sun4u include ../../sun4/cpumem-diagnosis/Makefile.cpumem diff --git a/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_cpu_arch.c b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_cpu_arch.c new file mode 100644 index 0000000000..9f07d1b878 --- /dev/null +++ b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_cpu_arch.c @@ -0,0 +1,81 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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" + +/* + * Support routines for managing per-CPU state. + */ + +#include <cmd_cpu.h> +#include <cmd_ecache.h> +#include <cmd_mem.h> +#include <cmd.h> + +#include <stdio.h> +#include <string.h> +#include <strings.h> +#include <errno.h> +#include <kstat.h> +#include <fm/fmd_api.h> +#include <sys/async.h> +#include <sys/fm/protocol.h> +#include <sys/fm/cpu/UltraSPARC-III.h> +#include <sys/cheetahregs.h> + +/* + * The unused argument 'clcode' is needed for our sun4v sibling. + */ + +/*ARGSUSED*/ +int +cmd_xr_fill(fmd_hdl_t *hdl, nvlist_t *nvl, cmd_xr_t *xr, cmd_errcl_t clcode) +{ + if (nvlist_lookup_uint16(nvl, FM_EREPORT_PAYLOAD_NAME_SYND, + &xr->xr_synd) != 0) + return (-1); + if (nvlist_lookup_uint8(nvl, FM_EREPORT_PAYLOAD_NAME_SYND_STATUS, + &xr->xr_synd_status) != 0) + return (-1); + if (nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_NAME_AFAR, + &xr->xr_afar) != 0) + return (-1); + if (nvlist_lookup_uint8(nvl, FM_EREPORT_PAYLOAD_NAME_AFAR_STATUS, + &xr->xr_afar_status) != 0) + return (-1); + return (0); +} + +int +cmd_cpu_synd_check(uint16_t synd) +{ + if (synd == CH_POISON_SYND_FROM_XXU_WRITE || + synd == CH_POISON_SYND_FROM_XXU_WRMERGE || + synd == CH_POISON_SYND_FROM_DSTAT23) + return (-1); + else + return (0); +} diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_ecache.c b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_ecache.c index 9f231fa589..9f231fa589 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_ecache.c +++ b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_ecache.c diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_ecache.h b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_ecache.h index 00baa093bb..00baa093bb 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_ecache.h +++ b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_ecache.h diff --git a/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_memerr_arch.c b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_memerr_arch.c index b3cce031ae..4f4edc1b40 100644 --- a/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_memerr_arch.c +++ b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cmd_memerr_arch.c @@ -46,7 +46,15 @@ #include <sys/async.h> #include <sys/cheetahregs.h> #include <sys/errclassify.h> +#include <sys/fm/io/sun4upci.h> +#include <sys/pci/pcisch.h> +/* Jalapeno-specific values from cheetahregs.h */ +#define USIIIi_AFSR_AID 0x0000000000003e00ull /* AID causing UE/CE */ +#define USIIIi_AFSR_AID_SHIFT 9 +#define USIIIi_AFSR_JREQ 0x0000000007000000ull /* Active JBus req */ +#define USIIIi_AFSR_JREQ_SHIFT 24 +#define TOM_AID_MATCH_MASK 0xe /*ARGSUSED*/ cmd_evdisp_t @@ -118,3 +126,317 @@ cmd_frx(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, return (cmd_rxefrx_common(hdl, ep, nvl, class, clcode, matchmask)); } + +/* + * When we complete an IOxE/RxE FRx pair, we have enough information to + * create either a CE or a UE, as appropriate. Before dispatching the + * joined event to the xE handler, we need to generate the FMRI for the + * named DIMM. While one of the events may already contain a resource FMRI, + * said FMRI is incomplete. The detector didn't have the necessary + * information (the AFAR, the AFSR, *and* the syndrome) needed to create + * a DIMM-level FMRI. + */ +static cmd_evdisp_t +iorxefrx_synthesize(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, + const char *class, uint64_t afar, uint8_t afar_status, uint64_t afsr, + uint16_t synd, uint8_t synd_status, ce_dispact_t type, uint64_t disp, + cmd_xe_handler_f *hdlr) +{ + nvlist_t *fmri; + int rc; + + if ((fmri = cmd_dimm_fmri_derive(hdl, afar, synd, afsr)) == NULL) + return (CMD_EVD_UNUSED); + + rc = hdlr(hdl, ep, nvl, class, afar, afar_status, synd, synd_status, + type, disp, fmri); + + nvlist_free(fmri); + + return (rc); +} + +static cmd_iorxefrx_t * +iorxefrx_match(fmd_hdl_t *hdl, cmd_errcl_t errcl, cmd_errcl_t matchmask, + uint_t det_agentid, uint_t afsr_agentid) +{ + cmd_iorxefrx_t *rf; + + for (rf = cmd_list_next(&cmd.cmd_iorxefrx); rf != NULL; + rf = cmd_list_next(rf)) { + + fmd_hdl_debug(hdl, "rf->rf_errcl = %llx, matchmask = %llx\n" + "rf->rf_det_agentid = %lx, afsr_agentid = %lx\n" + "rf->rf_afsr_agentid = %lx, det_agentid = %lx\n", + rf->rf_errcl, matchmask, rf->rf_det_agentid, afsr_agentid, + rf->rf_afsr_agentid, det_agentid); + + if ((rf->rf_errcl & matchmask) == 0) + continue; + + /* + * For IOxEs we are unable to match based on both the detector + * and the captured Agent Id in the AFSR, because the bridge + * captures it's own Agent Id instead of the remote CPUs. + * + * Also, the LSB of Tomatillo's jpid is aliased for each chip + * and therefore needs to be factored out of our matching. + */ + if ((CMD_ERRCL_ISIOXE(rf->rf_errcl) || + CMD_ERRCL_ISIOXE(errcl)) && + ((rf->rf_afsr_agentid & TOM_AID_MATCH_MASK) == + (afsr_agentid & TOM_AID_MATCH_MASK))) + return (rf); + + /* + * Check for both here since IOxE is not involved + */ + if ((rf->rf_afsr_agentid == det_agentid) && + (rf->rf_det_agentid == afsr_agentid)) + return (rf); + } + + return (NULL); +} + +/* + * Got an RxE or an FRx. FRx ereports can be matched with RxE ereports and + * vice versa. FRx ereports can also be matched with IOxE ereports. + */ +cmd_evdisp_t +cmd_rxefrx_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, + const char *class, cmd_errcl_t clcode, cmd_errcl_t matchmask) +{ + cmd_xe_handler_f *hdlr; + cmd_iorxefrx_t *rfmatch, *rferr; + cmd_cpu_t *cpu; + char *typenm; + int isrxe = CMD_ERRCL_MATCH(clcode, CMD_ERRCL_RCE | CMD_ERRCL_RUE); + int isce = CMD_ERRCL_MATCH(clcode, CMD_ERRCL_RCE | CMD_ERRCL_FRC); + int rc; + int minorvers = 1; + + rferr = fmd_hdl_zalloc(hdl, sizeof (cmd_iorxefrx_t), FMD_SLEEP); + + if (nvlist_lookup_pairs(nvl, 0, + FM_EREPORT_PAYLOAD_NAME_SYND, DATA_TYPE_UINT16, &rferr->rf_synd, + FM_EREPORT_PAYLOAD_NAME_SYND_STATUS, DATA_TYPE_UINT8, + &rferr->rf_synd_status, + FM_EREPORT_PAYLOAD_NAME_AFAR, DATA_TYPE_UINT64, &rferr->rf_afar, + FM_EREPORT_PAYLOAD_NAME_AFAR_STATUS, DATA_TYPE_UINT8, + &rferr->rf_afar_status, + FM_EREPORT_PAYLOAD_NAME_AFSR, DATA_TYPE_UINT64, &rferr->rf_afsr, + FM_EREPORT_PAYLOAD_NAME_ERR_TYPE, DATA_TYPE_STRING, &typenm, + NULL) != 0) { + fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); + return (CMD_EVD_BAD); + } + if (nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_NAME_ERR_DISP, + &rferr->rf_disp) != 0) + minorvers = 0; + + rferr->rf_type = cmd_mem_name2type(typenm, minorvers); + + if ((cpu = cmd_cpu_lookup_from_detector(hdl, nvl, class)) == NULL) { + fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); + return (CMD_EVD_UNUSED); + } + + if (!isrxe && rferr->rf_synd_status != AFLT_STAT_VALID) { + fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); + return (CMD_EVD_UNUSED); + } + + if (isrxe) { + rferr->rf_afsr_agentid = (rferr->rf_afsr & + USIIIi_AFSR_JREQ) >> USIIIi_AFSR_JREQ_SHIFT; + } else { + rferr->rf_afsr_agentid = (rferr->rf_afsr & + USIIIi_AFSR_AID) >> USIIIi_AFSR_AID_SHIFT; + } + + rferr->rf_errcl = clcode; + rferr->rf_det_agentid = cpu->cpu_cpuid; + + if ((rfmatch = iorxefrx_match(hdl, clcode, matchmask, + rferr->rf_det_agentid, rferr->rf_afsr_agentid)) == NULL) { + cmd_iorxefrx_queue(hdl, rferr); + return (CMD_EVD_OK); + } + + /* + * Found a match. Send a synthesized ereport to the appropriate + * routine. + */ + fmd_hdl_debug(hdl, "matched %cE %llx with %llx", "UC"[isce], + rferr->rf_errcl, rfmatch->rf_errcl); + + hdlr = (isce ? cmd_ce_common : cmd_ue_common); + if (isrxe) { + rc = iorxefrx_synthesize(hdl, ep, nvl, class, rferr->rf_afar, + rferr->rf_afar_status, rfmatch->rf_afsr, rfmatch->rf_synd, + rfmatch->rf_synd_status, rferr->rf_type, rferr->rf_disp, + hdlr); + } else { + rc = iorxefrx_synthesize(hdl, ep, nvl, class, rfmatch->rf_afar, + rfmatch->rf_afar_status, rferr->rf_afsr, rferr->rf_synd, + rferr->rf_synd_status, rfmatch->rf_type, rferr->rf_disp, + hdlr); + } + + cmd_iorxefrx_free(hdl, rfmatch); + fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); + + return (rc); +} + +/* This IOxE must be matched with an FRx before UE/CE processing is possible */ +static cmd_evdisp_t +cmd_ioxefrx_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, + const char *class, cmd_errcl_t errcl, cmd_errcl_t matchmask) +{ + cmd_xe_handler_f *hdlr; + cmd_iorxefrx_t *rfmatch, *rferr; + char *typenm; + int isce = CMD_ERRCL_MATCH(errcl, CMD_ERRCL_IOCE); + char *portid_str; + char *path = NULL; + nvlist_t *det = NULL; + int rc; + int minorvers = 1; + + rferr = fmd_hdl_zalloc(hdl, sizeof (cmd_iorxefrx_t), FMD_SLEEP); + + if (nvlist_lookup_pairs(nvl, 0, + PCI_ECC_AFAR, DATA_TYPE_UINT64, &rferr->rf_afar, + PCI_ECC_AFSR, DATA_TYPE_UINT64, &rferr->rf_afsr, + PCI_ECC_SYND, DATA_TYPE_UINT16, &rferr->rf_synd, + PCI_ECC_TYPE, DATA_TYPE_STRING, &typenm, + NULL) != 0) { + fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); + return (CMD_EVD_BAD); + } + + if (nvlist_lookup_uint64(nvl, PCI_ECC_DISP, &rferr->rf_disp) != 0) + minorvers = 0; + + rferr->rf_type = cmd_mem_name2type(typenm, minorvers); + rferr->rf_errcl = errcl; + + /* + * Lookup device path of host bridge. + */ + (void) nvlist_lookup_nvlist(nvl, FM_EREPORT_DETECTOR, &det); + (void) nvlist_lookup_string(det, FM_FMRI_DEV_PATH, &path); + + /* + * get Jbus port id from the device path + */ + portid_str = strrchr(path, '@') + 1; + rferr->rf_det_agentid = strtol(portid_str, NULL, 16); + + rferr->rf_afsr_agentid = (rferr->rf_afsr & + SCHIZO_ECC_UE_AFSR_AGENT_MID) >> SCHIZO_ECC_UE_AFSR_AGENT_MID_SHIFT; + + /* + * Only 4 bits of the Jbus AID are sent on the Jbus. MSB is the one + * that is chosen not to make the trip. This is not in any of the Jbus + * or Tomatillo documents and was discovered during testing and verified + * by Jalapeno H/W designer. + */ + rferr->rf_afsr_agentid &= 0xf; + rferr->rf_afar_status = AFLT_STAT_VALID; + rferr->rf_synd_status = AFLT_STAT_VALID; + + /* + * Need to send in the io_jpid that we get from the device path above + * for both the det_agentid and the afsr_agentid, since the CPU does not + * capture the same address as the bridge. The bridge has the LSB + * aliased and the CPU is missing the MSB. + */ + if ((rfmatch = iorxefrx_match(hdl, rferr->rf_errcl, matchmask, + rferr->rf_det_agentid, rferr->rf_afsr_agentid)) == NULL) { + cmd_iorxefrx_queue(hdl, rferr); + return (CMD_EVD_OK); + } + + /* Found a match. Synthesize an ereport for UE/CE processing. */ + fmd_hdl_debug(hdl, "matched %cE %llx with %llx\n", "UC"[isce], + rferr->rf_errcl, rfmatch->rf_errcl); + + hdlr = (isce ? cmd_ce_common : cmd_ue_common); + rc = iorxefrx_synthesize(hdl, ep, nvl, class, rferr->rf_afar, + rferr->rf_afar_status, rfmatch->rf_afsr, rfmatch->rf_synd, + rfmatch->rf_synd_status, rferr->rf_type, rferr->rf_disp, hdlr); + + cmd_iorxefrx_free(hdl, rfmatch); + fmd_hdl_free(hdl, rferr, sizeof (cmd_iorxefrx_t)); + + return (rc); +} + +/* IOxE ereports that don't need matching with FRx ereports */ +static cmd_evdisp_t +ioxe_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, + cmd_errcl_t clcode) +{ + int isce = CMD_ERRCL_MATCH(clcode, CMD_ERRCL_IOCE); + cmd_xe_handler_f *hdlr = isce ? cmd_ce_common : cmd_ue_common; + uint64_t afar; + uint16_t synd; + nvlist_t *rsrc; + char *typenm; + uint64_t disp; + int minorvers = 1; + + if (nvlist_lookup_pairs(nvl, 0, + PCI_ECC_AFAR, DATA_TYPE_UINT64, &afar, + PCI_ECC_SYND, DATA_TYPE_UINT16, &synd, + PCI_ECC_TYPE, DATA_TYPE_STRING, &typenm, + PCI_ECC_RESOURCE, DATA_TYPE_NVLIST, &rsrc, + NULL) != 0) + return (CMD_EVD_BAD); + + if (nvlist_lookup_uint64(nvl, PCI_ECC_DISP, &disp) != 0) + minorvers = 0; + + return (hdlr(hdl, ep, nvl, class, afar, AFLT_STAT_VALID, synd, + AFLT_STAT_VALID, cmd_mem_name2type(typenm, minorvers), disp, + rsrc)); +} + +cmd_evdisp_t +cmd_rxe(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, + cmd_errcl_t clcode) +{ + cmd_errcl_t matchmask = (clcode == CMD_ERRCL_RCE ? CMD_ERRCL_FRC : + CMD_ERRCL_FRU); + + return (cmd_rxefrx_common(hdl, ep, nvl, class, clcode, matchmask)); +} + +cmd_evdisp_t +cmd_ioxe(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, + cmd_errcl_t clcode) +{ + cmd_errcl_t matchmask = (clcode == CMD_ERRCL_IOCE ? CMD_ERRCL_FRC : + CMD_ERRCL_FRU); + + if (fmd_nvl_class_match(hdl, nvl, "ereport.io.tom.*")) { + return (cmd_ioxefrx_common(hdl, ep, nvl, class, clcode, + matchmask)); + } else + return (ioxe_common(hdl, ep, nvl, class, clcode)); +} + +/*ARGSUSED*/ +cmd_evdisp_t +cmd_ioxe_sec(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class, + cmd_errcl_t clcode) +{ + /* + * Secondary IOxE's can't be used to identify failed or failing + * resources, as they don't contain enough information. Ignore them. + */ + return (CMD_EVD_OK); +} diff --git a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cpumem-diagnosis.conf b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cpumem-diagnosis.conf index 9abaec04b3..9abaec04b3 100644 --- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cpumem-diagnosis.conf +++ b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/cpumem-diagnosis.conf diff --git a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile index d85adedca2..6b7b1272a5 100644 --- a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile +++ b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile @@ -27,10 +27,6 @@ ARCH = sun4v -# A sun4v-specific build should not be #include 'ing files from a sun4u -# directory, but this is necessary until the files can be reorganized -# properly. - -INCDIRS = $(SRC)/uts/sun4u +INCDIRS = $(SRC)/uts/sun4v include ../../sun4/cpumem-diagnosis/Makefile.cpumem diff --git a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_cpu_arch.c b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_cpu_arch.c new file mode 100644 index 0000000000..6fa9378c69 --- /dev/null +++ b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_cpu_arch.c @@ -0,0 +1,133 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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" + +/* + * Support routines for managing per-CPU state. + */ + +#include <cmd_cpu.h> +#include <cmd_mem.h> +#include <cmd.h> + +#include <stdio.h> +#include <string.h> +#include <strings.h> +#include <errno.h> +#include <kstat.h> +#include <fm/fmd_api.h> +#include <sys/async.h> +#include <sys/fm/protocol.h> +#include <sys/fm/cpu/UltraSPARC-T1.h> +#include <sys/niagararegs.h> + +int +cmd_xr_fill(fmd_hdl_t *hdl, nvlist_t *nvl, cmd_xr_t *xr, cmd_errcl_t clcode) +{ + uint64_t niagara_l2_afsr = 0; + + if (nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_NAME_L2_AFSR, + &niagara_l2_afsr) != 0) + return (-1); + if (nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_NAME_L2_REAL_AFAR, + &xr->xr_afar) != 0) + return (-1); + if (nvlist_lookup_uint32(nvl, FM_EREPORT_PAYLOAD_NAME_L2_SYND, + &xr->xr_synd) != 0) + return (-1); + + /* + * Set Niagara afar and synd validity. + * For a given set of error registers, the payload value is valid iff + * no higher priority error status bit is set. See niagararegs.h + * for error status bit values and priority settings. + */ + switch (clcode) { + case CMD_ERRCL_LDAU: + case CMD_ERRCL_LDSU: + xr->xr_synd_status = + ((niagara_l2_afsr & NI_L2AFSR_P02) == 0) ? + AFLT_STAT_VALID : AFLT_STAT_INVALID; + break; + case CMD_ERRCL_LDWU: + xr->xr_synd_status = + ((niagara_l2_afsr & NI_L2AFSR_P03) == 0) ? + AFLT_STAT_VALID : AFLT_STAT_INVALID; + break; + case CMD_ERRCL_LDRU: + xr->xr_synd_status = + ((niagara_l2_afsr & NI_L2AFSR_P04) == 0) ? + AFLT_STAT_VALID : AFLT_STAT_INVALID; + break; + case CMD_ERRCL_LDAC: + case CMD_ERRCL_LDSC: + xr->xr_synd_status = + ((niagara_l2_afsr & NI_L2AFSR_P07) == 0) ? + AFLT_STAT_VALID : AFLT_STAT_INVALID; + break; + case CMD_ERRCL_LDWC: + xr->xr_synd_status = + ((niagara_l2_afsr & NI_L2AFSR_P08) == 0) ? + AFLT_STAT_VALID : AFLT_STAT_INVALID; + break; + case CMD_ERRCL_LDRC: + xr->xr_synd_status = + ((niagara_l2_afsr & NI_L2AFSR_P09) == 0) ? + AFLT_STAT_VALID : AFLT_STAT_INVALID; + break; + default: + fmd_hdl_debug(hdl, "Niagara unrecognized l2cache error\n"); + xr->xr_synd_status = 0; + return (-1); + } + xr->xr_afar_status = xr->xr_synd_status; + return (0); +} + +int +cmd_cpu_synd_check(uint32_t synd) +{ + int i; + + /* + * Niagara L2 fetches from a memory location containing a UE + * are given a poison syndrome in one or more 7 bit subsyndromes + * each covering one of 4 4 byte checkwords. + * + * 0 is an invalid syndrome because it denotes no error, but + * is associated with an ereport -- meaning there WAS an error. + */ + if (synd == 0) + return (-1); + + for (i = 0; i < 4; i++) { + if (((synd >> i*NI_L2_POISON_SYND_SIZE) & + NI_L2_POISON_SYND_MASK) == NI_L2_POISON_SYND_FROM_DAU) + return (-1); + } + return (0); +} diff --git a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_memerr_arch.c b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_memerr_arch.c index 950ecede81..ac43f5b6b2 100644 --- a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_memerr_arch.c +++ b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_memerr_arch.c @@ -42,15 +42,11 @@ #include <errno.h> #include <fm/fmd_api.h> #include <sys/fm/protocol.h> -#include <sys/fm/cpu/UltraSPARC-III.h> #include <sys/fm/cpu/UltraSPARC-T1.h> #include <sys/async.h> -#include <sys/cheetahregs.h> - #include <sys/errclassify.h> - -#include <cmd_memerr_arch.h> +#include <sys/niagararegs.h> /*ARGSUSED*/ cmd_evdisp_t @@ -97,9 +93,9 @@ xe_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, FM_EREPORT_PAYLOAD_NAME_L2_AFSR, DATA_TYPE_UINT64, &l2_afsr, FM_EREPORT_PAYLOAD_NAME_DRAM_AFSR, DATA_TYPE_UINT64, &dram_afsr, FM_EREPORT_PAYLOAD_NAME_L2_REAL_AFAR, DATA_TYPE_UINT64, - &l2_real_afar, + &l2_real_afar, FM_EREPORT_PAYLOAD_NAME_DRAM_REAL_AFAR, DATA_TYPE_UINT64, - &dram_real_afar, + &dram_real_afar, FM_EREPORT_PAYLOAD_NAME_ERR_TYPE, DATA_TYPE_STRING, &typenm, FM_EREPORT_PAYLOAD_NAME_RESOURCE, DATA_TYPE_NVLIST, &rsrc, NULL) != 0) @@ -119,32 +115,32 @@ xe_common(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, * higher priority error will override. */ switch (clcode) { - case CMD_ERRCL_DAC: + case CMD_ERRCL_DAC: afar = l2_real_afar; afar_status = ((l2_afsr & NI_L2AFSR_P10) == 0) ? AFLT_STAT_VALID : AFLT_STAT_INVALID; synd_status = ((dram_afsr & NI_DMAFSR_P01) == 0) ? AFLT_STAT_VALID : AFLT_STAT_INVALID; break; - case CMD_ERRCL_DSC: + case CMD_ERRCL_DSC: afar = dram_real_afar; afar_status = ((dram_afsr & NI_DMAFSR_P01) == 0) ? AFLT_STAT_VALID : AFLT_STAT_INVALID; synd_status = afar_status; break; - case CMD_ERRCL_DAU: + case CMD_ERRCL_DAU: afar = l2_real_afar; afar_status = ((l2_afsr & NI_L2AFSR_P05) == 0) ? AFLT_STAT_VALID : AFLT_STAT_INVALID; synd_status = AFLT_STAT_VALID; break; - case CMD_ERRCL_DSU: + case CMD_ERRCL_DSU: afar = dram_real_afar; afar_status = synd_status = AFLT_STAT_VALID; break; - default: + default: fmd_hdl_debug(hdl, "Niagara unrecognized mem error %llx\n", - clcode); + clcode); return (CMD_EVD_UNUSED); } diff --git a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_memerr_arch.h b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_memerr_arch.h deleted file mode 100644 index 8755ee3519..0000000000 --- a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cmd_memerr_arch.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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. - */ - -#ifndef _CMD_MEMERR_ARCH_H -#define _CMD_MEMERR_ARCH_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Header file for Niagara-specific registers - */ - -/* - * Bit masks for interrupt bits in L2 Error Status Register - */ - -#define NI_L2AFSR_MEU 0x8000000000000000 -#define NI_L2AFSR_MEC 0x4000000000000000 -#define NI_L2AFSR_RW 0x2000000000000000 -#define NI_L2AFSR_RSVD0 0x1000000000000000 -#define NI_L2AFSR_MODA 0x0800000000000000 -#define NI_L2AFSR_VCID 0x07C0000000000000 -#define NI_L2AFSR_LDAC 0x0020000000000000 -#define NI_L2AFSR_LDAU 0x0010000000000000 -#define NI_L2AFSR_LDWC 0x0008000000000000 -#define NI_L2AFSR_LDWU 0x0004000000000000 -#define NI_L2AFSR_LDRC 0x0002000000000000 -#define NI_L2AFSR_LDRU 0x0001000000000000 -#define NI_L2AFSR_LDSC 0x0000800000000000 -#define NI_L2AFSR_LDSU 0x0000400000000000 -#define NI_L2AFSR_LTC 0x0000200000000000 -#define NI_L2AFSR_LRU 0x0000100000000000 -#define NI_L2AFSR_LVU 0x0000080000000000 -#define NI_L2AFSR_DAC 0x0000040000000000 -#define NI_L2AFSR_DAU 0x0000020000000000 -#define NI_L2AFSR_DRC 0x0000010000000000 -#define NI_L2AFSR_DRU 0x0000008000000000 -#define NI_L2AFSR_DSC 0x0000004000000000 -#define NI_L2AFSR_DSU 0x0000002000000000 -#define NI_L2AFSR_VEC 0x0000001000000000 -#define NI_L2AFSR_VEU 0x0000000800000000 -#define NI_L2AFSR_RSVD1 0x0000000700000000 -#define NI_L2AFSR_SYND 0x00000000FFFFFFFF - -/* - * These bit masks are used to determine if another bit of higher priority - * is set. This tells us whether the reported syndrome and address "belong" - * to this ereport. If the error in hand is Pn, use Pn-1 to bitwise & with - * the l2-afsr value. If result is 0, then this ereport's afsr is valid. - */ -#define NI_L2AFSR_P01 (NI_L2AFSR_LVU) -#define NI_L2AFSR_P02 (NI_L2AFSR_P01 | NI_L2AFSR_LRU) -#define NI_L2AFSR_P03 (NI_L2AFSR_P02 | NI_L2AFSR_LDAU | NI_L2AFSR_LDSU) -#define NI_L2AFSR_P04 (NI_L2AFSR_P03 | NI_L2AFSR_LDWU) -#define NI_L2AFSR_P05 (NI_L2AFSR_P04 | NI_L2AFSR_LDRU) -#define NI_L2AFSR_P06 (NI_L2AFSR_P05 | NI_L2AFSR_DAU | NI_L2AFSR_DRU) -#define NI_L2AFSR_P07 (NI_L2AFSR_P06 | NI_L2AFSR_LTC) -#define NI_L2AFSR_P08 (NI_L2AFSR_P07 | NI_L2AFSR_LDAC | NI_L2AFSR_LDSC) -#define NI_L2AFSR_P09 (NI_L2AFSR_P08 | NI_L2AFSR_LDWC) -#define NI_L2AFSR_P10 (NI_L2AFSR_P09 | NI_L2AFSR_LDRC) -#define NI_L2AFSR_P11 (NI_L2AFSR_P10 | NI_L2AFSR_DAC | NI_L2AFSR_DRC) - - -#define NI_DMAFSR_MEU 0x8000000000000000 -#define NI_DMAFSR_MEC 0x4000000000000000 -#define NI_DMAFSR_DAC 0x2000000000000000 -#define NI_DMAFSR_DAU 0x1000000000000000 -#define NI_DMAFSR_DSC 0x0800000000000000 -#define NI_DMAFSR_DSU 0x0400000000000000 -#define NI_DMAFSR_DBU 0x0200000000000000 -#define NI_DMAFSR_RSVD 0x01FFFFFFFFFF0000 -#define NI_DMAFSR_SYND 0x000000000000FFFF - -#define NI_DMAFSR_P01 (NI_DMAFSR_DSU | NI_DMAFSR_DAU) - -#define NI_DRAM_POISON_SYND_FROM_LDWU 0x1118 -#define NI_L2_POISON_SYND_FROM_DAU 0x3 - -#ifdef __cplusplus -} -#endif - -#endif /* _CMD_MEMERR_ARCH_H */ diff --git a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cpumem-diagnosis.conf b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cpumem-diagnosis.conf new file mode 100644 index 0000000000..24bbbacc74 --- /dev/null +++ b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/cpumem-diagnosis.conf @@ -0,0 +1,32 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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. +# +#ident "%Z%%M% %I% %E% SMI" + +# +# cpumem-diagnosis +# + +dictionary SUN4V diff --git a/usr/src/cmd/fm/schemes/cpu/Makefile b/usr/src/cmd/fm/schemes/cpu/Makefile index cbb5ff9015..86765d82d4 100644 --- a/usr/src/cmd/fm/schemes/cpu/Makefile +++ b/usr/src/cmd/fm/schemes/cpu/Makefile @@ -28,28 +28,19 @@ include ../Makefile.com SCHEME_COMMON = ../common -MDESC_COMMON = $(SRC)/common/mdesc sparc_SRCS = \ cpu_mdesc.c \ - mdesc_devinit.c \ - mdesc_init_intern.c \ - mdesc_findname.c \ - mdesc_findnodeprop.c \ - mdesc_fini.c \ - mdesc_getpropval.c \ - mdesc_nodecount.c \ - mdesc_scandag.c + mdesc_devinit.c SRCS = \ cpu.c \ $($(MACH)_SRCS) -LDLIBS += -lkstat +sparc_LDLIBS = -L$(ROOTLIB)/fm -lmdesc +LDLIBS += -lkstat $($(MACH)_LDLIBS) -# These LINTFLAGS are provided for benefit of mdesc routines - -LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN -v +LDFLAGS += -R/usr/lib/fm include ../Makefile.targ @@ -57,13 +48,5 @@ include ../Makefile.targ $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) -%.o: $(MDESC_COMMON)/%.c - $(COMPILE.c) -o $@ $< - $(CTFCONVERT_O) - %.ln: $(SCHEME_COMMON)/%.c - $(LINT.c) -c $< - -%.ln: $(MDESC_COMMON)/%.c - $(LINT.c) -c $< - + $(LINT.c) -erroff=E_BAD_PTR_CAST_ALIGN -v -c $< diff --git a/usr/src/cmd/fm/schemes/cpu/cpu.c b/usr/src/cmd/fm/schemes/cpu/cpu.c index b763b4eb82..ef78d27cb1 100644 --- a/usr/src/cmd/fm/schemes/cpu/cpu.c +++ b/usr/src/cmd/fm/schemes/cpu/cpu.c @@ -43,9 +43,11 @@ * The scheme plugin for cpu FMRIs. */ -#ifdef sparc +#ifdef sparc +#define ONTARIO_PLAT_NAME "SUNW,Sun-Fire-T200" +#define ERIE_PLAT_NAME "SUNW,Sun-Fire-T1000" cpu_t cpu; -#endif /* sparc */ +#endif /* sparc */ ssize_t fmd_fmri_nvl2str(nvlist_t *nvl, char *buf, size_t buflen) @@ -104,12 +106,36 @@ cpu_get_serialid(uint32_t cpuid, uint64_t *serialidp) { #ifdef sparc if (cpu.cpu_mdesc_cpus != NULL) - return (cpu_get_serialid_mdesc(cpuid, serialidp)); + return (cpu_get_serialid_mdesc(cpuid, serialidp)); else #endif /* sparc */ - return (cpu_get_serialid_kstat(cpuid, serialidp)); + return (cpu_get_serialid_kstat(cpuid, serialidp)); } +#ifdef sparc +static int +cpu_phys2virt(uint32_t cpuid, uint32_t *cpuvidp) +{ + md_cpumap_t *mcmp; + int idx; + + if (cpu.cpu_mdesc_cpus == NULL) + return (ENOENT); + + for (idx = 0, mcmp = cpu.cpu_mdesc_cpus; + idx < cpu.cpu_mdesc_ncpus; idx++, mcmp++) { + if (mcmp->cpumap_pid == (uint64_t)-1) + continue; /* ignore invalid value */ + if (mcmp->cpumap_pid == cpuid) { + *cpuvidp = mcmp->cpumap_id; + return (0); + } + } + + return (ENOENT); +} +#endif /* sparc */ + int fmd_fmri_expand(nvlist_t *nvl) { @@ -124,16 +150,35 @@ fmd_fmri_expand(nvlist_t *nvl) return (fmd_fmri_set_errno(EINVAL)); if ((rc = nvlist_lookup_uint64(nvl, FM_FMRI_CPU_SERIAL_ID, - &serialid)) == 0) - return (0); /* fmri is already expanded */ - else if (rc != ENOENT) - return (fmd_fmri_set_errno(rc)); + &serialid)) != 0) { + if (rc != ENOENT) + return (fmd_fmri_set_errno(rc)); - if (cpu_get_serialid(cpuid, &serialid) != 0) - return (-1); /* errno is set for us */ + if (cpu_get_serialid(cpuid, &serialid) != 0) + return (-1); /* errno is set for us */ - if ((rc = nvlist_add_uint64(nvl, FM_FMRI_CPU_SERIAL_ID, serialid)) != 0) - return (fmd_fmri_set_errno(rc)); + if ((rc = nvlist_add_uint64(nvl, FM_FMRI_CPU_SERIAL_ID, + serialid)) != 0) + return (fmd_fmri_set_errno(rc)); + } + +#ifdef sparc + { + uint32_t cpuvid; + const char *platform = fmd_fmri_get_platform(); + + if (strcmp(platform, ONTARIO_PLAT_NAME) == 0 || + strcmp(platform, ERIE_PLAT_NAME) == 0) { + if (cpu_phys2virt(cpuid, &cpuvid) != 0) + return (fmd_fmri_set_errno(ENOENT)); + + (void) nvlist_remove_all(nvl, FM_FMRI_CPU_VID); + if ((rc = nvlist_add_uint32(nvl, FM_FMRI_CPU_VID, + cpuvid)) != 0) + return (fmd_fmri_set_errno(rc)); + } + } +#endif /* sparc */ return (0); } @@ -167,8 +212,23 @@ fmd_fmri_unusable(nvlist_t *nvl) version > FM_CPU_SCHEME_VERSION || nvlist_lookup_uint32(nvl, FM_FMRI_CPU_ID, &cpuid) != 0) return (fmd_fmri_set_errno(EINVAL)); - else - return (p_online(cpuid, P_STATUS) == P_FAULTED); +#ifdef sparc + { + uint32_t cpuvid; + if (nvlist_lookup_uint32(nvl, FM_FMRI_CPU_VID, &cpuvid) == 0) { + /* + * This FMRI has a 'cpuvid' member, but its value could + * be stale -- especially when restoring saved state. + * Do a fresh lookup and use the result for p_online(). + */ + if (cpu_phys2virt(cpuid, &cpuvid) != 0) + return (fmd_fmri_set_errno(ENOENT)); + return (p_online(cpuvid, P_STATUS) == P_FAULTED); + } + } +#endif /* sparc */ + + return (p_online(cpuid, P_STATUS) == P_FAULTED); } #ifdef sparc diff --git a/usr/src/cmd/fm/schemes/cpu/cpu_mdesc.c b/usr/src/cmd/fm/schemes/cpu/cpu_mdesc.c index 2487555813..d14c14b17e 100644 --- a/usr/src/cmd/fm/schemes/cpu/cpu_mdesc.c +++ b/usr/src/cmd/fm/schemes/cpu/cpu_mdesc.c @@ -64,7 +64,7 @@ cpu_mdesc_init(void) mdp = mdesc_devinit(&bufsiz); if (mdp == NULL) - return (0); /* successful, no mdesc */ + return (0); /* successful, no mdesc */ num_nodes = md_node_count(mdp); @@ -84,15 +84,16 @@ cpu_mdesc_init(void) idx++, mcmp++) { uint64_t tl; - if (md_get_prop_val(mdp, listp[idx], "id", &tl)) tl = -1; + if (md_get_prop_val(mdp, listp[idx], "id", &tl) < 0) + tl = (uint64_t)-1; /* invalid value */ mcmp->cpumap_id = tl; - if (md_get_prop_val(mdp, listp[idx], "pid", &tl)) - tl = mcmp->cpumap_id; + if (md_get_prop_val(mdp, listp[idx], "pid", &tl) < 0) + tl = mcmp->cpumap_id; mcmp->cpumap_pid = tl; if (md_get_prop_val(mdp, listp[idx], "serial#", - &mcmp->cpumap_serialno)) + &mcmp->cpumap_serialno) < 0) mcmp->cpumap_serialno = 0; } fmd_fmri_free(listp, sizeof (mde_cookie_t)*num_nodes); diff --git a/usr/src/cmd/fm/schemes/mem/Makefile b/usr/src/cmd/fm/schemes/mem/Makefile index d4525cca90..26d61c24bd 100644 --- a/usr/src/cmd/fm/schemes/mem/Makefile +++ b/usr/src/cmd/fm/schemes/mem/Makefile @@ -28,27 +28,18 @@ include ../Makefile.com SCHEME_COMMON = ../common -MDESC_COMMON = $(SRC)/common/mdesc SRCS = \ mdesc_devinit.c \ - mdesc_fini.c \ - mdesc_findname.c \ - mdesc_findnodeprop.c \ - mdesc_getpropstr.c \ - mdesc_getpropval.c \ - mdesc_init_intern.c \ - mdesc_nodecount.c \ - mdesc_scandag.c \ mem.c \ mem_disc.c \ mem_read.c \ mem_unum.c \ mem_util.c -# These LINTFLAGS are provided for benefit of mdesc routines -LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN -v +LDLIBS += -L$(ROOTLIB)/fm -lmdesc +LDFLAGS += -R/usr/lib/fm include ../Makefile.targ @@ -56,13 +47,5 @@ include ../Makefile.targ $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) -%.o: $(MDESC_COMMON)/%.c - $(COMPILE.c) -o $@ $< - $(CTFCONVERT_O) - %.ln: $(SCHEME_COMMON)/%.c - $(LINT.c) -c $< - -%.ln: $(MDESC_COMMON)/%.c - $(LINT.c) -c $< - + $(LINT.c) -erroff=E_BAD_PTR_CAST_ALIGN -v -c $< diff --git a/usr/src/cmd/fm/schemes/mem/mem_disc.c b/usr/src/cmd/fm/schemes/mem/mem_disc.c index 4bee9d67c5..830f6142ad 100644 --- a/usr/src/cmd/fm/schemes/mem/mem_disc.c +++ b/usr/src/cmd/fm/schemes/mem/mem_disc.c @@ -38,8 +38,7 @@ * without PICL configuration files are acceptable (some platforms, like * Serengeti and Starcat, don't have configuration files as of this writing), * platforms with only one or the other aren't. - */ -/* + * * On Sun4v platforms, we read the 'mdesc' machine description file in order * to obtain the mapping between dimm unum+jnum strings (which denote slot * names) and the serial numbers of the dimms occupying those slots. @@ -370,8 +369,9 @@ mem_discover_mdesc(void) for (idx = 0; idx < mdesc_dimm_count; idx++) { char *unum, *serial; - if (md_get_prop_str(mdp, listp[idx], "nac", &unum)) unum = ""; - if (md_get_prop_str(mdp, listp[idx], "serial#", &serial)) + if (md_get_prop_str(mdp, listp[idx], "nac", &unum) < 0) + unum = ""; + if (md_get_prop_str(mdp, listp[idx], "serial#", &serial) < 0) serial = ""; dm = fmd_fmri_zalloc(sizeof (mem_dimm_map_t)); diff --git a/usr/src/lib/fm/Makefile b/usr/src/lib/fm/Makefile index ec8e4aaa04..a462b8bfd3 100644 --- a/usr/src/lib/fm/Makefile +++ b/usr/src/lib/fm/Makefile @@ -20,11 +20,13 @@ # CDDL HEADER END # # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" -SUBDIRS = libdiagcode libfmd_adm libfmd_log libtopo +sparc_SUBDIRS = libmdesc + +SUBDIRS = libdiagcode libfmd_adm libfmd_log libtopo $($(MACH)_SUBDIRS) include ./Makefile.subdirs diff --git a/usr/src/lib/fm/libmdesc/Makefile b/usr/src/lib/fm/libmdesc/Makefile new file mode 100644 index 0000000000..81dde4a4f6 --- /dev/null +++ b/usr/src/lib/fm/libmdesc/Makefile @@ -0,0 +1,61 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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. +# +#ident "%Z%%M% %I% %E% SMI" + +include ../../Makefile.lib +include ../Makefile.lib + +FMHDRS = +HDRDIR = common + +SUBDIRS = $(MACH) +$(BUILD64)SUBDIRS += $(MACH64) + +all := TARGET = all +clean := TARGET = clean +clobber := TARGET = clobber +install := TARGET = install +lint := TARGET = lint + +.KEEP_STATE: + +all clean clobber: spec .WAIT $(SUBDIRS) + +install: install_h spec .WAIT $(SUBDIRS) + +lint: $(SUBDIRS) + +install_h: $(ROOTFMHDRS) + +check: $(CHECKHDRS) + +spec $(SUBDIRS): FRC + @cd $@; pwd; $(MAKE) $(TARGET) + +FRC: + +include ../../Makefile.targ +include ../Makefile.targ diff --git a/usr/src/lib/fm/libmdesc/Makefile.com b/usr/src/lib/fm/libmdesc/Makefile.com new file mode 100644 index 0000000000..14ceedb9bf --- /dev/null +++ b/usr/src/lib/fm/libmdesc/Makefile.com @@ -0,0 +1,78 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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. +# +#ident "%Z%%M% %I% %E% SMI" + +LIBRARY = libmdesc.a +VERS = .1 + +LIBSRCS = \ + mdesc_fini.c \ + mdesc_findname.c \ + mdesc_findnodeprop.c \ + mdesc_getpropstr.c \ + mdesc_getpropval.c \ + mdesc_init_intern.c \ + mdesc_nodecount.c \ + mdesc_scandag.c + +OBJECTS = $(LIBSRCS:%.c=%.o) + +include ../../../Makefile.lib +include ../../Makefile.lib + +SRCS = $(LIBSRCS:%.c=$(SRC)/common/mdesc/%.c) + +LIBS = $(DYNLIB) $(LINTLIB) + +SRCDIR = ../common +SPECMAPFILE = $(MAPDIR)/mapfile + +CPPFLAGS += -I../common -I. +CFLAGS += $(CCVERBOSE) -K PIC +CFLAGS64 += $(CCVERBOSE) -K PIC +LDLIBS += -lc + +LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN -v +LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN -v +$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) +$(LINTLIB) := LINTFLAGS = -nsvx +$(LINTLIB) := LINTFLAGS64 = -nsvx -Xarch=$(MACH64:sparcv9=v9) + +.KEEP_STATE: + +all: $(LIBS) + +lint: $(LINTLIB) lintcheck + +pics/%.o: $(SRC)/common/mdesc/%.c + $(COMPILE.c) -o $@ $< + $(POST_PROCESS_O) + +%.ln: $(SRC)/common/mdesc/%.c + $(LINT.c) -o $@ $< + +include ../../../Makefile.targ +include ../../Makefile.targ diff --git a/usr/src/lib/fm/libmdesc/common/llib-lmdesc b/usr/src/lib/fm/libmdesc/common/llib-lmdesc new file mode 100644 index 0000000000..8d876f05b9 --- /dev/null +++ b/usr/src/lib/fm/libmdesc/common/llib-lmdesc @@ -0,0 +1,32 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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" + +/*LINTLIBRARY*/ +/*PROTOLIB1*/ + +#include <sys/mdesc.h> diff --git a/usr/src/lib/fm/libmdesc/sparc/Makefile b/usr/src/lib/fm/libmdesc/sparc/Makefile new file mode 100644 index 0000000000..dca1669f5d --- /dev/null +++ b/usr/src/lib/fm/libmdesc/sparc/Makefile @@ -0,0 +1,31 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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. +# +#ident "%Z%%M% %I% %E% SMI" + +MAPDIR = ../spec/sparc +include ../Makefile.com + +install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT) diff --git a/usr/src/lib/fm/libmdesc/sparcv9/Makefile b/usr/src/lib/fm/libmdesc/sparcv9/Makefile new file mode 100644 index 0000000000..6614c15f09 --- /dev/null +++ b/usr/src/lib/fm/libmdesc/sparcv9/Makefile @@ -0,0 +1,32 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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. +# +#ident "%Z%%M% %I% %E% SMI" + +MAPDIR = ../spec/sparcv9 +include ../Makefile.com +include ../../../Makefile.lib.64 + +install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64) diff --git a/usr/src/lib/fm/libmdesc/spec/Makefile b/usr/src/lib/fm/libmdesc/spec/Makefile new file mode 100644 index 0000000000..2cb984bfc9 --- /dev/null +++ b/usr/src/lib/fm/libmdesc/spec/Makefile @@ -0,0 +1,28 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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. +# +#ident "%Z%%M% %I% %E% SMI" + +include $(SRC)/lib/Makefile.spec.arch diff --git a/usr/src/lib/fm/libmdesc/spec/Makefile.targ b/usr/src/lib/fm/libmdesc/spec/Makefile.targ new file mode 100644 index 0000000000..bad8b2b5de --- /dev/null +++ b/usr/src/lib/fm/libmdesc/spec/Makefile.targ @@ -0,0 +1,32 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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. +# +#ident "%Z%%M% %I% %E% SMI" + +.KEEP_STATE: + +LIBRARY = libmdesc.a +VERS = .1 +OBJECTS = mdesc.o diff --git a/usr/src/lib/fm/libmdesc/spec/mdesc.spec b/usr/src/lib/fm/libmdesc/spec/mdesc.spec new file mode 100644 index 0000000000..e64d5d6f25 --- /dev/null +++ b/usr/src/lib/fm/libmdesc/spec/mdesc.spec @@ -0,0 +1,57 @@ +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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 +# +#ident "%Z%%M% %I% %E% SMI" + +function md_fini +version SUNWprivate +end + +function md_find_name +version SUNWprivate +end + +function md_find_node_prop +version SUNWprivate +end + +function md_get_prop_str +version SUNWprivate +end + +function md_get_prop_val +version SUNWprivate +end + +function md_init_intern +version SUNWprivate +end + +function md_node_count +version SUNWprivate +end + +function md_scan_dag +version SUNWprivate +end diff --git a/usr/src/lib/fm/libmdesc/spec/sparc/Makefile b/usr/src/lib/fm/libmdesc/spec/sparc/Makefile new file mode 100644 index 0000000000..2ad3b54409 --- /dev/null +++ b/usr/src/lib/fm/libmdesc/spec/sparc/Makefile @@ -0,0 +1,35 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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. +# +#ident "%Z%%M% %I% %E% SMI" + +# To enable apptrace, comment out the next line +DISABLE_APPTRACE= $(POUND_SIGN) + +include ../Makefile.targ +include $(SRC)/lib/Makefile.lib +include $(SRC)/lib/Makefile.spec + +$(DISABLE_APPTRACE)install: $(ROOTABILIB) diff --git a/usr/src/lib/fm/libmdesc/spec/sparcv9/Makefile b/usr/src/lib/fm/libmdesc/spec/sparcv9/Makefile new file mode 100644 index 0000000000..b6eb6145ad --- /dev/null +++ b/usr/src/lib/fm/libmdesc/spec/sparcv9/Makefile @@ -0,0 +1,36 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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. +# +#ident "%Z%%M% %I% %E% SMI" + +# To enable apptrace, comment out the next line +DISABLE_APPTRACE= $(POUND_SIGN) + +include ../Makefile.targ +include $(SRC)/lib/Makefile.lib +include $(SRC)/lib/Makefile.lib.64 +include $(SRC)/lib/Makefile.spec + +$(DISABLE_APPTRACE)install: $(ROOTABILIB64) diff --git a/usr/src/lib/fm/libmdesc/spec/versions b/usr/src/lib/fm/libmdesc/spec/versions new file mode 100644 index 0000000000..1da266aa3a --- /dev/null +++ b/usr/src/lib/fm/libmdesc/spec/versions @@ -0,0 +1,35 @@ +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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 +# +# ident "%Z%%M% %I% %E% SMI" +# + +sparc { + SUNWprivate; +} + +sparcv9 { + SUNWprivate; +} + diff --git a/usr/src/pkgdefs/SUNW0on/prototype_com b/usr/src/pkgdefs/SUNW0on/prototype_com index 69bdc2f408..d5c8475c0e 100644 --- a/usr/src/pkgdefs/SUNW0on/prototype_com +++ b/usr/src/pkgdefs/SUNW0on/prototype_com @@ -48,6 +48,7 @@ f none usr/lib/locale/C/LC_MESSAGES/FMD.po 644 root bin f none usr/lib/locale/C/LC_MESSAGES/SMF.po 644 root bin f none usr/lib/locale/C/LC_MESSAGES/SUN4.po 644 root bin f none usr/lib/locale/C/LC_MESSAGES/SUN4U.po 644 root bin +f none usr/lib/locale/C/LC_MESSAGES/SUN4V.po 644 root bin f none usr/lib/locale/C/LC_MESSAGES/SUNOS.po 644 root bin f none usr/lib/locale/C/LC_MESSAGES/PCI.po 644 root bin f none usr/lib/locale/C/LC_MESSAGES/ZFS.po 644 root bin diff --git a/usr/src/pkgdefs/SUNWfmd/prototype_sparc b/usr/src/pkgdefs/SUNWfmd/prototype_sparc index 911fde3bae..47a4e1751a 100644 --- a/usr/src/pkgdefs/SUNWfmd/prototype_sparc +++ b/usr/src/pkgdefs/SUNWfmd/prototype_sparc @@ -29,7 +29,12 @@ f none usr/lib/fm/dict/SUN4.dict 444 root bin f none usr/lib/fm/dict/SUN4U.dict 444 root bin +f none usr/lib/fm/dict/SUN4V.dict 444 root bin f none usr/lib/fm/fmd/schemes/mem.so 555 root bin +f none usr/lib/fm/libmdesc.so.1 755 root bin +s none usr/lib/fm/libmdesc.so=libmdesc.so.1 755 root bin +f none usr/lib/fm/llib-lmdesc 644 root bin +f none usr/lib/fm/llib-lmdesc.ln 644 root bin d none usr/lib/fm/sparcv9 755 root bin f none usr/lib/fm/sparcv9/libdiagcode.so.1 755 root bin s none usr/lib/fm/sparcv9/libdiagcode.so=libdiagcode.so.1 @@ -40,6 +45,9 @@ f none usr/lib/fm/sparcv9/llib-lfmd_adm.ln 644 root bin f none usr/lib/fm/sparcv9/libfmd_log.so.1 755 root bin s none usr/lib/fm/sparcv9/libfmd_log.so=libfmd_log.so.1 f none usr/lib/fm/sparcv9/llib-lfmd_log.ln 644 root bin +f none usr/lib/fm/sparcv9/libmdesc.so.1 755 root bin +s none usr/lib/fm/sparcv9/libmdesc.so=libmdesc.so.1 755 root bin +f none usr/lib/fm/sparcv9/llib-lmdesc.ln 644 root bin f none usr/lib/fm/sparcv9/libtopo.so.1 755 root bin s none usr/lib/fm/sparcv9/libtopo.so=libtopo.so.1 f none usr/lib/fm/sparcv9/llib-ltopo.ln 644 root bin @@ -109,6 +117,7 @@ f none usr/lib/fm/topo/SUNW,Sun-Fire-T200/pciexdev.topo 444 root bin f none usr/lib/fm/topo/SUNW,Sun-Fire-T200/pcidev.topo 444 root bin f none usr/lib/locale/C/LC_MESSAGES/SUN4.mo 444 root bin f none usr/lib/locale/C/LC_MESSAGES/SUN4U.mo 444 root bin +f none usr/lib/locale/C/LC_MESSAGES/SUN4V.mo 444 root bin d none usr/platform 755 root sys d none usr/platform/sun4u 755 root sys d none usr/platform/sun4u/lib 755 root bin diff --git a/usr/src/uts/common/sys/fm/cpu/UltraSPARC-T1.h b/usr/src/uts/common/sys/fm/cpu/UltraSPARC-T1.h index c48622f597..e6ffdfe922 100644 --- a/usr/src/uts/common/sys/fm/cpu/UltraSPARC-T1.h +++ b/usr/src/uts/common/sys/fm/cpu/UltraSPARC-T1.h @@ -50,6 +50,15 @@ extern "C" { #define FM_EREPORT_CPU_UST1_DSU "dsu" #define FM_EREPORT_CPU_UST1_DSC "dsc" +/* + * The following constants are also defined in UltraSPARC-III.h and + * could possibly be moved into a common header file + */ + +#define FM_EREPORT_PAYLOAD_NAME_RESOURCE "resource" +#define FM_EREPORT_PAYLOAD_NAME_ERR_TYPE "error-type" +#define FM_EREPORT_PAYLOAD_NAME_ERR_DISP "error-disposition" + #ifdef __cplusplus } #endif diff --git a/usr/src/uts/common/sys/fm/protocol.h b/usr/src/uts/common/sys/fm/protocol.h index 939dd66c5d..de54f511ea 100644 --- a/usr/src/uts/common/sys/fm/protocol.h +++ b/usr/src/uts/common/sys/fm/protocol.h @@ -216,6 +216,8 @@ extern "C" { #define FM_FMRI_CPU_ID "cpuid" #define FM_FMRI_CPU_SERIAL_ID "serial" #define FM_FMRI_CPU_MASK "cpumask" +#define FM_FMRI_CPU_VID "cpuvid" +#define FM_FMRI_CPU_CPUFRU "cpufru" /* legacy-hc scheme member names */ #define FM_FMRI_LEGACY_HC "component" diff --git a/usr/src/uts/common/sys/mdesc.h b/usr/src/uts/common/sys/mdesc.h index 87e3e8492b..e05374f60e 100644 --- a/usr/src/uts/common/sys/mdesc.h +++ b/usr/src/uts/common/sys/mdesc.h @@ -29,6 +29,8 @@ #pragma ident "%Z%%M% %I% %E% SMI" +#include <sys/types.h> + #ifdef __cplusplus extern "C" { #endif diff --git a/usr/src/uts/sun4u/sys/errclassify.h b/usr/src/uts/sun4/sys/errclassify.h index 0370f2ad17..0370f2ad17 100644 --- a/usr/src/uts/sun4u/sys/errclassify.h +++ b/usr/src/uts/sun4/sys/errclassify.h diff --git a/usr/src/uts/sun4u/sys/Makefile b/usr/src/uts/sun4u/sys/Makefile index 2ba0d40f93..c4420286fe 100644 --- a/usr/src/uts/sun4u/sys/Makefile +++ b/usr/src/uts/sun4u/sys/Makefile @@ -49,6 +49,7 @@ SUN4_HDRS= \ ddi_subrdefs.h \ dvma.h \ eeprom.h \ + errclassify.h \ fcode.h \ idprom.h \ intr.h \ @@ -77,7 +78,6 @@ HDRS= \ envctrl_gen.h \ envctrl_ue250.h \ envctrl_ue450.h \ - errclassify.h \ gpio_87317.h \ fc_plat.h \ iocache.h \ diff --git a/usr/src/uts/sun4v/sys/niagararegs.h b/usr/src/uts/sun4v/sys/niagararegs.h index 08642f5f76..61cfdabdf1 100644 --- a/usr/src/uts/sun4v/sys/niagararegs.h +++ b/usr/src/uts/sun4v/sys/niagararegs.h @@ -112,6 +112,101 @@ extern uint64_t hv_niagara_setperf(uint64_t regnum, uint64_t val); extern uint64_t hv_niagara_getperf(uint64_t regnum, uint64_t *val); #endif +/* + * Bits defined in L2 Error Status Register + * + * +---+---+---+---+----+----+----+----+----+----+----+----+----+----+ + * |MEU|MEC|RW |RSV|MODA|VCID|LDAC|LDAU|LDWC|LDWU|LDRC|LDRU|LDSC|LDSU| + * +---+---+---+---+----+----+----+----+----+----+----+----+----+----+ + * 63 62 61 60 59 58-54 53 52 51 50 49 48 47 46 + * + * +---+---+---+---+---+---+---+---+---+---+---+-------+------+ + * |LTC|LRU|LVU|DAC|DAU|DRC|DRU|DSC|DSU|VEC|VEU| RSVD1 | SYND | + * +---+---+---+---+---+---+---+---+---+---+---+-------+------+ + * 45 44 43 42 41 40 39 38 37 36 35 34-32 31-0 + */ +#define NI_L2AFSR_MEU 0x8000000000000000 +#define NI_L2AFSR_MEC 0x4000000000000000 +#define NI_L2AFSR_RW 0x2000000000000000 +#define NI_L2AFSR_RSVD0 0x1000000000000000 +#define NI_L2AFSR_MODA 0x0800000000000000 +#define NI_L2AFSR_VCID 0x07C0000000000000 +#define NI_L2AFSR_LDAC 0x0020000000000000 +#define NI_L2AFSR_LDAU 0x0010000000000000 +#define NI_L2AFSR_LDWC 0x0008000000000000 +#define NI_L2AFSR_LDWU 0x0004000000000000 +#define NI_L2AFSR_LDRC 0x0002000000000000 +#define NI_L2AFSR_LDRU 0x0001000000000000 +#define NI_L2AFSR_LDSC 0x0000800000000000 +#define NI_L2AFSR_LDSU 0x0000400000000000 +#define NI_L2AFSR_LTC 0x0000200000000000 +#define NI_L2AFSR_LRU 0x0000100000000000 +#define NI_L2AFSR_LVU 0x0000080000000000 +#define NI_L2AFSR_DAC 0x0000040000000000 +#define NI_L2AFSR_DAU 0x0000020000000000 +#define NI_L2AFSR_DRC 0x0000010000000000 +#define NI_L2AFSR_DRU 0x0000008000000000 +#define NI_L2AFSR_DSC 0x0000004000000000 +#define NI_L2AFSR_DSU 0x0000002000000000 +#define NI_L2AFSR_VEC 0x0000001000000000 +#define NI_L2AFSR_VEU 0x0000000800000000 +#define NI_L2AFSR_RSVD1 0x0000000700000000 +#define NI_L2AFSR_SYND 0x00000000FFFFFFFF + +/* + * These L2 bit masks are used to determine if another bit of higher priority + * is set. This tells us whether the reported syndrome and address are valid + * for this ereport. If the error in hand is Pn, use Pn-1 to bitwise & with + * the l2-afsr value. If result is 0, then this ereport's afsr is valid. + */ +#define NI_L2AFSR_P01 (NI_L2AFSR_LVU) +#define NI_L2AFSR_P02 (NI_L2AFSR_P01 | NI_L2AFSR_LRU) +#define NI_L2AFSR_P03 (NI_L2AFSR_P02 | NI_L2AFSR_LDAU | NI_L2AFSR_LDSU) +#define NI_L2AFSR_P04 (NI_L2AFSR_P03 | NI_L2AFSR_LDWU) +#define NI_L2AFSR_P05 (NI_L2AFSR_P04 | NI_L2AFSR_LDRU) +#define NI_L2AFSR_P06 (NI_L2AFSR_P05 | NI_L2AFSR_DAU | NI_L2AFSR_DRU) +#define NI_L2AFSR_P07 (NI_L2AFSR_P06 | NI_L2AFSR_LTC) +#define NI_L2AFSR_P08 (NI_L2AFSR_P07 | NI_L2AFSR_LDAC | NI_L2AFSR_LDSC) +#define NI_L2AFSR_P09 (NI_L2AFSR_P08 | NI_L2AFSR_LDWC) +#define NI_L2AFSR_P10 (NI_L2AFSR_P09 | NI_L2AFSR_LDRC) +#define NI_L2AFSR_P11 (NI_L2AFSR_P10 | NI_L2AFSR_DAC | NI_L2AFSR_DRC) + +/* + * Bits defined in DRAM Error Status Register + * + * +---+---+---+---+---+---+---+----------+------+ + * |MEU|MEC|DAC|DAU|DSC|DSU|DBU| RESERVED | SYND | + * +---+---+---+---+---+---+---+----------+------+ + * 63 62 61 60 59 58 57 56-16 15-0 + * + */ +#define NI_DMAFSR_MEU 0x8000000000000000 +#define NI_DMAFSR_MEC 0x4000000000000000 +#define NI_DMAFSR_DAC 0x2000000000000000 +#define NI_DMAFSR_DAU 0x1000000000000000 +#define NI_DMAFSR_DSC 0x0800000000000000 +#define NI_DMAFSR_DSU 0x0400000000000000 +#define NI_DMAFSR_DBU 0x0200000000000000 +#define NI_DMAFSR_RSVD 0x01FFFFFFFFFF0000 +#define NI_DMAFSR_SYND 0x000000000000FFFF + +/* Bit mask for DRAM priority determination */ +#define NI_DMAFSR_P01 (NI_DMAFSR_DSU | NI_DMAFSR_DAU) + +/* + * The following is the syndrome value placed in memory + * when an uncorrectable error is written back from L2 cache. + */ +#define NI_DRAM_POISON_SYND_FROM_LDWU 0x1118 + +/* + * This L2 poison syndrome is placed on 4 byte checkwords of L2 + * when a UE is loaded or DMA'ed into L2 + */ +#define NI_L2_POISON_SYND_FROM_DAU 0x3 +#define NI_L2_POISON_SYND_MASK 0x7F +#define NI_L2_POISON_SYND_SIZE 7 + #ifdef __cplusplus } #endif |