[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/intc/ioapic: Delete a wrong IRQ redirection on I/O APIC
From: |
David Woodhouse |
Subject: |
Re: [PATCH] hw/intc/ioapic: Delete a wrong IRQ redirection on I/O APIC |
Date: |
Wed, 24 Jul 2024 13:07:48 +0100 |
User-agent: |
Evolution 3.44.4-0ubuntu2 |
On Tue, 2024-07-23 at 16:15 +0200, Paolo Bonzini wrote:
> On Tue, Jun 25, 2024 at 2:03 PM TaiseiIto <taisei1212@outlook.jp> wrote:
> > Before this commit, interruptions from i8254 which should be sent to IRQ0
> > were sent to IRQ2. After this commit, these are correctly sent to IRQ0. When
> > I had an HPET timer generate interruptions once per second to test an HPET
> > driver in my operating system on QEMU, I observed more frequent
> > interruptions than I configured on the HPET timer. I investigated the cause
> > and found that not only interruptions from HPET but also interruptions from
> > i8254 were sent to IRQ2 because of a redirection from IRQ0 to IRQ2. This
> > redirection is added in hw/apic.c at commit
> > 16b29ae1807b024bd5052301550f5d47dae958a2 but this redirection caused wrong
> > interruptions. So I deleted the redirection. Finally, I confirmed there is
> > no problem on 'make check' results and that interruptions from i8254 and
> > interruptions from HPET are correclty sent to IRQ0 and IRQ2 respectively.
>
> Hi, did you set the legacy replacement route bit on the HPET?
>
> My understanding is that:
> - if you enable legacy-replacement routing, the HPET will take care of
> dropping all i8254 interrupts
> - if you disable legacy-replacement routing, the i8254 will still
> generate interrupts on ISA IRQ 0. If you then enable the IO-APIC and
> program the routes according to the ACPI MADT table, the interrupt
> from the i8254 (ISA IRQ 0) will be redirected to the IO-APIC's GSI2.
>
> So the solutions would be one of the following if you use HPET timer 0:
> - disable the i8254
> - enable legacy-replacement routing
> - mask GSI2 on the IO-APIC and use a different route for the HPET
> (worse, but should also work)
Or we delete the existing hack which redirects IRQ0→IRQ2 in the I/OAPIC
and replace it with an IRQ2→IRQ0 hack in gsi_handler(), as seen in
https://mail.gnu.org/archive/html/qemu-devel/2023-10/msg06163.html
smime.p7s
Description: S/MIME cryptographic signature