Skip to contentSkip to conversation

[7088] Implement dynamic guest ram allocation.

Qemu-devel Paul Brook 1 participant 1 message Apr 11, 2009

lore
Share & tools
lore

Paul Brook

author
#0 lore raw

Revision: 7088

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7088
Author:   pbrook
Date:     2009-04-11 17:15:54 +0000 (Sat, 11 Apr 2009)

Log Message:
-----------
Implement dynamic guest ram allocation.

Modified Paths:
--------------
trunk/cpu-all.h
trunk/exec-all.h
trunk/exec.c
trunk/kqemu.c
trunk/vl.c

Modified: trunk/cpu-all.h
===================================================================

cpu-all.h +1 -2
@@ -854,11 +854,10 @@
 
 /* memory API */
 
-extern ram_addr_t phys_ram_size;
 extern int phys_ram_fd;
-extern uint8_t *phys_ram_base;
 extern uint8_t *phys_ram_dirty;
 extern ram_addr_t ram_size;
+extern ram_addr_t last_ram_offset;
 
 /* physical memory access */
 

Modified: trunk/exec-all.h
===================================================================

exec-all.h +3 -0
@@ -370,6 +370,9 @@
 
 extern uint32_t kqemu_comm_base;
 
+extern ram_addr_t kqemu_phys_ram_size;
+extern uint8_t *kqemu_phys_ram_base;
+
 static inline int kqemu_is_ok(CPUState *env)
 {
     return(env->kqemu_enabled &&

Modified: trunk/exec.c
===================================================================

exec.c +116 -14

180 lines not on this page · raw message

Modified: trunk/kqemu.c
===================================================================

kqemu.c +6 -3
@@ -91,6 +91,8 @@
 uint8_t *modified_ram_pages_table;
 int qpi_io_memory;
 uint32_t kqemu_comm_base; /* physical address of the QPI communication page */
+ram_addr_t kqemu_phys_ram_size;
+uint8_t *kqemu_phys_ram_base;
 
 #define cpuid(index, eax, ebx, ecx, edx) \
   asm volatile ("cpuid" \
@@ -214,13 +216,14 @@
                                       sizeof(uint64_t));
     if (!modified_ram_pages)
         goto fail;
-    modified_ram_pages_table = qemu_mallocz(phys_ram_size >> TARGET_PAGE_BITS);
+    modified_ram_pages_table =
+        qemu_mallocz(kqemu_phys_ram_size >> TARGET_PAGE_BITS);
     if (!modified_ram_pages_table)
         goto fail;
 
     memset(&kinit, 0, sizeof(kinit)); /* set the paddings to zero */
-    kinit.ram_base = phys_ram_base;
-    kinit.ram_size = phys_ram_size;
+    kinit.ram_base = kqemu_phys_ram_base;
+    kinit.ram_size = kqemu_phys_ram_size;
     kinit.ram_dirty = phys_ram_dirty;
     kinit.pages_to_flush = pages_to_flush;
     kinit.ram_pages_to_update = ram_pages_to_update;

Modified: trunk/vl.c
===================================================================

vl.c +23 -33

120 lines not on this page · raw message