From nobody Wed Oct 23 01:29:20 2024 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 94B361BD005 for ; Tue, 1 Oct 2024 07:04:11 +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=1727766251; cv=none; b=NvRYWhUw5AqnyYkXupH6OJU6mTC6s63pQQl14tbSxOwZqXQ3NswlgH7Jc5RLUblVuYRWlL5cQyX6j7hVqbBBNde1jVgzZDPJ3Ft/wvExZ7b8oUZAcMD5HCoKa+EgNA3cZsIpGp0gcCfzfW9oWQB38ze0rF6+f3U2B5Oo0/2cAiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727766251; c=relaxed/simple; bh=gE66plh5Ccq78f0B7n/cfi2RLPCdjB5/duOjscO/Y2Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NjhVWwQVkItcHgFBaNQpt7xACVj6CmJig3fVXrwZfycZurY/XCPoGeJL1DXbRJ8qqYQX5zx62THrRSLUVelMAXXR9z3qOuIFTbxokqfUV4qgP0Y/LqgwUPXM2qPKMhoS8aQxeWTkdMy08xU4W+1WAw5Iz1VRAdiZE8ZWNh6iplM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ciwP6AnM; 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="ciwP6AnM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28786C4CED4; Tue, 1 Oct 2024 07:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727766251; bh=gE66plh5Ccq78f0B7n/cfi2RLPCdjB5/duOjscO/Y2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ciwP6AnM++vYVNJQt5gvXc9ltCwJ3LE2S+hmwhoAInnjBLo5A0HIWT8qBek4wXb3S ZP3rzyq6mXe1BBaFxnaeidrQ794moxuFBLE/aoFSW32AfhCMgZjOxAC2ipXD+f1B/R UCWTJfTqm9uC1zCbwbnWYZG6RKvwwRBBHS0OvqLojrppbMv+0LSq93ZIiPLMpK3VSR R+xRshthycTF3rcwQ9RuaF5NO9d0tYfvN2F4bPMlyqbdU9AenpvPk7VH1ZA9HVGRZb ZByUYdA7uxmZ1rNG5e8tqOhfCheSxEURer+1B+l6AYKhxbwMRl5VrtbOolb2CBAnoD IAKVehLrLbKVg== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1svWvY-00000001V0U-1f0O; Tue, 01 Oct 2024 09:04:08 +0200 From: Mauro Carvalho Chehab To: Igor Mammedov Cc: Mauro Carvalho Chehab , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , Peter Maydell , Shannon Zhao , linux-kernel@vger.kernel.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org, Jonathan Cameron Subject: [PATCH v2 03/15] acpi/ghes: simplify the per-arch caller to build HEST table Date: Tue, 1 Oct 2024 09:03:40 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 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. This prepares for further changes where the HEST table generation will become more generic. 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 f76fb117adff..bafd9a56c217 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -943,10 +943,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.46.0