summaryrefslogtreecommitdiff
path: root/include/sysemu/memory_mapping.h
AgeCommit message (Collapse)AuthorFilesLines
2013-08-08dump: rebase from host-private RAMBlock offsets to guest-physical addressesLaszlo Ersek1-2/+5
RAMBlock.offset --> GuestPhysBlock.target_start RAMBlock.offset + RAMBlock.length --> GuestPhysBlock.target_end RAMBlock.length --> GuestPhysBlock.target_end - GuestPhysBlock.target_start "GuestPhysBlock.host_addr" is only used when writing the dump contents. This patch enables "crash" to work with the vmcore by rebasing the vmcore from the left side of the following diagram to the right side: host-private offset relative to ram_addr RAMBlock guest-visible paddrs 0 +-------------------+.....+-------------------+ 0 | ^ | | ^ | | 640 KB | | 640 KB | | v | | v | 0x0000a0000 +-------------------+.....+-------------------+ 0x0000a0000 | ^ | |XXXXXXXXXXXXXXXXXXX| | 384 KB | |XXXXXXXXXXXXXXXXXXX| | v | |XXXXXXXXXXXXXXXXXXX| 0x000100000 +-------------------+.....+-------------------+ 0x000100000 | ^ | | ^ | | 3583 MB | | 3583 MB | | v | | v | 0x0e0000000 +-------------------+.....+-------------------+ 0x0e0000000 | ^ |. |XXXXXXXXXXXXXXXXXXX| | above_4g_mem_size | . |XXXX PCI hole XXXXX| | v | . |XXXX XXXXX| ram_size +-------------------+ . |XXXX 512 MB XXXXX| . .|XXXXXXXXXXXXXXXXXXX| . +-------------------+ 0x100000000 . | ^ | . | above_4g_mem_size | .| v | +-------------------+ ram_size + 512 MB Related RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=981582 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-08-08dump: populate guest_phys_blocksLaszlo Ersek1-0/+1
While the machine is paused, in guest_phys_blocks_append() we register a one-shot MemoryListener, solely for the initial collection of the valid guest-physical memory ranges that happens at listener registration time. For each range that is reported to guest_phys_blocks_region_add(), we attempt to merge the range with the preceding one. Ranges can only be joined if they are contiguous in both guest-physical address space, and contiguous in host virtual address space. The "maximal" ranges that remain in the end constitute the guest-physical memory map that the dump will be based on. Related RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=981582 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-08-08dump: introduce GuestPhysBlockListLaszlo Ersek1-0/+22
The vmcore must use physical addresses that are visible to the guest, not addresses that point into linear RAMBlocks. As first step, introduce the list type into which we'll collect the physical mappings in effect at the time of the dump. Related RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=981582 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-06-11memory_mapping: Improve qemu_get_guest_memory_mapping() error reportingAndreas Färber1-7/+1
Pass any Error out into dump_init() and have it actually stop on errors. Whether it is unsupported on a certain CPU can be checked by looking for a NULL CPUClass::get_memory_mapping field. Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> [AF: Reverted changes to CPU loops] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-11cpu: Turn cpu_get_memory_mapping() into a CPUState hookAndreas Färber1-2/+0
Change error reporting from return value to Error argument. Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> [AF: Fixed cpu_get_memory_mapping() documentation] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-11memory_mapping: Move MemoryMappingList typedef to qemu/typedefs.hAndreas Färber1-2/+3
This will avoid issues with hwaddr and ram_addr_t when including sysemu/memory_mapping.h for CONFIG_USER_ONLY, e.g., from qom/cpu.h. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-11cpu: Turn cpu_paging_enabled() into a CPUState hookAndreas Färber1-1/+0
Relocate assignment of x86 get_arch_id to have all hooks in one place. Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19softmmu: move include files to include/sysemu/Paolo Bonzini1-0/+64
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>