提交 9f9a35a7 编写于 作者: T Tomasz Nowicki 提交者: Rafael J. Wysocki

ACPI / APEI / ARM64: APEI initial support for ARM64

This patch provides APEI arch-specific bits for ARM64

Meanwhile,
 (1) Move HEST type (ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) checking to
     a generic place.
 (2) Select HAVE_ACPI_APEI when EFI and ACPI is set on ARM64, because
     arch_apei_get_mem_attribute is using efi_mem_attributes() on
     ARM64.
Signed-off-by: NTomasz Nowicki <tomasz.nowicki@linaro.org>
Tested-by: NJonathan (Zhixiong) Zhang <zjzhang@codeaurora.org>
Signed-off-by: NFu Wei <fu.wei@linaro.org>
[ Fu Wei: improve && upstream ]
Acked-by: NHanjun Guo <hanjun.guo@linaro.org>
Tested-by: NTyler Baicar <tbaicar@codeaurora.org>
Acked-by: NWill Deacon <will.deacon@arm.com>
Reviewed-by: NBorislav Petkov <bp@suse.de>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 a545715d
...@@ -52,6 +52,7 @@ config ARM64 ...@@ -52,6 +52,7 @@ config ARM64
select GENERIC_TIME_VSYSCALL select GENERIC_TIME_VSYSCALL
select HANDLE_DOMAIN_IRQ select HANDLE_DOMAIN_IRQ
select HARDIRQS_SW_RESEND select HARDIRQS_SW_RESEND
select HAVE_ACPI_APEI if (ACPI && EFI)
select HAVE_ALIGNED_STRUCT_PAGE if SLUB select HAVE_ALIGNED_STRUCT_PAGE if SLUB
select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_AUDITSYSCALL
select HAVE_ARCH_BITREVERSE select HAVE_ARCH_BITREVERSE
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <asm/cputype.h> #include <asm/cputype.h>
#include <asm/smp_plat.h> #include <asm/smp_plat.h>
#include <asm/tlbflush.h>
/* Macros for consistency checks of the GICC subtable of MADT */ /* Macros for consistency checks of the GICC subtable of MADT */
#define ACPI_MADT_GICC_LENGTH \ #define ACPI_MADT_GICC_LENGTH \
...@@ -114,8 +115,28 @@ static inline const char *acpi_get_enable_method(int cpu) ...@@ -114,8 +115,28 @@ static inline const char *acpi_get_enable_method(int cpu)
} }
#ifdef CONFIG_ACPI_APEI #ifdef CONFIG_ACPI_APEI
/*
* acpi_disable_cmcff is used in drivers/acpi/apei/hest.c for disabling
* IA-32 Architecture Corrected Machine Check (CMC) Firmware-First mode
* with a kernel command line parameter "acpi=nocmcoff". But we don't
* have this IA-32 specific feature on ARM64, this definition is only
* for compatibility.
*/
#define acpi_disable_cmcff 1
pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr); pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr);
#endif
/*
* Despite its name, this function must still broadcast the TLB
* invalidation in order to ensure other CPUs don't end up with junk
* entries as a result of speculation. Unusually, its also called in
* IRQ context (ghes_iounmap_irq) so if we ever need to use IPIs for
* TLB broadcasting, then we're in trouble here.
*/
static inline void arch_apei_flush_tlb_one(unsigned long addr)
{
flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
}
#endif /* CONFIG_ACPI_APEI */
#ifdef CONFIG_ACPI_NUMA #ifdef CONFIG_ACPI_NUMA
int arm64_acpi_numa_init(void); int arm64_acpi_numa_init(void);
......
...@@ -24,9 +24,6 @@ int arch_apei_enable_cmcff(struct acpi_hest_header *hest_hdr, void *data) ...@@ -24,9 +24,6 @@ int arch_apei_enable_cmcff(struct acpi_hest_header *hest_hdr, void *data)
struct acpi_hest_ia_corrected *cmc; struct acpi_hest_ia_corrected *cmc;
struct acpi_hest_ia_error_bank *mc_bank; struct acpi_hest_ia_error_bank *mc_bank;
if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
return 0;
cmc = (struct acpi_hest_ia_corrected *)hest_hdr; cmc = (struct acpi_hest_ia_corrected *)hest_hdr;
if (!cmc->enabled) if (!cmc->enabled)
return 0; return 0;
......
...@@ -123,7 +123,13 @@ EXPORT_SYMBOL_GPL(apei_hest_parse); ...@@ -123,7 +123,13 @@ EXPORT_SYMBOL_GPL(apei_hest_parse);
*/ */
static int __init hest_parse_cmc(struct acpi_hest_header *hest_hdr, void *data) static int __init hest_parse_cmc(struct acpi_hest_header *hest_hdr, void *data)
{ {
return arch_apei_enable_cmcff(hest_hdr, data); if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
return 0;
if (!acpi_disable_cmcff)
return !arch_apei_enable_cmcff(hest_hdr, data);
return 0;
} }
struct ghes_arr { struct ghes_arr {
...@@ -232,8 +238,9 @@ void __init acpi_hest_init(void) ...@@ -232,8 +238,9 @@ void __init acpi_hest_init(void)
goto err; goto err;
} }
if (!acpi_disable_cmcff) rc = apei_hest_parse(hest_parse_cmc, NULL);
apei_hest_parse(hest_parse_cmc, NULL); if (rc)
goto err;
if (!ghes_disable) { if (!ghes_disable) {
rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count); rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册