summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAnthony Liguori2013-08-12 15:30:49 +0200
committerAnthony Liguori2013-08-12 15:30:49 +0200
commit4a9a8876a14653fd03918945dbb96de3e84b3e3f (patch)
treec9800364ff8af8ef8e49bc58336637961f31b595 /include
parentMerge remote-tracking branch 'kraxel/usb.87' into staging (diff)
parentdump: rebase from host-private RAMBlock offsets to guest-physical addresses (diff)
downloadqemu-4a9a8876a14653fd03918945dbb96de3e84b3e3f.tar.gz
qemu-4a9a8876a14653fd03918945dbb96de3e84b3e3f.tar.xz
qemu-4a9a8876a14653fd03918945dbb96de3e84b3e3f.zip
Merge remote-tracking branch 'luiz/queue/qmp' into staging
# By Laszlo Ersek # Via Luiz Capitulino * luiz/queue/qmp: dump: rebase from host-private RAMBlock offsets to guest-physical addresses dump: populate guest_phys_blocks dump: introduce GuestPhysBlockList dump: clamp guest-provided mapping lengths to ramblock sizes Message-id: 1375974809-1757-1-git-send-email-lcapitulino@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/sysemu/dump.h4
-rw-r--r--include/sysemu/memory_mapping.h30
2 files changed, 31 insertions, 3 deletions
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
index b8c770f8d9..19fafb2cf9 100644
--- a/include/sysemu/dump.h
+++ b/include/sysemu/dump.h
@@ -20,7 +20,9 @@ typedef struct ArchDumpInfo {
int d_class; /* ELFCLASS32 or ELFCLASS64 */
} ArchDumpInfo;
-int cpu_get_dump_info(ArchDumpInfo *info);
+struct GuestPhysBlockList; /* memory_mapping.h */
+int cpu_get_dump_info(ArchDumpInfo *info,
+ const struct GuestPhysBlockList *guest_phys_blocks);
ssize_t cpu_get_note_size(int class, int machine, int nr_cpus);
#endif
diff --git a/include/sysemu/memory_mapping.h b/include/sysemu/memory_mapping.h
index 6dfb68ddcd..a75d59a55d 100644
--- a/include/sysemu/memory_mapping.h
+++ b/include/sysemu/memory_mapping.h
@@ -17,6 +17,25 @@
#include "qemu/queue.h"
#include "qemu/typedefs.h"
+typedef struct GuestPhysBlock {
+ /* visible to guest, reflects PCI hole, etc */
+ hwaddr target_start;
+
+ /* implies size */
+ hwaddr target_end;
+
+ /* points into host memory */
+ uint8_t *host_addr;
+
+ QTAILQ_ENTRY(GuestPhysBlock) next;
+} GuestPhysBlock;
+
+/* point-in-time snapshot of guest-visible physical mappings */
+typedef struct GuestPhysBlockList {
+ unsigned num;
+ QTAILQ_HEAD(GuestPhysBlockHead, GuestPhysBlock) head;
+} GuestPhysBlockList;
+
/* The physical and virtual address in the memory mapping are contiguous. */
typedef struct MemoryMapping {
hwaddr phys_addr;
@@ -45,10 +64,17 @@ void memory_mapping_list_free(MemoryMappingList *list);
void memory_mapping_list_init(MemoryMappingList *list);
-void qemu_get_guest_memory_mapping(MemoryMappingList *list, Error **errp);
+void guest_phys_blocks_free(GuestPhysBlockList *list);
+void guest_phys_blocks_init(GuestPhysBlockList *list);
+void guest_phys_blocks_append(GuestPhysBlockList *list);
+
+void qemu_get_guest_memory_mapping(MemoryMappingList *list,
+ const GuestPhysBlockList *guest_phys_blocks,
+ Error **errp);
/* get guest's memory mapping without do paging(virtual address is 0). */
-void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list);
+void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list,
+ const GuestPhysBlockList *guest_phys_blocks);
void memory_mapping_filter(MemoryMappingList *list, int64_t begin,
int64_t length);