All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-pci@vger.kernel.org, Len Brown <lenb@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH] ACPI: PCI: IRQ: Handle INTx GSIs as u32 values not int
Date: Fri, 2 Jan 2026 13:29:30 -0600	[thread overview]
Message-ID: <20260102192930.GA226444@bhelgaas> (raw)
In-Reply-To: <aVerBwCsuoHadX9K@lpieralisi>

On Fri, Jan 02, 2026 at 12:24:55PM +0100, Lorenzo Pieralisi wrote:
> On Wed, Dec 31, 2025 at 11:01:50AM -0600, Bjorn Helgaas wrote:
> > On Wed, Dec 31, 2025 at 10:26:15AM +0100, Lorenzo Pieralisi wrote:
> > > In ACPI Global System Interrupts (GSIs) are described using a 32-bit
> > > value.
> > > 
> > > ACPI/PCI legacy interrupts (INTx) parsing code treats GSIs as 'int', which
> > > poses issues if the GSI interrupt value is a 32-bit value with the MSB set
> > > (as required in some interrupt configurations - eg ARM64 GICv5 systems).
> > > 
> > > Fix ACPI/PCI legacy INTx parsing by converting variables representing
> > > GSIs from 'int' to 'u32' bringing the code in line with the ACPI
> > > specification.
> > 
> > Looks good to me.  Is there any symptom of what the issue looks like
> > that could be mentioned here?  Might also be useful in the subject,
> > which currently describes the C code without really saying why we want
> > to do this.
> 
> Thanks ! Happy New Year !

Happy New Year!

> acpi_pci_link_allocate_irq() would return a GSI with MSB set, that the
> logic in acpi_pci_irq_enable() would treat as a failure because that's
> a negative value.
> 
> After fixing that - passing a 32-bit value with MSB set to
> acpi_irq_get_penalty() causes an array acpi_isa_irq_penalty dereference
> with an an index that is way beyond the array size.

Ouch, out-of-bounds reference.  Best case, maybe a data page fault or
a "No IRQ available" message or just a suboptimal IRQ choice.

      reply	other threads:[~2026-01-02 19:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-31  9:26 [PATCH] ACPI: PCI: IRQ: Handle INTx GSIs as u32 values not int Lorenzo Pieralisi
2025-12-31 17:01 ` Bjorn Helgaas
2026-01-02 11:24   ` Lorenzo Pieralisi
2026-01-02 19:29     ` Bjorn Helgaas [this message]

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=20260102192930.GA226444@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=rafael@kernel.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.