aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/apei/apei-internal.h12
-rw-r--r--drivers/acpi/apei/cper.c58
-rw-r--r--drivers/acpi/apei/ghes.c54
-rw-r--r--include/acpi/actbl1.h14
-rw-r--r--include/acpi/ghes.h2
-rw-r--r--include/linux/cper.h2
6 files changed, 71 insertions, 71 deletions
diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
index f220d642136e..21ba34a73883 100644
--- a/drivers/acpi/apei/apei-internal.h
+++ b/drivers/acpi/apei/apei-internal.h
@@ -122,11 +122,11 @@ struct dentry;
122struct dentry *apei_get_debugfs_dir(void); 122struct dentry *apei_get_debugfs_dir(void);
123 123
124#define apei_estatus_for_each_section(estatus, section) \ 124#define apei_estatus_for_each_section(estatus, section) \
125 for (section = (struct acpi_hest_generic_data *)(estatus + 1); \ 125 for (section = (struct acpi_generic_data *)(estatus + 1); \
126 (void *)section - (void *)estatus < estatus->data_length; \ 126 (void *)section - (void *)estatus < estatus->data_length; \
127 section = (void *)(section+1) + section->error_data_length) 127 section = (void *)(section+1) + section->error_data_length)
128 128
129static inline u32 apei_estatus_len(struct acpi_hest_generic_status *estatus) 129static inline u32 cper_estatus_len(struct acpi_generic_status *estatus)
130{ 130{
131 if (estatus->raw_data_length) 131 if (estatus->raw_data_length)
132 return estatus->raw_data_offset + \ 132 return estatus->raw_data_offset + \
@@ -135,10 +135,10 @@ static inline u32 apei_estatus_len(struct acpi_hest_generic_status *estatus)
135 return sizeof(*estatus) + estatus->data_length; 135 return sizeof(*estatus) + estatus->data_length;
136} 136}
137 137
138void apei_estatus_print(const char *pfx, 138void cper_estatus_print(const char *pfx,
139 const struct acpi_hest_generic_status *estatus); 139 const struct acpi_generic_status *estatus);
140int apei_estatus_check_header(const struct acpi_hest_generic_status *estatus); 140int cper_estatus_check_header(const struct acpi_generic_status *estatus);
141int apei_estatus_check(const struct acpi_hest_generic_status *estatus); 141int cper_estatus_check(const struct acpi_generic_status *estatus);
142 142
143int apei_osc_setup(void); 143int apei_osc_setup(void);
144#endif 144#endif
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
index f827f02bfbe8..eb5f6d6d7dbc 100644
--- a/drivers/acpi/apei/cper.c
+++ b/drivers/acpi/apei/cper.c
@@ -5,7 +5,7 @@
5 * Author: Huang Ying <ying.huang@intel.com> 5 * Author: Huang Ying <ying.huang@intel.com>
6 * 6 *
7 * CPER is the format used to describe platform hardware error by 7 * CPER is the format used to describe platform hardware error by
8 * various APEI tables, such as ERST, BERT and HEST etc. 8 * various tables, such as ERST, BERT and HEST etc.
9 * 9 *
10 * For more information about CPER, please refer to Appendix N of UEFI 10 * For more information about CPER, please refer to Appendix N of UEFI
11 * Specification version 2.3. 11 * Specification version 2.3.
@@ -73,7 +73,7 @@ static const char *cper_severity_str(unsigned int severity)
73 * printed, with @pfx is printed at the beginning of each line. 73 * printed, with @pfx is printed at the beginning of each line.
74 */ 74 */
75void cper_print_bits(const char *pfx, unsigned int bits, 75void cper_print_bits(const char *pfx, unsigned int bits,
76 const char *strs[], unsigned int strs_size) 76 const char * const strs[], unsigned int strs_size)
77{ 77{
78 int i, len = 0; 78 int i, len = 0;
79 const char *str; 79 const char *str;
@@ -98,32 +98,32 @@ void cper_print_bits(const char *pfx, unsigned int bits,
98 printk("%s\n", buf); 98 printk("%s\n", buf);
99} 99}
100 100
101static const char *cper_proc_type_strs[] = { 101static const char * const cper_proc_type_strs[] = {
102 "IA32/X64", 102 "IA32/X64",
103 "IA64", 103 "IA64",
104}; 104};
105 105
106static const char *cper_proc_isa_strs[] = { 106static const char * const cper_proc_isa_strs[] = {
107 "IA32", 107 "IA32",
108 "IA64", 108 "IA64",
109 "X64", 109 "X64",
110}; 110};
111 111
112static const char *cper_proc_error_type_strs[] = { 112static const char * const cper_proc_error_type_strs[] = {
113 "cache error", 113 "cache error",
114 "TLB error", 114 "TLB error",
115 "bus error", 115 "bus error",
116 "micro-architectural error", 116 "micro-architectural error",
117}; 117};
118 118
119static const char *cper_proc_op_strs[] = { 119static const char * const cper_proc_op_strs[] = {
120 "unknown or generic", 120 "unknown or generic",
121 "data read", 121 "data read",
122 "data write", 122 "data write",
123 "instruction execution", 123 "instruction execution",
124}; 124};
125 125
126static const char *cper_proc_flag_strs[] = { 126static const char * const cper_proc_flag_strs[] = {
127 "restartable", 127 "restartable",
128 "precise IP", 128 "precise IP",
129 "overflow", 129 "overflow",
@@ -248,7 +248,7 @@ static const char *cper_pcie_port_type_strs[] = {
248}; 248};
249 249
250static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, 250static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie,
251 const struct acpi_hest_generic_data *gdata) 251 const struct acpi_generic_data *gdata)
252{ 252{
253 if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE) 253 if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE)
254 printk("%s""port_type: %d, %s\n", pfx, pcie->port_type, 254 printk("%s""port_type: %d, %s\n", pfx, pcie->port_type,
@@ -283,17 +283,17 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie,
283 pfx, pcie->bridge.secondary_status, pcie->bridge.control); 283 pfx, pcie->bridge.secondary_status, pcie->bridge.control);
284} 284}
285 285
286static const char *apei_estatus_section_flag_strs[] = { 286static const char * const cper_estatus_section_flag_strs[] = {
287 "primary", 287 "primary",
288 "containment warning", 288 "containment warning",
289 "reset", 289 "reset",
290 "threshold exceeded", 290 "error threshold exceeded",
291 "resource not accessible", 291 "resource not accessible",
292 "latent error", 292 "latent error",
293}; 293};
294 294
295static void apei_estatus_print_section( 295static void cper_estatus_print_section(
296 const char *pfx, const struct acpi_hest_generic_data *gdata, int sec_no) 296 const char *pfx, const struct acpi_generic_data *gdata, int sec_no)
297{ 297{
298 uuid_le *sec_type = (uuid_le *)gdata->section_type; 298 uuid_le *sec_type = (uuid_le *)gdata->section_type;
299 __u16 severity; 299 __u16 severity;
@@ -302,8 +302,8 @@ static void apei_estatus_print_section(
302 printk("%s""section: %d, severity: %d, %s\n", pfx, sec_no, severity, 302 printk("%s""section: %d, severity: %d, %s\n", pfx, sec_no, severity,
303 cper_severity_str(severity)); 303 cper_severity_str(severity));
304 printk("%s""flags: 0x%02x\n", pfx, gdata->flags); 304 printk("%s""flags: 0x%02x\n", pfx, gdata->flags);
305 cper_print_bits(pfx, gdata->flags, apei_estatus_section_flag_strs, 305 cper_print_bits(pfx, gdata->flags, cper_estatus_section_flag_strs,
306 ARRAY_SIZE(apei_estatus_section_flag_strs)); 306 ARRAY_SIZE(cper_estatus_section_flag_strs));
307 if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID) 307 if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID)
308 printk("%s""fru_id: %pUl\n", pfx, (uuid_le *)gdata->fru_id); 308 printk("%s""fru_id: %pUl\n", pfx, (uuid_le *)gdata->fru_id);
309 if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT) 309 if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT)
@@ -339,34 +339,34 @@ err_section_too_small:
339 pr_err(FW_WARN "error section length is too small\n"); 339 pr_err(FW_WARN "error section length is too small\n");
340} 340}
341 341
342void apei_estatus_print(const char *pfx, 342void cper_estatus_print(const char *pfx,
343 const struct acpi_hest_generic_status *estatus) 343 const struct acpi_generic_status *estatus)
344{ 344{
345 struct acpi_hest_generic_data *gdata; 345 struct acpi_generic_data *gdata;
346 unsigned int data_len, gedata_len; 346 unsigned int data_len, gedata_len;
347 int sec_no = 0; 347 int sec_no = 0;
348 __u16 severity; 348 __u16 severity;
349 349
350 printk("%s""APEI generic hardware error status\n", pfx); 350 printk("%s""Generic Hardware Error Status\n", pfx);
351 severity = estatus->error_severity; 351 severity = estatus->error_severity;
352 printk("%s""severity: %d, %s\n", pfx, severity, 352 printk("%s""severity: %d, %s\n", pfx, severity,
353 cper_severity_str(severity)); 353 cper_severity_str(severity));
354 data_len = estatus->data_length; 354 data_len = estatus->data_length;
355 gdata = (struct acpi_hest_generic_data *)(estatus + 1); 355 gdata = (struct acpi_generic_data *)(estatus + 1);
356 while (data_len >= sizeof(*gdata)) { 356 while (data_len >= sizeof(*gdata)) {
357 gedata_len = gdata->error_data_length; 357 gedata_len = gdata->error_data_length;
358 apei_estatus_print_section(pfx, gdata, sec_no); 358 cper_estatus_print_section(pfx, gdata, sec_no);
359 data_len -= gedata_len + sizeof(*gdata); 359 data_len -= gedata_len + sizeof(*gdata);
360 gdata = (void *)(gdata + 1) + gedata_len; 360 gdata = (void *)(gdata + 1) + gedata_len;
361 sec_no++; 361 sec_no++;
362 } 362 }
363} 363}
364EXPORT_SYMBOL_GPL(apei_estatus_print); 364EXPORT_SYMBOL_GPL(cper_estatus_print);
365 365
366int apei_estatus_check_header(const struct acpi_hest_generic_status *estatus) 366int cper_estatus_check_header(const struct acpi_generic_status *estatus)
367{ 367{
368 if (estatus->data_length && 368 if (estatus->data_length &&
369 estatus->data_length < sizeof(struct acpi_hest_generic_data)) 369 estatus->data_length < sizeof(struct acpi_generic_data))
370 return -EINVAL; 370 return -EINVAL;
371 if (estatus->raw_data_length && 371 if (estatus->raw_data_length &&
372 estatus->raw_data_offset < sizeof(*estatus) + estatus->data_length) 372 estatus->raw_data_offset < sizeof(*estatus) + estatus->data_length)
@@ -374,19 +374,19 @@ int apei_estatus_check_header(const struct acpi_hest_generic_status *estatus)
374 374
375 return 0; 375 return 0;
376} 376}
377EXPORT_SYMBOL_GPL(apei_estatus_check_header); 377EXPORT_SYMBOL_GPL(cper_estatus_check_header);
378 378
379int apei_estatus_check(const struct acpi_hest_generic_status *estatus) 379int cper_estatus_check(const struct acpi_generic_status *estatus)
380{ 380{
381 struct acpi_hest_generic_data *gdata; 381 struct acpi_generic_data *gdata;
382 unsigned int data_len, gedata_len; 382 unsigned int data_len, gedata_len;
383 int rc; 383 int rc;
384 384
385 rc = apei_estatus_check_header(estatus); 385 rc = cper_estatus_check_header(estatus);
386 if (rc) 386 if (rc)
387 return rc; 387 return rc;
388 data_len = estatus->data_length; 388 data_len = estatus->data_length;
389 gdata = (struct acpi_hest_generic_data *)(estatus + 1); 389 gdata = (struct acpi_generic_data *)(estatus + 1);
390 while (data_len >= sizeof(*gdata)) { 390 while (data_len >= sizeof(*gdata)) {
391 gedata_len = gdata->error_data_length; 391 gedata_len = gdata->error_data_length;
392 if (gedata_len > data_len - sizeof(*gdata)) 392 if (gedata_len > data_len - sizeof(*gdata))
@@ -399,4 +399,4 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)
399 399
400 return 0; 400 return 0;
401} 401}
402EXPORT_SYMBOL_GPL(apei_estatus_check); 402EXPORT_SYMBOL_GPL(cper_estatus_check);
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 8ec37bbdd699..0db6e4ff6501 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -75,13 +75,13 @@
75#define GHES_ESTATUS_CACHE_LEN(estatus_len) \ 75#define GHES_ESTATUS_CACHE_LEN(estatus_len) \
76 (sizeof(struct ghes_estatus_cache) + (estatus_len)) 76 (sizeof(struct ghes_estatus_cache) + (estatus_len))
77#define GHES_ESTATUS_FROM_CACHE(estatus_cache) \ 77#define GHES_ESTATUS_FROM_CACHE(estatus_cache) \
78 ((struct acpi_hest_generic_status *) \ 78 ((struct acpi_generic_status *) \
79 ((struct ghes_estatus_cache *)(estatus_cache) + 1)) 79 ((struct ghes_estatus_cache *)(estatus_cache) + 1))
80 80
81#define GHES_ESTATUS_NODE_LEN(estatus_len) \ 81#define GHES_ESTATUS_NODE_LEN(estatus_len) \
82 (sizeof(struct ghes_estatus_node) + (estatus_len)) 82 (sizeof(struct ghes_estatus_node) + (estatus_len))
83#define GHES_ESTATUS_FROM_NODE(estatus_node) \ 83#define GHES_ESTATUS_FROM_NODE(estatus_node) \
84 ((struct acpi_hest_generic_status *) \ 84 ((struct acpi_generic_status *) \
85 ((struct ghes_estatus_node *)(estatus_node) + 1)) 85 ((struct ghes_estatus_node *)(estatus_node) + 1))
86 86
87bool ghes_disable; 87bool ghes_disable;
@@ -378,17 +378,17 @@ static int ghes_read_estatus(struct ghes *ghes, int silent)
378 ghes->flags |= GHES_TO_CLEAR; 378 ghes->flags |= GHES_TO_CLEAR;
379 379
380 rc = -EIO; 380 rc = -EIO;
381 len = apei_estatus_len(ghes->estatus); 381 len = cper_estatus_len(ghes->estatus);
382 if (len < sizeof(*ghes->estatus)) 382 if (len < sizeof(*ghes->estatus))
383 goto err_read_block; 383 goto err_read_block;
384 if (len > ghes->generic->error_block_length) 384 if (len > ghes->generic->error_block_length)
385 goto err_read_block; 385 goto err_read_block;
386 if (apei_estatus_check_header(ghes->estatus)) 386 if (cper_estatus_check_header(ghes->estatus))
387 goto err_read_block; 387 goto err_read_block;
388 ghes_copy_tofrom_phys(ghes->estatus + 1, 388 ghes_copy_tofrom_phys(ghes->estatus + 1,
389 buf_paddr + sizeof(*ghes->estatus), 389 buf_paddr + sizeof(*ghes->estatus),
390 len - sizeof(*ghes->estatus), 1); 390 len - sizeof(*ghes->estatus), 1);
391 if (apei_estatus_check(ghes->estatus)) 391 if (cper_estatus_check(ghes->estatus))
392 goto err_read_block; 392 goto err_read_block;
393 rc = 0; 393 rc = 0;
394 394
@@ -409,7 +409,7 @@ static void ghes_clear_estatus(struct ghes *ghes)
409 ghes->flags &= ~GHES_TO_CLEAR; 409 ghes->flags &= ~GHES_TO_CLEAR;
410} 410}
411 411
412static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int sev) 412static void ghes_handle_memory_failure(struct acpi_generic_data *gdata, int sev)
413{ 413{
414#ifdef CONFIG_ACPI_APEI_MEMORY_FAILURE 414#ifdef CONFIG_ACPI_APEI_MEMORY_FAILURE
415 unsigned long pfn; 415 unsigned long pfn;
@@ -438,10 +438,10 @@ static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int
438} 438}
439 439
440static void ghes_do_proc(struct ghes *ghes, 440static void ghes_do_proc(struct ghes *ghes,
441 const struct acpi_hest_generic_status *estatus) 441 const struct acpi_generic_status *estatus)
442{ 442{
443 int sev, sec_sev; 443 int sev, sec_sev;
444 struct acpi_hest_generic_data *gdata; 444 struct acpi_generic_data *gdata;
445 445
446 sev = ghes_severity(estatus->error_severity); 446 sev = ghes_severity(estatus->error_severity);
447 apei_estatus_for_each_section(estatus, gdata) { 447 apei_estatus_for_each_section(estatus, gdata) {
@@ -496,7 +496,7 @@ static void ghes_do_proc(struct ghes *ghes,
496 496
497static void __ghes_print_estatus(const char *pfx, 497static void __ghes_print_estatus(const char *pfx,
498 const struct acpi_hest_generic *generic, 498 const struct acpi_hest_generic *generic,
499 const struct acpi_hest_generic_status *estatus) 499 const struct acpi_generic_status *estatus)
500{ 500{
501 static atomic_t seqno; 501 static atomic_t seqno;
502 unsigned int curr_seqno; 502 unsigned int curr_seqno;
@@ -513,12 +513,12 @@ static void __ghes_print_estatus(const char *pfx,
513 snprintf(pfx_seq, sizeof(pfx_seq), "%s{%u}" HW_ERR, pfx, curr_seqno); 513 snprintf(pfx_seq, sizeof(pfx_seq), "%s{%u}" HW_ERR, pfx, curr_seqno);
514 printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n", 514 printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n",
515 pfx_seq, generic->header.source_id); 515 pfx_seq, generic->header.source_id);
516 apei_estatus_print(pfx_seq, estatus); 516 cper_estatus_print(pfx_seq, estatus);
517} 517}
518 518
519static int ghes_print_estatus(const char *pfx, 519static int ghes_print_estatus(const char *pfx,
520 const struct acpi_hest_generic *generic, 520 const struct acpi_hest_generic *generic,
521 const struct acpi_hest_generic_status *estatus) 521 const struct acpi_generic_status *estatus)
522{ 522{
523 /* Not more than 2 messages every 5 seconds */ 523 /* Not more than 2 messages every 5 seconds */
524 static DEFINE_RATELIMIT_STATE(ratelimit_corrected, 5*HZ, 2); 524 static DEFINE_RATELIMIT_STATE(ratelimit_corrected, 5*HZ, 2);
@@ -540,15 +540,15 @@ static int ghes_print_estatus(const char *pfx,
540 * GHES error status reporting throttle, to report more kinds of 540 * GHES error status reporting throttle, to report more kinds of
541 * errors, instead of just most frequently occurred errors. 541 * errors, instead of just most frequently occurred errors.
542 */ 542 */
543static int ghes_estatus_cached(struct acpi_hest_generic_status *estatus) 543static int ghes_estatus_cached(struct acpi_generic_status *estatus)
544{ 544{
545 u32 len; 545 u32 len;
546 int i, cached = 0; 546 int i, cached = 0;
547 unsigned long long now; 547 unsigned long long now;
548 struct ghes_estatus_cache *cache; 548 struct ghes_estatus_cache *cache;
549 struct acpi_hest_generic_status *cache_estatus; 549 struct acpi_generic_status *cache_estatus;
550 550
551 len = apei_estatus_len(estatus); 551 len = cper_estatus_len(estatus);
552 rcu_read_lock(); 552 rcu_read_lock();
553 for (i = 0; i < GHES_ESTATUS_CACHES_SIZE; i++) { 553 for (i = 0; i < GHES_ESTATUS_CACHES_SIZE; i++) {
554 cache = rcu_dereference(ghes_estatus_caches[i]); 554 cache = rcu_dereference(ghes_estatus_caches[i]);
@@ -571,19 +571,19 @@ static int ghes_estatus_cached(struct acpi_hest_generic_status *estatus)
571 571
572static struct ghes_estatus_cache *ghes_estatus_cache_alloc( 572static struct ghes_estatus_cache *ghes_estatus_cache_alloc(
573 struct acpi_hest_generic *generic, 573 struct acpi_hest_generic *generic,
574 struct acpi_hest_generic_status *estatus) 574 struct acpi_generic_status *estatus)
575{ 575{
576 int alloced; 576 int alloced;
577 u32 len, cache_len; 577 u32 len, cache_len;
578 struct ghes_estatus_cache *cache; 578 struct ghes_estatus_cache *cache;
579 struct acpi_hest_generic_status *cache_estatus; 579 struct acpi_generic_status *cache_estatus;
580 580
581 alloced = atomic_add_return(1, &ghes_estatus_cache_alloced); 581 alloced = atomic_add_return(1, &ghes_estatus_cache_alloced);
582 if (alloced > GHES_ESTATUS_CACHE_ALLOCED_MAX) { 582 if (alloced > GHES_ESTATUS_CACHE_ALLOCED_MAX) {
583 atomic_dec(&ghes_estatus_cache_alloced); 583 atomic_dec(&ghes_estatus_cache_alloced);
584 return NULL; 584 return NULL;
585 } 585 }
586 len = apei_estatus_len(estatus); 586 len = cper_estatus_len(estatus);
587 cache_len = GHES_ESTATUS_CACHE_LEN(len); 587 cache_len = GHES_ESTATUS_CACHE_LEN(len);
588 cache = (void *)gen_pool_alloc(ghes_estatus_pool, cache_len); 588 cache = (void *)gen_pool_alloc(ghes_estatus_pool, cache_len);
589 if (!cache) { 589 if (!cache) {
@@ -603,7 +603,7 @@ static void ghes_estatus_cache_free(struct ghes_estatus_cache *cache)
603{ 603{
604 u32 len; 604 u32 len;
605 605
606 len = apei_estatus_len(GHES_ESTATUS_FROM_CACHE(cache)); 606 len = cper_estatus_len(GHES_ESTATUS_FROM_CACHE(cache));
607 len = GHES_ESTATUS_CACHE_LEN(len); 607 len = GHES_ESTATUS_CACHE_LEN(len);
608 gen_pool_free(ghes_estatus_pool, (unsigned long)cache, len); 608 gen_pool_free(ghes_estatus_pool, (unsigned long)cache, len);
609 atomic_dec(&ghes_estatus_cache_alloced); 609 atomic_dec(&ghes_estatus_cache_alloced);
@@ -619,7 +619,7 @@ static void ghes_estatus_cache_rcu_free(struct rcu_head *head)
619 619
620static void ghes_estatus_cache_add( 620static void ghes_estatus_cache_add(
621 struct acpi_hest_generic *generic, 621 struct acpi_hest_generic *generic,
622 struct acpi_hest_generic_status *estatus) 622 struct acpi_generic_status *estatus)
623{ 623{
624 int i, slot = -1, count; 624 int i, slot = -1, count;
625 unsigned long long now, duration, period, max_period = 0; 625 unsigned long long now, duration, period, max_period = 0;
@@ -751,7 +751,7 @@ static void ghes_proc_in_irq(struct irq_work *irq_work)
751 struct llist_node *llnode, *next; 751 struct llist_node *llnode, *next;
752 struct ghes_estatus_node *estatus_node; 752 struct ghes_estatus_node *estatus_node;
753 struct acpi_hest_generic *generic; 753 struct acpi_hest_generic *generic;
754 struct acpi_hest_generic_status *estatus; 754 struct acpi_generic_status *estatus;
755 u32 len, node_len; 755 u32 len, node_len;
756 756
757 llnode = llist_del_all(&ghes_estatus_llist); 757 llnode = llist_del_all(&ghes_estatus_llist);
@@ -765,7 +765,7 @@ static void ghes_proc_in_irq(struct irq_work *irq_work)
765 estatus_node = llist_entry(llnode, struct ghes_estatus_node, 765 estatus_node = llist_entry(llnode, struct ghes_estatus_node,
766 llnode); 766 llnode);
767 estatus = GHES_ESTATUS_FROM_NODE(estatus_node); 767 estatus = GHES_ESTATUS_FROM_NODE(estatus_node);
768 len = apei_estatus_len(estatus); 768 len = cper_estatus_len(estatus);
769 node_len = GHES_ESTATUS_NODE_LEN(len); 769 node_len = GHES_ESTATUS_NODE_LEN(len);
770 ghes_do_proc(estatus_node->ghes, estatus); 770 ghes_do_proc(estatus_node->ghes, estatus);
771 if (!ghes_estatus_cached(estatus)) { 771 if (!ghes_estatus_cached(estatus)) {
@@ -784,7 +784,7 @@ static void ghes_print_queued_estatus(void)
784 struct llist_node *llnode; 784 struct llist_node *llnode;
785 struct ghes_estatus_node *estatus_node; 785 struct ghes_estatus_node *estatus_node;
786 struct acpi_hest_generic *generic; 786 struct acpi_hest_generic *generic;
787 struct acpi_hest_generic_status *estatus; 787 struct acpi_generic_status *estatus;
788 u32 len, node_len; 788 u32 len, node_len;
789 789
790 llnode = llist_del_all(&ghes_estatus_llist); 790 llnode = llist_del_all(&ghes_estatus_llist);
@@ -797,7 +797,7 @@ static void ghes_print_queued_estatus(void)
797 estatus_node = llist_entry(llnode, struct ghes_estatus_node, 797 estatus_node = llist_entry(llnode, struct ghes_estatus_node,
798 llnode); 798 llnode);
799 estatus = GHES_ESTATUS_FROM_NODE(estatus_node); 799 estatus = GHES_ESTATUS_FROM_NODE(estatus_node);
800 len = apei_estatus_len(estatus); 800 len = cper_estatus_len(estatus);
801 node_len = GHES_ESTATUS_NODE_LEN(len); 801 node_len = GHES_ESTATUS_NODE_LEN(len);
802 generic = estatus_node->generic; 802 generic = estatus_node->generic;
803 ghes_print_estatus(NULL, generic, estatus); 803 ghes_print_estatus(NULL, generic, estatus);
@@ -843,7 +843,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
843#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG 843#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
844 u32 len, node_len; 844 u32 len, node_len;
845 struct ghes_estatus_node *estatus_node; 845 struct ghes_estatus_node *estatus_node;
846 struct acpi_hest_generic_status *estatus; 846 struct acpi_generic_status *estatus;
847#endif 847#endif
848 if (!(ghes->flags & GHES_TO_CLEAR)) 848 if (!(ghes->flags & GHES_TO_CLEAR))
849 continue; 849 continue;
@@ -851,7 +851,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
851 if (ghes_estatus_cached(ghes->estatus)) 851 if (ghes_estatus_cached(ghes->estatus))
852 goto next; 852 goto next;
853 /* Save estatus for further processing in IRQ context */ 853 /* Save estatus for further processing in IRQ context */
854 len = apei_estatus_len(ghes->estatus); 854 len = cper_estatus_len(ghes->estatus);
855 node_len = GHES_ESTATUS_NODE_LEN(len); 855 node_len = GHES_ESTATUS_NODE_LEN(len);
856 estatus_node = (void *)gen_pool_alloc(ghes_estatus_pool, 856 estatus_node = (void *)gen_pool_alloc(ghes_estatus_pool,
857 node_len); 857 node_len);
@@ -923,7 +923,7 @@ static int ghes_probe(struct platform_device *ghes_dev)
923 923
924 rc = -EIO; 924 rc = -EIO;
925 if (generic->error_block_length < 925 if (generic->error_block_length <
926 sizeof(struct acpi_hest_generic_status)) { 926 sizeof(struct acpi_generic_status)) {
927 pr_warning(FW_BUG GHES_PFX "Invalid error block length: %u for generic hardware error source: %d\n", 927 pr_warning(FW_BUG GHES_PFX "Invalid error block length: %u for generic hardware error source: %d\n",
928 generic->error_block_length, 928 generic->error_block_length,
929 generic->header.source_id); 929 generic->header.source_id);
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 0bd750ebeb49..556c83ee6b42 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -596,7 +596,7 @@ struct acpi_hest_generic {
596 596
597/* Generic Error Status block */ 597/* Generic Error Status block */
598 598
599struct acpi_hest_generic_status { 599struct acpi_generic_status {
600 u32 block_status; 600 u32 block_status;
601 u32 raw_data_offset; 601 u32 raw_data_offset;
602 u32 raw_data_length; 602 u32 raw_data_length;
@@ -606,15 +606,15 @@ struct acpi_hest_generic_status {
606 606
607/* Values for block_status flags above */ 607/* Values for block_status flags above */
608 608
609#define ACPI_HEST_UNCORRECTABLE (1) 609#define ACPI_GEN_ERR_UC BIT(0)
610#define ACPI_HEST_CORRECTABLE (1<<1) 610#define ACPI_GEN_ERR_CE BIT(1)
611#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2) 611#define ACPI_GEN_ERR_MULTI_UC BIT(2)
612#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3) 612#define ACPI_GEN_ERR_MULTI_CE BIT(3)
613#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ 613#define ACPI_GEN_ERR_COUNT_SHIFT (0xFF<<4) /* 8 bits, error count */
614 614
615/* Generic Error Data entry */ 615/* Generic Error Data entry */
616 616
617struct acpi_hest_generic_data { 617struct acpi_generic_data {
618 u8 section_type[16]; 618 u8 section_type[16];
619 u32 error_severity; 619 u32 error_severity;
620 u16 revision; 620 u16 revision;
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
index 720446cb243e..dfd60d0bfd27 100644
--- a/include/acpi/ghes.h
+++ b/include/acpi/ghes.h
@@ -14,7 +14,7 @@
14 14
15struct ghes { 15struct ghes {
16 struct acpi_hest_generic *generic; 16 struct acpi_hest_generic *generic;
17 struct acpi_hest_generic_status *estatus; 17 struct acpi_generic_status *estatus;
18 u64 buffer_paddr; 18 u64 buffer_paddr;
19 unsigned long flags; 19 unsigned long flags;
20 union { 20 union {
diff --git a/include/linux/cper.h b/include/linux/cper.h
index c23049496531..09ebe2113641 100644
--- a/include/linux/cper.h
+++ b/include/linux/cper.h
@@ -389,6 +389,6 @@ struct cper_sec_pcie {
389 389
390u64 cper_next_record_id(void); 390u64 cper_next_record_id(void);
391void cper_print_bits(const char *prefix, unsigned int bits, 391void cper_print_bits(const char *prefix, unsigned int bits,
392 const char *strs[], unsigned int strs_size); 392 const char * const strs[], unsigned int strs_size);
393 393
394#endif 394#endif