qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [4246] RAM usage information in machine definition.


From: Igor Kovalenko
Subject: Re: [Qemu-devel] [4246] RAM usage information in machine definition.
Date: Sun, 27 Apr 2008 01:15:30 +0400

On Thu, Apr 24, 2008 at 9:59 PM, Andrzej Zaborowski <address@hidden> wrote:
> Revision: 4246
>           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4246
>  Author:   balrog
>  Date:     2008-04-24 17:59:27 +0000 (Thu, 24 Apr 2008)
>
>  Log Message:
>  -----------
>  RAM usage information in machine definition.
[...]
>  Modified: trunk/hw/sun4u.c
>  ===================================================================
>  --- trunk/hw/sun4u.c    2008-04-24 17:20:25 UTC (rev 4245)
>  +++ trunk/hw/sun4u.c    2008-04-24 17:59:27 UTC (rev 4246)
>  @@ -385,4 +385,5 @@
>      "sun4u",
>      "Sun4u platform",
>      sun4u_init,
>  +    PROM_SIZE_MAX + VGA_RAM_SIZE,
>   };
>
[...]
>  Modified: trunk/vl.c
>  ===================================================================
>  --- trunk/vl.c  2008-04-24 17:20:25 UTC (rev 4245)
>  +++ trunk/vl.c  2008-04-24 17:59:27 UTC (rev 4246)
>  @@ -8277,7 +8277,7 @@
>      machine = first_machine;
>      cpu_model = NULL;
>      initrd_filename = NULL;
>  -    ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
>  +    ram_size = -1;
>      vga_ram_size = VGA_RAM_SIZE;
>   #ifdef CONFIG_GDBSTUB
>      use_gdbstub = 0;
>  @@ -8963,8 +8963,26 @@
>   #endif
>
>      /* init the memory */
>  -    phys_ram_size = ram_size + vga_ram_size + MAX_BIOS_SIZE;
>  +    phys_ram_size = machine->ram_require & ~RAMSIZE_FIXED;
>
>  +    if (machine->ram_require & RAMSIZE_FIXED) {
>  +        if (ram_size > 0) {
>  +            if (ram_size < phys_ram_size) {
>  +                fprintf(stderr, "Machine `%s' requires %i bytes of 
> memory\n",
>  +                                machine->name, phys_ram_size);
>  +                exit(-1);
>  +            }
>  +
>  +            phys_ram_size = ram_size;
>  +        } else
>  +            ram_size = phys_ram_size;
>  +    } else {
>  +        if (ram_size < 0)
>  +            ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
>  +
>  +        phys_ram_size += ram_size;
>  +    }
>  +
>      phys_ram_base = qemu_vmalloc(phys_ram_size);
>      if (!phys_ram_base) {
>          fprintf(stderr, "Could not allocate physical memory\n");
>

512K is not enough to load sparc64 openbios ELF image
Can we do something to make sure the elf loader is aware of available space?
Or just restore old behavior:

Index: hw/sun4u.c
===================================================================
--- hw/sun4u.c  (revision 4256)
+++ hw/sun4u.c  (working copy)
@@ -35,7 +35,7 @@
 #define KERNEL_LOAD_ADDR     0x00404000
 #define CMDLINE_ADDR         0x003ff000
 #define INITRD_LOAD_ADDR     0x00300000
-#define PROM_SIZE_MAX        (512 * 1024)
+#define PROM_SIZE_MAX        (4* 1024 * 1024)
 #define PROM_ADDR            0x1fff0000000ULL
 #define PROM_VADDR           0x000ffd00000ULL
 #define APB_SPECIAL_BASE     0x1fe00000000ULL

-- 
Kind regards,
Igor V. Kovalenko




reply via email to

[Prev in Thread] Current Thread [Next in Thread]