From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTic3-0003Si-JC for qemu-devel@nongnu.org; Thu, 24 Nov 2011 18:21:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTic0-0007aN-4R for qemu-devel@nongnu.org; Thu, 24 Nov 2011 18:21:51 -0500 Received: from mail-qy0-f173.google.com ([209.85.216.173]:44837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTic0-0007aF-0u for qemu-devel@nongnu.org; Thu, 24 Nov 2011 18:21:48 -0500 Received: by qyl38 with SMTP id 38so2430652qyl.4 for ; Thu, 24 Nov 2011 15:21:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1322172453-26340-1-git-send-email-sw@weilnetz.de> References: <1322172453-26340-1-git-send-email-sw@weilnetz.de> Date: Thu, 24 Nov 2011 23:21:46 +0000 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1.0] malta: Fix regression (i8259 interrupts did not work) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Anthony Liguori , qemu-devel@nongnu.org, Aurelien Jarno , Avi Kivity On 24 November 2011 22:07, Stefan Weil wrote: > Commit 5632ae46d5bda798e971dae48ebb318ac2c3686a passes the address > of i8259 to qemu_irq_proxy. i8259 was an auto variable with undefined > value outside of mips_malta_init. This made the proxy unusable. > > Ethernet for example no longer worked with MIPS Malta. > > There is only one Malta device with one i8259, so using a static > variable for i8259 is the simplest solution which fixes the problem. > > Signed-off-by: Stefan Weil > --- > =C2=A0hw/mips_malta.c | =C2=A0 =C2=A05 ++++- > =C2=A01 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/hw/mips_malta.c b/hw/mips_malta.c > index bb49749..e4dc7fb 100644 > --- a/hw/mips_malta.c > +++ b/hw/mips_malta.c > @@ -775,7 +775,10 @@ void mips_malta_init (ram_addr_t ram_size, > =C2=A0 =C2=A0 int64_t kernel_entry; > =C2=A0 =C2=A0 PCIBus *pci_bus; > =C2=A0 =C2=A0 CPUState *env; > - =C2=A0 =C2=A0qemu_irq *i8259 =3D NULL, *isa_irq; > + =C2=A0 =C2=A0/* The address of i8259 is passed to qemu_irq_proxy and sa= ved there, but > + =C2=A0 =C2=A0 =C2=A0 its value is set later, so it must have a fixed re= served address. */ > + =C2=A0 =C2=A0static qemu_irq *i8259; > + =C2=A0 =C2=A0qemu_irq *isa_irq; Yuck. (If boards had state structures the way devices do we'd have somewhere to put this rather than a local static. More generally if we have to do this kind of trick then either our device model is wrong or we're not using it right in this specific situation...) -- PMM