Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into…
Browse files Browse the repository at this point in the history
… staging

NEED_CPU_H cleanups, big enough to deserve their own pull request.

# gpg: Signature made Thu 19 May 2016 15:42:37 BST using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"

* remotes/bonzini/tags/for-upstream: (52 commits)
  hw: clean up hw/hw.h includes
  hw: remove pio_addr_t
  cpu: move exec-all.h inclusion out of cpu.h
  exec: extract exec/tb-context.h
  hw: explicitly include qemu/log.h
  mips: move CP0 functions out of cpu.h
  arm: move arm_log_exception into .c file
  qemu-common: push cpu.h inclusion out of qemu-common.h
  acpi: do not use TARGET_PAGE_SIZE
  s390x: reorganize CSS bits between cpu.h and other headers
  dma: do not depend on kvm_enabled()
  gdbstub: remove unnecessary includes from gdbstub-xml.c
  qemu-common: stop including qemu/host-utils.h from qemu-common.h
  qemu-common: stop including qemu/bswap.h from qemu-common.h
  cpu: move endian-dependent load/store functions to cpu-all.h
  hw: cannot include hw/hw.h from user emulation
  hw: move CPU state serialization to migration/cpu.h
  hw: do not use VMSTATE_*TL
  include: poison symbols in osdep.h
  apic: move target-dependent definitions to cpu.h
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed May 19, 2016
2 parents 8ec4fe0 + df43d49 commit 776efef
Show file tree
Hide file tree
Showing 431 changed files with 2,099 additions and 1,618 deletions.
2 changes: 2 additions & 0 deletions arch_init.c
Expand Up @@ -22,6 +22,8 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "cpu.h"
#include "sysemu/sysemu.h"
#include "sysemu/arch_init.h"
#include "hw/pci/pci.h"
Expand Down
1 change: 1 addition & 0 deletions audio/mixeng.c
Expand Up @@ -24,6 +24,7 @@
*/
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/bswap.h"
#include "audio.h"

#define AUDIO_CAP "mixeng"
Expand Down
1 change: 1 addition & 0 deletions audio/noaudio.c
Expand Up @@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/host-utils.h"
#include "audio.h"
#include "qemu/timer.h"

Expand Down
1 change: 1 addition & 0 deletions audio/spiceaudio.c
Expand Up @@ -19,6 +19,7 @@

#include "qemu/osdep.h"
#include "hw/hw.h"
#include "qemu/host-utils.h"
#include "qemu/error-report.h"
#include "qemu/timer.h"
#include "ui/qemu-spice.h"
Expand Down
2 changes: 1 addition & 1 deletion audio/wavaudio.c
Expand Up @@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
#include "hw/hw.h"
#include "qemu/host-utils.h"
#include "qemu/timer.h"
#include "audio.h"

Expand Down
1 change: 1 addition & 0 deletions block/bochs.c
Expand Up @@ -27,6 +27,7 @@
#include "qemu-common.h"
#include "block/block_int.h"
#include "qemu/module.h"
#include "qemu/bswap.h"

/**************************************************************/

Expand Down
1 change: 1 addition & 0 deletions block/cloop.c
Expand Up @@ -26,6 +26,7 @@
#include "qemu-common.h"
#include "block/block_int.h"
#include "qemu/module.h"
#include "qemu/bswap.h"
#include <zlib.h>

/* Maximum compressed block size */
Expand Down
1 change: 1 addition & 0 deletions block/parallels.c
Expand Up @@ -33,6 +33,7 @@
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "qemu/bswap.h"
#include "qemu/bitmap.h"
#include "qapi/util.h"

Expand Down
1 change: 1 addition & 0 deletions block/qcow.c
Expand Up @@ -28,6 +28,7 @@
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "qemu/bswap.h"
#include <zlib.h>
#include "qapi/qmp/qerror.h"
#include "crypto/cipher.h"
Expand Down
1 change: 1 addition & 0 deletions block/qcow2-cluster.c
Expand Up @@ -29,6 +29,7 @@
#include "qemu-common.h"
#include "block/block_int.h"
#include "block/qcow2.h"
#include "qemu/bswap.h"
#include "trace.h"

int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
Expand Down
1 change: 1 addition & 0 deletions block/qcow2-refcount.c
Expand Up @@ -28,6 +28,7 @@
#include "block/block_int.h"
#include "block/qcow2.h"
#include "qemu/range.h"
#include "qemu/bswap.h"

static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size);
static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
Expand Down
1 change: 1 addition & 0 deletions block/qcow2-snapshot.c
Expand Up @@ -26,6 +26,7 @@
#include "qapi/error.h"
#include "block/block_int.h"
#include "block/qcow2.h"
#include "qemu/bswap.h"
#include "qemu/error-report.h"
#include "qemu/cutils.h"

Expand Down
1 change: 1 addition & 0 deletions block/qcow2.c
Expand Up @@ -36,6 +36,7 @@
#include "trace.h"
#include "qemu/option_int.h"
#include "qemu/cutils.h"
#include "qemu/bswap.h"

