qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: "Andreas Färber" <afaerber@suse.de>
Cc: "Stefan Weil" <sw@weilnetz.de>,
	"James Hogan" <james.hogan@imgtec.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	qemu-devel@nongnu.org,
	"Peter Jovanovic" <petar.jovanovic@imgtec.com>
Subject: Re: [Qemu-devel] [PATCH for-1.6] mips_malta: do not raise exceptions when accessing invalid memory
Date: Tue, 13 Aug 2013 22:23:10 +0200	[thread overview]
Message-ID: <20130813202310.GB20566@ohm.aurel32.net> (raw)
In-Reply-To: <520A2747.9000804@suse.de>

On Tue, Aug 13, 2013 at 02:32:07PM +0200, Andreas Färber wrote:
> Am 13.08.2013 12:05, schrieb James Hogan:
> > On 12 August 2013 20:44, Aurelien Jarno <aurelien@aurel32.net> wrote:
> >> Since commit c658b94f6e8c206c59d02aa6fbac285b86b53d2c, MIPS raises
> >> exceptions when accessing invalid memory. This is not the correct
> >> behaviour for MIPS Malta Core LV, as the GT-64120A system controller
> >> just ignore undecoded access. This feature is used by the Linux kernel
> >> to probe for some devices.
> >>
> >> Emulate the correct behaviour in QEMU by adding an empty slot covering
> >> the entire memory space decoded by the GT-64120A.
> >>
> >> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> >> ---
> > 
> > <snip>
> > 
> >> @@ -908,6 +909,11 @@ void mips_malta_init(QEMUMachineInitArgs *args)
> >>      DeviceState *dev = qdev_create(NULL, TYPE_MIPS_MALTA);
> >>      MaltaState *s = MIPS_MALTA(dev);
> >>
> >> +    /* The whole address space decoded by the GT-64120A doesn't generate
> >> +       exception when accessing invalid memory. Create an empty slot to
> >> +       emulate this feature. */
> >> +    empty_slot_init(0, 0x1fffffff);
> > 
> > Out of interest, any particular reason not to put this in
> > hw/mips/gt64xxx_pci.c? As far as I can tell from your description it's
> > specific to the GT-64* system controller rather than the malta board?

That is correct that it is specific to the GT-64* system controller.
That said it is modeled in QEMU as the PCI controller, and not as the
system and memory controller.

> I was assuming that we didn't properly model that device when putting it
> on the board directly, but if there is one then putting it into such a
> device will avoid having to copy it into multiple boards.
> 
> Perhaps in that case we can even have a proper MemoryRegion in the
> SysBus device instead of a separate empty slot pseudo-device?

The problem is that while the behaviour is GT-64120A specific, the
decoded range is Malta specific. Putting this on one side or another
is still introducing assumptions from the other side.

> FWIW gt64xxx_pci.c could certainly use some more love to eliminate
> gt64120_register() and to create PCIDevice and PCIBus in the bridge
> itself for instance...

gt64xxx_pci.c was following all the API at the time it has been added.

It's great that people improve QEMU by providing new APIs allowing more
things. That said it's a real pitty that people providing a new API do 
not (always) convert devices to the new API, as they are the one really
knowing and understanding it. Now I'll have to spend time on that
instead of doing things actually useful.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2013-08-13 20:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 19:44 [Qemu-devel] [PATCH for-1.6] mips_malta: do not raise exceptions when accessing invalid memory Aurelien Jarno
2013-08-12 20:38 ` Stefan Weil
2013-08-12 21:18   ` Aurelien Jarno
2013-08-13 10:05 ` James Hogan
2013-08-13 12:32   ` Andreas Färber
2013-08-13 20:23     ` Aurelien Jarno [this message]
2013-08-13 20:45       ` Peter Maydell
2013-08-13 21:15         ` Aurelien Jarno
2013-08-13 21:20           ` Peter Maydell
2013-08-13 21:26             ` Aurelien Jarno
2013-08-14  5:18               ` [Qemu-devel] Free BIOS for MIPS Malta (was: mips_malta: do not raise exceptions when accessing invalid memory) Stefan Weil

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=20130813202310.GB20566@ohm.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=afaerber@suse.de \
    --cc=hpoussin@reactos.org \
    --cc=james.hogan@imgtec.com \
    --cc=petar.jovanovic@imgtec.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).