aboutsummaryrefslogtreecommitdiff
path: root/migration/postcopy-ram.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-09-24 18:48:45 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-09-24 18:48:45 +0100
commit8c1c07929feae876202ba26f07a540c5115c18cd (patch)
tree20f6c8e2ac556bfb3c88a98c0d0cb2689de0263e /migration/postcopy-ram.c
parent1bd5556f6686365e76f7ff67fe67260c449e8345 (diff)
parentd73415a315471ac0b127ed3fad45c8ec5d711de1 (diff)
downloadqemu-8c1c07929feae876202ba26f07a540c5115c18cd.zip
qemu-8c1c07929feae876202ba26f07a540c5115c18cd.tar.gz
qemu-8c1c07929feae876202ba26f07a540c5115c18cd.tar.bz2
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Pull request This includes the atomic_ -> qatomic_ rename that touches many files and is prone to conflicts. # gpg: Signature made Wed 23 Sep 2020 17:08:43 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: qemu/atomic.h: rename atomic_ to qatomic_ tests: add test-fdmon-epoll fdmon-poll: reset npfd when upgrading to fdmon-epoll gitmodules: add qemu.org vbootrom submodule gitmodules: switch to qemu.org meson mirror gitmodules: switch to qemu.org qboot mirror docs/system: clarify deprecation schedule virtio-crypto: don't modify elem->in/out_sg virtio-blk: undo destructive iov_discard_*() operations util/iov: add iov_discard_undo() virtio: add vhost-user-fs-ccw device libvhost-user: handle endianness as mandated by the spec MAINTAINERS: add Stefan Hajnoczi as block/nvme.c maintainer Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'migration/postcopy-ram.c')
-rw-r--r--migration/postcopy-ram.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index baf094b..1654ff1 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -530,7 +530,7 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
Error *local_err = NULL;
/* Let the fault thread quit */
- atomic_set(&mis->fault_thread_quit, 1);
+ qatomic_set(&mis->fault_thread_quit, 1);
postcopy_fault_thread_notify(mis);
trace_postcopy_ram_incoming_cleanup_join();
qemu_thread_join(&mis->fault_thread);
@@ -742,12 +742,12 @@ static void mark_postcopy_blocktime_begin(uintptr_t addr, uint32_t ptid,
low_time_offset = get_low_time_offset(dc);
if (dc->vcpu_addr[cpu] == 0) {
- atomic_inc(&dc->smp_cpus_down);
+ qatomic_inc(&dc->smp_cpus_down);
}
- atomic_xchg(&dc->last_begin, low_time_offset);
- atomic_xchg(&dc->page_fault_vcpu_time[cpu], low_time_offset);
- atomic_xchg(&dc->vcpu_addr[cpu], addr);
+ qatomic_xchg(&dc->last_begin, low_time_offset);
+ qatomic_xchg(&dc->page_fault_vcpu_time[cpu], low_time_offset);
+ qatomic_xchg(&dc->vcpu_addr[cpu], addr);
/*
* check it here, not at the beginning of the function,
@@ -756,9 +756,9 @@ static void mark_postcopy_blocktime_begin(uintptr_t addr, uint32_t ptid,
*/
already_received = ramblock_recv_bitmap_test(rb, (void *)addr);
if (already_received) {
- atomic_xchg(&dc->vcpu_addr[cpu], 0);
- atomic_xchg(&dc->page_fault_vcpu_time[cpu], 0);
- atomic_dec(&dc->smp_cpus_down);
+ qatomic_xchg(&dc->vcpu_addr[cpu], 0);
+ qatomic_xchg(&dc->page_fault_vcpu_time[cpu], 0);
+ qatomic_dec(&dc->smp_cpus_down);
}
trace_mark_postcopy_blocktime_begin(addr, dc, dc->page_fault_vcpu_time[cpu],
cpu, already_received);
@@ -813,28 +813,28 @@ static void mark_postcopy_blocktime_end(uintptr_t addr)
for (i = 0; i < smp_cpus; i++) {
uint32_t vcpu_blocktime = 0;
- read_vcpu_time = atomic_fetch_add(&dc->page_fault_vcpu_time[i], 0);
- if (atomic_fetch_add(&dc->vcpu_addr[i], 0) != addr ||
+ read_vcpu_time = qatomic_fetch_add(&dc->page_fault_vcpu_time[i], 0);
+ if (qatomic_fetch_add(&dc->vcpu_addr[i], 0) != addr ||
read_vcpu_time == 0) {
continue;
}
- atomic_xchg(&dc->vcpu_addr[i], 0);
+ qatomic_xchg(&dc->vcpu_addr[i], 0);
vcpu_blocktime = low_time_offset - read_vcpu_time;
affected_cpu += 1;
/* we need to know is that mark_postcopy_end was due to
* faulted page, another possible case it's prefetched
* page and in that case we shouldn't be here */
if (!vcpu_total_blocktime &&
- atomic_fetch_add(&dc->smp_cpus_down, 0) == smp_cpus) {
+ qatomic_fetch_add(&dc->smp_cpus_down, 0) == smp_cpus) {
vcpu_total_blocktime = true;
}
/* continue cycle, due to one page could affect several vCPUs */
dc->vcpu_blocktime[i] += vcpu_blocktime;
}
- atomic_sub(&dc->smp_cpus_down, affected_cpu);
+ qatomic_sub(&dc->smp_cpus_down, affected_cpu);
if (vcpu_total_blocktime) {
- dc->total_blocktime += low_time_offset - atomic_fetch_add(
+ dc->total_blocktime += low_time_offset - qatomic_fetch_add(
&dc->last_begin, 0);
}
trace_mark_postcopy_blocktime_end(addr, dc, dc->total_blocktime,
@@ -928,7 +928,7 @@ static void *postcopy_ram_fault_thread(void *opaque)
error_report("%s: read() failed", __func__);
}
- if (atomic_read(&mis->fault_thread_quit)) {
+ if (qatomic_read(&mis->fault_thread_quit)) {
trace_postcopy_ram_fault_thread_quit();
break;
}
@@ -1410,13 +1410,13 @@ static PostcopyState incoming_postcopy_state;
PostcopyState postcopy_state_get(void)
{
- return atomic_mb_read(&incoming_postcopy_state);
+ return qatomic_mb_read(&incoming_postcopy_state);
}
/* Set the state and return the old state */
PostcopyState postcopy_state_set(PostcopyState new_state)
{
- return atomic_xchg(&incoming_postcopy_state, new_state);
+ return qatomic_xchg(&incoming_postcopy_state, new_state);
}
/* Register a handler for external shared memory postcopy