/*
Differences with QCOW:
Expand Down
1 change: 1 addition & 0 deletions block/qed-table.c
Expand Up @@ -16,6 +16,7 @@
#include "trace.h"
#include "qemu/sockets.h" /* for EINPROGRESS on Windows */
#include "qed.h"
#include "qemu/bswap.h"

typedef struct {
GenericCB gencb;
Expand Down
1 change: 1 addition & 0 deletions block/qed.c
Expand Up @@ -15,6 +15,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/timer.h"
#include "qemu/bswap.h"
#include "trace.h"
#include "qed.h"
#include "qapi/qmp/qerror.h"
Expand Down
1 change: 1 addition & 0 deletions block/vdi.c
Expand Up @@ -54,6 +54,7 @@
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "qemu/bswap.h"
#include "migration/migration.h"
#include "qemu/coroutine.h"
#include "qemu/cutils.h"
Expand Down
1 change: 1 addition & 0 deletions block/vhdx-endian.c
Expand Up @@ -18,6 +18,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "block/block_int.h"
#include "qemu/bswap.h"
#include "block/vhdx.h"

#include <uuid/uuid.h>
Expand Down
1 change: 1 addition & 0 deletions block/vhdx-log.c
Expand Up @@ -23,6 +23,7 @@
#include "block/block_int.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "qemu/bswap.h"
#include "block/vhdx.h"


Expand Down
1 change: 1 addition & 0 deletions block/vhdx.c
Expand Up @@ -22,6 +22,7 @@
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "qemu/crc32c.h"
#include "qemu/bswap.h"
#include "block/vhdx.h"
#include "migration/migration.h"

Expand Down
1 change: 1 addition & 0 deletions block/vmdk.c
Expand Up @@ -30,6 +30,7 @@
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "qemu/bswap.h"
#include "migration/migration.h"
#include "qemu/cutils.h"
#include <zlib.h>
Expand Down
1 change: 1 addition & 0 deletions block/vpc.c
Expand Up @@ -29,6 +29,7 @@
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "migration/migration.h"
#include "qemu/bswap.h"
#if defined(CONFIG_UUID)
#include <uuid/uuid.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions block/vvfat.c
Expand Up @@ -27,6 +27,7 @@
#include "qapi/error.h"
#include "block/block_int.h"
#include "qemu/module.h"
#include "qemu/bswap.h"
#include "migration/migration.h"
#include "qapi/qmp/qint.h"
#include "qapi/qmp/qbool.h"
Expand Down
1 change: 1 addition & 0 deletions bootdevice.c
Expand Up @@ -28,6 +28,7 @@
#include "qapi/visitor.h"
#include "qemu/error-report.h"
#include "hw/hw.h"
#include "hw/qdev-core.h"

typedef struct FWBootEntry FWBootEntry;

Expand Down
2 changes: 2 additions & 0 deletions bsd-user/main.c
Expand Up @@ -25,6 +25,7 @@
#include "qemu/help_option.h"
/* For tb_lock */
#include "cpu.h"
#include "exec/exec-all.h"
#include "tcg.h"
#include "qemu/timer.h"
#include "qemu/envlist.h"
Expand Down Expand Up @@ -849,6 +850,7 @@ int main(int argc, char **argv)
}

