Commit 0a00fd5e authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki

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

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

The following commit has changed ACPICA table header definitions:

 Commit: 88f074f4
 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: default avatarLv 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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 7171511e
...@@ -69,11 +69,11 @@ static u32 l1_percpu_entry; ...@@ -69,11 +69,11 @@ static u32 l1_percpu_entry;
#define ELOG_ENTRY_ADDR(phyaddr) \ #define ELOG_ENTRY_ADDR(phyaddr) \
(phyaddr - elog_base + (u8 *)elog_addr) (phyaddr - elog_base + (u8 *)elog_addr)
static struct acpi_generic_status *extlog_elog_entry_check(int cpu, int bank) static struct acpi_hest_generic_status *extlog_elog_entry_check(int cpu, int bank)
{ {
int idx; int idx;
u64 data; u64 data;
struct acpi_generic_status *estatus; struct acpi_hest_generic_status *estatus;
WARN_ON(cpu < 0); WARN_ON(cpu < 0);
idx = ELOG_IDX(cpu, bank); idx = ELOG_IDX(cpu, bank);
...@@ -82,7 +82,7 @@ static struct acpi_generic_status *extlog_elog_entry_check(int cpu, int bank) ...@@ -82,7 +82,7 @@ static struct acpi_generic_status *extlog_elog_entry_check(int cpu, int bank)
return NULL; return NULL;
data &= EXT_ELOG_ENTRY_MASK; data &= EXT_ELOG_ENTRY_MASK;
estatus = (struct acpi_generic_status *)ELOG_ENTRY_ADDR(data); estatus = (struct acpi_hest_generic_status *)ELOG_ENTRY_ADDR(data);
/* if no valid data in elog entry, just return */ /* if no valid data in elog entry, just return */
if (estatus->block_status == 0) if (estatus->block_status == 0)
...@@ -92,7 +92,7 @@ static struct acpi_generic_status *extlog_elog_entry_check(int cpu, int bank) ...@@ -92,7 +92,7 @@ static struct acpi_generic_status *extlog_elog_entry_check(int cpu, int bank)
} }
static void __print_extlog_rcd(const char *pfx, static void __print_extlog_rcd(const char *pfx,
struct acpi_generic_status *estatus, int cpu) struct acpi_hest_generic_status *estatus, int cpu)
{ {
static atomic_t seqno; static atomic_t seqno;
unsigned int curr_seqno; unsigned int curr_seqno;
...@@ -111,7 +111,7 @@ static void __print_extlog_rcd(const char *pfx, ...@@ -111,7 +111,7 @@ static void __print_extlog_rcd(const char *pfx,
} }
static int print_extlog_rcd(const char *pfx, static int print_extlog_rcd(const char *pfx,
struct acpi_generic_status *estatus, int cpu) struct acpi_hest_generic_status *estatus, int cpu)
{ {
/* Not more than 2 messages every 5 seconds */ /* Not more than 2 messages every 5 seconds */
static DEFINE_RATELIMIT_STATE(ratelimit_corrected, 5*HZ, 2); static DEFINE_RATELIMIT_STATE(ratelimit_corrected, 5*HZ, 2);
...@@ -137,7 +137,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val, ...@@ -137,7 +137,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
struct mce *mce = (struct mce *)data; struct mce *mce = (struct mce *)data;
int bank = mce->bank; int bank = mce->bank;
int cpu = mce->extcpu; int cpu = mce->extcpu;
struct acpi_generic_status *estatus; struct acpi_hest_generic_status *estatus;
int rc; int rc;
estatus = extlog_elog_entry_check(cpu, bank); estatus = extlog_elog_entry_check(cpu, bank);
...@@ -148,7 +148,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val, ...@@ -148,7 +148,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
/* clear record status to enable BIOS to update it again */ /* clear record status to enable BIOS to update it again */
estatus->block_status = 0; estatus->block_status = 0;
rc = print_extlog_rcd(NULL, (struct acpi_generic_status *)elog_buf, cpu); rc = print_extlog_rcd(NULL, (struct acpi_hest_generic_status *)elog_buf, cpu);
return NOTIFY_STOP; return NOTIFY_STOP;
} }
......
...@@ -121,11 +121,11 @@ struct dentry; ...@@ -121,11 +121,11 @@ struct dentry;
struct dentry *apei_get_debugfs_dir(void); struct dentry *apei_get_debugfs_dir(void);
#define apei_estatus_for_each_section(estatus, section) \ #define apei_estatus_for_each_section(estatus, section) \
for (section = (struct acpi_generic_data *)(estatus + 1); \ for (section = (struct acpi_hest_generic_data *)(estatus + 1); \
(void *)section - (void *)estatus < estatus->data_length; \ (void *)section - (void *)estatus < estatus->data_length; \
section = (void *)(section+1) + section->error_data_length) section = (void *)(section+1) + section->error_data_length)
static inline u32 cper_estatus_len(struct acpi_generic_status *estatus) static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
{ {
if (estatus->raw_data_length) if (estatus->raw_data_length)
return estatus->raw_data_offset + \ return estatus->raw_data_offset + \
...@@ -135,9 +135,9 @@ static inline u32 cper_estatus_len(struct acpi_generic_status *estatus) ...@@ -135,9 +135,9 @@ static inline u32 cper_estatus_len(struct acpi_generic_status *estatus)
} }
void cper_estatus_print(const char *pfx, void cper_estatus_print(const char *pfx,
const struct acpi_generic_status *estatus); const struct acpi_hest_generic_status *estatus);
int cper_estatus_check_header(const struct acpi_generic_status *estatus); int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus);
int cper_estatus_check(const struct acpi_generic_status *estatus); int cper_estatus_check(const struct acpi_hest_generic_status *estatus);
int apei_osc_setup(void); int apei_osc_setup(void);
#endif #endif
...@@ -74,13 +74,13 @@ ...@@ -74,13 +74,13 @@
#define GHES_ESTATUS_CACHE_LEN(estatus_len) \ #define GHES_ESTATUS_CACHE_LEN(estatus_len) \
(sizeof(struct ghes_estatus_cache) + (estatus_len)) (sizeof(struct ghes_estatus_cache) + (estatus_len))
#define GHES_ESTATUS_FROM_CACHE(estatus_cache) \ #define GHES_ESTATUS_FROM_CACHE(estatus_cache) \
((struct acpi_generic_status *) \ ((struct acpi_hest_generic_status *) \
((struct ghes_estatus_cache *)(estatus_cache) + 1)) ((struct ghes_estatus_cache *)(estatus_cache) + 1))
#define GHES_ESTATUS_NODE_LEN(estatus_len) \ #define GHES_ESTATUS_NODE_LEN(estatus_len) \
(sizeof(struct ghes_estatus_node) + (estatus_len)) (sizeof(struct ghes_estatus_node) + (estatus_len))
#define GHES_ESTATUS_FROM_NODE(estatus_node) \ #define GHES_ESTATUS_FROM_NODE(estatus_node) \
((struct acpi_generic_status *) \ ((struct acpi_hest_generic_status *) \
((struct ghes_estatus_node *)(estatus_node) + 1)) ((struct ghes_estatus_node *)(estatus_node) + 1))
bool ghes_disable; bool ghes_disable;
...@@ -408,7 +408,7 @@ static void ghes_clear_estatus(struct ghes *ghes) ...@@ -408,7 +408,7 @@ static void ghes_clear_estatus(struct ghes *ghes)
ghes->flags &= ~GHES_TO_CLEAR; ghes->flags &= ~GHES_TO_CLEAR;
} }
static void ghes_handle_memory_failure(struct acpi_generic_data *gdata, int sev) static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int sev)
{ {
#ifdef CONFIG_ACPI_APEI_MEMORY_FAILURE #ifdef CONFIG_ACPI_APEI_MEMORY_FAILURE
unsigned long pfn; unsigned long pfn;
...@@ -441,10 +441,10 @@ static void ghes_handle_memory_failure(struct acpi_generic_data *gdata, int sev) ...@@ -441,10 +441,10 @@ static void ghes_handle_memory_failure(struct acpi_generic_data *gdata, int sev)
} }
static void ghes_do_proc(struct ghes *ghes, static void ghes_do_proc(struct ghes *ghes,
const struct acpi_generic_status *estatus) const struct acpi_hest_generic_status *estatus)
{ {
int sev, sec_sev; int sev, sec_sev;
struct acpi_generic_data *gdata; struct acpi_hest_generic_data *gdata;
sev = ghes_severity(estatus->error_severity); sev = ghes_severity(estatus->error_severity);
apei_estatus_for_each_section(estatus, gdata) { apei_estatus_for_each_section(estatus, gdata) {
...@@ -498,7 +498,7 @@ static void ghes_do_proc(struct ghes *ghes, ...@@ -498,7 +498,7 @@ static void ghes_do_proc(struct ghes *ghes,
static void __ghes_print_estatus(const char *pfx, static void __ghes_print_estatus(const char *pfx,
const struct acpi_hest_generic *generic, const struct acpi_hest_generic *generic,
const struct acpi_generic_status *estatus) const struct acpi_hest_generic_status *estatus)
{ {
static atomic_t seqno; static atomic_t seqno;
unsigned int curr_seqno; unsigned int curr_seqno;
...@@ -520,7 +520,7 @@ static void __ghes_print_estatus(const char *pfx, ...@@ -520,7 +520,7 @@ static void __ghes_print_estatus(const char *pfx,
static int ghes_print_estatus(const char *pfx, static int ghes_print_estatus(const char *pfx,
const struct acpi_hest_generic *generic, const struct acpi_hest_generic *generic,
const struct acpi_generic_status *estatus) const struct acpi_hest_generic_status *estatus)
{ {
/* Not more than 2 messages every 5 seconds */ /* Not more than 2 messages every 5 seconds */
static DEFINE_RATELIMIT_STATE(ratelimit_corrected, 5*HZ, 2); static DEFINE_RATELIMIT_STATE(ratelimit_corrected, 5*HZ, 2);
...@@ -542,13 +542,13 @@ static int ghes_print_estatus(const char *pfx, ...@@ -542,13 +542,13 @@ static int ghes_print_estatus(const char *pfx,
* GHES error status reporting throttle, to report more kinds of * GHES error status reporting throttle, to report more kinds of
* errors, instead of just most frequently occurred errors. * errors, instead of just most frequently occurred errors.
*/ */
static int ghes_estatus_cached(struct acpi_generic_status *estatus) static int ghes_estatus_cached(struct acpi_hest_generic_status *estatus)
{ {
u32 len; u32 len;
int i, cached = 0; int i, cached = 0;
unsigned long long now; unsigned long long now;
struct ghes_estatus_cache *cache; struct ghes_estatus_cache *cache;
struct acpi_generic_status *cache_estatus; struct acpi_hest_generic_status *cache_estatus;
len = cper_estatus_len(estatus); len = cper_estatus_len(estatus);
rcu_read_lock(); rcu_read_lock();
...@@ -573,12 +573,12 @@ static int ghes_estatus_cached(struct acpi_generic_status *estatus) ...@@ -573,12 +573,12 @@ static int ghes_estatus_cached(struct acpi_generic_status *estatus)
static struct ghes_estatus_cache *ghes_estatus_cache_alloc( static struct ghes_estatus_cache *ghes_estatus_cache_alloc(
struct acpi_hest_generic *generic, struct acpi_hest_generic *generic,
struct acpi_generic_status *estatus) struct acpi_hest_generic_status *estatus)
{ {
int alloced; int alloced;
u32 len, cache_len; u32 len, cache_len;
struct ghes_estatus_cache *cache; struct ghes_estatus_cache *cache;
struct acpi_generic_status *cache_estatus; struct acpi_hest_generic_status *cache_estatus;
alloced = atomic_add_return(1, &ghes_estatus_cache_alloced); alloced = atomic_add_return(1, &ghes_estatus_cache_alloced);
if (alloced > GHES_ESTATUS_CACHE_ALLOCED_MAX) { if (alloced > GHES_ESTATUS_CACHE_ALLOCED_MAX) {
...@@ -621,7 +621,7 @@ static void ghes_estatus_cache_rcu_free(struct rcu_head *head) ...@@ -621,7 +621,7 @@ static void ghes_estatus_cache_rcu_free(struct rcu_head *head)
static void ghes_estatus_cache_add( static void ghes_estatus_cache_add(
struct acpi_hest_generic *generic, struct acpi_hest_generic *generic,
struct acpi_generic_status *estatus) struct acpi_hest_generic_status *estatus)
{ {
int i, slot = -1, count; int i, slot = -1, count;
unsigned long long now, duration, period, max_period = 0; unsigned long long now, duration, period, max_period = 0;
...@@ -753,7 +753,7 @@ static void ghes_proc_in_irq(struct irq_work *irq_work) ...@@ -753,7 +753,7 @@ static void ghes_proc_in_irq(struct irq_work *irq_work)
struct llist_node *llnode, *next; struct llist_node *llnode, *next;
struct ghes_estatus_node *estatus_node; struct ghes_estatus_node *estatus_node;
struct acpi_hest_generic *generic; struct acpi_hest_generic *generic;
struct acpi_generic_status *estatus; struct acpi_hest_generic_status *estatus;
u32 len, node_len; u32 len, node_len;
llnode = llist_del_all(&ghes_estatus_llist); llnode = llist_del_all(&ghes_estatus_llist);
...@@ -786,7 +786,7 @@ static void ghes_print_queued_estatus(void) ...@@ -786,7 +786,7 @@ static void ghes_print_queued_estatus(void)
struct llist_node *llnode; struct llist_node *llnode;
struct ghes_estatus_node *estatus_node; struct ghes_estatus_node *estatus_node;
struct acpi_hest_generic *generic; struct acpi_hest_generic *generic;
struct acpi_generic_status *estatus; struct acpi_hest_generic_status *estatus;
u32 len, node_len; u32 len, node_len;
llnode = llist_del_all(&ghes_estatus_llist); llnode = llist_del_all(&ghes_estatus_llist);
...@@ -845,7 +845,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) ...@@ -845,7 +845,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG #ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
u32 len, node_len; u32 len, node_len;
struct ghes_estatus_node *estatus_node; struct ghes_estatus_node *estatus_node;
struct acpi_generic_status *estatus; struct acpi_hest_generic_status *estatus;
#endif #endif
if (!(ghes->flags & GHES_TO_CLEAR)) if (!(ghes->flags & GHES_TO_CLEAR))
continue; continue;
...@@ -925,7 +925,7 @@ static int ghes_probe(struct platform_device *ghes_dev) ...@@ -925,7 +925,7 @@ static int ghes_probe(struct platform_device *ghes_dev)
rc = -EIO; rc = -EIO;
if (generic->error_block_length < if (generic->error_block_length <
sizeof(struct acpi_generic_status)) { sizeof(struct acpi_hest_generic_status)) {
pr_warning(FW_BUG GHES_PFX "Invalid error block length: %u for generic hardware error source: %d\n", pr_warning(FW_BUG GHES_PFX "Invalid error block length: %u for generic hardware error source: %d\n",
generic->error_block_length, generic->error_block_length,
generic->header.source_id); generic->header.source_id);
......
...@@ -262,7 +262,7 @@ static const char *cper_pcie_port_type_strs[] = { ...@@ -262,7 +262,7 @@ static const char *cper_pcie_port_type_strs[] = {
}; };
static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie,
const struct acpi_generic_data *gdata) const struct acpi_hest_generic_data *gdata)
{ {
if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE) if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE)
printk("%s""port_type: %d, %s\n", pfx, pcie->port_type, printk("%s""port_type: %d, %s\n", pfx, pcie->port_type,
...@@ -298,7 +298,7 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, ...@@ -298,7 +298,7 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie,
} }
static void cper_estatus_print_section( static void cper_estatus_print_section(
const char *pfx, const struct acpi_generic_data *gdata, int sec_no) const char *pfx, const struct acpi_hest_generic_data *gdata, int sec_no)
{ {
uuid_le *sec_type = (uuid_le *)gdata->section_type; uuid_le *sec_type = (uuid_le *)gdata->section_type;
__u16 severity; __u16 severity;
...@@ -344,9 +344,9 @@ static void cper_estatus_print_section( ...@@ -344,9 +344,9 @@ static void cper_estatus_print_section(
} }
void cper_estatus_print(const char *pfx, void cper_estatus_print(const char *pfx,
const struct acpi_generic_status *estatus) const struct acpi_hest_generic_status *estatus)
{ {
struct acpi_generic_data *gdata; struct acpi_hest_generic_data *gdata;
unsigned int data_len, gedata_len; unsigned int data_len, gedata_len;
int sec_no = 0; int sec_no = 0;
char newpfx[64]; char newpfx[64];
...@@ -359,7 +359,7 @@ void cper_estatus_print(const char *pfx, ...@@ -359,7 +359,7 @@ void cper_estatus_print(const char *pfx,
"and requires no further action"); "and requires no further action");
printk("%s""event severity: %s\n", pfx, cper_severity_str(severity)); printk("%s""event severity: %s\n", pfx, cper_severity_str(severity));
data_len = estatus->data_length; data_len = estatus->data_length;
gdata = (struct acpi_generic_data *)(estatus + 1); gdata = (struct acpi_hest_generic_data *)(estatus + 1);
snprintf(newpfx, sizeof(newpfx), "%s%s", pfx, INDENT_SP); snprintf(newpfx, sizeof(newpfx), "%s%s", pfx, INDENT_SP);
while (data_len >= sizeof(*gdata)) { while (data_len >= sizeof(*gdata)) {
gedata_len = gdata->error_data_length; gedata_len = gdata->error_data_length;
...@@ -371,10 +371,10 @@ void cper_estatus_print(const char *pfx, ...@@ -371,10 +371,10 @@ void cper_estatus_print(const char *pfx,
} }
EXPORT_SYMBOL_GPL(cper_estatus_print); EXPORT_SYMBOL_GPL(cper_estatus_print);
int cper_estatus_check_header(const struct acpi_generic_status *estatus) int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus)
{ {
if (estatus->data_length && if (estatus->data_length &&
estatus->data_length < sizeof(struct acpi_generic_data)) estatus->data_length < sizeof(struct acpi_hest_generic_data))
return -EINVAL; return -EINVAL;
if (estatus->raw_data_length && if (estatus->raw_data_length &&
estatus->raw_data_offset < sizeof(*estatus) + estatus->data_length) estatus->raw_data_offset < sizeof(*estatus) + estatus->data_length)
...@@ -384,9 +384,9 @@ int cper_estatus_check_header(const struct acpi_generic_status *estatus) ...@@ -384,9 +384,9 @@ int cper_estatus_check_header(const struct acpi_generic_status *estatus)
} }
EXPORT_SYMBOL_GPL(cper_estatus_check_header); EXPORT_SYMBOL_GPL(cper_estatus_check_header);
int cper_estatus_check(const struct acpi_generic_status *estatus) int cper_estatus_check(const struct acpi_hest_generic_status *estatus)
{ {
struct acpi_generic_data *gdata; struct acpi_hest_generic_data *gdata;
unsigned int data_len, gedata_len; unsigned int data_len, gedata_len;
int rc; int rc;
...@@ -394,7 +394,7 @@ int cper_estatus_check(const struct acpi_generic_status *estatus) ...@@ -394,7 +394,7 @@ int cper_estatus_check(const struct acpi_generic_status *estatus)
if (rc) if (rc)
return rc; return rc;
data_len = estatus->data_length; data_len = estatus->data_length;
gdata = (struct acpi_generic_data *)(estatus + 1); gdata = (struct acpi_hest_generic_data *)(estatus + 1);
while (data_len >= sizeof(*gdata)) { while (data_len >= sizeof(*gdata)) {
gedata_len = gdata->error_data_length; gedata_len = gdata->error_data_length;
if (gedata_len > data_len - sizeof(*gdata)) if (gedata_len > data_len - sizeof(*gdata))
......
...@@ -604,7 +604,7 @@ struct acpi_hest_generic { ...@@ -604,7 +604,7 @@ struct acpi_hest_generic {
/* Generic Error Status block */ /* Generic Error Status block */
struct acpi_generic_status { struct acpi_hest_generic_status {
u32 block_status; u32 block_status;
u32 raw_data_offset; u32 raw_data_offset;
u32 raw_data_length; u32 raw_data_length;
...@@ -614,15 +614,15 @@ struct acpi_generic_status { ...@@ -614,15 +614,15 @@ struct acpi_generic_status {
/* Values for block_status flags above */ /* Values for block_status flags above */
#define ACPI_GEN_ERR_UC BIT(0) #define ACPI_HEST_UNCORRECTABLE (1)
#define ACPI_GEN_ERR_CE BIT(1) #define ACPI_HEST_CORRECTABLE (1<<1)
#define ACPI_GEN_ERR_MULTI_UC BIT(2) #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
#define ACPI_GEN_ERR_MULTI_CE BIT(3) #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
#define ACPI_GEN_ERR_COUNT_SHIFT (0xFF<<4) /* 8 bits, error count */ #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
/* Generic Error Data entry */ /* Generic Error Data entry */
struct acpi_generic_data { struct acpi_hest_generic_data {
u8 section_type[16]; u8 section_type[16];
u32 error_severity; u32 error_severity;
u16 revision; u16 revision;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
struct ghes { struct ghes {
struct acpi_hest_generic *generic; struct acpi_hest_generic *generic;
struct acpi_generic_status *estatus; struct acpi_hest_generic_status *estatus;
u64 buffer_paddr; u64 buffer_paddr;
unsigned long flags; unsigned long flags;
union { union {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment