On Mon, Mar 28, 2011 at 4:44 PM, Peter Maydell <peter.mayd...@linaro.org> wrote: > 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). > > Changes in v2: > * use target_physaddr_t rather than ram_addr_t for max_ram, so > we can specify maximum ram sizes for 64 bit target boards > * new patches 3,4 which update sun4m to use the generic max_ram, so > we can delete the sun4m-specific code which was doing the same job > * patch 5 does some tidy-up of sun4m init functions; not strictly > related but the assert() at least is enabled by the cleanup done > in patch 3. > > The number of changed lines in sun4m.c is a bit alarming but it's > almost all just moving code around...
Very nice patch set!