qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Let boards state maximum RAM limits in QEMUMachine struct
@ 2011-03-21 17:47 Peter Maydell
  2011-03-21 17:47 ` [Qemu-devel] [PATCH 1/2] Allow boards to specify maximum RAM size Peter Maydell
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Peter Maydell @ 2011-03-21 17:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

This fairly simple patchset adds a new 'max_ram' field to the QEMUMachine
structure so that a board model can specify the maximum RAM it will accept.
We can then produce a friendly diagnostic message when the user tries to
start qemu with a '-m' option asking for more RAM than that. (Currently
most of the ARM devboard models respond with an obscure guest crash when
the guest tries to access RAM and finds device registers instead.)

If no maximum size is specified we default to the old behaviour of
"do not impose any limit".

The advantage of doing this in vl.c rather than in each board (apart
from avoiding code duplication) is that we can distinguish between
"the user asked for more RAM than we support" (an error) and "the global
default RAM size is more than our maximum" (just cap the RAM size to
the board maximum).

I did think about also adding a "default_ram" field so each board could
default to the same amount of RAM that real hardware has, but since we
allocate RAM up front rather than only when accessed, this would push the
initial default allocated RAM size up from 128MB to 1GB on models like
the PBX A9, and it didn't seem very friendly to do that. I'm happy
to be persuaded back again, though :-)

This patchset was prompted by bugs like:
https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/584480
https://bugs.launchpad.net/ubuntu/+source/rootstock/+bug/570588

Peter Maydell (2):
  Allow boards to specify maximum RAM size
  hw: Add maximum RAM specifications for ARM devboard models

 hw/boards.h       |    1 +
 hw/integratorcp.c |    1 +
 hw/realview.c     |   11 +++++++++++
 hw/versatilepb.c  |    5 +++++
 vl.c              |   16 +++++++++++++++-
 5 files changed, 33 insertions(+), 1 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-28 10:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21 17:47 [Qemu-devel] [PATCH 0/2] Let boards state maximum RAM limits in QEMUMachine struct Peter Maydell
2011-03-21 17:47 ` [Qemu-devel] [PATCH 1/2] Allow boards to specify maximum RAM size Peter Maydell
2011-03-21 17:47 ` [Qemu-devel] [PATCH 2/2] hw: Add maximum RAM specifications for ARM devboard models Peter Maydell
2011-03-21 19:34 ` [Qemu-devel] [PATCH 0/2] Let boards state maximum RAM limits in QEMUMachine struct Anthony Liguori
2011-03-21 20:44 ` Brad Hards
2011-03-26 11:41 ` Blue Swirl
2011-03-28 10:32   ` Peter Maydell

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).