From nobody Sat Sep 6 17:00:14 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=1757085291; cv=none; d=zohomail.com; s=zohoarc; b=HdmCZDaWiFcToBPi/dGSJMQ4MgWmDkiGrdqE98ZNOQ5D8DozFGo461r+vg8eK2+jQ7p5qXfZqHePlpjMJrvz3/L55duCjhDxpszHBf5iOGH9xmutj/7QGh6dGWNKOhvVZPkIoob9tfwDnOaGqg9JDtn7faUbcazDQ0f+4QkzlZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757085291; h=Content-Type: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=RFdV3NmNvuOW5pM6BpyaGCpJ0dM5+KLYTt+R3j2+wgA=; b=XE42swrGte6IvHTEcjY0whLMlkTooqgI5qYsYIjqNQrTh6Mae4diVOaFLnE06Y2cnmbMaq3H3fKrmxzWjgNRzFzA38DIaTpafS5oKShWuCcLYVlPZ3pNjp+NtzZjb4xQGcAV8w1q5/twQ0Es/6JRfM+mpgjy+HQw+wFVR/NeDr0= 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 1757085291661878.2023240542472; Fri, 5 Sep 2025 08:14:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuY5D-0007rV-UC; Fri, 05 Sep 2025 11:10:36 -0400 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 1uuY4c-0007UC-UH; Fri, 05 Sep 2025 11:10:00 -0400 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uuY4T-0005mr-6u; Fri, 05 Sep 2025 11:09:57 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id DC30C44DC8; Fri, 5 Sep 2025 15:09:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A3DBC4CEFF; Fri, 5 Sep 2025 15:09:34 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1uuY49-0000000HEV3-3Jvj; Fri, 05 Sep 2025 17:09:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757084974; bh=EclrcsGZqO/owgluQvlf2G9WUh9H1RucXRt+xhJ9yU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PU2sNk+7KrAmP1DqHTZVdAfujNKyAt5l1xBXm7ZDUtp+BvEhguWHVFvrEgsFdHxZH nY5t6ZuZFEUSCDzk+n7W8ybB/6F8cCF46OuzI13GG8PkjKOnMurV00b9975tNzp863 ftbxTUp91GqL9M5JBXVHX1Y60eSa6CEpkUww21+SMBAmkpB/egflz782nig03e7b8Y TqkZVDmCYO4EVE415Ayr2lL80MqdHQLaOgEc7GVTbnRuJbrwGkykoXEwSjHxBUrUDt ivnZiCzia+jlt/DiWUmEoItg6S6bW6IHuLkcJbVxpdeeLgTC34dNInJKKa1fCvC9w2 IRDPwMmfa1fYQ== From: Mauro Carvalho Chehab To: Igor Mammedov , "Michael S . Tsirkin" Cc: Jonathan Cameron , Shiju Jose , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Mauro Carvalho Chehab , Ani Sinha , Dongjiu Geng Subject: [PATCH v11 07/17] acpi/ghes: add a notifier to notify when error data is ready Date: Fri, 5 Sep 2025 17:09:14 +0200 Message-ID: X-Mailer: git-send-email 2.51.0 In-Reply-To: References: Content-Type: text/plain; charset="utf-8" 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=172.234.252.31; envelope-from=mchehab+huawei@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757085294361116600 Some error injection notify methods are async, like GPIO notify. Add a notifier to be used when the error record is ready to be sent to the guest OS. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Acked-by: Igor Mammedov --- hw/acpi/ghes.c | 5 ++++- include/hw/acpi/ghes.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index f49d0d628fc4..0135ac844bcf 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -510,6 +510,9 @@ static void get_ghes_source_offsets(uint16_t source_id, *read_ack_start_addr =3D le64_to_cpu(*read_ack_start_addr); } =20 +NotifierList acpi_generic_error_notifiers =3D + NOTIFIER_LIST_INITIALIZER(error_device_notifiers); + void ghes_record_cper_errors(AcpiGhesState *ags, const void *cper, size_t = len, uint16_t source_id, Error **errp) { @@ -550,7 +553,7 @@ void ghes_record_cper_errors(AcpiGhesState *ags, const = void *cper, size_t len, /* Write the generic error data entry into guest memory */ cpu_physical_memory_write(cper_addr, cper, len); =20 - return; + notifier_list_notify(&acpi_generic_error_notifiers, NULL); } =20 int acpi_ghes_memory_errors(AcpiGhesState *ags, uint16_t source_id, diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h index 8c4b08433760..390943e46d99 100644 --- a/include/hw/acpi/ghes.h +++ b/include/hw/acpi/ghes.h @@ -24,6 +24,9 @@ =20 #include "hw/acpi/bios-linker-loader.h" #include "qapi/error.h" +#include "qemu/notify.h" + +extern NotifierList acpi_generic_error_notifiers; =20 /* * Values for Hardware Error Notification Type field --=20 2.51.0