Pablo Greco 7b2c62
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
Pablo Greco 7b2c62
From: Al Stone <ahs3@redhat.com>
Pablo Greco 7b2c62
Date: Tue, 27 Feb 2018 00:21:23 -0500
Pablo Greco 7b2c62
Subject: [PATCH] ACPI: APEI: arm64: Ignore broken HPE moonshot APEI support
Pablo Greco 7b2c62
Pablo Greco 7b2c62
Message-id: <20180227002123.21608-1-ahs3@redhat.com>
Pablo Greco 7b2c62
Patchwork-id: 206052
Pablo Greco 7b2c62
O-Subject: [RHEL8 BZ1518076 PATCH] ACPI: APEI: arm64: Ignore broken HPE moonshot APEI support
Pablo Greco 7b2c62
Bugzilla: 1518076
Pablo Greco 7b2c62
RH-Acked-by: Mark Salter <msalter@redhat.com>
Pablo Greco 7b2c62
RH-Acked-by: Jeremy McNicoll <jmcnicol@redhat.com>
Pablo Greco 7b2c62
Pablo Greco 7b2c62
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1518076
Pablo Greco 7b2c62
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=15417197
Pablo Greco 7b2c62
Tested: compile-only; several other patches are required for full booting
Pablo Greco 7b2c62
        QE has tested limited boot (see comment#12 of BZ)
Pablo Greco 7b2c62
Pablo Greco 7b2c62
This is a re-post of a RHEL-ALT-7.5 patch specific to aarch64 moonshots
Pablo Greco 7b2c62
that we use in beaker.  It is required for these machines to boot.
Pablo Greco 7b2c62
Pablo Greco 7b2c62
    commit 8a663a264863efedf8bb4a9d76ac603920fdd739
Pablo Greco 7b2c62
    Author: Robert Richter <rrichter@redhat.com>
Pablo Greco 7b2c62
    Date:   Wed Aug 16 19:49:30 2017 -0400
Pablo Greco 7b2c62
Pablo Greco 7b2c62
    [acpi] APEI: arm64: Ignore broken HPE moonshot APEI support
Pablo Greco 7b2c62
Pablo Greco 7b2c62
    From: Mark Salter <msalter@redhat.com>
Pablo Greco 7b2c62
    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1344237
Pablo Greco 7b2c62
    Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13768971
Pablo Greco 7b2c62
    Tested: Booted on moonshot with patched 4.11.0-20 kernel
Pablo Greco 7b2c62
    Upstream: RHEL-only
Pablo Greco 7b2c62
Pablo Greco 7b2c62
    The aarch64 HP moonshot platforms we have in beaker and elsewhere have
Pablo Greco 7b2c62
    a firmware bug which causes a spurious fatal memory error via APEI at
Pablo Greco 7b2c62
    boot time. This platform is no longer supported and no further firmware
Pablo Greco 7b2c62
    updates are expected. This is a downstream-only hack to avoid the problem
Pablo Greco 7b2c62
    by bailing out of HEST table probing if we detect a moonshot HEST table.
Pablo Greco 7b2c62
Pablo Greco 7b2c62
    Signed-off-by: Mark Salter <msalter@redhat.com>
Pablo Greco 7b2c62
    Signed-off-by: Robert Richter <rrichter@redhat.com>
Pablo Greco 7b2c62
    Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
Pablo Greco 7b2c62
Pablo Greco 7b2c62
Upstream Status: RHEL only
Pablo Greco 7b2c62
Signed-off-by: Al Stone <ahs3@redhat.com>
Pablo Greco 7b2c62
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
Pablo Greco 7b2c62
---
Pablo Greco 7b2c62
 drivers/acpi/apei/hest.c | 8 ++++++++
Pablo Greco 7b2c62
 1 file changed, 8 insertions(+)
Pablo Greco 7b2c62
Pablo Greco 7b2c62
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
Pablo Greco 7b2c62
index 6e980fe16772..37bc003e7a83 100644
Pablo Greco 7b2c62
--- a/drivers/acpi/apei/hest.c
Pablo Greco 7b2c62
+++ b/drivers/acpi/apei/hest.c
Pablo Greco 7b2c62
@@ -88,6 +88,14 @@ int apei_hest_parse(apei_hest_func_t func, void *data)
Pablo Greco 7b2c62
 	if (hest_disable || !hest_tab)
Pablo Greco 7b2c62
 		return -EINVAL;
Pablo Greco 7b2c62
Pablo Greco 7b2c62
+#ifdef CONFIG_ARM64
Pablo Greco 7b2c62
+	/* Ignore broken firmware */
Pablo Greco 7b2c62
+	if (!strncmp(hest_tab->header.oem_id, "HPE   ", 6) &&
Pablo Greco 7b2c62
+	    !strncmp(hest_tab->header.oem_table_id, "ProLiant", 8) &&
Pablo Greco 7b2c62
+	    MIDR_IMPLEMENTOR(read_cpuid_id()) == ARM_CPU_IMP_APM)
Pablo Greco 7b2c62
+		return -EINVAL;
Pablo Greco 7b2c62
+#endif
Pablo Greco 7b2c62
+
Pablo Greco 7b2c62
 	hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
Pablo Greco 7b2c62
 	for (i = 0; i < hest_tab->error_source_count; i++) {
Pablo Greco 7b2c62
 		len = hest_esrc_len(hest_hdr);
Pablo Greco 7b2c62
-- 
Pablo Greco 7b2c62
2.28.0
Pablo Greco 7b2c62