From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV4zw-0007cp-Ng for qemu-devel@nongnu.org; Mon, 28 Nov 2011 12:28:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RV4zv-0008Hj-8A for qemu-devel@nongnu.org; Mon, 28 Nov 2011 12:28:08 -0500 Received: from e6.ny.us.ibm.com ([32.97.182.146]:35906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV4zv-0008H8-1b for qemu-devel@nongnu.org; Mon, 28 Nov 2011 12:28:07 -0500 Received: from /spool/local by e6.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Nov 2011 12:28:00 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pASHRDqZ342998 for ; Mon, 28 Nov 2011 12:27:16 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pASHRA7J022548 for ; Mon, 28 Nov 2011 15:27:12 -0200 Message-ID: <4ED3C469.2030302@us.ibm.com> Date: Mon, 28 Nov 2011 11:27:05 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1322172453-26340-1-git-send-email-sw@weilnetz.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: Peter Maydell Cc: Stefan Weil , qemu-devel@nongnu.org, Aurelien Jarno , Avi Kivity On 11/24/2011 05:21 PM, Peter Maydell wrote: > 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 >> --- >> hw/mips_malta.c | 5 ++++- >> 1 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, >> int64_t kernel_entry; >> PCIBus *pci_bus; >> CPUState *env; >> - qemu_irq *i8259 = NULL, *isa_irq; >> + /* The address of i8259 is passed to qemu_irq_proxy and saved there, but >> + its value is set later, so it must have a fixed reserved address. */ >> + static qemu_irq *i8259; >> + qemu_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...) Boards should be modeled in qdev as first class devices. I have a series ready to go that I'll send out once 1.1 opens that gets us started in that direction. Regards, Anthony Liguori > > -- PMM > >