From: Anthony Liguori <anthony@codemonkey.ws>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Blue Swirl <blauwirbel@gmail.com>,
Jes Sorensen <Jes.Sorensen@redhat.com>,
qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH v3 0/7] Let boards state maximum RAM limits in QEMUMachine struct
Date: Wed, 30 Mar 2011 08:56:07 -0500 [thread overview]
Message-ID: <4D933677.8000606@codemonkey.ws> (raw)
In-Reply-To: <AANLkTimKrEU5XGYV57mRpr19Wt_GKOOoBP+LMAd+F3Et@mail.gmail.com>
On 03/30/2011 08:22 AM, Peter Maydell wrote:
> On 30 March 2011 11:51, Jes Sorensen<Jes.Sorensen@redhat.com> wrote:
>> On 03/30/11 10:09, Peter Maydell wrote:
>>> On 30 March 2011 08:48, Jes Sorensen<Jes.Sorensen@redhat.com> wrote:
>>>> I am a little concerned about this approach. It should work for simple
>>>> embedded boards, but for larger systems, it really ought to be a mask
>>>> rather than a max address.
>>> It's not a maximum address, it's a maximum size. For instance
>>> the RAM isn't contiguous on some of the ARM devboards.
>> Right, but the fact that you can have holes makes it even more an issue.
> Not really, typically they're just filled up in some particular
> order (main RAM in one place and expansion RAM elsewhere).
> Since the board init function is only passed a single "ram_size"
> parameter that's all you can do anyhow.
FWIW, I don't think any static data is going to be perfect here. A lot
of boards have strict requirements on ram_size based on plausible
combinations of DIMMs. Arbitrary values up to ram_size is not good enough.
ram_size ought to be viewed as a hint, not a mechanism to allow common
code to completely validate the passed in ram size parameter. It's
still up to the board to validate that the given ram size makes sense.
Regards,
Anthony Liguori
>>>> Ideally I think it would be better to have a mask and then introduce a
>>>> is_valid_memory() kinda function to check it with.
> I'm not sure what this mask would look like. You want megabyte
> granularity, but even if you assume only 48 bit physical addresses
> that would still be an alarmingly large number of bits. So I
> guess you'd actually want a list of (start,length) tuples.
>
> I strongly dislike this approach. I think it introduces unneeded
> extra complexity, and it doesn't even address all the cases you
> might want a generic "validate RAM options" mechanism to do (eg
> boards which only allow RAM in 16MB increments, boards where you
> must fill the base RAM first and then the expansion RAM, boards
> where the RAM isn't at a specific physical address but can be
> remapped under guest control, just to pick three). So it falls
> awkwardly between the two stools of "flexible and generic" and
> "simple and straightforward".
>
>>> The command line option doesn't provide any means of saying
>>> "put 64MB in this hole and another 128 over here and 32 there",
>> You can on x86 using the -numa argument. When you use that, it is
>> completely pointless to have the max memory limit, to use your own words.
> (Is there any documentation on what you can do with the -numa
> option? http://qemu.weilnetz.de/qemu-doc.html is decidedly laconic.)
>
>> Since you have holes on ARM too, it makes sense IMHO to use a mask
>> exactly because you can then map that to max memory by simply adding up
>> the available holes. A linear number on the other hand is much harder to
>> validate against once you start populating holes explicitly.
> But I don't want to populate holes explicitly, and I don't imagine
> most of the other boards want to populate holes explicitly
> either.
>
> The current QEMU design basically only controls the total amount
> of RAM (as a command line option, and as a parameter to the board
> init function), with NUMA being a an optional extra. Non-NUMA is
> the common use case and you want the API used by the board code
> to be straightforward to implement this common case. Adding a
> simple "maximum RAM" field fits in with the existing design and
> solves a genuine requirement for multiple board models.
>
> Even if one system happens to have NUMA-specific requirements we
> don't want to have to have every single devboard specify its RAM
> limits in a complicated fashion for the benefit of the one NUMA
> system. Just have the NUMA system not specify max_ram (so it gets
> the default of zero, ie "don't check") and have some NUMA-specific
> QEMUMachine fields which default to "system doesn't support NUMA".
> Then NUMA aware board models can do the right thing, and non-NUMA
> boards also do the right thing without having to think about
> NUMA-related fields at all.
> (Compare the way non-SMP boards don't have to worry about the
> max_cpus field.)
>
> -- PMM
>
next prev parent reply other threads:[~2011-03-30 13:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-29 14:08 [Qemu-devel] [PATCH v3 0/7] Let boards state maximum RAM limits in QEMUMachine struct Peter Maydell
2011-03-29 14:08 ` [Qemu-devel] [PATCH v3 1/7] Allow boards to specify maximum RAM size Peter Maydell
2011-03-29 14:08 ` [Qemu-devel] [PATCH v3 2/7] hw: Add maximum RAM specifications for ARM devboard models Peter Maydell
2011-03-29 14:08 ` [Qemu-devel] [PATCH v3 3/7] vl.c: Fix machine registration so QEMUMachine structs can be const Peter Maydell
2011-03-29 14:08 ` [Qemu-devel] [PATCH v3 4/7] hw/sun4m: Move QEMUMachine structs into sun4*_hwdef structs Peter Maydell
2011-03-29 14:08 ` [Qemu-devel] [PATCH v3 5/7] hw/sun4m: Use the QEMUMachine max_ram to implement memory limit Peter Maydell
2011-03-29 14:08 ` [Qemu-devel] [PATCH v3 6/7] hw/sun4m: Use a macro to hide the repetitive board init functions Peter Maydell
2011-03-29 14:08 ` [Qemu-devel] [PATCH v3 7/7] hw: Make QEMUMachine structure definitions const Peter Maydell
2011-03-30 7:48 ` [Qemu-devel] [PATCH v3 0/7] Let boards state maximum RAM limits in QEMUMachine struct Jes Sorensen
2011-03-30 8:09 ` Peter Maydell
2011-03-30 10:51 ` Jes Sorensen
2011-03-30 13:22 ` Peter Maydell
2011-03-30 13:55 ` Jes Sorensen
2011-03-30 13:56 ` Anthony Liguori [this message]
2011-03-30 14:07 ` Peter Maydell
2011-04-04 14:29 ` Jes Sorensen
2011-04-04 14:42 ` Peter Maydell
2011-04-04 14:53 ` Jes Sorensen
2011-04-04 16:54 ` Blue Swirl
2011-04-12 13:58 ` Jes Sorensen
2011-04-04 17:26 ` Peter Maydell
2011-04-12 13:55 ` Jes Sorensen
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=4D933677.8000606@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=Jes.Sorensen@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--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).