* -smp cleanpus (Yanan)
* Hyper-V enlightenment functionality (Vitaly)
* virtio-mem support in dump, tpm and QMP (David)
* NetBSD GCC 7.4 compiler support (Nia)
# gpg: Signature made Sun 03 Oct 2021 03:41:30 AM EDT
# gpg: using RSA key
F13338574B662389866C7682BFFBD25F78C7AE83
# gpg: issuer "
[email protected]"
# gpg: Good signature from "Paolo Bonzini <
[email protected]>" [full]
# gpg: aka "Paolo Bonzini <
[email protected]>" [full]
* remotes/bonzini/tags/for-upstream:
softmmu/memory_mapping: optimize for RamDiscardManager sections
softmmu/memory_mapping: factor out adding physical memory ranges
softmmu/memory_mapping: never merge ranges accross memory regions
tpm: mark correct memory region range dirty when clearing RAM
monitor: Rate-limit MEMORY_DEVICE_SIZE_CHANGE qapi events per device
qapi: Include qom-path in MEMORY_DEVICE_SIZE_CHANGE qapi events
virtio-mem-pci: Fix memory leak when creating MEMORY_DEVICE_SIZE_CHANGE event
configure: Loosen GCC requirement from 7.5.0 to 7.4.0
Signed-off-by: Richard Henderson <[email protected]>
# endif
# endif
#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
-# if __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 5)
-# error You need at least GCC v7.5.0 to compile QEMU
+# if __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 4)
+# error You need at least GCC v7.4.0 to compile QEMU
# endif
#else
# error You either need GCC or Clang to compiler QEMU
int main (void) { return 0; }
EOF
if ! compile_prog "" "" ; then
- error_exit "You need at least GCC v7.5 or Clang v6.0 (or XCode Clang v10.0)"
+ error_exit "You need at least GCC v7.4 or Clang v6.0 (or XCode Clang v10.0)"
fi
# Accumulate -Wfoo and -Wno-bar separately.
guest_phys_blocks_init(&guest_phys_blocks);
guest_phys_blocks_append(&guest_phys_blocks);
QTAILQ_FOREACH(block, &guest_phys_blocks.head, next) {
+ hwaddr mr_offs = block->host_addr -
+ (uint8_t *)memory_region_get_ram_ptr(block->mr);
+
trace_tpm_ppi_memset(block->host_addr,
block->target_end - block->target_start);
memset(block->host_addr, 0,
block->target_end - block->target_start);
- memory_region_set_dirty(block->mr, 0,
+ memory_region_set_dirty(block->mr, mr_offs,
block->target_end - block->target_start);
}
guest_phys_blocks_free(&guest_phys_blocks);
VirtIOMEMPCI *pci_mem = container_of(notifier, VirtIOMEMPCI,
size_change_notifier);
DeviceState *dev = DEVICE(pci_mem);
+ char *qom_path = object_get_canonical_path(OBJECT(dev));
const uint64_t * const size_p = data;
- const char *id = NULL;
- if (dev->id) {
- id = g_strdup(dev->id);
- }
-
- qapi_event_send_memory_device_size_change(!!id, id, *size_p);
+ qapi_event_send_memory_device_size_change(!!dev->id, dev->id, *size_p,
+ qom_path);
+ g_free(qom_path);
}
static void virtio_mem_pci_class_init(ObjectClass *klass, void *data)
hash += g_str_hash(qdict_get_str(evstate->data, "node-name"));
}
+ if (evstate->event == QAPI_EVENT_MEMORY_DEVICE_SIZE_CHANGE) {
+ hash += g_str_hash(qdict_get_str(evstate->data, "qom-path"));
+ }
+
return hash;
}
qdict_get_str(evb->data, "node-name"));
}
+ if (eva->event == QAPI_EVENT_MEMORY_DEVICE_SIZE_CHANGE) {
+ return !strcmp(qdict_get_str(eva->data, "qom-path"),
+ qdict_get_str(evb->data, "qom-path"));
+ }
+
return TRUE;
}
# action).
#
# @id: device's ID
+#
# @size: the new size of memory that the device provides
#
+# @qom-path: path to the device object in the QOM tree (since 6.2)
+#
# Note: this event is rate-limited.
#
# Since: 5.1
#
##
{ 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
- 'data': { '*id': 'str', 'size': 'size' } }
+ 'data': { '*id': 'str', 'size': 'size', 'qom-path' : 'str'} }
##
MemoryListener listener;
} GuestPhysListener;
-static void guest_phys_blocks_region_add(MemoryListener *listener,
+static void guest_phys_block_add_section(GuestPhysListener *g,
MemoryRegionSection *section)
{
- GuestPhysListener *g;
- uint64_t section_size;
- hwaddr target_start, target_end;
- uint8_t *host_addr;
- GuestPhysBlock *predecessor;
-
- /* we only care about RAM */
- if (!memory_region_is_ram(section->mr) ||
- memory_region_is_ram_device(section->mr) ||
- memory_region_is_nonvolatile(section->mr)) {
- return;
- }
-
- g = container_of(listener, GuestPhysListener, listener);
- section_size = int128_get64(section->size);
- target_start = section->offset_within_address_space;
- target_end = target_start + section_size;
- host_addr = memory_region_get_ram_ptr(section->mr) +
- section->offset_within_region;
- predecessor = NULL;
+ const hwaddr target_start = section->offset_within_address_space;
+ const hwaddr target_end = target_start + int128_get64(section->size);
+ uint8_t *host_addr = memory_region_get_ram_ptr(section->mr) +
+ section->offset_within_region;
+ GuestPhysBlock *predecessor = NULL;
/* find continuity in guest physical address space */
if (!QTAILQ_EMPTY(&g->list->head)) {
/* we want continuity in both guest-physical and host-virtual memory */
if (predecessor->target_end < target_start ||
- predecessor->host_addr + predecessor_size != host_addr) {
+ predecessor->host_addr + predecessor_size != host_addr ||
+ predecessor->mr != section->mr) {
predecessor = NULL;
}
}
#endif
}
+static int guest_phys_ram_populate_cb(MemoryRegionSection *section,
+ void *opaque)
+{
+ GuestPhysListener *g = opaque;
+
+ guest_phys_block_add_section(g, section);
+ return 0;
+}
+
+static void guest_phys_blocks_region_add(MemoryListener *listener,
+ MemoryRegionSection *section)
+{
+ GuestPhysListener *g = container_of(listener, GuestPhysListener, listener);
+
+ /* we only care about RAM */
+ if (!memory_region_is_ram(section->mr) ||
+ memory_region_is_ram_device(section->mr) ||
+ memory_region_is_nonvolatile(section->mr)) {
+ return;
+ }
+
+ /* for special sparse regions, only add populated parts */
+ if (memory_region_has_ram_discard_manager(section->mr)) {
+ RamDiscardManager *rdm;
+
+ rdm = memory_region_get_ram_discard_manager(section->mr);
+ ram_discard_manager_replay_populated(rdm, section,
+ guest_phys_ram_populate_cb, g);
+ return;
+ }
+
+ guest_phys_block_add_section(g, section);
+}
+
void guest_phys_blocks_append(GuestPhysBlockList *list)
{
GuestPhysListener g = { 0 };