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>
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>
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>
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>
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>