From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 877FA1758B for ; Mon, 2 Jun 2025 10:22:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748859771; cv=none; b=SC9M56MZvPqBws8oW53YLlUp3x0KxxB7N5IyJQx9d9OY0jA+xNR39N0ZVifEayR7Jv2EVqBTpntPbgtnmzSNla/GaAXRi2FR0zyMrz8uhYjUmSvZqXZZN1VoTfsZkM3rYB+ntgtaGTfsiXyMIWv8MqSYdYOgNx0mHJ8y91UWGtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748859771; c=relaxed/simple; bh=C9pmjVW0KhwAcy61epjvYTBa4pXDQwO2yV+k8s/fuC4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s0kSPWv3h/ac51WB4h++nAzcxmtlLrh90gMyPclLSebK79DzmBXS4AXpZKNcyFNyTJ1Wd0qS/H5wU82noomHXrk5BxiSCt/fNF7wf/gsuwkssAPnCYfkmbROkwE66vuKVcTHv9w8Y5jIRSYyRv8Nkm+IiENbR42XfadqsqD547U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Q0QXgeEH; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Q0QXgeEH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748859768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CKMj/dmcZFnIoX+/jXJwdMyeYm/ORc0hdxg4CxCECwk=; b=Q0QXgeEHE8JrwbFxBCIH2P+xB/V/6ht8I78e6IoB03ZVh9k99z+qasneDXwSkG8HsKDQHP jFTDZeS2UIJvQ1F0QyW/SupSHCzEcvl9GJlBBrCOf+t70vzoFnGItp9mmpVCdGpV053WDH cCbO5J4RxW6s85uyML6N+ULhg1uTOyc= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-195-2hfh_mI2PPmC-y9yYQxzNA-1; Mon, 02 Jun 2025 06:22:47 -0400 X-MC-Unique: 2hfh_mI2PPmC-y9yYQxzNA-1 X-Mimecast-MFC-AGG-ID: 2hfh_mI2PPmC-y9yYQxzNA_1748859766 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-442e0e6eb84so26122365e9.0 for ; Mon, 02 Jun 2025 03:22:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748859766; x=1749464566; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CKMj/dmcZFnIoX+/jXJwdMyeYm/ORc0hdxg4CxCECwk=; b=IiX29bVe7amGhRvlHZ4C+GTsZC3mTExg0cVxToRxwtCOhOpZ1x4FLSwJqyIsQypWKt l+NBN89kHqQ5FKmH9juB0s2spNpwkD2gKPmfSChnehpxoVOK03NL+bVmDGMqz+HUzmHz CbRZyN4XVMG7i0j9VPQabF2SqFs8kjhyoaJhJRVAmJdf+4H+/GIUqTSrpd5BsLIEOO/y Oyl/CjSrv7V4rQ+h/pIFtU8rk0BFi/xY4+QAX5ABxHrdR/qrg1s+tUbioogVqXG3SncT knbx/S7TkNJYSWUOm2F/ZryXGe9qw8o8EsbH+E83xGP+emI6cwrVJTn0Qbxv7rVgerlm HoYA== X-Forwarded-Encrypted: i=1; AJvYcCUtKbseB4K6OCtnZah6+/vaK6khG+lGjb2wZy5ZSCMXcpnXhzi3BJbHA2pF7qRd0+b5AjPpCCuVevHCrRs=@vger.kernel.org X-Gm-Message-State: AOJu0YxYRTIi8vFSa1ZzF1unadJPq6GGC0dSrSLD+phwTcRol00huH9g 8cXROxz59T0JVaXCJbvKOCvp6TpiBtfOhea+UTurRw2zEt2SuJiBCdaWs41IQKhFitK7MX7a653 Cg5ksFpzqyYbBOkLGpDenQOFS8npElmKW6Du2Atoqaic9vKbyAXmFz0WUf2QPWZ9kGA== X-Gm-Gg: ASbGncvwm4BX1dUgpTmZFMgarztHSU7EPFTTMzPPoilDygDn6x82kANnrtYawmXY9pD XhfGduggLwKMc0lN1pvxVaU4HLTPvhyL3KDab9Xjr+ALCSOb7ZUPkZhTH4N6qlC3C+J4Xrdxk6H kw3l5jS8L1SG6m3TUgH9Dy2bqbIy4zAfwmTTGXb2Q4SaF+kb/RVUN7EBS8Q1lcFB0XoZWZhEpYp f38wyH8efjon3Z8WRVvfgpehmy3cWX2PbVoilZQvnP/jTrfOMuLOo3GqvlBsKQVwzaoxw7WNcDD fPb5dxM/ptrBE5OpN8fouOTo+hx1Hd6k X-Received: by 2002:a05:600c:1c08:b0:43c:ec0a:ddfd with SMTP id 5b1f17b1804b1-450d64e2cedmr95031995e9.6.1748859765976; Mon, 02 Jun 2025 03:22:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeawgvYHwXYBD7Ncx6S/vt4KgrtY/j8BkA9OdXSa/4ZY4UEAQYaLMSnHOrNdPF14e7MUUAoA== X-Received: by 2002:a05:600c:1c08:b0:43c:ec0a:ddfd with SMTP id 5b1f17b1804b1-450d64e2cedmr95031585e9.6.1748859765515; Mon, 02 Jun 2025 03:22:45 -0700 (PDT) Received: from imammedo.users.ipa.redhat.com ([85.93.96.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7fb80f6sm115820455e9.28.2025.06.02.03.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jun 2025 03:22:45 -0700 (PDT) Date: Mon, 2 Jun 2025 12:22:44 +0200 From: Igor Mammedov To: Mauro Carvalho Chehab Cc: "Michael S. Tsirkin" , Jonathan Cameron , Shiju Jose , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Philippe =?UTF-8?B?TWF0aGll?= =?UTF-8?B?dS1EYXVkw6k=?= , Ani Sinha , Eduardo Habkost , Marcel Apfelbaum , Peter Maydell , Shannon Zhao , Yanan Wang , Zhao Liu , linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 12/20] acpi/generic_event_device: add logic to detect if HEST addr is available Message-ID: <20250602122244.081a1960@imammedo.users.ipa.redhat.com> In-Reply-To: <20250530221810.694ce02e@foz.lan> References: <20250528174212.2823d3de@imammedo.users.ipa.redhat.com> <20250530080120-mutt-send-email-mst@kernel.org> <20250530164903.0f9f8444@imammedo.users.ipa.redhat.com> <20250530221810.694ce02e@foz.lan> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.49; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 30 May 2025 22:18:10 +0200 Mauro Carvalho Chehab wrote: > Em Fri, 30 May 2025 16:49:03 +0200 > Igor Mammedov escreveu: > > > On Fri, 30 May 2025 08:01:28 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, May 28, 2025 at 05:42:12PM +0200, Igor Mammedov wrote: > > > > On Tue, 20 May 2025 08:41:31 +0200 > > > > Mauro Carvalho Chehab wrote: > > > > > > > > > Create a new property (x-has-hest-addr) and use it to detect if > > > > > the GHES table offsets can be calculated from the HEST address > > > > > (qemu 10.0 and upper) or via the legacy way via an offset obtained > > > > > from the hardware_errors firmware file. > > > > > > > > > > > > it doesn't apply to current master anymore > > > > > > indeed. Mauro? > > > > Michael, > > it's trivial conflict in machine compat, > > could you fix it up while applying? > > IMHO, that's the best. The thing is, as code gets merged upstream with > backports, conflicts happen. > > I can re-send the series, if you prefer, as I'm keeping it rebasing it > from time to time at: > https://gitlab.com/mchehab_kernel/qemu/-/tree/qemu_submitted?ref_type=heads > > (it is on the top of upstream/master) > > But even that might have conflicts on your test tree if you pick > other patches touching this backport table: > > > -GlobalProperty hw_compat_10_0[] = {}; > > +GlobalProperty hw_compat_10_0[] = { > > + { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, > > +}; > > (this was the code when I sent the PR. When applying upstream, > such hunk is now(*): > > GlobalProperty hw_compat_10_0[] = { > { "scsi-hd", "dpofua", "off" }, > + { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, > }; > > > (*) https://gitlab.com/mchehab_kernel/qemu/-/commit/08c4859f8c6f36d7dccf2b773be88847e5d1fe0c > > If you still prefer that I resubmit the entire PR, let me know. If it's the only patch that needs rebase and doesn't affect the rest, I'd say there is no need to spam the list with whole series respin, just post rebased v10 12/20 as reply here If it's more than that, respin series. > > Regards, > Mauro > From mboxrd@z Thu Jan 1 00:00:00 1970 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 9043B21B9F5 for ; Mon, 2 Jun 2025 12:56:00 +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=1748868960; cv=none; b=hJRcNp9VADUHLKyQWLq2x1882HacDDlQYuWhVyjpgn29fl0NPBsMb3NkfQsdylz+CxbVuF453koAR7pr01Xyob7N7V6Stw4DcZ3cHgZk+ufthl6yUd0NlZwE4D0u9hx+zVwAF1RQ03QBT4Jo3kOOujM0FgacXZMn0Am+tb5LwWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748868960; c=relaxed/simple; bh=1y1k9L6v273vVnANqw0hHe3EnLWOX+Fa7Jbly59n7Q8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ugim5W8F7FzMDJBdAlXoixAO1Nb8cJD2fXTjEaAS878OHI4oiapQfBFvyq9HN2nL7v35B7/5o7k56llSX82lqQMLlQknult+slnMcQibql5XjYpg/zAaXPqxoLom18pGZqBmfKR7U/BJk8bH8VtLi2K1A4Ch+L7nHCK6nu/zGCA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AuTUU2ET; 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="AuTUU2ET" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F300EC4CEEB; Mon, 2 Jun 2025 12:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748868960; bh=1y1k9L6v273vVnANqw0hHe3EnLWOX+Fa7Jbly59n7Q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AuTUU2ETaC4zcMj2e9medq9DpK1kpQ1Z4GptW+VZfh+F0niL2wttEvT2MLo6mUH9Q iGtoKWqYgvlwP4M7vRgYcNy/bF67fKmEGd3PgJnJ3Qaibu2tOZmVKPkFi7v1InnG+i GhvVjUkiwmmDy9oxSFWraVNO2/03Fqx/O5Agz6uudV1u8Swa8LxepWWJFzShmB65z+ F7OLADiYqScR7qVbLd/uoL6wlfQZGzMaquoiRNPN5UeqelmD+GzGJTFxysHmv96RMu 7KSSKOYguLx5Fv7RmZS4a1rkxSKLwqWi6e5tQMYtSlFLrY4qIase30Aa26UqS8uG7h icbv4+ZA/omhQ== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1uM4hV-000000008bf-0Wcl; Mon, 02 Jun 2025 14:55:37 +0200 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , Eduardo Habkost , Marcel Apfelbaum , Peter Maydell , Shannon Zhao , Yanan Wang , Zhao Liu , linux-kernel@vger.kernel.org Subject: [PATCH v10 12/26] acpi/generic_event_device: add logic to detect if HEST addr is available Date: Mon, 2 Jun 2025 14:52:30 +0200 Message-ID: <20250602122244.081a1960@imammedo.users.ipa.redhat.com>, Mauro Carvalho Chehab X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250530221810.694ce02e@foz.lan> References: <20250530221810.694ce02e@foz.lan> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Create a new property (x-has-hest-addr) and use it to detect if the GHES table offsets can be calculated from the HEST address (qemu 10.0 and upper) or via the legacy way via an offset obtained from the hardware_errors firmware file. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- v10: - rebased on the top of upstream hw/acpi/generic_event_device.c | 2 ++ hw/arm/virt-acpi-build.c | 18 ++++++++++++++++-- hw/core/machine.c | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index d292f61b4e41..3cf9dab0d01a 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -318,6 +318,8 @@ static void acpi_ged_send_event(AcpiDeviceIf *adev, AcpiEventStatusBits ev) static const Property acpi_ged_properties[] = { DEFINE_PROP_UINT32("ged-event", AcpiGedState, ged_event_bitmap, 0), + DEFINE_PROP_BOOL("x-has-hest-addr", AcpiGedState, + ghes_state.use_hest_addr, false), }; static const VMStateDescription vmstate_memhp_state = { diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index da3ebf403ef9..3126234e657d 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -893,6 +893,10 @@ static const AcpiNotificationSourceId hest_ghes_notify[] = { { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, }; +static const AcpiNotificationSourceId hest_ghes_notify_10_0[] = { + { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, +}; + static void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) { @@ -947,15 +951,25 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) if (vms->ras) { AcpiGedState *acpi_ged_state; + static const AcpiNotificationSourceId *notify; + unsigned int notify_sz; AcpiGhesState *ags; acpi_ged_state = ACPI_GED(vms->acpi_dev); ags = &acpi_ged_state->ghes_state; if (ags) { acpi_add_table(table_offsets, tables_blob); + + if (!ags->use_hest_addr) { + notify = hest_ghes_notify_10_0; + notify_sz = ARRAY_SIZE(hest_ghes_notify_10_0); + } else { + notify = hest_ghes_notify; + notify_sz = ARRAY_SIZE(hest_ghes_notify); + } + acpi_build_hest(ags, tables_blob, tables->hardware_errors, - tables->linker, hest_ghes_notify, - ARRAY_SIZE(hest_ghes_notify), + tables->linker, notify, notify_sz, vms->oem_id, vms->oem_table_id); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index c3f3a5020d0b..aa90a83d8c23 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -35,10 +35,12 @@ #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-net.h" #include "hw/virtio/virtio-iommu.h" +#include "hw/acpi/generic_event_device.h" #include "audio/audio.h" GlobalProperty hw_compat_10_0[] = { { "scsi-hd", "dpofua", "off" }, + { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, }; const size_t hw_compat_10_0_len = G_N_ELEMENTS(hw_compat_10_0); -- 2.49.0 From mboxrd@z Thu Jan 1 00:00:00 1970 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 65E3721B918 for ; Mon, 2 Jun 2025 12:58:12 +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=1748869092; cv=none; b=HekYn2Lb0UNViYfRJVw/L164K8jd2B0lvDQtbITgwhEoq1VfefsccZeGnOhg1d2+22korOBd2gsgKGKy4T9R1nVBgWwH/MdbIBXGU/zqToJcZeBbCyPmHNPvbPZaq7qeNcgxNOS+A0OtuFRChylGVyuj5GG4rTUTfNms97Eaix4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748869092; c=relaxed/simple; bh=UGpf4ScskYQqBIauC9Wo+ugO/mp6oc4eJcEYr5RIoR0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rDfb2j8C+SgNM0CPlJ8jmGPsbBBipOkVeULPHQskhvk3pvC8YJ0FpkE39qHUqBjwrVwUwy1ZG7XuBBh9MBtjNqAwIAuNUwc0HTHcAXG8VM7R9eqVwJ3rM8HlxRAxyNyu3FZmLdleQYIXUxk5A0FS04xUjvXxy2VcB4cd/b1imI4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u8HhRNzr; 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="u8HhRNzr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D77FFC4CEEB; Mon, 2 Jun 2025 12:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748869091; bh=UGpf4ScskYQqBIauC9Wo+ugO/mp6oc4eJcEYr5RIoR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u8HhRNzrCqHQLjErCeTW1ab/J/WOyCqQ4162WtH2eKR1PymS4yPY6Ly2akh9ieK4C +mjQnJhhT5NdJf9n2AdRXyEspFZIXMlTfHhUPgZ02+hRDIlQJFh5yVEJsHAtF7FGHu gAWbVC+dxfIhrp32HBUAOjKUUkhcbTDjhL5GETxUOwEwvg/PjcR61cfP9FJRT+i/p9 i5If//kwZA7DkPz0K13JfvFBcYpCz0GU7uS+MBmlVPAhaxjR7SjujtA6VMQelcaaJw DUTl63rJg6DoO2/sPTXEmhEqed0N7Q40LzRiojUy8aJhfX9wrOF03xJih9g/mf8p0J SzO9y7fGtFF6A== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1uM4jx-000000008oD-3sD1; Mon, 02 Jun 2025 14:58:09 +0200 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , Eduardo Habkost , Marcel Apfelbaum , Peter Maydell , Shannon Zhao , Yanan Wang , Zhao Liu , linux-kernel@vger.kernel.org Subject: [PATCH v10 12/20 RESEND] acpi/generic_event_device: add logic to detect if HEST addr is available Date: Mon, 2 Jun 2025 14:57:12 +0200 Message-ID: <20250602122244.081a1960@imammedo.users.ipa.redhat.com>, Mauro Carvalho Chehab X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250530221810.694ce02e@foz.lan> References: <20250530221810.694ce02e@foz.lan> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Message-ID: <20250602125712.zRS3rDnUwpgBqaN6Cxy87fcfw2wsfLpc_wcW4oZ1UMI@z> Create a new property (x-has-hest-addr) and use it to detect if the GHES table offsets can be calculated from the HEST address (qemu 10.0 and upper) or via the legacy way via an offset obtained from the hardware_errors firmware file. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- PS.: patch resent as the previous version was "12/26" instead of "12/20" v10: - rebased on the top of upstream hw/acpi/generic_event_device.c | 2 ++ hw/arm/virt-acpi-build.c | 18 ++++++++++++++++-- hw/core/machine.c | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index d292f61b4e41..3cf9dab0d01a 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -318,6 +318,8 @@ static void acpi_ged_send_event(AcpiDeviceIf *adev, AcpiEventStatusBits ev) static const Property acpi_ged_properties[] = { DEFINE_PROP_UINT32("ged-event", AcpiGedState, ged_event_bitmap, 0), + DEFINE_PROP_BOOL("x-has-hest-addr", AcpiGedState, + ghes_state.use_hest_addr, false), }; static const VMStateDescription vmstate_memhp_state = { diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index da3ebf403ef9..3126234e657d 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -893,6 +893,10 @@ static const AcpiNotificationSourceId hest_ghes_notify[] = { { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, }; +static const AcpiNotificationSourceId hest_ghes_notify_10_0[] = { + { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, +}; + static void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) { @@ -947,15 +951,25 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) if (vms->ras) { AcpiGedState *acpi_ged_state; + static const AcpiNotificationSourceId *notify; + unsigned int notify_sz; AcpiGhesState *ags; acpi_ged_state = ACPI_GED(vms->acpi_dev); ags = &acpi_ged_state->ghes_state; if (ags) { acpi_add_table(table_offsets, tables_blob); + + if (!ags->use_hest_addr) { + notify = hest_ghes_notify_10_0; + notify_sz = ARRAY_SIZE(hest_ghes_notify_10_0); + } else { + notify = hest_ghes_notify; + notify_sz = ARRAY_SIZE(hest_ghes_notify); + } + acpi_build_hest(ags, tables_blob, tables->hardware_errors, - tables->linker, hest_ghes_notify, - ARRAY_SIZE(hest_ghes_notify), + tables->linker, notify, notify_sz, vms->oem_id, vms->oem_table_id); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index c3f3a5020d0b..aa90a83d8c23 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -35,10 +35,12 @@ #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-net.h" #include "hw/virtio/virtio-iommu.h" +#include "hw/acpi/generic_event_device.h" #include "audio/audio.h" GlobalProperty hw_compat_10_0[] = { { "scsi-hd", "dpofua", "off" }, + { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, }; const size_t hw_compat_10_0_len = G_N_ELEMENTS(hw_compat_10_0); -- 2.49.0