/* SPDX-License-Identifier: GPL-2.0 */ /* * Common codes for both the skx_edac driver and Intel 10nm server EDAC driver. * Originally split out from the skx_edac driver. * * Copyright (c) 2018, Intel Corporation.
*/
/* * According to Intel Architecture spec vol 3B, * Table 15-10 "IA32_MCi_Status [15:0] Compound Error Code Encoding" * memory errors should fit one of these masks: * 000f 0000 1mmm cccc (binary) * 000f 0010 1mmm cccc (binary) [RAM used as cache] * where: * f = Correction Report Filtering Bit. If 1, subsequent errors * won't be shown * mmm = error type * cccc = channel
*/ #define MCACOD_MEM_ERR_MASK 0xef80 /* * Errors from either the memory of the 1-level memory system or the * 2nd level memory (the slow "far" memory) of the 2-level memory system.
*/ #define MCACOD_MEM_CTL_ERR 0x80 /* * Errors from the 1st level memory (the fast "near" memory as cache) * of the 2-level memory system.
*/ #define MCACOD_EXT_MEM_ERR 0x280
/* Max RRL register sets per {,sub-,pseudo-}channel. */ #define NUM_RRL_SET 4 /* Max RRL registers per set. */ #define NUM_RRL_REG 6 /* Max correctable error count registers. */ #define NUM_CECNT_REG 8
/* Modes of RRL register set. */ enum rrl_mode { /* Last read error from patrol scrub. */
LRE_SCRUB, /* Last read error from demand. */
LRE_DEMAND, /* First read error from patrol scrub. */
FRE_SCRUB, /* First read error from demand. */
FRE_DEMAND,
};
/* RRL registers per {,sub-,pseudo-}channel. */ struct reg_rrl { /* RRL register parts. */ int set_num, reg_num; enum rrl_mode modes[NUM_RRL_SET];
u32 offsets[NUM_RRL_SET][NUM_RRL_REG]; /* RRL register widths in byte per set. */
u8 widths[NUM_RRL_REG]; /* RRL control bits of the first register per set. */
u32 v_mask;
u32 uc_mask;
u32 over_mask;
u32 en_patspr_mask;
u32 noover_mask;
u32 en_mask;
/* * Each cpu socket contains some pci devices that provide global * information, and also some that are local to each of the two * memory controllers on the die.
*/ struct skx_dev { struct list_head list;
u8 bus[4]; int seg; struct pci_dev *sad_all; struct pci_dev *util_all; struct pci_dev *uracu; /* for i10nm CPU */ struct pci_dev *pcu_cr3; /* for HBM memory detection */
u32 mcroute; /* * Some server BIOS may hide certain memory controllers, and the * EDAC driver skips those hidden memory controllers. However, the * ADXL still decodes memory error address using physical memory * controller indices. The mapping table is used to convert the * physical indices (reported by ADXL) to the logical indices * (used the EDAC driver) of present memory controllers during the * error handling process.
*/
u8 mc_mapping[NUM_IMC]; struct skx_imc { struct mem_ctl_info *mci; struct pci_dev *mdev; /* for i10nm CPU */ void __iomem *mbase; /* for i10nm CPU */ int chan_mmio_sz; /* for i10nm CPU */ int num_channels; /* channels per memory controller */ int num_dimms; /* dimms per channel */ bool hbm_mc;
u8 mc; /* system wide mc# */
u8 lmc; /* socket relative mc# */
u8 src_id; struct skx_channel { struct pci_dev *cdev; struct pci_dev *edev; /* * Two groups of RRL control registers per channel to save default RRL * settings of two {sub-,pseudo-}channels in Linux RRL control mode.
*/
u32 rrl_ctl[2][NUM_RRL_SET]; struct skx_dimm {
u8 close_pg;
u8 bank_xor_enable;
u8 fine_grain_bank;
u8 rowbits;
u8 colbits;
} dimms[NUM_DIMMS];
} chan[NUM_CHANNELS];
} imc[NUM_IMC];
};
struct decoded_addr { struct mce *mce; struct skx_dev *dev;
u64 addr; int socket; int imc; int channel;
u64 chan_addr; int sktways; int chanways; int dimm; int cs; int rank; int channel_rank;
u64 rank_address; int row; int column; int bank_address; int bank_group; bool decoded_by_adxl;
};
struct pci_bdf {
u32 bus : 8;
u32 dev : 5;
u32 fun : 3;
};
struct res_config { enum type type; /* Configuration agent device ID */ unsignedint decs_did; /* Default bus number configuration register offset */ int busno_cfg_offset; /* DDR memory controllers per socket */ int ddr_imc_num; /* DDR channels per DDR memory controller */ int ddr_chan_num; /* DDR DIMMs per DDR memory channel */ int ddr_dimm_num; /* Per DDR channel memory-mapped I/O size */ int ddr_chan_mmio_sz; /* HBM memory controllers per socket */ int hbm_imc_num; /* HBM channels per HBM memory controller */ int hbm_chan_num; /* HBM DIMMs per HBM memory channel */ int hbm_dimm_num; /* Per HBM channel memory-mapped I/O size */ int hbm_chan_mmio_sz; bool support_ddr5; /* SAD device BDF */ struct pci_bdf sad_all_bdf; /* PCU device BDF */ struct pci_bdf pcu_cr3_bdf; /* UTIL device BDF */ struct pci_bdf util_all_bdf; /* URACU device BDF */ struct pci_bdf uracu_bdf; /* DDR mdev device BDF */ struct pci_bdf ddr_mdev_bdf; /* HBM mdev device BDF */ struct pci_bdf hbm_mdev_bdf; int sad_all_offset; /* RRL register sets per DDR channel */ struct reg_rrl *reg_rrl_ddr; /* RRL register sets per HBM channel */ struct reg_rrl *reg_rrl_hbm[2];
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.