Skip to contentSkip to conversation

Add API to get memory mapping without do paging

PATCH Superseded Wen Congyang 1 participant 1 message Mar 20, 2012

v10 of 15 Superseded Latest is v15 →

lore
Share & tools
lore
#0 lore raw

PATCH v10 6/11 Add API to get memory mapping without do paging

crash does not need the virtual address and physical address mapping, and the mapping does not include the memory that is not referenced by the page table. crash does not use the virtual address, so we can create the mapping for all physical memory(virtual address is always 0). This patch provides a API to do this thing, and it will be used in the following patch.

---
 memory_mapping.c |    9 +++++++++
 memory_mapping.h |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)
memory_mapping.c +9 -0
index b92e2f6..9a2ffe6 100644
@@ -198,3 +198,12 @@ int qemu_get_guest_memory_mapping(MemoryMappingList *list)
     return 0;
 }
 #endif
+
+void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list)
+{
+    RAMBlock *block;
+
+    QLIST_FOREACH(block, &ram_list.blocks, next) {
+        create_new_memory_mapping(list, block->offset, 0, block->length);
+    }
+}
memory_mapping.h +3 -0
index 4d44641..a583e44 100644
@@ -59,4 +59,7 @@ static inline int qemu_get_guest_memory_mapping(MemoryMappingList *list)
 }
 #endif
 
+/* get guest's memory mapping without do paging(virtual address is 0). */
+void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list);
+
 #endif
Signature · 1 line
1.7.1