From nobody Sun Apr 13 07:18:45 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F5F2137750 for ; Sat, 7 Dec 2024 08:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733561805; cv=none; b=iTw94clfqeYTbx6O2mQTVE8RFTLDoxXIknmTc+8CKKHD4oV6gWVvAmwAoifDs1ZpSeMzGh+Nfzh1Xj+UnXE9LDiVQUB9yPJ5TNkdrrgfAX7QvpwKQisuHC0bSJTgIjAQ3O9jR4Pe3w86HOv9KwS7syv1sxUBoCyqVVfJvopVMPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733561805; c=relaxed/simple; bh=WpC/WWVfFKAeHGzqCpuL7CrOqSUL9tc8JrM8fpL82sA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R60+rTAcGMlTpbFHcwpPr+lzR9ljkRv88ppjFI/NvgN3xQ3A9T+jzeuiSUML9CcFJrEaXztXFGnly66TaCpmI4+zbJHTBZNUrqzwK13n2bxymmXKPJhSSBCgvONiDnXzfsUVMhwF/0JSPhUqQMB6gr7MCMWNe9/a0TbITMU54h8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I5dHE5qW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I5dHE5qW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6D25C4CECD; Sat, 7 Dec 2024 08:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733561804; bh=WpC/WWVfFKAeHGzqCpuL7CrOqSUL9tc8JrM8fpL82sA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I5dHE5qWGyD9+hyuqwCxhNb9rH4AhiMVuh2y2755gagmYp6a6rm4Z4XnMYVaUIeIk PV/hbDLEO2wXtd61o7dEcEwT/k+9sYiCZ7zWqggYjliOEwu5zMFJnq+0yCjtV3OVvj p4IE1sPwX6zEYkevMWcaH9S9IPK28dkC3XO4FlVn/qIX2yfw6JbZlbF3o7nV2PhVer CW0jRZAZrLeR9fZkgnYSNH3JyfTkioPuDW67jvmbsZuK7W4eBLUdZa6jf/wX0VZOe9 CKAbxsblqTJj/QmHF+epnDewTvFXlWgNPSd+wIPN0BI9PFkvSGlic+pBFKBYrt4Swh +y2Th2HSCB8Lw== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tJqcE-00000005j4g-4A1K; Sat, 07 Dec 2024 09:56:42 +0100 From: Mauro Carvalho Chehab To: "Michael S . Tsirkin" Cc: Jonathan Cameron , Shiju Jose , Mauro Carvalho Chehab , Ani Sinha , Dongjiu Geng , Igor Mammedov , Peter Maydell , Shannon Zhao , linux-kernel@vger.kernel.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v6 03/16] acpi/ghes: simplify the per-arch caller to build HEST table Date: Sat, 7 Dec 2024 09:54:09 +0100 Message-ID: <0617c0652412212cc34ba182a93b55fa0b12cc90.1733561462.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" The GHES driver requires not only a HEST table, but also a separate firmware file to store Error Structure records. It can't do one without the other. Simplify the caller logic for it to require one function. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- Changes from v10: - Removed the logic which associates notification and source ID. This will be placed on a separate patch. Changes from v8: - Non-rename/cleanup changes merged altogether; - source ID is now more generic, defined per guest target. That should make easier to add support for 86. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 7 +++++-- hw/arm/virt-acpi-build.c | 5 ++--- include/hw/acpi/ghes.h | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index e66f3be1502b..4a6c45bcb4be 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -233,7 +233,7 @@ static int acpi_ghes_record_mem_error(uint64_t error_bl= ock_address, * Initialize "etc/hardware_errors" and "etc/hardware_errors_addr" fw_cfg = blobs. * See docs/specs/acpi_hest_ghes.rst for blobs format. */ -void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker) +static void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *li= nker) { int i, error_status_block_offset; =20 @@ -356,12 +356,15 @@ static void build_ghes_v2(GArray *table_data, int sou= rce_id, BIOSLinker *linker) } =20 /* Build Hardware Error Source Table */ -void acpi_build_hest(GArray *table_data, BIOSLinker *linker, +void acpi_build_hest(GArray *table_data, GArray *hardware_errors, + BIOSLinker *linker, const char *oem_id, const char *oem_table_id) { AcpiTable table =3D { .sig =3D "HEST", .rev =3D 1, .oem_id =3D oem_id, .oem_table_id =3D oem_table_id= }; =20 + build_ghes_error_table(hardware_errors, linker); + acpi_table_begin(&table, table_data); =20 /* Error Source Count */ diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 620992c92c12..e059317b002e 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -942,10 +942,9 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildT= ables *tables) build_dbg2(tables_blob, tables->linker, vms); =20 if (vms->ras) { - build_ghes_error_table(tables->hardware_errors, tables->linker); acpi_add_table(table_offsets, tables_blob); - acpi_build_hest(tables_blob, tables->linker, vms->oem_id, - vms->oem_table_id); + acpi_build_hest(tables_blob, tables->hardware_errors, tables->link= er, + vms->oem_id, vms->oem_table_id); } =20 if (ms->numa_state->num_nodes > 0) { diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h index 59e3b8fb24b9..20016c226d1f 100644 --- a/include/hw/acpi/ghes.h +++ b/include/hw/acpi/ghes.h @@ -68,8 +68,8 @@ typedef struct AcpiGhesState { bool present; /* True if GHES is present at all on this board */ } AcpiGhesState; =20 -void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker); -void acpi_build_hest(GArray *table_data, BIOSLinker *linker, +void acpi_build_hest(GArray *table_data, GArray *hardware_errors, + BIOSLinker *linker, const char *oem_id, const char *oem_table_id); void acpi_ghes_add_fw_cfg(AcpiGhesState *vms, FWCfgState *s, GArray *hardware_errors); --=20 2.47.1