qapi/acpi-hest: add an interface to do generic CPER error injection

Create a QMP command to be used for generic ACPI APEI hardware error
injection (HEST) via GHESv2, and add support for it for ARM guests.

Error injection uses ACPI_HEST_SRC_ID_QMP source ID to be platform
independent. This is mapped at arch virt bindings, depending on the
types supported by QEMU and by the BIOS. So, on ARM, this is supported
via ACPI_GHES_NOTIFY_GPIO notification type.

This patch was co-authored:
    - original ghes logic to inject a simple ARM record by Shiju Jose;
    - generic logic to handle block addresses by Jonathan Cameron;
    - generic GHESv2 error inject by Mauro Carvalho Chehab;

Co-authored-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Co-authored-by: Shiju Jose <shiju.jose@huawei.com>
Co-authored-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <81e2118b3c8b7e5da341817f277d61251655e0db.1758610789.git.mchehab+huawei@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Mauro Carvalho Chehab 2025-09-23 09:04:07 +02:00 committed by Michael S. Tsirkin
parent d352e33e1f
commit ddd8f3baa2
13 changed files with 123 additions and 1 deletions

36
qapi/acpi-hest.json Normal file
View file

@ -0,0 +1,36 @@
# -*- Mode: Python -*-
# vim: filetype=python
# SPDX-License-Identifier: GPL-2.0-or-later
##
# == GHESv2 CPER Error Injection
#
# Defined since ACPI Specification 6.1,
# section 18.3.2.8 Generic Hardware Error Source version 2. See:
#
# https://uefi.org/sites/default/files/resources/ACPI_6_1.pdf
##
##
# @inject-ghes-v2-error:
#
# Inject an error with additional ACPI 6.1 GHESv2 error information
#
# @cper: contains a base64 encoded string with raw data for a single
# CPER record with Generic Error Status Block, Generic Error Data
# Entry and generic error data payload, as described at
# https://uefi.org/specs/UEFI/2.10/Apx_N_Common_Platform_Error_Record.html#format
#
# Features:
#
# @unstable: This command is experimental.
#
# Since: 10.2
##
{ 'command': 'inject-ghes-v2-error',
'data': {
'cper': 'str'
},
'features': [ 'unstable' ]
}

View file

@ -59,6 +59,7 @@ if have_system
qapi_all_modules += [
'accelerator',
'acpi',
'acpi-hest',
'audio',
'cryptodev',
'qdev',

View file

@ -68,6 +68,7 @@
{ 'include': 'misc-i386.json' }
{ 'include': 'audio.json' }
{ 'include': 'acpi.json' }
{ 'include': 'acpi-hest.json' }
{ 'include': 'pci.json' }
{ 'include': 'stats.json' }
{ 'include': 'virtio.json' }