From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Minor regression with kvm ioapic, gsi >= 16
Date: Thu, 16 Feb 2012 21:04:46 +0100 [thread overview]
Message-ID: <4F3D615E.2060603@web.de> (raw)
In-Reply-To: <4F3D5123.1020209@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3161 bytes --]
On 2012-02-16 19:55, Avi Kivity wrote:
> kvm-unit-tests.git x86/apic.flat is failing ioapic tests with
>
> qemu-system-x86_64 -vnc :99 -device testdev,chardev=x -chardev null,id=x
> -smp 2 -kernel ./x86/apic.flat -serial stdio
> ...
> ioapic interrupt: FAIL
> ioapic simultaneous interrupt: FAIL
>
> This happens because the test is invoking gsi 16, which is handled by
> the non-kvm ioapic instead of the kvm ioapic.
That test should be changed anyway as the hack that allowed it so far
will break finally when we move to upstream logic. Moreover, it is
testing unused path with our current chipset. When this may change, I'm
sure we will also have better IRQ injection mechanisms by that time.
Find a patch below.
>
> Introduced by
>
> commit c3388c9bd8d4f4fd841b521feed20993185d9be4
> Author: Jan Kiszka <jan.kiszka@siemens.com>
> Date: Mon Feb 6 12:20:53 2012 +0100
>
> qemu-kvm: Fix GSI handling with in-kernel irqchip
>
> Interrupt routing with in-kernel irqchip was always a mess. Now this
> increased after latest upstream merge: we started to call ioapic_set_irq
> also for kernel-handled interrupts.
>
> Reduce this mess again by using the upstream kvm_piix3_gsi_handler. It
> is aware of the PIIX3-specific routing in KVM mode and won't call into
> the user space APIC model (as we do not raise IRQs >= ISA_NUM_IRQS with
> the PIIX3).
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
>
> The obvious fix would be to start using upstream's kvm-ioapic, but you
> haven't, why?
>
I did this in a separate series, see your inbox.
Jan
--------8<--------
From: Jan Kiszka <jan.kiszka@siemens.com>
Do not use unsupported IRQ numbers
The testdev is not able to trigger IRQs outside the ISA range (without
fragile hacks). But we can use lower pins as well without losing
information as the PIC is masked during the test.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
x86/apic.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/x86/apic.c b/x86/apic.c
index 2725b9a..9e6bff9 100644
--- a/x86/apic.c
+++ b/x86/apic.c
@@ -139,8 +139,8 @@ static void ioapic_isr_77(isr_regs_t *regs)
static void test_ioapic_intr(void)
{
handle_irq(0x77, ioapic_isr_77);
- set_ioapic_redir(0x10, 0x77);
- toggle_irq_line(0x10);
+ set_ioapic_redir(0x0f, 0x77);
+ toggle_irq_line(0x0f);
asm volatile ("nop");
report("ioapic interrupt", g_isr_77 == 1);
}
@@ -168,11 +168,11 @@ static void test_ioapic_simultaneous(void)
{
handle_irq(0x78, ioapic_isr_78);
handle_irq(0x66, ioapic_isr_66);
- set_ioapic_redir(0x10, 0x78);
- set_ioapic_redir(0x11, 0x66);
+ set_ioapic_redir(0x0e, 0x78);
+ set_ioapic_redir(0x0f, 0x66);
irq_disable();
- toggle_irq_line(0x11);
- toggle_irq_line(0x10);
+ toggle_irq_line(0x0e);
+ toggle_irq_line(0x0f);
irq_enable();
asm volatile ("nop");
report("ioapic simultaneous interrupt",
--
1.7.3.4
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
prev parent reply other threads:[~2012-02-16 20:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 18:55 [Qemu-devel] Minor regression with kvm ioapic, gsi >= 16 Avi Kivity
2012-02-16 20:04 ` Jan Kiszka [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=4F3D615E.2060603@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--cc=mtosatti@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 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).