From nobody Thu Dec 18 20:19:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1733327986; cv=none; d=zohomail.com; s=zohoarc; b=QaxRibGh2oo1qnok4lNhyBnS3dpeQ9JbYbBZ51N1fNp+3W0lG1LaGp6D+irNmf8PIE9j/zoYygss+e9v+n+qrz81wUmgL5NhLh4vjax/dL+Znubc99WKjE71/cKVJxFKtUzHxaRLmFwOFo8H9SpCs0oOpYgKiKCP6vCOYpMheu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733327986; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7CwxEinX9z/9YC3whAOrtIDR4TKNT4oP6uHCE3HWIyU=; b=XTBJgWliUGdqLsQm9ahQFbcXNGr9RtquVOvkeu8NudI4zN+18EOghs/gdJX8j7MOIdhyA2uOHaqpXs3vIV7+3QvRUCIrGMiJOyFhzpIw8vZ9S/n/cqzM0MtsP+TUoSMZfGBGJGVHhtAijqIE4Q/+2tW4nQsnlhIEpNfVx8s8pDE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1733327986116744.7129329314287; Wed, 4 Dec 2024 07:59:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIrm2-0007dh-Qv; Wed, 04 Dec 2024 10:58:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIrly-0007bh-PS; Wed, 04 Dec 2024 10:58:43 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIrlx-00074t-1X; Wed, 04 Dec 2024 10:58:42 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3AF3C5C6F21; Wed, 4 Dec 2024 15:57:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6465C4CED1; Wed, 4 Dec 2024 15:58:27 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tIrlf-00000000HYv-3NFC; Wed, 04 Dec 2024 16:58:23 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733327907; bh=PWkIqGw8xzIQOhMT/EALs64oTgCjzdotXGAcwpZhIhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gAB/4wIpCYSlr1G3G9EBPuk+LdIlERZ2l7hqeVaTJ268KToJ0ifkmSs/SvcrgzugC H5CuEh+QPQLGCxe9iAPwVDMjayaYoiCo9ZEEXXqd4MAgbifiRvGZwA6oUXCFy/i04r bIRa9P67rIdkN643jisvG6Ep3qJyRL7c6VOFfcnrZ9x+7lHu/zhi0FzmwmtgN8pkwv VP6SdjQTzcxvaGPZ7QB0So8lW/8dcTGmF+DITmrVMkW/sA4KLT9+RgIfoCeAjkbNOp RemTp/2ePeC6sGiA7pPjUdHk1s900TYNW1SXw9QXfyStm64+CYIMr8akwt3JvrQON6 umQZ27A1PiEFQ== From: Mauro Carvalho Chehab To: Igor Mammedov Cc: Mauro Carvalho Chehab , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , linux-kernel@vger.kernel.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org, Jonathan Cameron Subject: [PATCH v3 2/5] acpi/ghes: add a firmware file with HEST address Date: Wed, 4 Dec 2024 16:57:56 +0100 Message-ID: <71b888996a71dc0913c8a26e98464b0fb881da21.1733327276.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=139.178.84.217; envelope-from=mchehab@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -100 X-Spam_score: -10.1 X-Spam_bar: ---------- X-Spam_report: (-10.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1733327986573116600 Content-Type: text/plain; charset="utf-8" Store HEST table address at GPA, placing its content at hest_addr_le variable. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- Change from v8: - hest_addr_lr is now pointing to the error source size and data. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 17 ++++++++++++++++- include/hw/acpi/ghes.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index b77e5c9d1b19..4a826c8ca6d4 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -30,6 +30,7 @@ =20 #define ACPI_HW_ERROR_FW_CFG_FILE "etc/hardware_errors" #define ACPI_HW_ERROR_ADDR_FW_CFG_FILE "etc/hardware_errors_addr" +#define ACPI_HEST_ADDR_FW_CFG_FILE "etc/acpi_table_hest_addr" =20 /* The max size in bytes for one error block */ #define ACPI_GHES_MAX_RAW_DATA_LENGTH (1 * KiB) @@ -261,7 +262,7 @@ static void build_ghes_error_table(GArray *hardware_err= ors, BIOSLinker *linker, } =20 /* - * tell firmware to write hardware_errors GPA into + * Tell firmware to write hardware_errors GPA into * hardware_errors_addr fw_cfg, once the former has been initialized. */ bios_linker_loader_write_pointer(linker, ACPI_HW_ERROR_ADDR_FW_CFG_FIL= E, 0, @@ -355,6 +356,8 @@ void acpi_build_hest(GArray *table_data, GArray *hardwa= re_errors, =20 acpi_table_begin(&table, table_data); =20 + int hest_offset =3D table_data->len; + /* Error Source Count */ build_append_int_noprefix(table_data, num_sources, 4); for (i =3D 0; i < num_sources; i++) { @@ -362,6 +365,15 @@ void acpi_build_hest(GArray *table_data, GArray *hardw= are_errors, } =20 acpi_table_end(linker, &table); + + /* + * tell firmware to write into GPA the address of HEST via fw_cfg, + * once initialized. + */ + bios_linker_loader_write_pointer(linker, + ACPI_HEST_ADDR_FW_CFG_FILE, 0, + sizeof(uint64_t), + ACPI_BUILD_TABLE_FILE, hest_offset); } =20 void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s, @@ -375,6 +387,9 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgStat= e *s, fw_cfg_add_file_callback(s, ACPI_HW_ERROR_ADDR_FW_CFG_FILE, NULL, NULL, NULL, &(ags->hw_error_le), sizeof(ags->hw_error_le), false); =20 + fw_cfg_add_file_callback(s, ACPI_HEST_ADDR_FW_CFG_FILE, NULL, NULL, + NULL, &(ags->hest_addr_le), sizeof(ags->hest_addr_le), false); + ags->present =3D true; } =20 diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h index 9f0120d0d596..237721fec0a2 100644 --- a/include/hw/acpi/ghes.h +++ b/include/hw/acpi/ghes.h @@ -58,6 +58,7 @@ enum AcpiGhesNotifyType { }; =20 typedef struct AcpiGhesState { + uint64_t hest_addr_le; uint64_t hw_error_le; bool present; /* True if GHES is present at all on this board */ } AcpiGhesState; --=20 2.47.1