From: Avi Kivity <avi@redhat.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] Memory API: handling unassigned physical memory
Date: Tue, 01 May 2012 15:46:46 +0300 [thread overview]
Message-ID: <4F9FDB36.70101@redhat.com> (raw)
In-Reply-To: <4F9E964A.1010408@ilande.co.uk>
On 04/30/2012 04:40 PM, Mark Cave-Ayland wrote:
> On 30/04/12 14:23, Avi Kivity wrote:
>
> Hi Avi,
>
>>> My understanding based upon this is that it would be impossible to
>>> register a different parent MemoryRegion without duplicating the init
>>> function for all shared devices which seems undesirable :(
>>
>> What are the requirements? You need a different catch-all mmio handler
>> for each slot? Or would one catch-all mmio handler for all sysbus
>> devices suffice?
>
> A single catch-all for all sysbus devices would suffice, however I'm
> thinking it makes sense to have one MemoryRegion per slot so that the
> devices can register onto the bus using their "slot relative" address
> to allow for potentially moving hardware between slots.
Ok, so you have a hierarchy: bus -> slot -> devices in slot? That
hierarchy is present in the hardware too, or that's how I interpret
"slot relative addresses".
>
>>> The only solution I can think of is to make sysbus_mmio_map() more
>>> intelligent so that instead of blindly adding the device to the "root"
>>> MemoryRegion, it traverses down the MemoryRegion hierarchy starting
>>> from the root to the furtherest leaf node it can find based upon the
>>> specified address and then adds the new subregion there. Hence if I
>>> add my SBus memory regions first before call the various peripheral
>>> init functions, everything should end up in the correct part of the
>>> memory tree.
>>>
>>
>> This solution attempts to reconstruct the memory hierarchy from the
>> address, instead of maintaining it in the device tree.
>
> So I guess that is bad...
Well, it's a lot of work -> bad.
>
>>> I believe this should preserve compatibility for existing sysbus API
>>> users with just a single "root" MemoryRegion, however due to lack of
>>> any documentation related to sysbus I'm not sure if this would break
>>> other platforms or maybe even violate one of its key design features?
>>
>> IMO the best fix is to unsysbus the device and qomify it instead. This
>> way we're 100% flexible in how we can attach it.
>
> That's interesting - I didn't realise that sysbus is a legacy
> interface with respect to QOM.
Maybe it's just wishful thinking on my part. But I always saw sysbus as
a wrong interface - it corresponds to no real bus and doesn't allow
hierarchy, unlike our pci or even isa implementations.
> Is there any documentation related to this? Then again, converting all
> of the devices over to QOM and testing that it doesn't break all
> platforms/busses suddenly becomes a huge job...
>
You can just follow Peter's suggestion, although qomification would be
preferable IMO.
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2012-05-01 12:46 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4F9D797E.500@ilande.co.uk>
[not found] ` <4F9D97F3.8080608@codemonkey.ws>
[not found] ` <4F9E5028.7010306@redhat.com>
[not found] ` <4F9E82C7.10706@ilande.co.uk>
[not found] ` <4F9E9268.70408@redhat.com>
[not found] ` <CAFEAcA_sKtzmHpFcdhkANLCY0=FuW0Hbof0ifp3uHM66NkWoOQ@mail.gmail.com>
[not found] ` <4F9E9906.8060401@ilande.co.uk>
2012-05-01 6:57 ` [Qemu-devel] Memory API: handling unassigned physical memory Blue Swirl
2012-05-01 13:53 ` Anthony Liguori
2012-05-01 18:48 ` Mark Cave-Ayland
2012-05-02 15:15 ` Bob Breuer
2012-05-06 8:45 ` Blue Swirl
2012-05-06 8:41 ` Blue Swirl
[not found] ` <CAFEAcA9VeJWPQ-LU=DvX6vp+=g44-uWda7zokK2NKfLiSkgGAg@mail.gmail.com>
[not found] ` <4F9EA2AD.9050208@ilande.co.uk>
2012-05-01 7:10 ` Blue Swirl
2012-05-01 18:50 ` Mark Cave-Ayland
2012-05-01 21:21 ` Andreas Färber
[not found] ` <4F9E9569.5000700@redhat.com>
[not found] ` <CAFEAcA_wFfsq=PwHAc_r-2bgdwUpSHaTOaL2VPVCJSs9x_JT6A@mail.gmail.com>
2012-05-01 12:39 ` Avi Kivity
2012-05-01 12:41 ` Peter Maydell
2012-05-01 12:42 ` Avi Kivity
2012-05-01 12:43 ` Peter Maydell
2012-05-01 12:48 ` Avi Kivity
2012-05-01 12:49 ` Peter Maydell
2012-05-01 13:01 ` Avi Kivity
2012-05-01 13:50 ` Anthony Liguori
2012-05-01 14:00 ` Peter Maydell
2012-05-01 14:06 ` Anthony Liguori
2012-05-01 14:20 ` Peter Maydell
2012-05-01 15:09 ` Anthony Liguori
2012-05-01 15:20 ` Peter Maydell
2012-05-01 15:26 ` Anthony Liguori
2012-05-01 15:37 ` Peter Maydell
2012-05-01 17:21 ` Anthony Liguori
2012-05-01 18:57 ` Mark Cave-Ayland
2012-05-01 19:03 ` Peter Maydell
2012-05-01 14:09 ` Avi Kivity
2012-05-01 14:15 ` Anthony Liguori
2012-05-01 14:26 ` Avi Kivity
2012-05-01 15:13 ` Anthony Liguori
[not found] ` <4F9E96EC.5080005@codemonkey.ws>
2012-05-01 12:41 ` Avi Kivity
[not found] ` <4F9E964A.1010408@ilande.co.uk>
2012-05-01 12:46 ` Avi Kivity [this message]
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=4F9FDB36.70101@redhat.com \
--to=avi@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
/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).