summaryrefslogtreecommitdiff
path: root/usr/src/uts/intel/sys/fm
diff options
context:
space:
mode:
authorgavinm <none@none>2007-10-14 10:10:53 -0700
committergavinm <none@none>2007-10-14 10:10:53 -0700
commit20c794b39650d115e17a15983b6b82e46238cf45 (patch)
treef2e62d1389c4067c9f09f4497d2279a0e3e7d8da /usr/src/uts/intel/sys/fm
parentbe47d14853d0e04809e26e9ff241631dfbd15d94 (diff)
downloadillumos-joyent-20c794b39650d115e17a15983b6b82e46238cf45.tar.gz
PSARC 2007/591 Generic x86 Machine Check Architecture
PSARC 2007/594 Intel CPU and 5000/7300 Series Chipset FMA 6443855 x86 modinfo slots being wasted during cpu module path search 6475380 cmi_load() should unload unused CPU module 6520280 MCA status bits not properly being cleared for intel processors 6558878 topo_node_hash returns out of range hash 6567218 FMA for Intel processors and 5000/7300 series memory controller 6567634 generic x86 MCA support needs to be improved 6607616 prepare FMA/x86 for xVM 6607626 eversholt Makefile.com lacks a default target 6607637 Add number of cpus and cores per chip to cpu_info kstat 6607643 x86 on_trap handler jumps from frying pan into the fire 6616180 topo should translate slashes in authority fields --HG-- rename : usr/src/uts/i86pc/cpu/amd_opteron/ao_mc.c => deleted_files/usr/src/uts/i86pc/cpu/amd_opteron/ao_mc.c rename : usr/src/uts/i86xpv/generic_cpu/Makefile => deleted_files/usr/src/uts/i86xpv/generic_cpu/Makefile
Diffstat (limited to 'usr/src/uts/intel/sys/fm')
-rw-r--r--usr/src/uts/intel/sys/fm/cpu/AMD.h127
-rw-r--r--usr/src/uts/intel/sys/fm/cpu/GENAMD.h91
-rw-r--r--usr/src/uts/intel/sys/fm/cpu/GMCA.h201
3 files changed, 346 insertions, 73 deletions
diff --git a/usr/src/uts/intel/sys/fm/cpu/AMD.h b/usr/src/uts/intel/sys/fm/cpu/AMD.h
index df66719ad3..7908c872a7 100644
--- a/usr/src/uts/intel/sys/fm/cpu/AMD.h
+++ b/usr/src/uts/intel/sys/fm/cpu/AMD.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -33,153 +33,134 @@
extern "C" {
#endif
+/*
+ * AMD model-specific ereports. These supplement the generic ereport
+ * members specified in GMCA.h.
+ */
+
/* Ereport class subcategory for AMD processors */
#define FM_EREPORT_CPU_AMD "amd"
/*
* Ereport payload definitions
*/
-#define FM_EREPORT_PAYLOAD_NAME_BANK_STAT "bank-status"
-#define FM_EREPORT_PAYLOAD_NAME_BANK_NUM "bank-number"
-#define FM_EREPORT_PAYLOAD_NAME_ADDR "addr"
-#define FM_EREPORT_PAYLOAD_NAME_ADDR_VALID "addr-valid"
-#define FM_EREPORT_PAYLOAD_NAME_BANK_MISC "bank-misc"
#define FM_EREPORT_PAYLOAD_NAME_SYND "syndrome"
#define FM_EREPORT_PAYLOAD_NAME_SYND_TYPE "syndrome-type"
-#define FM_EREPORT_PAYLOAD_NAME_IP "ip"
-#define FM_EREPORT_PAYLOAD_NAME_PRIV "privileged"
#define FM_EREPORT_PAYLOAD_NAME_RESOURCE "resource"
-#define FM_EREPORT_PAYLOAD_FLAG_BANK_STAT 0x0000000000000001
-#define FM_EREPORT_PAYLOAD_FLAG_BANK_NUM 0x0000000000000002
-#define FM_EREPORT_PAYLOAD_FLAG_ADDR 0x0000000000000004
-#define FM_EREPORT_PAYLOAD_FLAG_ADDR_VALID 0x0000000000000008
-#define FM_EREPORT_PAYLOAD_FLAG_SYND 0x0000000000000010
-#define FM_EREPORT_PAYLOAD_FLAG_SYND_TYPE 0x0000000000000020
-#define FM_EREPORT_PAYLOAD_FLAG_IP 0x0000000000000040
-#define FM_EREPORT_PAYLOAD_FLAG_PRIV 0x0000000000000080
-#define FM_EREPORT_PAYLOAD_FLAG_RESOURCE 0x0000000000000100
-#define FM_EREPORT_PAYLOAD_FLAG_STACK 0x0000000000000200
-#define FM_EREPORT_PAYLOAD_FLAG_BANK_MISC 0x0000000000000400
-
-#define FM_EREPORT_PAYLOAD_FLAGS_BANK \
- (FM_EREPORT_PAYLOAD_FLAG_BANK_STAT | FM_EREPORT_PAYLOAD_FLAG_BANK_NUM)
-#define FM_EREPORT_PAYLOAD_FLAGS_ADDR \
- (FM_EREPORT_PAYLOAD_FLAG_ADDR | FM_EREPORT_PAYLOAD_FLAG_ADDR_VALID)
+#define FM_EREPORT_PAYLOAD_FLAG_SYND 0x0000000000000001
+#define FM_EREPORT_PAYLOAD_FLAG_SYND_TYPE 0x0000000000000002
+#define FM_EREPORT_PAYLOAD_FLAG_RESOURCE 0x0000000000000004
+#define FM_EREPORT_PAYLOAD_FLAG_STACK 0x0000000000000008
+
+/*
+ * Model specific payload for each ereport type is specified using the
+ * following groupings of the individual flag values above.
+ */
+#define FM_EREPORT_PAYLOAD_FLAGS_COMMON 0x0ULL /* empty */
+
#define FM_EREPORT_PAYLOAD_FLAGS_SYND \
(FM_EREPORT_PAYLOAD_FLAG_SYND | FM_EREPORT_PAYLOAD_FLAG_SYND_TYPE)
#define FM_EREPORT_PAYLOAD_FLAGS_RESOURCE \
(FM_EREPORT_PAYLOAD_FLAG_RESOURCE)
-#define FM_EREPORT_PAYLOAD_FLAGS_COMMON \
- (FM_EREPORT_PAYLOAD_FLAGS_BANK | FM_EREPORT_PAYLOAD_FLAG_IP | \
- FM_EREPORT_PAYLOAD_FLAG_PRIV)
#define FM_EREPORT_PAYLOAD_FLAGS_NB \
- (FM_EREPORT_PAYLOAD_FLAG_STACK)
-#define FM_EREPORT_PAYLOAD_FLAGS_BANK_MISC \
- (FM_EREPORT_PAYLOAD_FLAG_BANK_MISC)
+ FM_EREPORT_PAYLOAD_FLAG_STACK
#define FM_EREPORT_PAYLOAD_FLAGS_1(f1) \
(FM_EREPORT_PAYLOAD_FLAGS_COMMON | FM_EREPORT_PAYLOAD_FLAGS_##f1)
#define FM_EREPORT_PAYLOAD_FLAGS_2(f1, f2) \
(FM_EREPORT_PAYLOAD_FLAGS_COMMON | FM_EREPORT_PAYLOAD_FLAGS_##f1 | \
FM_EREPORT_PAYLOAD_FLAGS_##f2)
-#define FM_EREPORT_PAYLOAD_FLAGS_3(f1, f2, f3) \
- (FM_EREPORT_PAYLOAD_FLAGS_COMMON | FM_EREPORT_PAYLOAD_FLAGS_##f1 | \
- FM_EREPORT_PAYLOAD_FLAGS_##f2 | FM_EREPORT_PAYLOAD_FLAGS_##f3)
-#define FM_EREPORT_PAYLOAD_FLAGS_4(f1, f2, f3, f4) \
- (FM_EREPORT_PAYLOAD_FLAGS_COMMON | FM_EREPORT_PAYLOAD_FLAGS_##f1 | \
- FM_EREPORT_PAYLOAD_FLAGS_##f2 | FM_EREPORT_PAYLOAD_FLAGS_##f3 | \
- FM_EREPORT_PAYLOAD_FLAGS_##f4)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_INF_SYS_ECC1 \
- FM_EREPORT_PAYLOAD_FLAGS_3(ADDR, SYND, RESOURCE)
+ FM_EREPORT_PAYLOAD_FLAGS_2(SYND, RESOURCE)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_INF_L2_ECC1 \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, SYND)
+ FM_EREPORT_PAYLOAD_FLAGS_1(SYND)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_INF_SYS_ECCM \
- FM_EREPORT_PAYLOAD_FLAGS_3(ADDR, SYND, RESOURCE)
+ FM_EREPORT_PAYLOAD_FLAGS_2(SYND, RESOURCE)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_INF_L2_ECCM \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, SYND)
+ FM_EREPORT_PAYLOAD_FLAGS_1(SYND)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_DATA_ECC1 \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, SYND)
+ FM_EREPORT_PAYLOAD_FLAGS_1(SYND)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_DATA_ECC1_UC \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, SYND)
+ FM_EREPORT_PAYLOAD_FLAGS_1(SYND)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_DATA_ECCM \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, SYND)
+ FM_EREPORT_PAYLOAD_FLAGS_1(SYND)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_TAG_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_STAG_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_L1TLB_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_DC_L2TLB_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_INF_SYS_ECC1 \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_INF_L2_ECC1 \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_INF_SYS_ECCM \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_INF_L2_ECCM \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_DATA_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_TAG_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_STAG_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_L1TLB_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_L2TLB_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_IC_RDDE \
FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_BU_L2D_ECC1 \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, SYND)
+ FM_EREPORT_PAYLOAD_FLAGS_1(SYND)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_BU_L2D_ECCM \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, SYND)
+ FM_EREPORT_PAYLOAD_FLAGS_1(SYND)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_BU_L2T_PAR \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_BU_L2T_ECC1 \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, SYND)
+ FM_EREPORT_PAYLOAD_FLAGS_1(SYND)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_BU_L2T_ECCM \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, SYND)
+ FM_EREPORT_PAYLOAD_FLAGS_1(SYND)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_BU_S_RDE \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_BU_S_ECC1 \
- FM_EREPORT_PAYLOAD_FLAGS_3(ADDR, SYND, RESOURCE)
+ FM_EREPORT_PAYLOAD_FLAGS_2(SYND, RESOURCE)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_BU_S_ECCM \
- FM_EREPORT_PAYLOAD_FLAGS_3(ADDR, SYND, RESOURCE)
+ FM_EREPORT_PAYLOAD_FLAGS_2(SYND, RESOURCE)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_LS_S_RDE \
FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_MEM_CE \
- FM_EREPORT_PAYLOAD_FLAGS_4(ADDR, SYND, RESOURCE, BANK_MISC)
+ FM_EREPORT_PAYLOAD_FLAGS_2(SYND, RESOURCE)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_MEM_UE \
- FM_EREPORT_PAYLOAD_FLAGS_4(ADDR, SYND, RESOURCE, BANK_MISC)
+ FM_EREPORT_PAYLOAD_FLAGS_2(SYND, RESOURCE)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_HT_CRC \
FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_HT_SYNC \
FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_MA \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, NB)
+ FM_EREPORT_PAYLOAD_FLAGS_1(NB)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_TA \
- FM_EREPORT_PAYLOAD_FLAGS_2(ADDR, NB)
+ FM_EREPORT_PAYLOAD_FLAGS_1(NB)
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_GART_WALK \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_RMW \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_WDOG \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_NB_DRAMADDR_PAR \
FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_MC_TESTFAIL \
FM_EREPORT_PAYLOAD_FLAG_RESOURCE
#define FM_EREPORT_PAYLOAD_FLAGS_CPU_AMD_UNKNOWN \
- FM_EREPORT_PAYLOAD_FLAGS_1(ADDR)
+ FM_EREPORT_PAYLOAD_FLAGS_COMMON
#define FM_EREPORT_CPU_AMD_DC_INF_SYS_ECC1 "dc.inf_sys_ecc1"
#define FM_EREPORT_CPU_AMD_DC_INF_SYS_ECCM "dc.inf_sys_eccm"
diff --git a/usr/src/uts/intel/sys/fm/cpu/GENAMD.h b/usr/src/uts/intel/sys/fm/cpu/GENAMD.h
new file mode 100644
index 0000000000..7654877976
--- /dev/null
+++ b/usr/src/uts/intel/sys/fm/cpu/GENAMD.h
@@ -0,0 +1,91 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (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 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SYS_FM_CPU_GENAMD_H
+#define _SYS_FM_CPU_GENAMD_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/* Ereport class subcategory - same as in GMCA.h */
+#define FM_EREPORT_CPU_GENAMD "generic-x86"
+
+/* Ereport leaf classes */
+#define FM_EREPORT_CPU_GENAMD_MEM_CE "mem_ce"
+#define FM_EREPORT_CPU_GENAMD_MEM_UE "mem_ue"
+#define FM_EREPORT_CPU_GENAMD_CKMEM_CE "mem_ce"
+#define FM_EREPORT_CPU_GENAMD_CKMEM_UE "mem_ue"
+#define FM_EREPORT_CPU_GENADM_GARTTBLWLK "gart_tbl_walk"
+
+#define _FM_EREPORT_FLAG(n) (1ULL << (n))
+
+#define FM_EREPORT_GENAMD_PAYLOAD_NAME_SYND "syndrome"
+#define FM_EREPORT_GENAMD_PAYLOAD_FLAG_SYND _FM_EREPORT_FLAG(1)
+
+#define FM_EREPORT_GENAMD_PAYLOAD_NAME_CKSYND "syndrome"
+#define FM_EREPORT_GENAMD_PAYLOAD_FLAG_CKSYND _FM_EREPORT_FLAG(2)
+
+#define FM_EREPORT_GENAMD_PAYLOAD_NAME_SYNDTYPE "syndrome-type"
+#define FM_EREPORT_GENAMD_PAYLOAD_FLAG_SYNDTYPE _FM_EREPORT_FLAG(3)
+
+#define FM_EREPORT_GENAMD_PAYLOAD_NAME_RESOURCE "resource"
+#define FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCE _FM_EREPORT_FLAG(4)
+
+#define FM_EREPORT_GENAMD_PAYLOAD_NAME_RESOURCECNT "resource_counts"
+#define FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCECNT _FM_EREPORT_FLAG(5)
+
+#define FM_EREPORT_GENAMD_PAYLOAD_FLAGS_MEM_CE \
+ (FM_EREPORT_GENAMD_PAYLOAD_FLAG_SYND | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_SYNDTYPE | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCE | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCECNT)
+
+#define FM_EREPORT_GENAMD_PAYLOAD_FLAGS_MEM_UE \
+ (FM_EREPORT_GENAMD_PAYLOAD_FLAG_SYND | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_SYNDTYPE | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCE | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCECNT)
+
+#define FM_EREPORT_GENAMD_PAYLOAD_FLAGS_CKMEM_CE \
+ (FM_EREPORT_GENAMD_PAYLOAD_FLAG_CKSYND | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_SYNDTYPE | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCE | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCECNT)
+
+#define FM_EREPORT_GENAMD_PAYLOAD_FLAGS_CKMEM_UE \
+ (FM_EREPORT_GENAMD_PAYLOAD_FLAG_CKSYND | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_SYNDTYPE | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCE | \
+ FM_EREPORT_GENAMD_PAYLOAD_FLAG_RESOURCECNT)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_FM_CPU_GENAMD_H */
diff --git a/usr/src/uts/intel/sys/fm/cpu/GMCA.h b/usr/src/uts/intel/sys/fm/cpu/GMCA.h
new file mode 100644
index 0000000000..c677efad87
--- /dev/null
+++ b/usr/src/uts/intel/sys/fm/cpu/GMCA.h
@@ -0,0 +1,201 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (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 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SYS_FM_CPU_GMCA_H
+#define _SYS_FM_CPU_GMCA_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Generic x86 cpu ereports.
+ *
+ * On a machine-check exception, or on a periodic poll for error status
+ * of a cpu, we read through all the MCA banks of the processor and
+ * log an ereport for each MCA bank that contains valid error telemetry.
+ * These ereports will all share the same detector FMRI and ENA.
+ *
+ * Since we have no model-specific knowledge of the cpu we cannot
+ * decode all details of the error, so we'll stick to the "architectural"
+ * bits. Similarly since we have no associated memory-controller driver
+ * or detailed topology information we cannot produce "resource" ereport
+ * FMRIs.
+ */
+
+/* Ereport class subcategory for generic x86 processors */
+#define FM_EREPORT_CPU_GENERIC "generic-x86"
+
+/*
+ * Simple error code ereport leaf classes
+ */
+#define FM_EREPORT_CPU_GENERIC_UNCLASSIFIED "unclassified"
+#define FM_EREPORT_CPU_GENERIC_MC_CODE_PARITY "microcode_rom_parity"
+#define FM_EREPORT_CPU_GENERIC_EXTERNAL "external"
+#define FM_EREPORT_CPU_GENERIC_FRC "frc"
+#define FM_EREPORT_CPU_GENERIC_INTERNAL_TIMER "internal_timer"
+#define FM_EREPORT_CPU_GENERIC_INTERNAL_UNCLASS "internal_unclassified"
+
+/*
+ * Leaf class to be used when we can match no simple or compound class
+ */
+#define FM_EREPORT_CPU_GENERIC_UNKNOWN "unknown"
+
+/*
+ * Compound error code ereport leaf classes. The arguments for snprintf
+ * will appear in the following order:
+ *
+ * 1 - TT interpretation
+ * 2 - LL interpretation
+ * 3 - RRRR interpretation
+ * 4 - PP interpretation
+ * 5 - II interpretation
+ * 6 - T interpretation
+ * 7 - "_uc" if this is a compound error with MCi_STATUS.UC set, else ""
+ *
+ * They can be selected in the format string using the %n$s specifier form.
+ *
+ * The set of interpretations that we expand to will not be exactly the
+ * same as the set of mnemonics described in Vol 3A (see the
+ * FM_EREPORT_PAYLOAD_NAME_COMPOUND_ERR ereport payload member for that).
+ * Instead we wish to compress the possible ereport classes that can
+ * be generated by pushing things such as "LG" for generic cache level
+ * down to "".
+ *
+ *
+ * "Memory Hierarchy" in compound errors actually refers to CPU cache
+ * memory.
+ */
+#define FM_EREPORT_CPU_GENERIC_GENMEMHIER "%2$s" "cache" "%7$s"
+#define FM_EREPORT_CPU_GENERIC_TLB "%2$s" "%1$s" "tlb" "%7$s"
+#define FM_EREPORT_CPU_GENERIC_MEMHIER "%2$s" "%1$s" "cache" "%7$s"
+#define FM_EREPORT_CPU_GENERIC_BUS_INTERCONNECT "bus_interconnect" "%5$s" "%7$s"
+
+/*
+ * The "interpretation" expansions for the above ereport leaf subclasses.
+ */
+#define FM_EREPORT_CPU_GENERIC_TT_INSTR "i"
+#define FM_EREPORT_CPU_GENERIC_TT_DATA "d"
+#define FM_EREPORT_CPU_GENERIC_TT_GEN ""
+
+#define FM_EREPORT_CPU_GENERIC_LL_L0 "l0"
+#define FM_EREPORT_CPU_GENERIC_LL_L1 "l1"
+#define FM_EREPORT_CPU_GENERIC_LL_L2 "l2"
+#define FM_EREPORT_CPU_GENERIC_LL_LG ""
+
+#define FM_EREPORT_CPU_GENERIC_RRRR_ERR ""
+#define FM_EREPORT_CPU_GENERIC_RRRR_RD ""
+#define FM_EREPORT_CPU_GENERIC_RRRR_WR ""
+#define FM_EREPORT_CPU_GENERIC_RRRR_DRD ""
+#define FM_EREPORT_CPU_GENERIC_RRRR_DWR ""
+#define FM_EREPORT_CPU_GENERIC_RRRR_IRD ""
+#define FM_EREPORT_CPU_GENERIC_RRRR_PREFETCH ""
+#define FM_EREPORT_CPU_GENERIC_RRRR_EVICT ""
+#define FM_EREPORT_CPU_GENERIC_RRRR_SNOOP ""
+
+#define FM_EREPORT_CPU_GENERIC_PP_SRC ""
+#define FM_EREPORT_CPU_GENERIC_PP_RES ""
+#define FM_EREPORT_CPU_GENERIC_PP_OBS ""
+#define FM_EREPORT_CPU_GENERIC_PP_GEN ""
+
+#define FM_EREPORT_CPU_GENERIC_II_MEM "_memory"
+#define FM_EREPORT_CPU_GENERIC_II_IO "_io"
+#define FM_EREPORT_CPU_GENERIC_II_GEN ""
+
+#define FM_EREPORT_CPU_GENERIC_T_NOTIMEOUT ""
+#define FM_EREPORT_CPU_GENERIC_T_TIMEOUT ""
+
+/*
+ * Ereport payload member names together with bitmask values to select
+ * their inclusion in ereports.
+ */
+
+#define _FM_EREPORT_FLAG(n) (1ULL << (n))
+
+#define FM_EREPORT_PAYLOAD_FLAG_COMPOUND_ERR _FM_EREPORT_FLAG(1)
+#define FM_EREPORT_PAYLOAD_NAME_COMPOUND_ERR "compound_errorname"
+
+#define FM_EREPORT_PAYLOAD_FLAG_MCG_STATUS _FM_EREPORT_FLAG(2)
+#define FM_EREPORT_PAYLOAD_NAME_MCG_STATUS "IA32_MCG_STATUS"
+#define FM_EREPORT_PAYLOAD_NAME_MCG_STATUS_MCIP "machine_check_in_progress"
+
+#define FM_EREPORT_PAYLOAD_FLAG_IP _FM_EREPORT_FLAG(3)
+#define FM_EREPORT_PAYLOAD_NAME_IP "ip"
+
+#define FM_EREPORT_PAYLOAD_FLAG_PRIV _FM_EREPORT_FLAG(4)
+#define FM_EREPORT_PAYLOAD_NAME_PRIV "privileged"
+
+#define FM_EREPORT_PAYLOAD_FLAG_BANK_NUM _FM_EREPORT_FLAG(5)
+#define FM_EREPORT_PAYLOAD_NAME_BANK_NUM "bank_number"
+#define FM_EREPORT_PAYLOAD_NAME_BANK_MSR_OFFSET "bank_msr_offset"
+
+#define FM_EREPORT_PAYLOAD_FLAG_MC_STATUS _FM_EREPORT_FLAG(6)
+#define FM_EREPORT_PAYLOAD_NAME_MC_STATUS "IA32_MCi_STATUS"
+#define FM_EREPORT_PAYLOAD_NAME_MC_STATUS_OVER "overflow"
+#define FM_EREPORT_PAYLOAD_NAME_MC_STATUS_UC "error_uncorrected"
+#define FM_EREPORT_PAYLOAD_NAME_MC_STATUS_EN "error_enabled"
+#define FM_EREPORT_PAYLOAD_NAME_MC_STATUS_PCC "processor_context_corrupt"
+#define FM_EREPORT_PAYLOAD_NAME_MC_STATUS_TES "threshold_based_error_status"
+#define FM_EREPORT_PAYLOAD_NAME_MC_STATUS_ERRCODE "error_code"
+#define FM_EREPORT_PAYLOAD_NAME_MC_STATUS_EXTERRCODE "model_specific_error_code"
+
+#define FM_EREPORT_PAYLOAD_FLAG_MC_ADDR _FM_EREPORT_FLAG(7)
+#define FM_EREPORT_PAYLOAD_NAME_MC_ADDR "IA32_MCi_ADDR"
+
+#define FM_EREPORT_PAYLOAD_FLAG_MC_MISC _FM_EREPORT_FLAG(8)
+#define FM_EREPORT_PAYLOAD_NAME_MC_MISC "IA32_MCi_MISC"
+
+#define FM_EREPORT_PAYLOAD_FLAG_DISP _FM_EREPORT_FLAG(9)
+#define FM_EREPORT_PAYLOAD_NAME_DISP "disp"
+
+/*
+ * Common combinations of payload members
+ */
+#define FM_EREPORT_PAYLOAD_FLAGS_GLOBAL \
+ (FM_EREPORT_PAYLOAD_FLAG_MCG_STATUS | \
+ FM_EREPORT_PAYLOAD_FLAG_IP | \
+ FM_EREPORT_PAYLOAD_FLAG_PRIV)
+
+#define FM_EREPORT_PAYLOAD_FLAGS_BANK \
+ (FM_EREPORT_PAYLOAD_FLAG_BANK_NUM | \
+ FM_EREPORT_PAYLOAD_FLAG_MC_STATUS | \
+ FM_EREPORT_PAYLOAD_FLAG_MC_ADDR | \
+ FM_EREPORT_PAYLOAD_FLAG_MC_MISC | \
+ FM_EREPORT_PAYLOAD_FLAG_DISP)
+
+#define FM_EREPORT_PAYLOAD_FLAGS_COMMON \
+ (FM_EREPORT_PAYLOAD_FLAGS_GLOBAL | FM_EREPORT_PAYLOAD_FLAGS_BANK)
+
+#define FM_EREPORT_PAYLOAD_FLAGS_COMPOUND_ERR \
+ (FM_EREPORT_PAYLOAD_FLAGS_COMMON | FM_EREPORT_PAYLOAD_FLAG_COMPOUND_ERR)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_FM_CPU_GMCA_H */