]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pull-reques...
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 13 Oct 2020 13:06:21 +0000 (14:06 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 13 Oct 2020 13:06:22 +0000 (14:06 +0100)
Trivial Patches Pull request 20201013

# gpg: Signature made Tue 13 Oct 2020 12:49:59 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/trivial-branch-for-5.2-pull-request:
  meson.build: drop duplicate 'sparc64' entry
  mingw: fix error __USE_MINGW_ANSI_STDIO redefined
  target/sparc/int32_helper: Remove duplicated 'Tag Overflow' entry
  goldfish_rtc: change MemoryRegionOps endianness to DEVICE_NATIVE_ENDIAN
  hw/char/serial: remove duplicate .class_init in serial_mm_info
  block/blkdebug: fix memory leak
  hw/pci: Fix typo in PCI hot-plug error message
  softmmu/memory: Log invalid memory accesses
  hw/acpi/piix4: Rename piix4_pm_add_propeties() to piix4_pm_add_properties()
  vmdk: fix maybe uninitialized warnings
  tests/test-char: Use a proper fallthrough comment
  hw/block/nvme: Simplify timestamp sum
  target/i386/cpu: Update comment that mentions Texinfo
  qemu-img-cmds.hx: Update comment that mentions Texinfo

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1  2 
meson.build
migration/dirtyrate.c

diff --combined meson.build
index 652c37cceb25dc2c77a9d16f86f6cec044022647,392d326f4563434306c7f1e5c57606b3e180088e..ad6c7c90c787c5863d7cc0ade585448a6bfd2963
@@@ -41,7 -41,7 +41,7 @@@ have_block = have_system or have_tool
  python = import('python').find_installation()
  
  supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
- supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64',
+ supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86', 'x86_64',
    'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
  
  cpu = host_machine.cpu_family()
@@@ -59,8 -59,6 +59,8 @@@ elif cpu == 's390x
    kvm_targets = ['s390x-softmmu']
  elif cpu in ['ppc', 'ppc64']
    kvm_targets = ['ppc-softmmu', 'ppc64-softmmu']
 +elif cpu in ['mips', 'mips64']
 +  kvm_targets = ['mips-softmmu', 'mipsel-softmmu', 'mips64-softmmu', 'mips64el-softmmu']
  else
    kvm_targets = []
  endif
@@@ -614,9 -612,7 +614,9 @@@ if not has_malloc_trim and get_option('
    endif
  endif
  
 -# Create config-host.h
 +#################
 +# config-host.h #
 +#################
  
  config_host_data.set('CONFIG_COCOA', cocoa.found())
  config_host_data.set('CONFIG_LIBUDEV', libudev.found())
@@@ -662,10 -658,6 +662,10 @@@ foreach k, v: config_hos
    endif
  endforeach
  
 +########################
 +# Target configuration #
 +########################
 +
  minikconf = find_program('scripts/minikconf.py')
  config_all = {}
  config_all_devices = {}
@@@ -872,9 -864,7 +872,9 @@@ config_all += 
    'CONFIG_ALL': true,
  }
  
 -# Submodules
 +##############
 +# Submodules #
 +##############
  
  capstone = not_found
  capstone_opt = get_option('capstone')
@@@ -1113,11 -1103,9 +1113,11 @@@ config_host_data.set('CONFIG_CAPSTONE'
  config_host_data.set('CONFIG_FDT', fdt.found())
  config_host_data.set('CONFIG_SLIRP', slirp.found())
  
 -genh += configure_file(output: 'config-host.h', configuration: config_host_data)
 +#####################
 +# Generated sources #
 +#####################
  
 -# Generators
 +genh += configure_file(output: 'config-host.h', configuration: config_host_data)
  
  hxtool = find_program('scripts/hxtool')
  shaderinclude = find_program('scripts/shaderinclude.pl')
@@@ -1192,28 -1180,21 +1192,28 @@@ sphinx_extn_depends = [ meson.source_ro
                          meson.source_root() / 'docs/sphinx/qmp_lexer.py',
                          qapi_gen_depends ]
  
 -# Collect sourcesets.
 +###################
 +# Collect sources #
 +###################
  
 -util_ss = ss.source_set()
 -stub_ss = ss.source_set()
 -trace_ss = ss.source_set()
 -block_ss = ss.source_set()
 +authz_ss = ss.source_set()
  blockdev_ss = ss.source_set()
 -qmp_ss = ss.source_set()
 -common_ss = ss.source_set()
 -softmmu_ss = ss.source_set()
 -user_ss = ss.source_set()
 +block_ss = ss.source_set()
  bsd_user_ss = ss.source_set()
 +chardev_ss = ss.source_set()
 +common_ss = ss.source_set()
 +crypto_ss = ss.source_set()
 +io_ss = ss.source_set()
  linux_user_ss = ss.source_set()
 -specific_ss = ss.source_set()
 +qmp_ss = ss.source_set()
 +qom_ss = ss.source_set()
 +softmmu_ss = ss.source_set()
  specific_fuzz_ss = ss.source_set()
 +specific_ss = ss.source_set()
 +stub_ss = ss.source_set()
 +trace_ss = ss.source_set()
 +user_ss = ss.source_set()
 +util_ss = ss.source_set()
  
  modules = {}
  hw_arch = {}
@@@ -1332,6 -1313,8 +1332,6 @@@ if enable_module
    modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO')
  endif
  
 -# Build targets from sourcesets
 -
  stub_ss = stub_ss.apply(config_all, strict: false)
  
  util_ss.add_all(trace_ss)
@@@ -1377,14 -1360,24 +1377,14 @@@ blockdev_ss.add(files
  # os-win32.c does not
  blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
  softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
 -
  softmmu_ss.add_all(blockdev_ss)
 -softmmu_ss.add(files(
 -  'bootdevice.c',
 -  'dma-helpers.c',
 -  'qdev-monitor.c',
 -), sdl)
 -
 -softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
 -softmmu_ss.add(when: 'CONFIG_SECCOMP', if_true: [files('qemu-seccomp.c'), seccomp])
 -softmmu_ss.add(when: fdt, if_true: files('device_tree.c'))
  
  common_ss.add(files('cpus-common.c'))
  
  subdir('softmmu')
  
  common_ss.add(capstone)
 -specific_ss.add(files('disas.c', 'exec.c', 'gdbstub.c'), capstone, libpmem, libdaxctl)
 +specific_ss.add(files('cpu.c', 'disas.c', 'gdbstub.c'), capstone)
  specific_ss.add(files('exec-vary.c'))
  specific_ss.add(when: 'CONFIG_TCG', if_true: files(
    'fpu/softfloat.c',
@@@ -1419,10 -1412,6 +1419,10 @@@ specific_ss.add_all(when: 'CONFIG_LINUX
  subdir('tests/qtest/libqos')
  subdir('tests/qtest/fuzz')
  
 +########################
 +# Library dependencies #
 +########################
 +
  block_mods = []
  softmmu_mods = []
  foreach d, list : modules
@@@ -1457,47 -1446,6 +1457,47 @@@ qemu_syms = custom_target('qemu.syms', 
                               capture: true,
                               command: [undefsym, nm, '@INPUT@'])
  
 +qom_ss = qom_ss.apply(config_host, strict: false)
 +libqom = static_library('qom', qom_ss.sources() + genh,
 +                        dependencies: [qom_ss.dependencies()],
 +                        name_suffix: 'fa')
 +
 +qom = declare_dependency(link_whole: libqom)
 +
 +authz_ss = authz_ss.apply(config_host, strict: false)
 +libauthz = static_library('authz', authz_ss.sources() + genh,
 +                          dependencies: [authz_ss.dependencies()],
 +                          name_suffix: 'fa',
 +                          build_by_default: false)
 +
 +authz = declare_dependency(link_whole: libauthz,
 +                           dependencies: qom)
 +
 +crypto_ss = crypto_ss.apply(config_host, strict: false)
 +libcrypto = static_library('crypto', crypto_ss.sources() + genh,
 +                           dependencies: [crypto_ss.dependencies()],
 +                           name_suffix: 'fa',
 +                           build_by_default: false)
 +
 +crypto = declare_dependency(link_whole: libcrypto,
 +                            dependencies: [authz, qom])
 +
 +io_ss = io_ss.apply(config_host, strict: false)
 +libio = static_library('io', io_ss.sources() + genh,
 +                       dependencies: [io_ss.dependencies()],
 +                       link_with: libqemuutil,
 +                       name_suffix: 'fa',
 +                       build_by_default: false)
 +
 +io = declare_dependency(link_whole: libio, dependencies: [crypto, qom])
 +
 +libmigration = static_library('migration', sources: migration_files + genh,
 +                              name_suffix: 'fa',
 +                              build_by_default: false)
 +migration = declare_dependency(link_with: libmigration,
 +                               dependencies: [zlib, qom, io])
 +softmmu_ss.add(migration)
 +
  block_ss = block_ss.apply(config_host, strict: false)
  libblock = static_library('block', block_ss.sources() + genh,
                            dependencies: block_ss.dependencies(),
@@@ -1517,22 -1465,6 +1517,22 @@@ libqmp = static_library('qmp', qmp_ss.s
  
  qmp = declare_dependency(link_whole: [libqmp])
  
 +libchardev = static_library('chardev', chardev_ss.sources() + genh,
 +                            name_suffix: 'fa',
 +                            build_by_default: false)
 +
 +chardev = declare_dependency(link_whole: libchardev)
 +
 +libhwcore = static_library('hwcore', sources: hwcore_files + genh,
 +                           name_suffix: 'fa',
 +                           build_by_default: false)
 +hwcore = declare_dependency(link_whole: libhwcore)
 +common_ss.add(hwcore)
 +
 +###########
 +# Targets #
 +###########
 +
  foreach m : block_mods + softmmu_mods
    shared_module(m.name(),
                  name_prefix: '',
@@@ -1807,10 -1739,6 +1807,10 @@@ if host_machine.system() == 'windows
    alias_target('installer', nsis)
  endif
  
 +#########################
 +# Configuration summary #
 +#########################
 +
  summary_info = {}
  summary_info += {'Install prefix':    config_host['prefix']}
  summary_info += {'BIOS directory':    config_host['qemu_datadir']}
diff --combined migration/dirtyrate.c
index ab9e1301f6123f2e8c9f32caeb6d94a556ba4fa8,47f761e67acbb537023f7e4a238bb347cc1a1583..8f728d2600d8d646bff0af07f1c449f31220d7e0
@@@ -10,8 -10,9 +10,9 @@@
   * See the COPYING file in the top-level directory.
   */
  
- #include <zlib.h>
  #include "qemu/osdep.h"
+ #include <zlib.h>
  #include "qapi/error.h"
  #include "cpu.h"
  #include "qemu/config-file.h"
@@@ -69,8 -70,9 +70,8 @@@ static struct DirtyRateInfo *query_dirt
      struct DirtyRateInfo *info = g_malloc0(sizeof(DirtyRateInfo));
  
      if (qatomic_read(&CalculatingState) == DIRTY_RATE_STATUS_MEASURED) {
 +        info->has_dirty_rate = true;
          info->dirty_rate = dirty_rate;
 -    } else {
 -        info->dirty_rate = -1;
      }
  
      info->status = CalculatingState;
      return info;
  }
  
 -static void reset_dirtyrate_stat(void)
 +static void init_dirtyrate_stat(int64_t start_time, int64_t calc_time)
  {
      DirtyStat.total_dirty_samples = 0;
      DirtyStat.total_sample_count = 0;
      DirtyStat.total_block_mem_MB = 0;
      DirtyStat.dirty_rate = -1;
 -    DirtyStat.start_time = 0;
 -    DirtyStat.calc_time = 0;
 +    DirtyStat.start_time = start_time;
 +    DirtyStat.calc_time = calc_time;
  }
  
  static void update_dirtyrate_stat(struct RamblockDirtyInfo *info)
@@@ -334,6 -336,7 +335,6 @@@ static void calculate_dirtyrate(struct 
      int64_t initial_time;
  
      rcu_register_thread();
 -    reset_dirtyrate_stat();
      rcu_read_lock();
      initial_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
      if (!record_ramblock_hash_info(&block_dinfo, config, &block_count)) {
@@@ -363,8 -366,6 +364,8 @@@ void *get_dirtyrate_thread(void *arg
  {
      struct DirtyRateConfig config = *(struct DirtyRateConfig *)arg;
      int ret;
 +    int64_t start_time;
 +    int64_t calc_time;
  
      ret = dirtyrate_set_state(&CalculatingState, DIRTY_RATE_STATUS_UNSTARTED,
                                DIRTY_RATE_STATUS_MEASURING);
          return NULL;
      }
  
 +    start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) / 1000;
 +    calc_time = config.sample_period_seconds;
 +    init_dirtyrate_stat(start_time, calc_time);
 +
      calculate_dirtyrate(config);
  
      ret = dirtyrate_set_state(&CalculatingState, DIRTY_RATE_STATUS_MEASURING,