From nobody Fri Dec 19 18:45:09 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=1733298202; cv=none; d=zohomail.com; s=zohoarc; b=X/didP7p7gcNDXsaUeW+TAPQc2WtqdB2h0gYk0w4FgWDtuz6SI+y2/01oQWt1YLHWV+gFNBC9NTK6guwawlATToUxI2lQBxjtQaieInaUe7Uf8BhhCM7MaGah+V8hxPMDG5Wbrty1PttVR0AqwFr9hBYDW7DsrYOc+CUUiTe0Cg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733298202; 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=gyYDlTrCXnTmceOnqwlOgM7OUAAchD1Pahq1wQ6BNK4=; b=b/KTrqmOcL7+EETulxdpxYVlYT1gD2vyt0CyMocWTXTGvLeIsGZsn3R7CT/pORzKQHlf9ym+eA0QBAix2GYrHj3IQu00FXzJPrlYYEHfrYL/A6t0aOR8BsRu2nOeSJvFpGY75XHvmi4BZ2sZlTBfigjdPcNbSGlpj2gvjX4V6Nk= 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 1733298202561347.1638720469332; Tue, 3 Dec 2024 23:43:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIk20-0003mJ-3L; Wed, 04 Dec 2024 02:42:45 -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 1tIk1u-0003lL-4h; Wed, 04 Dec 2024 02:42:38 -0500 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIk1s-0006Xq-DJ; Wed, 04 Dec 2024 02:42:37 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 084B0A41C0A; Wed, 4 Dec 2024 07:40:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE1A3C4CEE0; Wed, 4 Dec 2024 07:42:32 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tIk1n-00000004Kiu-09La; Wed, 04 Dec 2024 08:42:31 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733298153; bh=Zdz33+JrFuLWEYr3Q523j6TOZr8k9EjWwbpOCTAVnQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WmVcEjWkke/rDeYQ2obmJhkoAGJAPkxlbZEXvMX+MLFMJIUS4MWTgCwb85UP8htJX w7CskJ2rHQwrZV5w+I3LLjR7Kl5inq19etKKtCEDs9PCnJDpHFCEXLZgLSyxDpRArh Bd7Wv+Mq3LUJ51gd2wdvL9vb7u0HAYsHdXFar9J2ZuW7wrl8u7SyZS125IoPBkj8ho w+zxPw3x55e3AWt6N2TZEAp5foCI8KcD4jw5Lzlh0lEHT9BjWTkyIbI0gqJl0PZjhL u6nGo+YMgef1b5JhO84/LP3IWWPkQxsJSu1rnDpVZQePdcnJ8nGrkl0DyKoShajIgd WCm1q5Ofg3VUw== From: Mauro Carvalho Chehab To: Igor Mammedov Cc: Jonathan Cameron , Shiju Jose , Mauro Carvalho Chehab , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , linux-kernel@vger.kernel.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v5 04/16] acpi/ghes: better handle source_id and notification Date: Wed, 4 Dec 2024 08:41:12 +0100 Message-ID: <266784293ac084e27f2b13a3855bf234eb96a9ba.1733297707.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=2604:1380:45d1:ec00::3; envelope-from=mchehab+huawei@kernel.org; helo=nyc.source.kernel.org X-Spam_score_int: -73 X-Spam_score: -7.4 X-Spam_bar: ------- X-Spam_report: (-7.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 1733298203502116600 Content-Type: text/plain; charset="utf-8" GHES has two fields that are stored on HEST error source blocks associated with notifications: - notification type, which is a number defined at the ACPI spec containing several arch-specific synchronous and assynchronous types; - source id, which is a HW/FW defined number, used to distinguish between different implemented sources. There could be several sources with the same notification type, which is dependent of the way each architecture maps notifications. Right now, build_ghes_v2() hardcodes a 1:1 mapping between such fields. Move it to two independent parameters, allowing the caller function to fill both. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- Chenges from v10: - Some changes got moved to the previous 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 | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index 4a6c45bcb4be..29cd7e4d8171 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -284,9 +284,13 @@ static void build_ghes_error_table(GArray *hardware_er= rors, BIOSLinker *linker) } =20 /* Build Generic Hardware Error Source version 2 (GHESv2) */ -static void build_ghes_v2(GArray *table_data, int source_id, BIOSLinker *l= inker) +static void build_ghes_v2(GArray *table_data, + BIOSLinker *linker, + enum AcpiGhesNotifyType notify, + uint16_t source_id) { uint64_t address_offset; + /* * Type: * Generic Hardware Error Source version 2(GHESv2 - Type 10) @@ -316,18 +320,8 @@ static void build_ghes_v2(GArray *table_data, int sour= ce_id, BIOSLinker *linker) address_offset + GAS_ADDR_OFFSET, sizeof(uint64_t), ACPI_GHES_ERRORS_FW_CFG_FILE, source_id * sizeof(uint64_t)); =20 - switch (source_id) { - case ACPI_HEST_SRC_ID_SEA: - /* - * Notification Structure - * Now only enable ARMv8 SEA notification type - */ - build_ghes_hw_error_notification(table_data, ACPI_GHES_NOTIFY_SEA); - break; - default: - error_report("Not support this error source"); - abort(); - } + /* Notification Structure */ + build_ghes_hw_error_notification(table_data, notify); =20 /* Error Status Block Length */ build_append_int_noprefix(table_data, ACPI_GHES_MAX_RAW_DATA_LENGTH, 4= ); @@ -369,7 +363,8 @@ void acpi_build_hest(GArray *table_data, GArray *hardwa= re_errors, =20 /* Error Source Count */ build_append_int_noprefix(table_data, ACPI_GHES_ERROR_SOURCE_COUNT, 4); - build_ghes_v2(table_data, ACPI_HEST_SRC_ID_SEA, linker); + build_ghes_v2(table_data, linker, + ACPI_GHES_NOTIFY_SEA, ACPI_HEST_SRC_ID_SEA); =20 acpi_table_end(linker, &table); } --=20 2.47.1