From: Hanjun Guo <guohanjun@huawei.com>
To: <me@ahmedabdelfattah.dev>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Shuai Xue <xueshuai@linux.alibaba.com>,
Len Brown <lenb@kernel.org>, Will Deacon <will@kernel.org>
Cc: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<stable@vger.kernel.org>
Subject: Re: [PATCH] ACPI: APEI: Don't disable HEST for a disabled IA-32 CMC structure
Date: Thu, 3 Dec 2026 20:56:28 +0800 [thread overview]
Message-ID: <1ad32efd-8e1c-c0a7-205e-bd3ff4912554@huawei.com> (raw)
In-Reply-To: <20261119-acpi-hest-cmc-disabled-v1-1-87644a1bf0ca@ahmedabdelfattah.dev>
On 2026/11/20 2:35, Ahmed Abdelfattah via B4 Relay wrote:
> From: Ahmed Abdelfattah <me@ahmedabdelfattah.dev>
>
> On x86, a HEST whose IA-32 Architecture Corrected Machine Check
> structure has Enabled = 0 makes acpi_hest_init() give up on the whole
> table. hest_disable is set to HEST_DISABLED, no GHES device is
> registered, and every other error source in the table is ignored. The
> only trace of it is "GHES: HEST is not enabled!".
>
> arch_apei_enable_cmcff() returns 0 for a disabled structure and 1
> otherwise. hest_parse_cmc() returns the negation, so a disabled
> structure stops apei_hest_parse() with 1, which acpi_hest_init() takes
> as an error. Enabled = 0 is a valid value: ACPI 6.5, Table 18.5, says
> that the error source is then not to be enabled. It does not make the
> table invalid.
>
> Before commit 9f9a35a7b654 ("ACPI / APEI / ARM64: APEI initial support
> for ARM64"), the result of this walk was ignored. That commit inverted
> the callback's return value and started checking the result.
>
> There is nothing to report from hest_parse_cmc(), and the spec allows
> only one structure of this type, so ignore the return value of
> arch_apei_enable_cmcff() and let the walk go on.
>
> Fixes: 9f9a35a7b654 ("ACPI / APEI / ARM64: APEI initial support for ARM64")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ahmed Abdelfattah <me@ahmedabdelfattah.dev>
> ---
> I hit this with a hand-built HEST in a QEMU guest: clearing Enabled in
> its IA-32 Corrected Machine Check structure also took away the generic
> error source next to it.
>
> Tested on v7.4-rc3+ (4405c18c95d2) with a HEST loaded through
> -acpitable that holds two error sources, an IA-32 CMC structure
> (FIRMWARE_FIRST, bank 8) and a polled GHESv2:
>
> CMC structure without the patch with it
> Enabled = 1 HEST initialized, "Enabling the same
> Firmware First mode for
> corrected errors", GHES.1 bound
> Enabled = 0 "GHES: HEST is not enabled!", HEST initialized,
> no GHES device GHES.1 bound
> Enabled = 0, HEST initialized, GHES.1 the same
> acpi=nocmcff bound
>
> Every boot also prints "GHES: Failed to enable APEI firmware first
> mode", because the guest's firmware has no APEI _OSC; that is the same
> with and without the patch.
> ---
> drivers/acpi/apei/hest.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
> index 20d757687e3d..881dd0b25939 100644
> --- a/drivers/acpi/apei/hest.c
> +++ b/drivers/acpi/apei/hest.c
> @@ -185,7 +185,7 @@ static int __init hest_parse_cmc(struct acpi_hest_header *hest_hdr, void *data)
> return 0;
>
> if (!acpi_disable_cmcff)
> - return !arch_apei_enable_cmcff(hest_hdr, data);
> + arch_apei_enable_cmcff(hest_hdr, data);
>
> return 0;
> }
Looks good to me.
acpi_disable_cmcff will always be 1 on ARM64 and ARM64 is not using CMC,
we should keep the code as same behaviour as before on x86,thanks for
the fix.
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Thanks
Hanjun
prev parent reply other threads:[~2026-12-03 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 18:35 Ahmed Abdelfattah via B4 Relay
2026-12-01 15:27 ` Ahmed Abdelfattah
2026-12-03 12:56 ` Hanjun Guo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ad32efd-8e1c-c0a7-205e-bd3ff4912554@huawei.com \
--to=guohanjun@huawei.com \
--cc=bp@alien8.de \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=me@ahmedabdelfattah.dev \
--cc=rafael@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=will@kernel.org \
--cc=xueshuai@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®