From: Igor Mammedov <imammedo@redhat.com>
To: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Cc: mst@redhat.com, anisinha@redhat.com, pbonzini@redhat.com,
marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v3 1/4] hw/acpi/aml-build.c: add aml_irq() representing the 3-byte IRQ descriptor
Date: Thu, 14 May 2026 15:33:24 +0200 [thread overview]
Message-ID: <20260514153324.7ff20b8e@imammedo> (raw)
In-Reply-To: <20260508101901.930781-2-mark.caveayland@nutanix.com>
On Fri, 8 May 2026 11:17:40 +0100
Mark Cave-Ayland <mark.caveayland@nutanix.com> wrote:
> The existing aml_interrupt() uses the Extended Interrupt Descriptor to store
> the interrupt information, however newer Windows will only parse the
> standard IRQ Descriptor when enumerating ISA serial ports.
>
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
with nit below fixed:
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> include/hw/acpi/aml-build.h | 2 ++
> hw/acpi/aml-build-stub.c | 6 ++++++
> hw/acpi/aml-build.c | 25 +++++++++++++++++++++++++
> 3 files changed, 33 insertions(+)
>
> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
> index e70e0643b1..eaff025d26 100644
> --- a/include/hw/acpi/aml-build.h
> +++ b/include/hw/acpi/aml-build.h
> @@ -343,6 +343,8 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
> Aml *aml_operation_region(const char *name, AmlRegionSpace rs,
> Aml *offset, uint32_t len);
> Aml *aml_irq_no_flags(uint8_t irq);
> +Aml *aml_irq(uint8_t irq, AmlLevelAndEdge level_and_edge,
> + AmlActiveHighAndLow high_and_low, AmlShared shared);
> Aml *aml_named_field(const char *name, unsigned length);
> Aml *aml_reserved_field(unsigned length);
> Aml *aml_local(int num);
> diff --git a/hw/acpi/aml-build-stub.c b/hw/acpi/aml-build-stub.c
> index 89a8fec4af..3180c7c962 100644
> --- a/hw/acpi/aml-build-stub.c
> +++ b/hw/acpi/aml-build-stub.c
> @@ -67,6 +67,12 @@ Aml *aml_irq_no_flags(uint8_t irq)
> return NULL;
> }
>
> +Aml *aml_irq(uint8_t irq, AmlLevelAndEdge level_and_edge,
> + AmlActiveHighAndLow high_and_low, AmlShared shared)
> +{
> + return NULL;
> +}
> +
> Aml *aml_interrupt(AmlConsumerAndProducer con_and_pro,
> AmlLevelAndEdge level_and_edge,
> AmlActiveHighAndLow high_and_low, AmlShared shared,
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index 7edc8aed42..3aaf96c2a7 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -1061,6 +1061,31 @@ Aml *aml_irq_no_flags(uint8_t irq)
> return var;
> }
>
> +/*
> + * ACPI 1.0b: 6.4.2.1.1 ASL Macro for IRQ Descriptor
> + *
> + * More verbose description at:
> + * ACPI 5.0: 19.5.63 IRQ (Interrupt Resource Descriptor Macro)
> + * 6.4.2.1 IRQ Descriptor
> + */
> +Aml *aml_irq(uint8_t irq, AmlLevelAndEdge level_and_edge,
> + AmlActiveHighAndLow high_and_low, AmlShared shared)
> +{
> + uint16_t irq_mask;
> + Aml *var = aml_alloc();
> + uint8_t irq_flags = level_and_edge | (high_and_low << 3) |
> + (shared << 4);
I'd add here an assert for invalid level_and_edge/high_and_low
> +
> + assert(irq < 16);
> + build_append_byte(var->buf, 0x23); /* IRQ descriptor 3 byte form */
> +
> + irq_mask = 1U << irq;
> + build_append_byte(var->buf, irq_mask & 0xFF); /* IRQ mask bits[7:0] */
> + build_append_byte(var->buf, irq_mask >> 8); /* IRQ mask bits[15:8] */
> + build_append_byte(var->buf, irq_flags); /* IRQ flags */
> + return var;
> +}
> +
> /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLNot */
> Aml *aml_lnot(Aml *arg)
> {
next prev parent reply other threads:[~2026-05-14 13:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 10:17 [PATCH v3 0/4] isa-serial: acpi: declare shared IRQs for COM1/3 and COM2/4 Mark Cave-Ayland
2026-05-08 10:17 ` [PATCH v3 1/4] hw/acpi/aml-build.c: add aml_irq() representing the 3-byte IRQ descriptor Mark Cave-Ayland
2026-05-11 6:59 ` Ani Sinha
2026-05-14 13:33 ` Igor Mammedov [this message]
2026-05-15 14:04 ` Mark Cave-Ayland
2026-05-08 10:17 ` [PATCH v3 2/4] tests/acpi: allow DSDT acpi table changes Mark Cave-Ayland
2026-05-11 7:10 ` Ani Sinha
2026-05-14 13:34 ` Igor Mammedov
2026-05-08 10:17 ` [PATCH v3 3/4] hw/char/serial-isa.c: declare IRQ as shared in ACPI IRQ descriptor Mark Cave-Ayland
2026-05-11 7:13 ` Ani Sinha
2026-05-14 13:37 ` Igor Mammedov
2026-05-08 10:17 ` [PATCH v3 4/4] tests: data: update x86 ACPI tables Mark Cave-Ayland
2026-05-11 7:09 ` Ani Sinha
2026-05-14 13:37 ` 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=20260514153324.7ff20b8e@imammedo \
--to=imammedo@redhat.com \
--cc=anisinha@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mark.caveayland@nutanix.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.