From: Peter Maydell <peter.maydell@linaro.org>
To: Stefan Weil <sw@weilnetz.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>,
Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1.0] malta: Fix regression (i8259 interrupts did not work)
Date: Thu, 24 Nov 2011 23:21:46 +0000 [thread overview]
Message-ID: <CAFEAcA9bo6pZOm94dKgDkiGnOTFDVA_8PRi3eXM7yVCfYDVPEA@mail.gmail.com> (raw)
In-Reply-To: <1322172453-26340-1-git-send-email-sw@weilnetz.de>
On 24 November 2011 22:07, Stefan Weil <sw@weilnetz.de> 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 <sw@weilnetz.de>
> ---
> 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...)
-- PMM
next prev parent reply other threads:[~2011-11-24 23:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-24 22:07 [Qemu-devel] [PATCH 1.0] malta: Fix regression (i8259 interrupts did not work) Stefan Weil
2011-11-24 23:21 ` Peter Maydell [this message]
2011-11-25 7:01 ` Stefan Weil
2011-11-27 8:35 ` Avi Kivity
2011-11-28 17:27 ` Anthony Liguori
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=CAFEAcA9bo6pZOm94dKgDkiGnOTFDVA_8PRi3eXM7yVCfYDVPEA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=aliguori@us.ibm.com \
--cc=aurelien@aurel32.net \
--cc=avi@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/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).