From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] testdev: adjust for ISA irq changes Date: Sun, 29 May 2011 17:21:40 +0200 Message-ID: <4DE26484.8060804@web.de> References: <1306673851-23152-1-git-send-email-avi@redhat.com> <4DE260D3.4090507@web.de> <4DE261FF.20002@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig0E6FEFD16062E668F9E4A2CD" Cc: Marcelo Tosatti , kvm@vger.kernel.org, Markus Armbruster To: Avi Kivity Return-path: Received: from fmmailgate02.web.de ([217.72.192.227]:40683 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252Ab1E2PVn (ORCPT ); Sun, 29 May 2011 11:21:43 -0400 In-Reply-To: <4DE261FF.20002@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig0E6FEFD16062E668F9E4A2CD Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable 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 >> > --- >> > 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 kv= m >> 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 ou= t >> of this business until we have real irq pin manipulation in qemu. >=20 > 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. >=20 > Second, I'm not sure it's such a hack. =20 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. >=20 > 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 --------------enig0E6FEFD16062E668F9E4A2CD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk3iZIQACgkQitSsb3rl5xTMWQCfZ1r5VqpisRsdH0MPrUCBiAbc JmgAoLgaiU0+Wu3WzIHw9SI8GFyXFdDa =8Wfq -----END PGP SIGNATURE----- --------------enig0E6FEFD16062E668F9E4A2CD--