|
40 | 40 | #define MCI_STATUS_AR (1ULL<<55) /* Action required */ |
41 | 41 |
|
42 | 42 | /* AMD-specific bits */ |
| 43 | +#define MCI_STATUS_TCC (1ULL<<55) /* Task context corrupt */ |
| 44 | +#define MCI_STATUS_SYNDV (1ULL<<53) /* synd reg. valid */ |
43 | 45 | #define MCI_STATUS_DEFERRED (1ULL<<44) /* uncorrected error, deferred exception */ |
44 | 46 | #define MCI_STATUS_POISON (1ULL<<43) /* access poisonous data */ |
45 | | -#define MCI_STATUS_TCC (1ULL<<55) /* Task context corrupt */ |
46 | 47 |
|
47 | 48 | /* |
48 | 49 | * McaX field if set indicates a given bank supports MCA extensions: |
|
110 | 111 | #define MSR_AMD64_SMCA_MC0_MISC0 0xc0002003 |
111 | 112 | #define MSR_AMD64_SMCA_MC0_CONFIG 0xc0002004 |
112 | 113 | #define MSR_AMD64_SMCA_MC0_IPID 0xc0002005 |
| 114 | +#define MSR_AMD64_SMCA_MC0_SYND 0xc0002006 |
113 | 115 | #define MSR_AMD64_SMCA_MC0_DESTAT 0xc0002008 |
114 | 116 | #define MSR_AMD64_SMCA_MC0_DEADDR 0xc0002009 |
115 | 117 | #define MSR_AMD64_SMCA_MC0_MISC1 0xc000200a |
|
119 | 121 | #define MSR_AMD64_SMCA_MCx_MISC(x) (MSR_AMD64_SMCA_MC0_MISC0 + 0x10*(x)) |
120 | 122 | #define MSR_AMD64_SMCA_MCx_CONFIG(x) (MSR_AMD64_SMCA_MC0_CONFIG + 0x10*(x)) |
121 | 123 | #define MSR_AMD64_SMCA_MCx_IPID(x) (MSR_AMD64_SMCA_MC0_IPID + 0x10*(x)) |
| 124 | +#define MSR_AMD64_SMCA_MCx_SYND(x) (MSR_AMD64_SMCA_MC0_SYND + 0x10*(x)) |
122 | 125 | #define MSR_AMD64_SMCA_MCx_DESTAT(x) (MSR_AMD64_SMCA_MC0_DESTAT + 0x10*(x)) |
123 | 126 | #define MSR_AMD64_SMCA_MCx_DEADDR(x) (MSR_AMD64_SMCA_MC0_DEADDR + 0x10*(x)) |
124 | 127 | #define MSR_AMD64_SMCA_MCx_MISCy(x, y) ((MSR_AMD64_SMCA_MC0_MISC1 + y) + (0x10*(x))) |
@@ -334,44 +337,47 @@ extern void apei_mce_report_mem_error(int corrected, |
334 | 337 | * Scalable MCA. |
335 | 338 | */ |
336 | 339 | #ifdef CONFIG_X86_MCE_AMD |
337 | | -enum amd_ip_types { |
338 | | - SMCA_F17H_CORE = 0, /* Core errors */ |
339 | | - SMCA_DF, /* Data Fabric */ |
340 | | - SMCA_UMC, /* Unified Memory Controller */ |
341 | | - SMCA_PB, /* Parameter Block */ |
342 | | - SMCA_PSP, /* Platform Security Processor */ |
343 | | - SMCA_SMU, /* System Management Unit */ |
344 | | - N_AMD_IP_TYPES |
345 | | -}; |
346 | | - |
347 | | -struct amd_hwid { |
348 | | - const char *name; |
349 | | - unsigned int hwid; |
350 | | -}; |
351 | | - |
352 | | -extern struct amd_hwid amd_hwids[N_AMD_IP_TYPES]; |
353 | 340 |
|
354 | | -enum amd_core_mca_blocks { |
| 341 | +/* These may be used by multiple smca_hwid_mcatypes */ |
| 342 | +enum smca_bank_types { |
355 | 343 | SMCA_LS = 0, /* Load Store */ |
356 | 344 | SMCA_IF, /* Instruction Fetch */ |
357 | | - SMCA_L2_CACHE, /* L2 cache */ |
358 | | - SMCA_DE, /* Decoder unit */ |
359 | | - RES, /* Reserved */ |
360 | | - SMCA_EX, /* Execution unit */ |
| 345 | + SMCA_L2_CACHE, /* L2 Cache */ |
| 346 | + SMCA_DE, /* Decoder Unit */ |
| 347 | + SMCA_EX, /* Execution Unit */ |
361 | 348 | SMCA_FP, /* Floating Point */ |
362 | | - SMCA_L3_CACHE, /* L3 cache */ |
363 | | - N_CORE_MCA_BLOCKS |
| 349 | + SMCA_L3_CACHE, /* L3 Cache */ |
| 350 | + SMCA_CS, /* Coherent Slave */ |
| 351 | + SMCA_PIE, /* Power, Interrupts, etc. */ |
| 352 | + SMCA_UMC, /* Unified Memory Controller */ |
| 353 | + SMCA_PB, /* Parameter Block */ |
| 354 | + SMCA_PSP, /* Platform Security Processor */ |
| 355 | + SMCA_SMU, /* System Management Unit */ |
| 356 | + N_SMCA_BANK_TYPES |
364 | 357 | }; |
365 | 358 |
|
366 | | -extern const char * const amd_core_mcablock_names[N_CORE_MCA_BLOCKS]; |
| 359 | +struct smca_bank_name { |
| 360 | + const char *name; /* Short name for sysfs */ |
| 361 | + const char *long_name; /* Long name for pretty-printing */ |
| 362 | +}; |
| 363 | + |
| 364 | +extern struct smca_bank_name smca_bank_names[N_SMCA_BANK_TYPES]; |
| 365 | + |
| 366 | +#define HWID_MCATYPE(hwid, mcatype) ((hwid << 16) | mcatype) |
367 | 367 |
|
368 | | -enum amd_df_mca_blocks { |
369 | | - SMCA_CS = 0, /* Coherent Slave */ |
370 | | - SMCA_PIE, /* Power management, Interrupts, etc */ |
371 | | - N_DF_BLOCKS |
| 368 | +struct smca_hwid_mcatype { |
| 369 | + unsigned int bank_type; /* Use with smca_bank_types for easy indexing. */ |
| 370 | + u32 hwid_mcatype; /* (hwid,mcatype) tuple */ |
| 371 | + u32 xec_bitmap; /* Bitmap of valid ExtErrorCodes; current max is 21. */ |
372 | 372 | }; |
373 | 373 |
|
374 | | -extern const char * const amd_df_mcablock_names[N_DF_BLOCKS]; |
| 374 | +struct smca_bank_info { |
| 375 | + struct smca_hwid_mcatype *type; |
| 376 | + u32 type_instance; |
| 377 | +}; |
| 378 | + |
| 379 | +extern struct smca_bank_info smca_banks[MAX_NR_BANKS]; |
| 380 | + |
375 | 381 | #endif |
376 | 382 |
|
377 | 383 | #endif /* _ASM_X86_MCE_H */ |
0 commit comments