From nobody Wed Oct 23 01:28:59 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 5CE3714B962 for ; Wed, 25 Sep 2024 04:04:48 +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=1727237088; cv=none; b=lOqPyOGzzftDSOfWdbthwPYF9EkyhMdLiDebUYfh1XxTYGXYxA2T+WAy3QMeickB7eIZUjU1BTpR3x41nxy4hH/v3AfC81C8ymqjQcxyTzvcVJ9SUCT6yMgJdLxDyK4N8SaFzIG5F68YFNgWRU28MPKO2HgZpQpa9TY/Sa6vazU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727237088; c=relaxed/simple; bh=uYZ5dxTIe+VsUJtAek0OqcRidDumQi2sjdVoy0tc9tA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qEmD/O6xauSxzN6ylu3yz1ulZOFqfMdV1dKvwfEHkhdqfgDje2YKlKRUYjBa98CkirZt3610iAP85/8zZYg3g+kTzDIj+IWVnZHU+WnFlhSHRWMphjfwUeohPoh43vait0SXdGx+2XLZcqUlnAvByIx3R9RNFWXmgH9VtU4LIjY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=shmB2GV2; 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="shmB2GV2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03FC1C4CEC3; Wed, 25 Sep 2024 04:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727237088; bh=uYZ5dxTIe+VsUJtAek0OqcRidDumQi2sjdVoy0tc9tA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=shmB2GV2jeSyZHkxcWITr6JxIxZWdrV+rsIwj58fQHHlmBJonzOmxFUWik9+wAWKd GuLpllCdXjk9tguWvXqJiNTtnm18zFNTVr+ACpTPrXI+MJogzijJIE2S+n8xlQk1Fh lvO7Kmou37MGQQsm30798oEX9dBJaihJ9uXra+QZqfq9uvjuy8OKmH+mrCkEM1uumx KYaqZoqNO+LL1LRylNsBv4ym10uXIjRyNjluKT0NwCNPXmyw4jAK/dhN7/4vFT7WRs 6GC7qV1AkKJMKBqEtkvs2H1QKmQf1ad9ygPnhpObgdo1a91vHcHH2NCIiIn3mcY4/N VsN4eyk2WiOEw== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1stJGg-0000000827p-0Y4E; Wed, 25 Sep 2024 06:04:46 +0200 From: Mauro Carvalho Chehab To: Igor Mammedov Cc: Jonathan Cameron , Shiju Jose , 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 Subject: [PATCH 03/15] acpi/ghes: simplify the per-arch caller to build HEST table Date: Wed, 25 Sep 2024 06:04:08 +0200 Message-ID: <6305bca3d0c4fc02853fe2794eeb39f46823c733.1727236561.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.46.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. 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 --- 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 dacbd4d0c093..7b42ed59cd15 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.1