qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>, TaiseiIto <taisei1212@outlook.jp>
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [PATCH] hw/intc/ioapic: Delete a wrong IRQ redirection on I/O APIC
Date: Wed, 24 Jul 2024 13:07:48 +0100	[thread overview]
Message-ID: <6913716c615aaeef146bfd06771ee1d0c6fd352a.camel@infradead.org> (raw)
In-Reply-To: <CABgObfahS8SsZmOGoy4XWiZ8vrtYZz6HNX7gJhgKeO=+ziUsgQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2001 bytes --]

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]

      parent reply	other threads:[~2024-07-24 12:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 12:03 [PATCH] hw/intc/ioapic: Delete a wrong IRQ redirection on I/O APIC TaiseiIto
2024-07-05  3:33 ` [PING][PATCH] " 伊藤 太清
2024-07-13 12:03   ` [PING^2][PATCH] " 伊藤 太清
2024-07-23 14:15 ` [PATCH] " Paolo Bonzini
2024-07-24 11:29   ` 伊藤 太清
2024-07-24 12:07   ` David Woodhouse [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=6913716c615aaeef146bfd06771ee1d0c6fd352a.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=taisei1212@outlook.jp \
    /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).