Peter Maydell [Mon, 24 Apr 2017 08:43:03 +0000 (09:43 +0100)]
Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging
qemu-sparc update
# gpg: Signature made Fri 21 Apr 2017 20:09:35 BST
# gpg: using RSA key 0x5BC2C56FAE0F321F
# gpg: Good signature from "Mark Cave-Ayland <[email protected]>"
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C C9C4 5BC2 C56F AE0F 321F
* remotes/mcayland/tags/qemu-sparc-signed:
tcx: switch to load_image_mr() and remove prom_addr hack
tcx: use tcx_set_dirty() for accelerated ops
tcx: remove primitives for non-32-bit surfaces
tcx: remove TARGET_PAGE_SIZE from tcx24_update_display()
tcx: remove TARGET_PAGE_SIZE from tcx_update_display()
tcx: remove page24 and cpage from tcx24_update_display()
tcx: alter tcx24_reset_dirty() to accept address and length parameters
tcx: alter tcx24_check_dirty() to accept address and length parameters
tcx: ensure tcx_set_dirty() also invalidates the 24-bit plane and cplane
tcx: alter tcx_set_dirty() to accept address and length parameters
cg3: switch to load_image_mr() and remove prom-addr hack
cg3: fix up size parameter for memory_region_get_dirty()
cg3: remove TARGET_PAGE_SIZE rounding on dirty page detection
* remotes/juanquintela/tags/migration/20170421: (65 commits)
hmp: info migrate_parameters format tunes
hmp: info migrate_capability format tunes
migration: rename max_size to threshold_size
migration: set current_active_state once
virtio-rng: stop virtqueue while the CPU is stopped
migration: don't close a file descriptor while it can be in use
ram: Remove migration_bitmap_extend()
migration: Disable hotplug/unplug during migration
qdev: Move qdev_unplug() to qdev-monitor.c
qdev: Export qdev_hot_removed
qdev: qdev_hotplug is really a bool
migration: Remove MigrationState parameter from migration_is_idle()
ram: Use RAMBitmap type for coherence
ram: rename last_ram_offset() last_ram_pages()
ram: Use ramblock and page offset instead of absolute offset
ram: Change offset field in PageSearchStatus to page
ram: Remember last_page instead of last_offset
ram: Use page number instead of an address for the bitmap operations
ram: reorganize last_sent_block
ram: ram_discard_range() don't use the mis parameter
...
* remotes/stefanha/tags/tracing-pull-request:
simpletrace: document Analyzer method signatures
trace: Put all trace.o into libqemuutil.a
configure: eliminate Python dependency for --help
* remotes/stefanha/tags/block-pull-request:
MAINTAINERS: update my email address
MAINTAINERS: update Wen's email address
migration/block: use blk_pwrite_zeroes for each zero cluster
throttle: make throttle_config(throttle_get_config()) symmetric
throttle: do not use invalid config in test
qemu-options: explain disk I/O throttling options
* remotes/cohuck/tags/s390x-20170421:
s390x: Drop useless casts
s390x: register I/O adapters per ISC during init
s390x/flic: cache flic in s390_get_flic
s390x: initialize flic before I/O subsystems
s390x: use enum for adapter type and standardize its naming
s390x/css: consolidate the devno property for ccw devices
s390x/css: provide introspection for virtual subchannel and device busid
s390x/css: introduce read-only property type for device ids
s390x/pci: make printf always compile in debug output
s390x/kvm: make printf always compile in debug output
s390x: introduce 2.10 compat machine
Peter Xu [Sat, 1 Apr 2017 08:18:43 +0000 (16:18 +0800)]
migration: rename max_size to threshold_size
In migration codes (especially in migration_thread()), max_size is used
in many place for the threshold value that we will start to do the final
flush and jump to the next stage to dump the whole rest things to
destination. However its name is confusing to first readers. Let's
rename it to "threshold_size" when proper and add a comment for it. No
functional change is made.
virtio-rng: stop virtqueue while the CPU is stopped
If we modify the virtio-rng virqueue while the
vmstate is already migrated we can have some
inconsistencies between the virtqueue state and
the memory content.
To avoid this, stop the virtqueue while the CPU
is stopped.
migration: don't close a file descriptor while it can be in use
If we close the QEMUFile descriptor in process_incoming_migration_co()
while it has been stopped by an error, the postcopy_ram_listen_thread()
can try to continue to use it. And as the memory has been freed
it is working with an invalid pointer and crashes.
Fix this by releasing the memory after having managed the error
case (which, in fact, calls exit())
Juan Quintela [Wed, 22 Mar 2017 16:34:27 +0000 (17:34 +0100)]
migration: Disable hotplug/unplug during migration
Until we have reviewed what can/can't be hotplugged during migration,
disable it. We can enable it later for the things that we know that
work. For instance, memory hotplug during postcopy doesn't work
currently.
Juan Quintela [Tue, 21 Mar 2017 10:45:01 +0000 (11:45 +0100)]
ram: reorganize last_sent_block
We were setting it far away of when we changed it. Now everything is
done inside save_page_header. Once there, reorganize code to pass
RAMState. We also set CONTINUE flag in a single place.
Juan Quintela [Tue, 14 Mar 2017 17:20:30 +0000 (18:20 +0100)]
ram: Move dirty_pages_rate to RAMState
Treat it like the rest of ram stats counters. Export its value the
same way. As an added bonus, no more MigrationState used in
migration_bitmap_sync();
Juan Quintela [Mon, 20 Mar 2017 21:12:40 +0000 (22:12 +0100)]
ram: Move src_page_req* to RAMState
This are the last postcopy fields still at MigrationState. Once there
Move MigrationSrcPageRequest to ram.c and remove MigrationState
parameters where appropiate.
Juan Quintela [Tue, 14 Mar 2017 12:48:42 +0000 (13:48 +0100)]
ram: Move last_req_rb to RAMState
It was on MigrationState when it is only used inside ram.c for
postcopy. Problem is that we need to access it without being able to
pass it RAMState directly.
Stefan Hajnoczi [Tue, 11 Apr 2017 09:56:54 +0000 (10:56 +0100)]
simpletrace: document Analyzer method signatures
Users can inherit from the simpletrace.Analyzer class and receive
callbacks when events of interest occur in a trace file. The method
signature is a little magic because the timestamp and pid arguments are
optional. Document this.
Xu, Anthony [Tue, 4 Apr 2017 21:39:39 +0000 (21:39 +0000)]
trace: Put all trace.o into libqemuutil.a
Currently all trace.o are linked into qemu-system, qemu-img,
qemu-nbd, qemu-io etc., even the corresponding components
are not included.
Put all trace.o into libqemuutil.a that the linker would only pull in .o
files containing symbols that are actually referenced by the
program.
migration/block: use blk_pwrite_zeroes for each zero cluster
BLOCK_SIZE is (1 << 20), qcow2 cluster size is 65536 by default,
this may cause the qcow2 file size to be bigger after migration.
This patch checks each cluster, using blk_pwrite_zeroes for each
zero cluster.
[Initialize cluster_size to BLOCK_SIZE to prevent a gcc uninitialized
variable compiler warning. In reality we always initialize cluster_size
in a conditional but gcc doesn't know that.
--Stefan]
Stefan Hajnoczi [Wed, 1 Mar 2017 11:50:26 +0000 (11:50 +0000)]
throttle: make throttle_config(throttle_get_config()) symmetric
Throttling has a weird property that throttle_get_config() does not
always return the same throttling settings that were given with
throttle_config(). In other words, the set and get functions aren't
symmetric.
If .max is 0 then the throttling code assigns a default value of .avg /
10 in throttle_config(). This is an implementation detail of the
throttling algorithm. When throttle_get_config() is called the .max
value returned should still be 0.
Users are exposed to this quirk via "info block" or "query-block"
monitor commands. This has caused confusion because it looks like a bug
when an unexpected value is reported.
This patch hides the .max value adjustment in throttle_get_config() and
updates test-throttle.c appropriately.
Stefan Hajnoczi [Wed, 1 Mar 2017 11:50:25 +0000 (11:50 +0000)]
throttle: do not use invalid config in test
The (burst) max parameter cannot be smaller than the avg parameter.
There is a test case that uses avg = 56, max = 1 and gets away with it
because no input validation is performed by the test case.
This patch switches to valid test input parameters.
Peter Maydell [Fri, 21 Apr 2017 09:23:56 +0000 (10:23 +0100)]
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-pull-request' into staging
Machine queue for 2.10
# gpg: Signature made Thu 20 Apr 2017 19:44:27 BST
# gpg: using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <[email protected]>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6
* remotes/ehabkost/tags/machine-pull-request:
qdev: Constify local variable returned by blk_bs
qdev: Constify value passed to qdev_prop_set_macaddr
hostmem: use host_memory_backend_mr_inited() where proper
hostmem: introduce host_memory_backend_mr_inited()
hw/core/null-machine: Print error message when using the -kernel parameter
qdev: Make "hotplugged" property read-only
intel_iommu: enable remote IOTLB
intel_iommu: allow dynamic switch of IOMMU region
intel_iommu: provide its own replay() callback
intel_iommu: use the correct memory region for device IOTLB notification
memory: add MemoryRegionIOMMUOps.replay() callback
memory: introduce memory_region_notify_one()
memory: provide iommu_replay_all()
memory: provide IOMMU_NOTIFIER_FOREACH macro
memory: add section range info for IOMMU notifier
tcx: switch to load_image_mr() and remove prom_addr hack
Previous to the existence of load_image_mr(), the only way to load in the
FCode ROM image was to pass in its physical address via qdev properties
and use load_image_targphys().
Rather than calling memory_region_set_dirty() directly, make sure that we call
tcx_set_dirty() instead. This ensures that the 24-bit plane and cplane are
also invalidated correctly.
As all surfaces in QEMU are now either shared or 32-bit ARGB regardless of
the guest depth, remove all non-32-bit primitives from tcx_update_display()
and consequence their implementation which are no longer required.
tcx: remove page24 and cpage from tcx24_update_display()
Since all of the tcx_*_dirty() functions now calculate the 24-bit and
cplane offsets themselves from the base address, these variables are no
longer needed.
cg3: switch to load_image_mr() and remove prom-addr hack
Previous to the existence of load_image_mr(), the only way to load in the
FCode ROM image was to pass in its physical address via qdev properties
and use load_image_targphys().
Eric Blake [Wed, 5 Apr 2017 19:47:31 +0000 (14:47 -0500)]
s390x: Drop useless casts
An upcoming Coccinelle cleanup script wanted to reformat the casts
present in this file - but on closer look, we don't need the casts
at all because C automatically converts void* to any other pointer.
Fei Li [Thu, 24 Nov 2016 10:10:39 +0000 (11:10 +0100)]
s390x: register I/O adapters per ISC during init
The I/O adapters should exist as soon as the bus/infrastructure
exists, and not only when the guest is actually trying to do something
with them. While the lazy allocation was not wrong, allocating at init
time is cleaner, both for the architecture and the code. Let's adjust
this by having each device type (currently for PCI and virtio-ccw)
register the adapters for each ISC (as now we don't know which ISC the
guest will use) as soon as it initializes.
Use a two-dimensional array io_adapters[type][isc] to store adapters
in ChannelSubSys, so that we can conveniently get the adapter id by
the helper function css_get_adapter_id(type, isc).
Fei Li [Fri, 17 Mar 2017 09:28:30 +0000 (10:28 +0100)]
s390x/flic: cache flic in s390_get_flic
s390_get_flic() is called many times to obtain the flic. This wastes a
lot of time as it calls object_resolve_path() every time. Let's cache
S390FLICState by defining it as static.