From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Shiju Jose <shiju.jose@huawei.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Ani Sinha <anisinha@redhat.com>,
Dongjiu Geng <gengdongjiu1@gmail.com>,
linux-kernel@vger.kernel.org, qemu-arm@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH v8 03/13] acpi/ghes: Add support for GED error device
Date: Sat, 24 Aug 2024 01:28:06 +0200 [thread overview]
Message-ID: <20240824012806.6189d0a4@sal.lan> (raw)
In-Reply-To: <20240819134304.68c54eae@imammedo.users.ipa.redhat.com>
Em Mon, 19 Aug 2024 13:43:04 +0200
Igor Mammedov <imammedo@redhat.com> escreveu:
> On Fri, 16 Aug 2024 09:37:35 +0200
> Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:
>
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > As a GED error device is now defined, add another type
> > of notification.
> >
> > Add error notification to GHES v2 using
> >a GED error device GED triggered via interrupt.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This is hard to parse, perhaps update so it would be
> more clear what does what
>
> >
> > [mchehab: do some cleanups at ACPI_HEST_SRC_ID_* checks and
> > rename HEST event to better identify GED interrupt OSPM]
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> > Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> > ---
>
> in addition to change log in cover letter,
> I'd suggest to keep per patch change log as well (after ---),
> it helps reviewer to notice intended changes.
>
>
> [...]
> > + case ACPI_HEST_SRC_ID_GED:
> > + build_ghes_hw_error_notification(table_data, ACPI_GHES_NOTIFY_GPIO);
> While GPIO works for arm, it's not the case for other machines.
> I recall a suggestion to use ACPI_GHES_NOTIFY_EXTERNAL instead of GPIO one,
> but that got lost somewhere...
True, but the same also applies to SEA, which is ARMv8+. After having
everything in place, I confined the source ID into this code inside
ghes.c:
enum AcpiHestSourceId {
ACPI_HEST_SRC_ID_SEA,
ACPI_HEST_SRC_ID_GED,
/* Shall be the last one */
ACPI_HEST_SRC_ID_COUNT
} AcpiHestSourceId;
static bool ghes_notify_to_source_id(enum AcpiGhesNotifyType notify,
enum AcpiHestSourceId *source_id)
{
switch (notify) {
case ACPI_GHES_NOTIFY_SEA: /* ARMv8 */
*source_id = ACPI_HEST_SRC_ID_SEA;
return false;
case ACPI_GHES_NOTIFY_GPIO:
*source_id = ACPI_HEST_SRC_ID_GED;
return false;
default:
/* Unsupported notification types */
return true;
}
}
The only place where the source ID number is used is at
ghes_notify_to_source_id() - still we use ACPI_HEST_SRC_ID_COUNT on other
places to initialize and fill in the HEST table and its error source
structures.
On other words, the source ID field is filled from the notification types as
defined at include/hw/acpi/ghes.h:
ACPI_GHES_NOTIFY_POLLED = 0,
ACPI_GHES_NOTIFY_EXTERNAL = 1,
ACPI_GHES_NOTIFY_LOCAL = 2,
ACPI_GHES_NOTIFY_SCI = 3,
ACPI_GHES_NOTIFY_NMI = 4,
ACPI_GHES_NOTIFY_CMCI = 5,
ACPI_GHES_NOTIFY_MCE = 6,
ACPI_GHES_NOTIFY_GPIO = 7,
ACPI_GHES_NOTIFY_SEA = 8,
ACPI_GHES_NOTIFY_SEI = 9,
ACPI_GHES_NOTIFY_GSIV = 10,
ACPI_GHES_NOTIFY_SDEI = 11,
(please notice that ACPI already defines "EXTERNAL" as being something
else)
Now, if we want to add support for x86, we could either add some ifdefs
inside ghes.c, e. g. something like:
enum AcpiHestSourceId {
#ifdef TARGET_ARM
ACPI_HEST_SRC_ID_SEA,
ACPI_HEST_SRC_ID_GED,
#endif
#ifdef TARGET_I386
ACPI_HEST_SRC_ID_MCE,
#endif
/* Shall be the last one */
ACPI_HEST_SRC_ID_COUNT
} AcpiHestSourceId;
and something similar at ghes_notify_to_source_id():
static bool ghes_notify_to_source_id(enum AcpiGhesNotifyType notify,
enum AcpiHestSourceId *source_id)
{
switch (notify) {
#ifdef TARGET_ARM
case ACPI_GHES_NOTIFY_SEA: /* ARMv8 */
*source_id = ACPI_HEST_SRC_ID_SEA;
return false;
case ACPI_GHES_NOTIFY_GPIO:
*source_id = ACPI_HEST_SRC_ID_GED;
return false;
#endif
#ifdef TARGET_I386
case ACPI_GHES_NOTIFY_MCE:
*source_id = ACPI_HEST_SRC_ID_MCE;
return false;
#endif
default:
/* Unsupported notification types */
return true;
}
}
An alternative would be to move source id/notification code out, placing
them at hw/arm, hw/i386, but a more complex binding logic will be needed.
If we're willing to do something like that, I would prefer to not do such
redesign now. Better to do such change when we'll be ready to add some
notification support that works on x86 (MCE? SCI? NMI?).
Regards,
Mauro
next prev parent reply other threads:[~2024-08-23 23:29 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-16 7:37 [PATCH v8 00/13] Add ACPI CPER firmware first error injection on ARM emulation Mauro Carvalho Chehab
2024-08-16 7:37 ` [PATCH v8 01/13] acpi/generic_event_device: add an APEI error device Mauro Carvalho Chehab
2024-08-19 11:21 ` Igor Mammedov
2024-08-16 7:37 ` [PATCH v8 02/13] arm/virt: Wire up a GED error device for ACPI / GHES Mauro Carvalho Chehab
2024-08-16 7:37 ` [PATCH v8 03/13] acpi/ghes: Add support for GED error device Mauro Carvalho Chehab
2024-08-19 11:43 ` Igor Mammedov
2024-08-23 23:28 ` Mauro Carvalho Chehab [this message]
2024-08-16 7:37 ` [PATCH v8 04/13] qapi/acpi-hest: add an interface to do generic CPER error injection Mauro Carvalho Chehab
2024-08-19 11:54 ` Igor Mammedov
2024-08-16 7:37 ` [PATCH v8 05/13] acpi/ghes: rework the logic to handle HEST source ID Mauro Carvalho Chehab
2024-08-19 12:10 ` Igor Mammedov
2024-08-25 2:02 ` Mauro Carvalho Chehab
2024-08-16 7:37 ` [PATCH v8 06/13] acpi/ghes: add support for generic error injection via QAPI Mauro Carvalho Chehab
2024-08-19 12:51 ` Igor Mammedov
2024-08-25 3:29 ` Mauro Carvalho Chehab
2024-09-11 13:21 ` Igor Mammedov
2024-09-11 15:34 ` Jonathan Cameron via
2024-09-12 12:42 ` Igor Mammedov
2024-09-13 5:20 ` Mauro Carvalho Chehab
2024-09-13 10:13 ` Jonathan Cameron via
2024-09-13 12:28 ` Igor Mammedov
2024-09-14 5:38 ` Mauro Carvalho Chehab
2024-08-16 7:37 ` [PATCH v8 07/13] acpi/ghes: cleanup the memory error code logic Mauro Carvalho Chehab
2024-08-16 7:37 ` [PATCH v8 08/13] docs: acpi_hest_ghes: fix documentation for CPER size Mauro Carvalho Chehab
2024-08-16 7:37 ` [PATCH v8 09/13] scripts/ghes_inject: add a script to generate GHES error inject Mauro Carvalho Chehab
2024-08-16 7:37 ` [PATCH v8 10/13] target/arm: add an experimental mpidr arm cpu property object Mauro Carvalho Chehab
2024-08-16 7:37 ` [PATCH v8 11/13] scripts/arm_processor_error.py: retrieve mpidr if not filled Mauro Carvalho Chehab
2024-08-16 7:37 ` [PATCH v8 12/13] acpi/ghes: cleanup generic error data logic Mauro Carvalho Chehab
2024-08-19 12:57 ` Igor Mammedov
2024-08-16 7:37 ` [PATCH v8 13/13] acpi/ghes: check if the BIOS pointers for HEST are correct Mauro Carvalho Chehab
2024-08-19 14:07 ` Igor Mammedov
2024-08-24 0:15 ` Mauro Carvalho Chehab
2024-08-25 3:48 ` Mauro Carvalho Chehab
2024-08-19 14:21 ` [PATCH v8 00/13] Add ACPI CPER firmware first error injection on ARM emulation Igor Mammedov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240824012806.6189d0a4@sal.lan \
--to=mchehab+huawei@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=anisinha@redhat.com \
--cc=gengdongjiu1@gmail.com \
--cc=imammedo@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shiju.jose@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).