All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH] testdev: adjust for ISA irq changes
Date: Sun, 29 May 2011 17:21:40 +0200	[thread overview]
Message-ID: <4DE26484.8060804@web.de> (raw)
In-Reply-To: <4DE261FF.20002@redhat.com>

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

On 2011-05-29 17:10, Avi Kivity wrote:
> On 05/29/2011 06:05 PM, Jan Kiszka wrote:
>> On 2011-05-29 14:57, Avi Kivity wrote:
>> >  Recent changes killed the ioapic_irq_hack hack, use the
>> isa_get_irq() API
>> >  instead.
>> >
>> >  Signed-off-by: Avi Kivity<avi@redhat.com>
>> >  ---
>> >   hw/isa-bus.c |    2 +-
>> >   hw/testdev.c |    4 +---
>> >   2 files changed, 2 insertions(+), 4 deletions(-)
>> >
>> >  diff --git a/hw/isa-bus.c b/hw/isa-bus.c
>> >  index 2765543..7e06efc 100644
>> >  --- a/hw/isa-bus.c
>> >  +++ b/hw/isa-bus.c
>> >  @@ -66,7 +66,7 @@ void isa_bus_irqs(qemu_irq *irqs)
>> >    */
>> >   qemu_irq isa_get_irq(int isairq)
>> >   {
>> >  -    if (isairq<  0 || isairq>  15) {
>> >  +    if (isairq<  0 || isairq>  23) {
>>
>> That's a fairly evil hack. It will break again when we clean up the kvm
>> irqchips (not to speak of side effects in non-irqchip/non-kvm mode).
>>
>> Why not hook into the kvm irqchip directly? Would keep generic code out
>> of this business until we have real irq pin manipulation in qemu.
> 
> Firstly, I did the minimal patch to get things working, as is my custom
> when fixing up merge/refactoring problems.  Not that I often follow up
> with the clean fix.

The minimal fix would be simply initializing ioapic_isa_hack again. That
was lost while merging with the xen bits.

> 
> Second, I'm not sure it's such a hack.  

The hack is that isa_get_irq is supposed to return ISA IRQs, not GSIs.
Name-wise, there is already a bit mixed up in QEMU, but at least not in
that function.

> Suppose our motherboard wired
> the PCI links to GSI16-19 (or GSI16-23, as we once wanted before we had
> MSI-X)?  We'd need an API to access non-ISA interrupt lines.
> 
> So what's the clean fix here?  gsi_get_irq()?

Maybe. Depends on the requirements of the testdev. If you also want to
address PIC and IOAPIC separately or simulate injection from a specific
device, we need more logic.

We also need a better interface to discover and track legacy IRQ routes
for device assignment. Markus is currently collecting requirements for
qdev enhancements, and I think generic IRQ manipulation and discovery
belongs there.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2011-05-29 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-29 12:57 [PATCH] testdev: adjust for ISA irq changes Avi Kivity
2011-05-29 15:05 ` Jan Kiszka
2011-05-29 15:10   ` Avi Kivity
2011-05-29 15:21     ` Jan Kiszka [this message]
2011-05-29 15:26       ` Avi Kivity
2011-05-29 15:36         ` Jan Kiszka
2011-05-30 15:34           ` Markus Armbruster

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=4DE26484.8060804@web.de \
    --to=jan.kiszka@web.de \
    --cc=armbru@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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.