/* init debug */
qemu_log_needs_buffers();
qemu_set_log_filename(log_file);
if (log_mask) {
int mask;
Expand Down
1 change: 1 addition & 0 deletions bsd-user/qemu.h
Expand Up @@ -19,6 +19,7 @@


#include "cpu.h"
#include "exec/exec-all.h"
#include "exec/cpu_ldst.h"

#undef DEBUG_REMAP
Expand Down
1 change: 1 addition & 0 deletions contrib/ivshmem-server/ivshmem-server.c
Expand Up @@ -7,6 +7,7 @@
*/
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/host-utils.h"
#include "qemu/sockets.h"

#include <sys/mman.h>
Expand Down
1 change: 1 addition & 0 deletions cpu-exec-common.c
Expand Up @@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "sysemu/cpus.h"
#include "exec/exec-all.h"
#include "exec/memory-internal.h"

bool exit_request;
Expand Down
1 change: 1 addition & 0 deletions cpu-exec.c
Expand Up @@ -20,6 +20,7 @@
#include "cpu.h"
#include "trace.h"
#include "disas/disas.h"
#include "exec/exec-all.h"
#include "tcg.h"
#include "qemu/atomic.h"
#include "sysemu/qtest.h"
Expand Down
4 changes: 3 additions & 1 deletion cpus.c
Expand Up @@ -24,7 +24,8 @@

/* Needed early for CONFIG_BSD etc. */
#include "qemu/osdep.h"

#include "qemu-common.h"
#include "cpu.h"
#include "monitor/monitor.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
Expand All @@ -34,6 +35,7 @@
#include "sysemu/dma.h"
#include "sysemu/kvm.h"
#include "qmp-commands.h"
#include "exec/exec-all.h"

#include "qemu/thread.h"
#include "sysemu/cpus.h"
Expand Down
1 change: 1 addition & 0 deletions cputlb.c
Expand Up @@ -28,6 +28,7 @@

#include "exec/memory-internal.h"
#include "exec/ram_addr.h"
#include "exec/exec-all.h"
#include "tcg/tcg.h"

/* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */
Expand Down
1 change: 1 addition & 0 deletions crypto/afsplit.c
Expand Up @@ -24,6 +24,7 @@
*/

#include "qemu/osdep.h"
#include "qemu/bswap.h"
#include "crypto/afsplit.h"
#include "crypto/random.h"

Expand Down
1 change: 1 addition & 0 deletions crypto/block-luks.c
Expand Up @@ -20,6 +20,7 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/bswap.h"

#include "crypto/block-luks.h"

Expand Down
1 change: 1 addition & 0 deletions device_tree.c
Expand Up @@ -20,6 +20,7 @@
#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "qemu/bswap.h"
#include "sysemu/device_tree.h"
#include "sysemu/sysemu.h"
#include "hw/loader.h"
Expand Down
1 change: 1 addition & 0 deletions disas/tci.c
Expand Up @@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "disas/bfd.h"
#include "exec/exec-all.h"
#include "tcg/tcg.h"

/* Disassemble TCI bytecode. */
Expand Down
25 changes: 14 additions & 11 deletions exec.c
Expand Up @@ -24,24 +24,26 @@

#include "qemu/cutils.h"
#include "cpu.h"
#include "exec/exec-all.h"
#include "tcg.h"
#include "hw/hw.h"
#include "hw/qdev-core.h"
#if !defined(CONFIG_USER_ONLY)
#include "hw/boards.h"
#include "hw/xen/xen.h"
#endif
#include "hw/qdev.h"
#include "sysemu/kvm.h"
#include "sysemu/sysemu.h"
#include "hw/xen/xen.h"
#include "qemu/timer.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
#include "exec/memory.h"
#include "sysemu/dma.h"
#include "exec/address-spaces.h"
#if defined(CONFIG_USER_ONLY)
#include <qemu.h>
#else /* !CONFIG_USER_ONLY */
#include "hw/hw.h"
#include "exec/memory.h"
#include "exec/ioport.h"
#include "sysemu/dma.h"
#include "exec/address-spaces.h"
#include "sysemu/xen-mapcache.h"
#include "trace.h"
#endif
Expand Down Expand Up @@ -641,7 +643,6 @@ void cpu_exec_exit(CPUState *cpu)
void cpu_exec_init(CPUState *cpu, Error **errp)
{
CPUClass *cc = CPU_GET_CLASS(cpu);
int cpu_index;
Error *local_err = NULL;

cpu->as = NULL;
Expand All @@ -668,7 +669,7 @@ void cpu_exec_init(CPUState *cpu, Error **errp)
#if defined(CONFIG_USER_ONLY)
cpu_list_lock();
#endif
cpu_index = cpu->cpu_index = cpu_get_free_index(&local_err);
cpu->cpu_index = cpu_get_free_index(&local_err);
if (local_err) {
error_propagate(errp, local_err);
#if defined(CONFIG_USER_ONLY)
Expand All @@ -678,14 +679,16 @@ void cpu_exec_init(CPUState *cpu, Error **errp)
}
QTAILQ_INSERT_TAIL(&cpus, cpu, node);
#if defined(CONFIG_USER_ONLY)
(void) cc;
cpu_list_unlock();
#endif
#else
if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {
vmstate_register(NULL, cpu_index, &vmstate_cpu_common, cpu);
vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu);
}
if (cc->vmsd != NULL) {
vmstate_register(NULL, cpu_index, cc->vmsd, cpu);
vmstate_register(NULL, cpu->cpu_index, cc->vmsd, cpu);
}
#endif
}

#if defined(CONFIG_USER_ONLY)
Expand Down
3 changes: 2 additions & 1 deletion gdbstub.c
Expand Up @@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/cutils.h"

#include "cpu.h"
#ifdef CONFIG_USER_ONLY
#include "qemu.h"
#else
Expand All @@ -35,6 +35,7 @@
#include "qemu/sockets.h"
#include "sysemu/kvm.h"
#include "exec/semihost.h"
#include "exec/exec-all.h"

#ifdef CONFIG_USER_ONLY
#define GDB_ATTACHED "0"
Expand Down
6 changes: 6 additions & 0 deletions hw/acpi/core.c
Expand Up @@ -491,6 +491,12 @@ void acpi_pm_tmr_update(ACPIREGS *ar, bool enable)
}
}

static inline int64_t acpi_pm_tmr_get_clock(void)
{
return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), PM_TIMER_FREQUENCY,
NANOSECONDS_PER_SECOND);
}

void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar)
{
int64_t d = acpi_pm_tmr_get_clock();
Expand Down

0 comments on commit 776efef

Please sign in to comment.