gintel_main.c revision 728f047ccdb8a96a1aecc448cb87706241a08c94
/*
* 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
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Intel model-specific support. Right now all this conists of is
* to modify the ereport subclass to produce different ereport classes
* so that we can have different diagnosis rules and corresponding faults.
*/
#include <sys/cpu_module_ms_impl.h>
#include <sys/mc_intel.h>
#include <sys/pci_cfgspace.h>
int gintel_ms_support_disable = 0;
int gintel_error_action_return = 0;
int gintel_ms_unconstrained = 0;
int quickpath;
int max_bus_number = 0xff;
#define ERR_COUNTER_INDEX 2
#define MAX_CPU_NODES 2
#define N_MC_COR_ECC_CNT 6
#define MAX_BUS_NUMBER max_bus_number
#define MSCOD_MEM_ECC_READ 0x1
#define MSCOD_MEM_ECC_SCRUB 0x2
#define MSCOD_MEM_WR_PARITY 0x4
#define MSCOD_MEM_REDUNDANT_MEM 0x8
#define MSCOD_MEM_SPARE_MEM 0x10
#define MSCOD_MEM_ILLEGAL_ADDR 0x20
#define MSCOD_MEM_BAD_ID 0x40
#define MSCOD_MEM_ADDR_PARITY 0x80
#define MSCOD_MEM_BYTE_PARITY 0x100
#define GINTEL_ERROR_MEM 0x1000
#define GINTEL_ERROR_QUICKPATH 0x2000
#define MSR_MC_MISC_MEM_CHANNEL_MASK 0x00000000000c0000ULL
#define MSR_MC_MISC_MEM_CHANNEL_SHIFT 18
#define MSR_MC_MISC_MEM_DIMM_MASK 0x0000000000030000ULL
#define MSR_MC_MISC_MEM_DIMM_SHIFT 16
#define MSR_MC_MISC_MEM_SYNDROME_MASK 0xffffffff00000000ULL
#define MSR_MC_MISC_MEM_SYNDROME_SHIFT 32
#define CPU_GENERATION_DONT_CARE 0
#define CPU_GENERATION_NEHALEM_EP 1
#define INTEL_NEHALEM_CPU_FAMILY_ID 0x6
#define INTEL_NEHALEM_CPU_MODEL_ID 0x1A
#define NEHALEM_EP_MEMORY_CONTROLLER_DEV 0x3
#define NEHALEM_EP_MEMORY_CONTROLLER_FUNC 0x2
/*ARGSUSED*/
int
{
return (ENOTSUP);
if (!(x86_feature & X86_MCA))
return (ENOTSUP);
switch (nb_chipset) {
case INTEL_NB_7300:
case INTEL_NB_5000P:
case INTEL_NB_5000X:
case INTEL_NB_5000V:
case INTEL_NB_5000Z:
case INTEL_NB_5400:
case INTEL_NB_5400A:
case INTEL_NB_5400B:
if (!gintel_ms_unconstrained)
break;
case INTEL_QP_IO:
case INTEL_QP_36D:
case INTEL_QP_24D:
quickpath = 1;
break;
default:
break;
}
return (0);
}
/*ARGSUSED*/
{
if ((status & MSR_MC_STATUS_PCC) == 0)
return (gintel_error_action_return);
else
return (gintel_error_action_return & ~CMS_ERRSCOPE_POISONED);
}
/*ARGSUSED*/
{
/*
* memory controller errors
*/
if (mscode & MSCOD_MEM_SPARE_MEM) {
} else if (mscode & (MSCOD_MEM_ECC_READ |
if (status & MSR_MC_STATUS_UC)
else
} else if (mscode & (MSCOD_MEM_WR_PARITY |
} else if (mscode & MSCOD_MEM_ADDR_PARITY) {
} else if (mscode & MSCOD_MEM_REDUNDANT_MEM) {
} else if (mscode & MSCOD_MEM_ILLEGAL_ADDR) {
} else if (mscode & MSCOD_MEM_BAD_ID) {
} else {
}
} else if (quickpath &&
}
return (rt);
}
/*ARGSUSED*/
void
{
case GINTEL_ERROR_QUICKPATH:
*leafclsp = "quickpath.interconnect";
break;
case GINTEL_ERR_SPARE_MEM:
*leafclsp = "quickpath.mem_spare";
break;
case GINTEL_ERR_MEM_UE:
*leafclsp = "quickpath.mem_ue";
break;
case GINTEL_ERR_MEM_CE:
*leafclsp = "quickpath.mem_ce";
break;
case GINTEL_ERR_MEM_PARITY:
*leafclsp = "quickpath.mem_parity";
break;
*leafclsp = "quickpath.mem_addr_parity";
break;
case GINTEL_ERR_MEM_REDUNDANT:
*leafclsp = "quickpath.mem_redundant";
break;
case GINTEL_ERR_MEM_BAD_ADDR:
*leafclsp = "quickpath.mem_bad_addr";
break;
case GINTEL_ERR_MEM_BAD_ID:
*leafclsp = "quickpath.mem_bad_id";
break;
case GINTEL_ERR_MEM_UNKNOWN:
*leafclsp = "quickpath.mem_unknown";
break;
}
}
nvlist_t *
{
if (mscookie) {
return (NULL);
"motherboard", 0,
} else {
"motherboard", 0,
"memory-controller", 0);
}
}
return (nvl);
}
static nvlist_t *
{
return (NULL);
return (NULL);
}
unump->unum_offset);
} else {
}
return (nvl);
}
static void
{
int index;
}
static int
{
return (cpu_generation);
}
/*ARGSUSED*/
void
{
int chipid;
if (chan == 0xf)
chan = -1;
unum.unum_board = 0;
if (status & MSR_MC_STATUS_MISCV) {
(misc & MSR_MC_MISC_MEM_CHANNEL_MASK) >>
(misc & MSR_MC_MISC_MEM_DIMM_MASK) >>
DATA_TYPE_UINT32, synd, 0);
}
if (status & MSR_MC_STATUS_ADDRV) {
}
if (chipid < MAX_CPU_NODES) {
NULL);
NULL);
}
}
}
}
{
/*
* On Intel family 6 before QuickPath we must not enable machine check
* from bank 0 detectors. bank 0 is reserved for the platform
*/
if (banknum == 0 &&
return (1);
else
return (0);
}
gintel_init, /* cms_init */
NULL, /* cms_post_startup */
NULL, /* cms_post_mpstartup */
NULL, /* cms_logout_size */
NULL, /* cms_mcgctl_val */
gintel_bankctl_skipinit, /* cms_bankctl_skipinit */
NULL, /* cms_bankctl_val */
NULL, /* cms_bankstatus_skipinit */
NULL, /* cms_bankstatus_val */
NULL, /* cms_mca_init */
NULL, /* cms_poll_ownermask */
NULL, /* cms_bank_logout */
gintel_error_action, /* cms_error_action */
gintel_disp_match, /* cms_disp_match */
gintel_ereport_class, /* cms_ereport_class */
gintel_ereport_detector, /* cms_ereport_detector */
NULL, /* cms_ereport_includestack */
gintel_ereport_add_logout, /* cms_ereport_add_logout */
NULL, /* cms_msrinject */
NULL, /* cms_fini */
};
"Generic Intel model-specific MCA"
};
static struct modlinkage modlinkage = {
(void *)&modlcpu,
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
{
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}