xref: /titanic_50/usr/src/uts/intel/sys/fm/cpu/GMCA.h (revision 491f61a1e1c1fc54a47bbcf53dbbbe1293b93b27)
120c794b3Sgavinm /*
220c794b3Sgavinm  * CDDL HEADER START
320c794b3Sgavinm  *
420c794b3Sgavinm  * The contents of this file are subject to the terms of the
520c794b3Sgavinm  * Common Development and Distribution License (the "License").
620c794b3Sgavinm  * You may not use this file except in compliance with the License.
720c794b3Sgavinm  *
820c794b3Sgavinm  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
920c794b3Sgavinm  * or http://www.opensolaris.org/os/licensing.
1020c794b3Sgavinm  * See the License for the specific language governing permissions
1120c794b3Sgavinm  * and limitations under the License.
1220c794b3Sgavinm  *
1320c794b3Sgavinm  * When distributing Covered Code, include this CDDL HEADER in each
1420c794b3Sgavinm  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1520c794b3Sgavinm  * If applicable, add the following below this CDDL HEADER, with the
1620c794b3Sgavinm  * fields enclosed by brackets "[]" replaced with your own identifying
1720c794b3Sgavinm  * information: Portions Copyright [yyyy] [name of copyright owner]
1820c794b3Sgavinm  *
1920c794b3Sgavinm  * CDDL HEADER END
2020c794b3Sgavinm  */
2120c794b3Sgavinm 
2220c794b3Sgavinm /*
23*491f61a1SYanmin Sun  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
2420c794b3Sgavinm  * Use is subject to license terms.
2520c794b3Sgavinm  */
2620c794b3Sgavinm 
2720c794b3Sgavinm #ifndef	_SYS_FM_CPU_GMCA_H
2820c794b3Sgavinm #define	_SYS_FM_CPU_GMCA_H
2920c794b3Sgavinm 
3020c794b3Sgavinm #ifdef __cplusplus
3120c794b3Sgavinm extern "C" {
3220c794b3Sgavinm #endif
3320c794b3Sgavinm 
3420c794b3Sgavinm /*
3520c794b3Sgavinm  * Generic x86 cpu ereports.
3620c794b3Sgavinm  *
3720c794b3Sgavinm  * On a machine-check exception, or on a periodic poll for error status
3820c794b3Sgavinm  * of a cpu, we read through all the MCA banks of the processor and
3920c794b3Sgavinm  * log an ereport for each MCA bank that contains valid error telemetry.
4020c794b3Sgavinm  * These ereports will all share the same detector FMRI and ENA.
4120c794b3Sgavinm  *
4220c794b3Sgavinm  * Since we have no model-specific knowledge of the cpu we cannot
4320c794b3Sgavinm  * decode all details of the error, so we'll stick to the "architectural"
4420c794b3Sgavinm  * bits.  Similarly since we have no associated memory-controller driver
4520c794b3Sgavinm  * or detailed topology information we cannot produce "resource" ereport
4620c794b3Sgavinm  * FMRIs.
4720c794b3Sgavinm  */
4820c794b3Sgavinm 
4920c794b3Sgavinm /* Ereport class subcategory for generic x86 processors */
5020c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC	"generic-x86"
5120c794b3Sgavinm 
5220c794b3Sgavinm /*
5320c794b3Sgavinm  * Simple error code ereport leaf classes
5420c794b3Sgavinm  */
5520c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_UNCLASSIFIED	"unclassified"
5620c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_MC_CODE_PARITY	"microcode_rom_parity"
5720c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_EXTERNAL		"external"
5820c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_FRC		"frc"
59e3d60c9bSAdrian Frost #define	FM_EREPORT_CPU_GENERIC_INTERNAL_PARITY	"internal_parity"
6020c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_INTERNAL_TIMER	"internal_timer"
6120c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_INTERNAL_UNCLASS	"internal_unclassified"
6220c794b3Sgavinm 
6320c794b3Sgavinm /*
6420c794b3Sgavinm  * Leaf class to be used when we can match no simple or compound class
6520c794b3Sgavinm  */
6620c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_UNKNOWN		"unknown"
6720c794b3Sgavinm 
6820c794b3Sgavinm /*
6920c794b3Sgavinm  * Compound error code ereport leaf classes.  The arguments for snprintf
7020c794b3Sgavinm  * will appear in the following order:
7120c794b3Sgavinm  *
7220c794b3Sgavinm  *	1 - TT interpretation
7320c794b3Sgavinm  *	2 - LL interpretation
7420c794b3Sgavinm  *	3 - RRRR interpretation
7520c794b3Sgavinm  *	4 - PP interpretation
7620c794b3Sgavinm  *	5 - II interpretation
7720c794b3Sgavinm  *	6 - T interpretation
7820c794b3Sgavinm  *	7 - "_uc" if this is a compound error with MCi_STATUS.UC set, else ""
79e3d60c9bSAdrian Frost  *	8 - CCCC interpretation
80e3d60c9bSAdrian Frost  *	9 - MMM interpretation
8120c794b3Sgavinm  *
8220c794b3Sgavinm  * They can be selected in the format string using the %n$s specifier form.
8320c794b3Sgavinm  *
8420c794b3Sgavinm  * The set of interpretations that we expand to will not be exactly the
8520c794b3Sgavinm  * same as the set of mnemonics described in Vol 3A (see the
8620c794b3Sgavinm  * FM_EREPORT_PAYLOAD_NAME_COMPOUND_ERR ereport payload member for that).
8720c794b3Sgavinm  * Instead we wish to compress the possible ereport classes that can
8820c794b3Sgavinm  * be generated by pushing things such as "LG" for generic cache level
8920c794b3Sgavinm  * down to "".
9020c794b3Sgavinm  *
9120c794b3Sgavinm  *
9220c794b3Sgavinm  * "Memory Hierarchy" in compound errors actually refers to CPU cache
9320c794b3Sgavinm  * memory.
9420c794b3Sgavinm  */
9520c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_GENMEMHIER	"%2$s" "cache" "%7$s"
9620c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_TLB		"%2$s" "%1$s" "tlb" "%7$s"
9720c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_MEMHIER		"%2$s" "%1$s" "cache" "%7$s"
9820c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_BUS_INTERCONNECT	"bus_interconnect" "%5$s" "%7$s"
99e3d60c9bSAdrian Frost #define	FM_EREPORT_CPU_GENERIC_MEMORY_CONTROLLER "mc"
10020c794b3Sgavinm 
10120c794b3Sgavinm /*
10220c794b3Sgavinm  * The "interpretation" expansions for the above ereport leaf subclasses.
10320c794b3Sgavinm  */
10420c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_TT_INSTR		"i"
10520c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_TT_DATA		"d"
10620c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_TT_GEN		""
10720c794b3Sgavinm 
10820c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_LL_L0		"l0"
10920c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_LL_L1		"l1"
11020c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_LL_L2		"l2"
11120c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_LL_LG		""
11220c794b3Sgavinm 
11320c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_RRRR_ERR		""
11420c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_RRRR_RD		""
11520c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_RRRR_WR		""
11620c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_RRRR_DRD		""
11720c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_RRRR_DWR		""
11820c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_RRRR_IRD		""
11920c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_RRRR_PREFETCH	""
12020c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_RRRR_EVICT	""
12120c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_RRRR_SNOOP	""
12220c794b3Sgavinm 
12320c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_PP_SRC		""
12420c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_PP_RES		""
12520c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_PP_OBS		""
12620c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_PP_GEN		""
12720c794b3Sgavinm 
12820c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_II_MEM		"_memory"
12920c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_II_IO		"_io"
13020c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_II_GEN		""
13120c794b3Sgavinm 
13220c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_T_NOTIMEOUT	""
13320c794b3Sgavinm #define	FM_EREPORT_CPU_GENERIC_T_TIMEOUT	""
13420c794b3Sgavinm 
135e3d60c9bSAdrian Frost #define	FM_EREPORT_CPU_GENERIC_CCCC		""
136e3d60c9bSAdrian Frost 
137e3d60c9bSAdrian Frost #define	FM_EREPORT_CPU_GENERIC_MMM_ERR		""
138e3d60c9bSAdrian Frost #define	FM_EREPORT_CPU_GENERIC_MMM_RD		""
139e3d60c9bSAdrian Frost #define	FM_EREPORT_CPU_GENERIC_MMM_WR		""
140e3d60c9bSAdrian Frost #define	FM_EREPORT_CPU_GENERIC_MMM_ADRCMD	""
141*491f61a1SYanmin Sun #define	FM_EREPORT_CPU_GENERIC_MMM_SCRUB	""
142e3d60c9bSAdrian Frost 
14320c794b3Sgavinm /*
14420c794b3Sgavinm  * Ereport payload member names together with bitmask values to select
14520c794b3Sgavinm  * their inclusion in ereports.
14620c794b3Sgavinm  */
14720c794b3Sgavinm 
14820c794b3Sgavinm #define	_FM_EREPORT_FLAG(n) (1ULL << (n))
14920c794b3Sgavinm 
15020c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAG_COMPOUND_ERR _FM_EREPORT_FLAG(1)
15120c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_COMPOUND_ERR	"compound_errorname"
15220c794b3Sgavinm 
15320c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAG_MCG_STATUS _FM_EREPORT_FLAG(2)
15420c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MCG_STATUS	"IA32_MCG_STATUS"
15520c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MCG_STATUS_MCIP	"machine_check_in_progress"
15620c794b3Sgavinm 
15720c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAG_IP _FM_EREPORT_FLAG(3)
15820c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_IP		"ip"
15920c794b3Sgavinm 
16020c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAG_PRIV _FM_EREPORT_FLAG(4)
16120c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_PRIV		"privileged"
16220c794b3Sgavinm 
16320c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAG_BANK_NUM _FM_EREPORT_FLAG(5)
16420c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_BANK_NUM	"bank_number"
16520c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_BANK_MSR_OFFSET	"bank_msr_offset"
16620c794b3Sgavinm 
16720c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAG_MC_STATUS _FM_EREPORT_FLAG(6)
16820c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_STATUS	"IA32_MCi_STATUS"
16920c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_STATUS_OVER	"overflow"
17020c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_STATUS_UC	"error_uncorrected"
17120c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_STATUS_EN	"error_enabled"
17220c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_STATUS_PCC	"processor_context_corrupt"
17320c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_STATUS_TES	"threshold_based_error_status"
17420c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_STATUS_ERRCODE "error_code"
17520c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_STATUS_EXTERRCODE "model_specific_error_code"
17620c794b3Sgavinm 
17720c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAG_MC_ADDR _FM_EREPORT_FLAG(7)
17820c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_ADDR		"IA32_MCi_ADDR"
17920c794b3Sgavinm 
18020c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAG_MC_MISC _FM_EREPORT_FLAG(8)
18120c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_MC_MISC		"IA32_MCi_MISC"
18220c794b3Sgavinm 
18320c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAG_DISP	_FM_EREPORT_FLAG(9)
18420c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_NAME_DISP		"disp"
18520c794b3Sgavinm 
18620c794b3Sgavinm /*
18720c794b3Sgavinm  * Common combinations of payload members
18820c794b3Sgavinm  */
18920c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAGS_GLOBAL \
19020c794b3Sgavinm 	(FM_EREPORT_PAYLOAD_FLAG_MCG_STATUS | \
19120c794b3Sgavinm 	FM_EREPORT_PAYLOAD_FLAG_IP | \
19220c794b3Sgavinm 	FM_EREPORT_PAYLOAD_FLAG_PRIV)
19320c794b3Sgavinm 
19420c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAGS_BANK \
19520c794b3Sgavinm 	(FM_EREPORT_PAYLOAD_FLAG_BANK_NUM | \
19620c794b3Sgavinm 	FM_EREPORT_PAYLOAD_FLAG_MC_STATUS | \
19720c794b3Sgavinm 	FM_EREPORT_PAYLOAD_FLAG_MC_ADDR | \
19820c794b3Sgavinm 	FM_EREPORT_PAYLOAD_FLAG_MC_MISC | \
19920c794b3Sgavinm 	FM_EREPORT_PAYLOAD_FLAG_DISP)
20020c794b3Sgavinm 
20120c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAGS_COMMON \
20220c794b3Sgavinm 	(FM_EREPORT_PAYLOAD_FLAGS_GLOBAL | FM_EREPORT_PAYLOAD_FLAGS_BANK)
20320c794b3Sgavinm 
20420c794b3Sgavinm #define	FM_EREPORT_PAYLOAD_FLAGS_COMPOUND_ERR \
20520c794b3Sgavinm 	(FM_EREPORT_PAYLOAD_FLAGS_COMMON | FM_EREPORT_PAYLOAD_FLAG_COMPOUND_ERR)
20620c794b3Sgavinm 
20720c794b3Sgavinm #ifdef __cplusplus
20820c794b3Sgavinm }
20920c794b3Sgavinm #endif
21020c794b3Sgavinm 
21120c794b3Sgavinm #endif /* _SYS_FM_CPU_GMCA_H */
212