• [PATCH v2 6/6] hw/mips/malta: Introduce the 'malta-unleashed' 64-bi

    From Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?=@21:1/5 to All on Wed Jul 1 13:20:02 2020
    On Tue, Jun 30, 2020 at 04:52:36PM +0200, Philippe Mathieu-Daudé wrote:
    Introduce the 'malta-unleashed' machine. This machine does not
    model any existing hardware (as the default 'malta' neither model
    a real hardware). The purpose of this machine is to allow user
    of the current 'malta' machine to use more RAM, as it has been
    reported to be useful for build farms.

    References:
    - https://www.mail-archive.com/debian-mips@lists.debian.org/msg10912.html
    - https://alioth-lists.debian.net/pipermail/pkg-rust-maintainers/2019-January/004844.html
    - https://www.mail-archive.com/qemu-devel@nongnu.org/msg691406.html

    I'm not convinced that there's any real value in adding the malta-strict
    and malta-unleashed machine types.

    If you want to closely model a real physical machine it doesn't matter
    what the "max ram" setting says - you can just choose a "-m MB" value
    to match the physical machine you want to model.

    Similarly if users want to exceed what the physical machine would do
    there's no compelling reason for QEMU to artificially prevent that
    or force use of a different machine. Neither i440fx or q35 force
    users to the max RAM limit of the physical machine they were originally designed from. We have frequently just bumped the max limits in QEMU
    for i440fx/q35 as we had users who requested a higher level.

    IIUC, The current 2 GB limit is just a historical artifact from the
    limited address space in 32-bit, which we don't have to be bound by
    for 64-bit.

    IOW, instead of adding new machine types I would think we can just
    modify the existing limit for TARGET_MIPS64, by doing something akin
    to:


    diff --git a/hw/mips/malta.c b/hw/mips/malta.c
    index d95926a89c..48e34da39c 100644
    --- a/hw/mips/malta.c
    +++ b/hw/mips/malta.c
    @@ -1247,9 +1247,14 @@ void mips_malta_init(MachineState *machine)
    mips_create_cpu(machine, s, &cbus_irq, &i8259_irq);

    /* allocate RAM */
    - if (ram_size > 2 * GiB) {
    +#ifdef TARGET_MIPS64
    +#define MAX_RAM_MB 3056
    +#else
    +#define MAX_RAM_MB 2048
    +#endif
    + if (ram_size > MAX_RAM_MB * MiB) {
    error_report("Too much memory for this machine: %" PRId64 "MB,"
    - " maximum 2048MB", ram_size / MiB);
    + " maximum " MAX_RAM_MB "MB", ram_size / MiB);
    exit(1);
    }


    Regards,
    Daniel
    --
    |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)