diff options
Diffstat (limited to 'softmmu')
-rw-r--r-- | softmmu/memory.c | 18 | ||||
-rw-r--r-- | softmmu/physmem.c | 18 | ||||
-rw-r--r-- | softmmu/qdev-monitor.c | 2 | ||||
-rw-r--r-- | softmmu/vl.c | 11 |
4 files changed, 27 insertions, 22 deletions
diff --git a/softmmu/memory.c b/softmmu/memory.c index 8aba4114cf..11ca94d037 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -1813,7 +1813,10 @@ bool memory_region_is_ram_device(MemoryRegion *mr) uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr) { uint8_t mask = mr->dirty_log_mask; - if (global_dirty_log && (mr->ram_block || memory_region_is_iommu(mr))) { + RAMBlock *rb = mr->ram_block; + + if (global_dirty_log && ((rb && qemu_ram_is_migratable(rb)) || + memory_region_is_iommu(mr))) { mask |= (1 << DIRTY_MEMORY_MIGRATION); } return mask; @@ -1848,6 +1851,19 @@ static int memory_region_update_iommu_notify_flags(IOMMUMemoryRegion *iommu_mr, return ret; } +int memory_region_iommu_set_page_size_mask(IOMMUMemoryRegion *iommu_mr, + uint64_t page_size_mask, + Error **errp) +{ + IOMMUMemoryRegionClass *imrc = IOMMU_MEMORY_REGION_GET_CLASS(iommu_mr); + int ret = 0; + + if (imrc->iommu_set_page_size_mask) { + ret = imrc->iommu_set_page_size_mask(iommu_mr, page_size_mask, errp); + } + return ret; +} + int memory_region_register_iommu_notifier(MemoryRegion *mr, IOMMUNotifier *n, Error **errp) { diff --git a/softmmu/physmem.c b/softmmu/physmem.c index a9adedb9f8..3027747c03 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -1756,15 +1756,15 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp) if (!(block->flags & RAM_RESIZEABLE)) { error_setg_errno(errp, EINVAL, - "Length mismatch: %s: 0x" RAM_ADDR_FMT - " in != 0x" RAM_ADDR_FMT, block->idstr, + "Size mismatch: %s: 0x" RAM_ADDR_FMT + " != 0x" RAM_ADDR_FMT, block->idstr, newsize, block->used_length); return -EINVAL; } if (block->max_length < newsize) { error_setg_errno(errp, EINVAL, - "Length too large: %s: 0x" RAM_ADDR_FMT + "Size too large: %s: 0x" RAM_ADDR_FMT " > 0x" RAM_ADDR_FMT, block->idstr, newsize, block->max_length); return -EINVAL; @@ -2723,22 +2723,14 @@ static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr) static bool prepare_mmio_access(MemoryRegion *mr) { - bool unlocked = !qemu_mutex_iothread_locked(); bool release_lock = false; - if (unlocked) { + if (!qemu_mutex_iothread_locked()) { qemu_mutex_lock_iothread(); - unlocked = false; release_lock = true; } if (mr->flush_coalesced_mmio) { - if (unlocked) { - qemu_mutex_lock_iothread(); - } qemu_flush_coalesced_mmio_buffer(); - if (unlocked) { - qemu_mutex_unlock_iothread(); - } } return release_lock; diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index bcfb90a08f..bf79d0bbcd 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/softmmu/vl.c b/softmmu/vl.c index a537a0377f..e6e0ad5a92 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -632,6 +632,7 @@ static const RunStateTransition runstate_transitions_def[] = { { RUN_STATE_SHUTDOWN, RUN_STATE_PAUSED }, { RUN_STATE_SHUTDOWN, RUN_STATE_FINISH_MIGRATE }, { RUN_STATE_SHUTDOWN, RUN_STATE_PRELAUNCH }, + { RUN_STATE_SHUTDOWN, RUN_STATE_COLO }, { RUN_STATE_DEBUG, RUN_STATE_SUSPENDED }, { RUN_STATE_RUNNING, RUN_STATE_SUSPENDED }, @@ -2886,7 +2887,6 @@ void qemu_init(int argc, char **argv, char **envp) int display_remote = 0; const char *log_mask = NULL; const char *log_file = NULL; - char *trace_file = NULL; ram_addr_t maxram_size; uint64_t ram_slots = 0; FILE *vmstate_dump_file = NULL; @@ -3688,8 +3688,7 @@ void qemu_init(int argc, char **argv, char **envp) xen_domid_restrict = true; break; case QEMU_OPTION_trace: - g_free(trace_file); - trace_file = trace_opt_parse(optarg); + trace_opt_parse(optarg); break; case QEMU_OPTION_plugin: qemu_plugin_opt_parse(optarg, &plugin_list); @@ -3939,7 +3938,7 @@ void qemu_init(int argc, char **argv, char **envp) if (!trace_init_backends()) { exit(1); } - trace_init_file(trace_file); + trace_init_file(); /* Open the logfile at this point and set the log mask if necessary. */ @@ -4284,9 +4283,6 @@ void qemu_init(int argc, char **argv, char **envp) qemu_opts_foreach(qemu_find_opts("mon"), mon_init_func, NULL, &error_fatal); - /* connect semihosting console input if requested */ - qemu_semihosting_console_init(); - if (foreach_device_config(DEV_SERIAL, serial_parse) < 0) exit(1); if (foreach_device_config(DEV_PARALLEL, parallel_parse) < 0) @@ -4296,6 +4292,7 @@ void qemu_init(int argc, char **argv, char **envp) /* now chardevs have been created we may have semihosting to connect */ qemu_semihosting_connect_chardevs(); + qemu_semihosting_console_init(); /* If no default VGA is requested, the default is "none". */ if (default_vga) { |