Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPICA: Restore error table definitions to reduce code differences between Linux and ACPICA upstream.

The following commit has changed ACPICA table header definitions:

Commit: 88f074f4871a8c212b212b725e4dcdcdb09613c1
Subject: ACPI, CPER: Update cper info

While such definitions are currently maintained in ACPICA. As the
modifications applying to the table definitions affect other OSPMs'
drivers, it is very difficult for ACPICA to initiate a process to
complete the merge. Thus this commit finally only leaves us divergences.

Revert such naming modifications to reduce the source code differecnes
between Linux and ACPICA upstream. No functional changes.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Cc: Bob Moore <robert.moore@intel.com>
Cc: Chen, Gong <gong.chen@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Lv Zheng and committed by
Rafael J. Wysocki
0a00fd5e 7171511e

+46 -46
+7 -7
drivers/acpi/acpi_extlog.c
··· 69 69 #define ELOG_ENTRY_ADDR(phyaddr) \ 70 70 (phyaddr - elog_base + (u8 *)elog_addr) 71 71 72 - static struct acpi_generic_status *extlog_elog_entry_check(int cpu, int bank) 72 + static struct acpi_hest_generic_status *extlog_elog_entry_check(int cpu, int bank) 73 73 { 74 74 int idx; 75 75 u64 data; 76 - struct acpi_generic_status *estatus; 76 + struct acpi_hest_generic_status *estatus; 77 77 78 78 WARN_ON(cpu < 0); 79 79 idx = ELOG_IDX(cpu, bank); ··· 82 82 return NULL; 83 83 84 84 data &= EXT_ELOG_ENTRY_MASK; 85 - estatus = (struct acpi_generic_status *)ELOG_ENTRY_ADDR(data); 85 + estatus = (struct acpi_hest_generic_status *)ELOG_ENTRY_ADDR(data); 86 86 87 87 /* if no valid data in elog entry, just return */ 88 88 if (estatus->block_status == 0) ··· 92 92 } 93 93 94 94 static void __print_extlog_rcd(const char *pfx, 95 - struct acpi_generic_status *estatus, int cpu) 95 + struct acpi_hest_generic_status *estatus, int cpu) 96 96 { 97 97 static atomic_t seqno; 98 98 unsigned int curr_seqno; ··· 111 111 } 112 112 113 113 static int print_extlog_rcd(const char *pfx, 114 - struct acpi_generic_status *estatus, int cpu) 114 + struct acpi_hest_generic_status *estatus, int cpu) 115 115 { 116 116 /* Not more than 2 messages every 5 seconds */ 117 117 static DEFINE_RATELIMIT_STATE(ratelimit_corrected, 5*HZ, 2); ··· 137 137 struct mce *mce = (struct mce *)data; 138 138 int bank = mce->bank; 139 139 int cpu = mce->extcpu; 140 - struct acpi_generic_status *estatus; 140 + struct acpi_hest_generic_status *estatus; 141 141 int rc; 142 142 143 143 estatus = extlog_elog_entry_check(cpu, bank); ··· 148 148 /* clear record status to enable BIOS to update it again */ 149 149 estatus->block_status = 0; 150 150 151 - rc = print_extlog_rcd(NULL, (struct acpi_generic_status *)elog_buf, cpu); 151 + rc = print_extlog_rcd(NULL, (struct acpi_hest_generic_status *)elog_buf, cpu); 152 152 153 153 return NOTIFY_STOP; 154 154 }
+5 -5
drivers/acpi/apei/apei-internal.h
··· 121 121 struct dentry *apei_get_debugfs_dir(void); 122 122 123 123 #define apei_estatus_for_each_section(estatus, section) \ 124 - for (section = (struct acpi_generic_data *)(estatus + 1); \ 124 + for (section = (struct acpi_hest_generic_data *)(estatus + 1); \ 125 125 (void *)section - (void *)estatus < estatus->data_length; \ 126 126 section = (void *)(section+1) + section->error_data_length) 127 127 128 - static inline u32 cper_estatus_len(struct acpi_generic_status *estatus) 128 + static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus) 129 129 { 130 130 if (estatus->raw_data_length) 131 131 return estatus->raw_data_offset + \ ··· 135 135 } 136 136 137 137 void cper_estatus_print(const char *pfx, 138 - const struct acpi_generic_status *estatus); 139 - int cper_estatus_check_header(const struct acpi_generic_status *estatus); 140 - int cper_estatus_check(const struct acpi_generic_status *estatus); 138 + const struct acpi_hest_generic_status *estatus); 139 + int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus); 140 + int cper_estatus_check(const struct acpi_hest_generic_status *estatus); 141 141 142 142 int apei_osc_setup(void); 143 143 #endif
+16 -16
drivers/acpi/apei/ghes.c
··· 74 74 #define GHES_ESTATUS_CACHE_LEN(estatus_len) \ 75 75 (sizeof(struct ghes_estatus_cache) + (estatus_len)) 76 76 #define GHES_ESTATUS_FROM_CACHE(estatus_cache) \ 77 - ((struct acpi_generic_status *) \ 77 + ((struct acpi_hest_generic_status *) \ 78 78 ((struct ghes_estatus_cache *)(estatus_cache) + 1)) 79 79 80 80 #define GHES_ESTATUS_NODE_LEN(estatus_len) \ 81 81 (sizeof(struct ghes_estatus_node) + (estatus_len)) 82 82 #define GHES_ESTATUS_FROM_NODE(estatus_node) \ 83 - ((struct acpi_generic_status *) \ 83 + ((struct acpi_hest_generic_status *) \ 84 84 ((struct ghes_estatus_node *)(estatus_node) + 1)) 85 85 86 86 bool ghes_disable; ··· 408 408 ghes->flags &= ~GHES_TO_CLEAR; 409 409 } 410 410 411 - static void ghes_handle_memory_failure(struct acpi_generic_data *gdata, int sev) 411 + static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int sev) 412 412 { 413 413 #ifdef CONFIG_ACPI_APEI_MEMORY_FAILURE 414 414 unsigned long pfn; ··· 441 441 } 442 442 443 443 static void ghes_do_proc(struct ghes *ghes, 444 - const struct acpi_generic_status *estatus) 444 + const struct acpi_hest_generic_status *estatus) 445 445 { 446 446 int sev, sec_sev; 447 - struct acpi_generic_data *gdata; 447 + struct acpi_hest_generic_data *gdata; 448 448 449 449 sev = ghes_severity(estatus->error_severity); 450 450 apei_estatus_for_each_section(estatus, gdata) { ··· 498 498 499 499 static void __ghes_print_estatus(const char *pfx, 500 500 const struct acpi_hest_generic *generic, 501 - const struct acpi_generic_status *estatus) 501 + const struct acpi_hest_generic_status *estatus) 502 502 { 503 503 static atomic_t seqno; 504 504 unsigned int curr_seqno; ··· 520 520 521 521 static int ghes_print_estatus(const char *pfx, 522 522 const struct acpi_hest_generic *generic, 523 - const struct acpi_generic_status *estatus) 523 + const struct acpi_hest_generic_status *estatus) 524 524 { 525 525 /* Not more than 2 messages every 5 seconds */ 526 526 static DEFINE_RATELIMIT_STATE(ratelimit_corrected, 5*HZ, 2); ··· 542 542 * GHES error status reporting throttle, to report more kinds of 543 543 * errors, instead of just most frequently occurred errors. 544 544 */ 545 - static int ghes_estatus_cached(struct acpi_generic_status *estatus) 545 + static int ghes_estatus_cached(struct acpi_hest_generic_status *estatus) 546 546 { 547 547 u32 len; 548 548 int i, cached = 0; 549 549 unsigned long long now; 550 550 struct ghes_estatus_cache *cache; 551 - struct acpi_generic_status *cache_estatus; 551 + struct acpi_hest_generic_status *cache_estatus; 552 552 553 553 len = cper_estatus_len(estatus); 554 554 rcu_read_lock(); ··· 573 573 574 574 static struct ghes_estatus_cache *ghes_estatus_cache_alloc( 575 575 struct acpi_hest_generic *generic, 576 - struct acpi_generic_status *estatus) 576 + struct acpi_hest_generic_status *estatus) 577 577 { 578 578 int alloced; 579 579 u32 len, cache_len; 580 580 struct ghes_estatus_cache *cache; 581 - struct acpi_generic_status *cache_estatus; 581 + struct acpi_hest_generic_status *cache_estatus; 582 582 583 583 alloced = atomic_add_return(1, &ghes_estatus_cache_alloced); 584 584 if (alloced > GHES_ESTATUS_CACHE_ALLOCED_MAX) { ··· 621 621 622 622 static void ghes_estatus_cache_add( 623 623 struct acpi_hest_generic *generic, 624 - struct acpi_generic_status *estatus) 624 + struct acpi_hest_generic_status *estatus) 625 625 { 626 626 int i, slot = -1, count; 627 627 unsigned long long now, duration, period, max_period = 0; ··· 753 753 struct llist_node *llnode, *next; 754 754 struct ghes_estatus_node *estatus_node; 755 755 struct acpi_hest_generic *generic; 756 - struct acpi_generic_status *estatus; 756 + struct acpi_hest_generic_status *estatus; 757 757 u32 len, node_len; 758 758 759 759 llnode = llist_del_all(&ghes_estatus_llist); ··· 786 786 struct llist_node *llnode; 787 787 struct ghes_estatus_node *estatus_node; 788 788 struct acpi_hest_generic *generic; 789 - struct acpi_generic_status *estatus; 789 + struct acpi_hest_generic_status *estatus; 790 790 u32 len, node_len; 791 791 792 792 llnode = llist_del_all(&ghes_estatus_llist); ··· 845 845 #ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG 846 846 u32 len, node_len; 847 847 struct ghes_estatus_node *estatus_node; 848 - struct acpi_generic_status *estatus; 848 + struct acpi_hest_generic_status *estatus; 849 849 #endif 850 850 if (!(ghes->flags & GHES_TO_CLEAR)) 851 851 continue; ··· 925 925 926 926 rc = -EIO; 927 927 if (generic->error_block_length < 928 - sizeof(struct acpi_generic_status)) { 928 + sizeof(struct acpi_hest_generic_status)) { 929 929 pr_warning(FW_BUG GHES_PFX "Invalid error block length: %u for generic hardware error source: %d\n", 930 930 generic->error_block_length, 931 931 generic->header.source_id);
+10 -10
drivers/firmware/efi/cper.c
··· 262 262 }; 263 263 264 264 static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, 265 - const struct acpi_generic_data *gdata) 265 + const struct acpi_hest_generic_data *gdata) 266 266 { 267 267 if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE) 268 268 printk("%s""port_type: %d, %s\n", pfx, pcie->port_type, ··· 298 298 } 299 299 300 300 static void cper_estatus_print_section( 301 - const char *pfx, const struct acpi_generic_data *gdata, int sec_no) 301 + const char *pfx, const struct acpi_hest_generic_data *gdata, int sec_no) 302 302 { 303 303 uuid_le *sec_type = (uuid_le *)gdata->section_type; 304 304 __u16 severity; ··· 344 344 } 345 345 346 346 void cper_estatus_print(const char *pfx, 347 - const struct acpi_generic_status *estatus) 347 + const struct acpi_hest_generic_status *estatus) 348 348 { 349 - struct acpi_generic_data *gdata; 349 + struct acpi_hest_generic_data *gdata; 350 350 unsigned int data_len, gedata_len; 351 351 int sec_no = 0; 352 352 char newpfx[64]; ··· 359 359 "and requires no further action"); 360 360 printk("%s""event severity: %s\n", pfx, cper_severity_str(severity)); 361 361 data_len = estatus->data_length; 362 - gdata = (struct acpi_generic_data *)(estatus + 1); 362 + gdata = (struct acpi_hest_generic_data *)(estatus + 1); 363 363 snprintf(newpfx, sizeof(newpfx), "%s%s", pfx, INDENT_SP); 364 364 while (data_len >= sizeof(*gdata)) { 365 365 gedata_len = gdata->error_data_length; ··· 371 371 } 372 372 EXPORT_SYMBOL_GPL(cper_estatus_print); 373 373 374 - int cper_estatus_check_header(const struct acpi_generic_status *estatus) 374 + int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus) 375 375 { 376 376 if (estatus->data_length && 377 - estatus->data_length < sizeof(struct acpi_generic_data)) 377 + estatus->data_length < sizeof(struct acpi_hest_generic_data)) 378 378 return -EINVAL; 379 379 if (estatus->raw_data_length && 380 380 estatus->raw_data_offset < sizeof(*estatus) + estatus->data_length) ··· 384 384 } 385 385 EXPORT_SYMBOL_GPL(cper_estatus_check_header); 386 386 387 - int cper_estatus_check(const struct acpi_generic_status *estatus) 387 + int cper_estatus_check(const struct acpi_hest_generic_status *estatus) 388 388 { 389 - struct acpi_generic_data *gdata; 389 + struct acpi_hest_generic_data *gdata; 390 390 unsigned int data_len, gedata_len; 391 391 int rc; 392 392 ··· 394 394 if (rc) 395 395 return rc; 396 396 data_len = estatus->data_length; 397 - gdata = (struct acpi_generic_data *)(estatus + 1); 397 + gdata = (struct acpi_hest_generic_data *)(estatus + 1); 398 398 while (data_len >= sizeof(*gdata)) { 399 399 gedata_len = gdata->error_data_length; 400 400 if (gedata_len > data_len - sizeof(*gdata))
+7 -7
include/acpi/actbl1.h
··· 604 604 605 605 /* Generic Error Status block */ 606 606 607 - struct acpi_generic_status { 607 + struct acpi_hest_generic_status { 608 608 u32 block_status; 609 609 u32 raw_data_offset; 610 610 u32 raw_data_length; ··· 614 614 615 615 /* Values for block_status flags above */ 616 616 617 - #define ACPI_GEN_ERR_UC BIT(0) 618 - #define ACPI_GEN_ERR_CE BIT(1) 619 - #define ACPI_GEN_ERR_MULTI_UC BIT(2) 620 - #define ACPI_GEN_ERR_MULTI_CE BIT(3) 621 - #define ACPI_GEN_ERR_COUNT_SHIFT (0xFF<<4) /* 8 bits, error count */ 617 + #define ACPI_HEST_UNCORRECTABLE (1) 618 + #define ACPI_HEST_CORRECTABLE (1<<1) 619 + #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2) 620 + #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3) 621 + #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ 622 622 623 623 /* Generic Error Data entry */ 624 624 625 - struct acpi_generic_data { 625 + struct acpi_hest_generic_data { 626 626 u8 section_type[16]; 627 627 u32 error_severity; 628 628 u16 revision;
+1 -1
include/acpi/ghes.h
··· 14 14 15 15 struct ghes { 16 16 struct acpi_hest_generic *generic; 17 - struct acpi_generic_status *estatus; 17 + struct acpi_hest_generic_status *estatus; 18 18 u64 buffer_paddr; 19 19 unsigned long flags; 20 20 union {