dump: Abstract dump_init() further with qemu_for_each_cpu()

Allows to drop CPUArchState variable.

Signed-off-by: Andreas Färber <afaerber@suse.de>
dump: Abstract write_elf{64,32}_notes() with qemu_for_each_cpu()

Removes the last use of CPUArchState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
memory_mapping: Use hwaddr type for MemoryMapping virt_addr field

The memory mapping API uses hwaddr, so use it in the struct, too.
This avoids a header dependency on target_ulong type.

Cc: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
memory_mapping: Build only once

Move RAMBlock, RAMList and ram_list to exec/cpu-common.h since they do
not depend on CPUArchState. We can then use it together with qom/cpu.h
to replace cpu.h and exec/cpu-all.h includes, making it fully
target-independent.

Signed-off-by: Andreas Färber <afaerber@suse.de>
kvm: Change kvm_cpu_synchronize_state() argument to CPUState

It no longer relies on CPUArchState since 20d695a.

Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
kvm: Change cpu_synchronize_state() argument to CPUState

Change Monitor::mon_cpu to CPUState as well.
In cpu_synchronize_all_states() use qemu_for_each_cpu() now.

Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
gdbstub: Simplify find_cpu()

Use qemu_get_cpu() and CPUState::env_ptr.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Change cpu_exit() argument to CPUState

It no longer depends on CPUArchState, so move it to qom/cpu.c.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Change cpu_thread_is_idle() argument to CPUState

It no longer needs CPUArchState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Change qemu_kvm_wait_io_event() argument to CPUState

It no longer uses CPUArchState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
kvm: Change kvm_set_signal_mask() argument to CPUState

CPUArchState is no longer needed.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Change qemu_kvm_init_cpu_signals() argument to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks

Make cpustats monitor command available unconditionally.

Signed-off-by: Andreas Färber <afaerber@suse.de>
kvm: Change kvm_handle_internal_error() argument to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
kvm: Change kvm_cpu_exec() argument to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
gdbstub: Set gdb_set_stop_cpu() argument to CPUState

Use CPUState::env_ptr for now.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Change cpu_handle_guest_debug() argument to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Change qemu_kvm_start_vcpu() argument to CPUState

Pass it on to qemu_kvm_cpu_thread_fn().

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Change qemu_dummy_start_vcpu() argument to CPUState

Pass it to qemu_dummy_cpu_thread_fn().
Use CPUState::env_ptr for cpu_single_env.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Change qemu_init_vcpu() argument to CPUState

This allows to move the call to CPUState's realizefn.
Therefore move the stub into libqemustub.a.

Signed-off-by: Andreas Färber <afaerber@suse.de>