Misc patches for 2023-08-31
Subsystems (6)
The following changes since commit 156618d9ea67f2f2e31d9dedd97f2dcccbe6808c:
Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-08-30 09:20:27 -0400)
are available in the Git repository at:
https://github.com/philmd/qemu.git tags/misc-20230831
for you to fetch changes up to b4283914d64b2486c1fc1938280ee7041a569159:
tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc (2023-08-31 14:51:12 +0200)
----------------------------------------------------------------
Misc patches queue
Overall cleanups:
- Do not declare function prototypes using 'extern' keyword
- Remove unmaintained HAX accelerator
- Have FEWatchFunc handlers return G_SOURCE_CONTINUE/REMOVE instead of boolean
- Avoid modifying QOM class internals from instance in pmbus_device
- Avoid variable-length array in xhci_get_port_bandwidth
- Remove unuseful kvmclock_create() stub
- Style: permit inline loop variables
- Various header cleanups
- Various spelling fixes
Build fixes:
- Fix MESONINTROSPECT parsing
- Only define OS_OBJECT_USE_OBJC with gcc
----------------------------------------------------------------
Akihiko Odaki (1):
meson: Fix MESONINTROSPECT parsing
Alex Bennée (1):
docs/style: permit inline loop variables
Alexander Graf (1):
build: Only define OS_OBJECT_USE_OBJC with gcc
Michael Tokarev (9):
accel/tcg: spelling fixes
hw/i2c: spelling fixes
hw/ide: spelling fixes
hw/display: spelling fixes
hw/mips: spelling fixes
hw/sd: spelling fixes
hw/usb: spelling fixes
util: spelling fixes
ui: spelling fixes
Peter Maydell (1):
hw/usb/hcd-xhci: Avoid variable-length array in
xhci_get_port_bandwidth()
Philippe Mathieu-Daudé (28):
accel: Remove HAX accelerator
qemu/uri: Use QueryParams type definition
bulk: Do not declare function prototypes using 'extern' keyword hw/net/i82596: Include missing 'exec/address-spaces.h' header hw/dma/etraxfs: Include missing 'exec/memory.h' header exec/address-spaces.h: Remove unuseful 'exec/memory.h' include target/ppc/pmu: Include missing 'qemu/timer.h' header target/riscv/pmu: Restrict 'qemu/log.h' include to source target/translate: Include missing 'exec/cpu_ldst.h' header target/translate: Remove unnecessary 'exec/cpu_ldst.h' header target/translate: Restrict 'exec/cpu_ldst.h' to user emulation target/helpers: Remove unnecessary 'exec/cpu_ldst.h' header target/helpers: Remove unnecessary 'qemu/main-loop.h' header target/mips: Remove unused headers in lcsr_helper.c target/xtensa: Include missing 'qemu/atomic.h' header qemu/processor: Remove unused 'qemu/atomic.h' header exec/translation-block: Clean up includes chardev/char-fe: Document FEWatchFunc typedef
hw/char: Have FEWatchFunc handlers return G_SOURCE_CONTINUE/REMOVE hw/char/pl011: Restrict MemoryRegionOps implementation access sizes hw/char/pl011: Display register name in trace events hw/char/pl011: Remove duplicated PL011_INT_[RT]X definitions hw/char/pl011: Replace magic values by register field definitions hw/i2c/pmbus_device: Fix modifying QOM class internals from instance hw/i386: Remove unuseful kvmclock_create() stub
hw/i386: Rename 'hw/kvm/clock.h' -> 'hw/i386/kvm/clock.h' util/fifo8: Fix typo in fifo8_push_all() description tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc
MAINTAINERS | 8 -
docs/about/build-platforms.rst | 2 +-
docs/about/deprecated.rst | 6 -
docs/about/index.rst | 2 +-
docs/about/removed-features.rst | 11 +-
docs/devel/style.rst | 9 +-
docs/system/index.rst | 2 +-
docs/system/introduction.rst | 3 -
meson.build | 11 +-
bsd-user/bsd-file.h | 6 +-
crypto/hmacpriv.h | 13 +-
{include/hw => hw/i386}/kvm/clock.h | 14 +-
hw/ide/ahci_internal.h | 4 +-
hw/usb/quirks.h | 2 +-
hw/xen/xen_pt.h | 8 +-
include/chardev/char-fe.h | 14 +
include/crypto/secret_common.h | 14 +-
include/elf.h | 4 +-
include/exec/address-spaces.h | 2 -
include/exec/exec-all.h | 2 +-
include/exec/page-vary.h | 4 +-
include/exec/poison.h | 1 -
include/exec/translation-block.h | 6 +-
include/hw/core/cpu.h | 2 +-
include/hw/core/tcg-cpu-ops.h | 2 +-
include/hw/i2c/npcm7xx_smbus.h | 2 +-
include/hw/misc/aspeed_scu.h | 2 +-
include/hw/misc/auxbus.h | 2 +-
include/hw/nvram/npcm7xx_otp.h | 4 +-
include/hw/qdev-core.h | 4 +-
include/io/channel-socket.h | 4 +-
include/io/task.h | 2 +-
include/qemu/crc-ccitt.h | 4 +-
include/qemu/fifo8.h | 2 +-
include/qemu/iova-tree.h | 4 +-
include/qemu/osdep.h | 4 +-
include/qemu/processor.h | 2 -
include/qemu/rcu.h | 14 +-
include/qemu/sys_membarrier.h | 4 +-
include/qemu/uri.h | 6 +-
include/qemu/yank.h | 2 +-
include/sysemu/accel-blocker.h | 14 +-
include/sysemu/hax.h | 49 -
include/sysemu/hw_accel.h | 1 -
include/sysemu/os-win32.h | 4 +-
include/tcg/helper-info.h | 2 +-
include/tcg/tcg.h | 4 +-
include/ui/kbd-state.h | 2 +-
include/ui/spice-display.h | 2 +-
include/user/safe-syscall.h | 6 +-
target/i386/hax/hax-accel-ops.h | 31 -
target/i386/hax/hax-i386.h | 98 --
target/i386/hax/hax-interface.h | 369 ------
target/i386/hax/hax-posix.h | 61 -
target/i386/hax/hax-windows.h | 88 --
target/i386/sev.h | 6 +-
target/mips/cpu.h | 4 +-
target/riscv/pmu.h | 3 -
tcg/tcg-internal.h | 4 +-
ui/keymaps.h | 2 +-
ui/vnc-enc-zywrle.h | 4 +-
include/exec/memory_ldst.h.inc | 42 +-
accel/stubs/hax-stub.c | 24 -
accel/tcg/tb-maint.c | 2 +-
contrib/plugins/cache.c | 2 +-
contrib/plugins/lockstep.c | 2 +-
hw/char/cadence_uart.c | 8 +-
hw/char/cmsdk-apb-uart.c | 6 +-
hw/char/ibex_uart.c | 8 +-
hw/char/nrf51_uart.c | 4 +-
hw/char/pl011.c | 58 +-
hw/char/serial.c | 2 +-
hw/char/virtio-console.c | 2 +-
hw/display/bochs-display.c | 2 +-
hw/display/qxl.c | 2 +-
hw/display/ssd0303.c | 2 +-
hw/display/ssd0323.c | 2 +-
hw/display/xlnx_dp.c | 2 +-
hw/dma/etraxfs_dma.c | 1 +
hw/i2c/pm_smbus.c | 2 +-
hw/i2c/pmbus_device.c | 19 +-
hw/i2c/smbus_slave.c | 2 +-
hw/i386/kvm/clock.c | 6 +-
hw/i386/microvm.c | 6 +-
hw/i386/pc_piix.c | 4 +-
hw/i386/pc_q35.c | 6 +-
hw/ide/cmd646.c | 2 +-
hw/ide/core.c | 2 +-
hw/intc/apic_common.c | 3 +-
hw/mips/malta.c | 2 +-
hw/net/i82596.c | 1 +
hw/sd/sd.c | 2 +-
hw/sd/sdhci.c | 2 +-
hw/sensor/isl_pmbus_vr.c | 2 +-
hw/sensor/max34451.c | 2 +-
hw/usb/ccid-card-emulated.c | 2 +-
hw/usb/hcd-ehci.c | 6 +-
hw/usb/hcd-ohci.c | 2 +-
hw/usb/hcd-xhci.c | 10 +-
hw/usb/redirect.c | 4 +-
hw/usb/xen-usb.c | 2 +-
hw/xtensa/pic_cpu.c | 1 +
linux-user/flatload.c | 2 +-
linux-user/syscall.c | 4 +-
monitor/monitor.c | 2 +-
net/vhost-user.c | 2 +-
semihosting/config.c | 2 +-
semihosting/syscalls.c | 4 +-
softmmu/cpus.c | 6 -
softmmu/icount.c | 2 +-
softmmu/ioport.c | 2 +-
softmmu/vl.c | 6 -
target/alpha/translate.c | 1 -
target/avr/helper.c | 1 +
target/cris/op_helper.c | 1 -
target/hexagon/translate.c | 1 -
target/hppa/translate.c | 1 -
target/i386/hax/hax-accel-ops.c | 105 --
target/i386/hax/hax-all.c | 1141 -----------------
target/i386/hax/hax-mem.c | 323 -----
target/i386/hax/hax-posix.c | 305 -----
target/i386/hax/hax-windows.c | 485 -------
target/i386/tcg/fpu_helper.c | 1 +
target/i386/tcg/sysemu/excp_helper.c | 1 +
target/loongarch/cpu.c | 1 +
target/loongarch/iocsr_helper.c | 1 -
target/loongarch/op_helper.c | 1 -
target/m68k/translate.c | 1 -
target/microblaze/translate.c | 1 -
target/mips/tcg/fpu_helper.c | 1 -
target/mips/tcg/ldst_helper.c | 1 +
target/mips/tcg/msa_helper.c | 13 +-
target/mips/tcg/mxu_translate.c | 6 +-
target/mips/tcg/sysemu/lcsr_helper.c | 5 -
target/nios2/op_helper.c | 1 -
target/nios2/translate.c | 1 -
target/openrisc/translate.c | 1 -
target/ppc/int_helper.c | 1 -
target/ppc/machine.c | 1 -
target/ppc/mem_helper.c | 1 -
target/ppc/mmu_common.c | 1 -
target/ppc/mmu_helper.c | 1 -
target/ppc/power8-pmu.c | 2 +-
target/ppc/translate.c | 2 -
target/riscv/csr.c | 1 -
target/riscv/m128_helper.c | 1 -
target/riscv/op_helper.c | 2 +-
target/riscv/pmu.c | 1 +
target/riscv/vector_helper.c | 1 +
target/s390x/tcg/crypto_helper.c | 1 -
target/s390x/tcg/excp_helper.c | 1 -
target/s390x/tcg/fpu_helper.c | 1 -
target/s390x/tcg/misc_helper.c | 1 -
target/sh4/translate.c | 1 -
target/sparc/translate.c | 1 -
target/xtensa/dbg_helper.c | 1 -
target/xtensa/exc_helper.c | 1 +
target/xtensa/fpu_helper.c | 1 -
target/xtensa/mmu_helper.c | 2 -
target/xtensa/op_helper.c | 3 +-
target/xtensa/win_helper.c | 1 -
tests/tcg/aarch64/bti-1.c | 2 +-
tests/tcg/aarch64/bti-3.c | 2 +-
ui/sdl2-2d.c | 2 +-
ui/sdl2.c | 2 +-
util/cpuinfo-aarch64.c | 4 +-
util/cpuinfo-i386.c | 4 +-
util/cpuinfo-ppc.c | 2 +-
util/main-loop.c | 2 +-
util/oslib-posix.c | 2 +-
util/qdist.c | 2 +-
util/qemu-sockets.c | 2 +-
util/rcu.c | 2 +-
target/mips/cpu-defs.c.inc | 2 +-
.../aarch64/{bti-crt.inc.c => bti-crt.c.inc} | 0
ui/vnc-enc-zrle.c.inc | 2 +-
accel/Kconfig | 3 -
accel/stubs/meson.build | 1 -
hw/char/trace-events | 4 +-
hw/usb/trace-events | 2 +-
meson_options.txt | 2 -
qemu-options.hx | 8 +-
.../ci/org.centos/stream/8/x86_64/configure | 1 -
scripts/meson-buildoptions.sh | 3 -
scripts/symlink-install-tree.py | 3 +-
target/i386/hax/meson.build | 7 -
target/i386/meson.build | 1 -
ui/cocoa.m | 2 +-
188 files changed, 317 insertions(+), 3443 deletions(-)
rename {include/hw => hw/i386}/kvm/clock.h (65%)
delete mode 100644 include/sysemu/hax.h
delete mode 100644 target/i386/hax/hax-accel-ops.h
delete mode 100644 target/i386/hax/hax-i386.h
delete mode 100644 target/i386/hax/hax-interface.h
delete mode 100644 target/i386/hax/hax-posix.h
delete mode 100644 target/i386/hax/hax-windows.h
delete mode 100644 accel/stubs/hax-stub.c
delete mode 100644 target/i386/hax/hax-accel-ops.c
delete mode 100644 target/i386/hax/hax-all.c
delete mode 100644 target/i386/hax/hax-mem.c
delete mode 100644 target/i386/hax/hax-posix.c
delete mode 100644 target/i386/hax/hax-windows.c
rename tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} (100%)
delete mode 100644 target/i386/hax/meson.buildSignature · 1 line
2.41.0
[PULL 01/41] accel: Remove HAX accelerator
HAX is deprecated since commits 73741fda6c ("MAINTAINERS: Abort HAXM maintenance") and 90c167a1da ("docs/about/deprecated: Mark HAXM in QEMU as deprecated"), released in v8.0.0.
Per the latest HAXM release (v7.8 [*]), the latest QEMU supported is v7.2:
Note: Up to this release, HAXM supports QEMU from 2.9.0 to 7.2.0.
The next commit (https://github.com/intel/haxm/commit/da1b8ec072)
added:
HAXM v7.8.0 is our last release and we will not accept pull requests or respond to issues after this.
It became very hard to build and test HAXM. Its previous maintainers made it clear they won't help. It doesn't seem to be a very good use of QEMU maintainers to spend their time in a dead project. Save our time by removing this orphan zombie code.
[*] https://github.com/intel/haxm/releases/tag/v7.8.0
Message-Id: <[email protected]>
--- MAINTAINERS | 8 - docs/about/build-platforms.rst | 2 +- docs/about/deprecated.rst | 6 - docs/about/index.rst | 2 +- docs/about/removed-features.rst | 11 +- docs/system/index.rst | 2 +- docs/system/introduction.rst | 3 - meson.build | 7 - include/exec/poison.h | 1 - include/hw/core/cpu.h | 2 +- include/sysemu/hax.h | 49 - include/sysemu/hw_accel.h | 1 - target/i386/hax/hax-accel-ops.h | 31 - target/i386/hax/hax-i386.h | 98 -- target/i386/hax/hax-interface.h | 369 ------ target/i386/hax/hax-posix.h | 61 - target/i386/hax/hax-windows.h | 88 -- accel/stubs/hax-stub.c | 24 - hw/intc/apic_common.c | 3 +- softmmu/cpus.c | 6 - softmmu/vl.c | 6 - target/i386/hax/hax-accel-ops.c | 105 -- target/i386/hax/hax-all.c | 1141 ----------------- target/i386/hax/hax-mem.c | 323 ----- target/i386/hax/hax-posix.c | 305 ----- target/i386/hax/hax-windows.c | 485 ------- accel/Kconfig | 3 - accel/stubs/meson.build | 1 - meson_options.txt | 2 - qemu-options.hx | 8 +- .../ci/org.centos/stream/8/x86_64/configure | 1 - scripts/meson-buildoptions.sh | 3 - target/i386/hax/meson.build | 7 - target/i386/meson.build | 1 - 34 files changed, 16 insertions(+), 3149 deletions(-) delete mode 100644 include/sysemu/hax.h delete mode 100644 target/i386/hax/hax-accel-ops.h delete mode 100644 target/i386/hax/hax-i386.h delete mode 100644 target/i386/hax/hax-interface.h delete mode 100644 target/i386/hax/hax-posix.h delete mode 100644 target/i386/hax/hax-windows.h delete mode 100644 accel/stubs/hax-stub.c delete mode 100644 target/i386/hax/hax-accel-ops.c delete mode 100644 target/i386/hax/hax-all.c delete mode 100644 target/i386/hax/hax-mem.c delete mode 100644 target/i386/hax/hax-posix.c delete mode 100644 target/i386/hax/hax-windows.c delete mode 100644 target/i386/hax/meson.build
MAINTAINERS +0 -8
@@ -543,14 +543,6 @@ F: include/sysemu/xen.h F: include/sysemu/xen-mapcache.h F: stubs/xen-hw-stub.c -Guest CPU Cores (HAXM) ---------------------- -X86 HAXM CPUs -S: Orphan -F: accel/stubs/hax-stub.c -F: include/sysemu/hax.h -F: target/i386/hax/ - Guest CPU Cores (NVMM) ---------------------- NetBSD Virtual Machine Monitor (NVMM) CPU support
docs/about/build-platforms.rst +1 -1
@@ -52,7 +52,7 @@ Those hosts are officially supported, with various accelerators: * - SPARC - tcg * - x86 - - hax, hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen + - hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen Other host architectures are not supported. It is possible to build QEMU system emulation on an unsupported host architecture using the configure
docs/about/deprecated.rst +0 -6
@@ -105,12 +105,6 @@ Use ``-machine hpet=off`` instead. The ``-no-acpi`` setting has been turned into a machine property. Use ``-machine acpi=off`` instead. -``-accel hax`` (since 8.0) -'''''''''''''''''''''''''' - -The HAXM project has been retired (see https://github.com/intel/haxm#status). -Use "whpx" (on Windows) or "hvf" (on macOS) instead. - ``-async-teardown`` (since 8.1) '''''''''''''''''''''''''''''''
docs/about/index.rst +1 -1
@@ -8,7 +8,7 @@ QEMU can be used in several different ways. The most common is for :ref:`System Emulation`, where it provides a virtual model of an entire machine (CPU, memory and emulated devices) to run a guest OS. In this mode the CPU may be fully emulated, or it may work with a -hypervisor such as KVM, Xen, Hax or Hypervisor.Framework to allow the +hypervisor such as KVM, Xen or Hypervisor.Framework to allow the guest to run directly on the host CPU. The second supported way to use QEMU is :ref:`User Mode Emulation`,
docs/about/removed-features.rst +7 -4
@@ -659,15 +659,18 @@ Use ``Icelake-Server`` instead. System accelerators ------------------- -Userspace local APIC with KVM (x86, removed 8.0) -'''''''''''''''''''''''''''''''''''''''''''''''' +Userspace local APIC with KVM (x86, removed in 8.0) +''''''''''''''''''''''''''''''''''''''''''''''''''' ``-M kernel-irqchip=off`` cannot be used on KVM if the CPU model includes a local APIC. The ``split`` setting is supported, as is using ``-M kernel-irqchip=off`` when the CPU does not have a local APIC. -System accelerators -------------------- +HAXM (``-accel hax``) (removed in 8.2) +'''''''''''''''''''''''''''''''''''''' + +The HAXM project has been retired (see https://github.com/intel/haxm#status). +Use "whpx" (on Windows) or "hvf" (on macOS) instead. MIPS "Trap-and-Emulate" KVM support (removed in 8.0) ''''''''''''''''''''''''''''''''''''''''''''''''''''
docs/system/index.rst +1 -1
@@ -6,7 +6,7 @@ System Emulation This section of the manual is the overall guide for users using QEMU for full system emulation (as opposed to user-mode emulation). -This includes working with hypervisors such as KVM, Xen, Hax +This includes working with hypervisors such as KVM, Xen or Hypervisor.Framework. .. toctree::
docs/system/introduction.rst +0 -3
@@ -21,9 +21,6 @@ Tiny Code Generator (TCG) capable of emulating many CPUs. * - Xen - Linux (as dom0) - Arm, x86 - * - Intel HAXM (hax) - - Linux, Windows - - x86 * - Hypervisor Framework (hvf) - MacOS - x86 (64 bit only), Arm (64 bit only)
meson.build +0 -7
@@ -140,7 +140,6 @@ if cpu in ['x86', 'x86_64', 'arm', 'aarch64'] endif if cpu in ['x86', 'x86_64'] accelerator_targets += { - 'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_HVF': ['x86_64-softmmu'], 'CONFIG_NVMM': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
@@ -663,11 +662,6 @@ if get_option('hvf').allowed() accelerators += 'CONFIG_HVF' endif endif -if get_option('hax').allowed() - if get_option('hax').enabled() or targetos in ['windows', 'darwin', 'netbsd'] - accelerators += 'CONFIG_HAX' - endif -endif if targetos == 'netbsd' nvmm = cc.find_library('nvmm', required: get_option('nvmm')) if nvmm.found()
@@ -4140,7 +4134,6 @@ endif summary_info = {} if have_system summary_info += {'KVM support': config_all.has_key('CONFIG_KVM')} - summary_info += {'HAX support': config_all.has_key('CONFIG_HAX')} summary_info += {'HVF support': config_all.has_key('CONFIG_HVF')} summary_info += {'WHPX support': config_all.has_key('CONFIG_WHPX')} summary_info += {'NVMM support': config_all.has_key('CONFIG_NVMM')}
include/exec/poison.h +0 -1
@@ -81,7 +81,6 @@#pragma GCC poison CONFIG_SPARC_DIS#pragma GCC poison CONFIG_XTENSA_DIS -#pragma GCC poison CONFIG_HAX#pragma GCC poison CONFIG_HVF#pragma GCC poison CONFIG_LINUX_USER#pragma GCC poison CONFIG_KVM
include/hw/core/cpu.h +1 -1
@@ -422,7 +422,7 @@ struct CPUState {int32_t exception_index;AccelCPUState *accel; -/* shared by kvm, hax and hvf */ +/* shared by kvm and hvf */ bool vcpu_dirty;/* Used to keep track of an outstanding cpu throttle thread for migration
include/sysemu/hax.h deleted +0 -49
49 lines not on this page · raw message
include/sysemu/hw_accel.h +0 -1
@@ -12,7 +12,6 @@#define QEMU_HW_ACCEL_H #include "hw/core/cpu.h" -#include "sysemu/hax.h" #include "sysemu/kvm.h" #include "sysemu/hvf.h" #include "sysemu/whpx.h"
target/i386/hax/hax-accel-ops.h deleted +0 -31
@@ -1,31 +0,0 @@ -/* -* Accelerator CPUS Interface -* -* Copyright 2020 SUSE LLC -* -* This work is licensed under the terms of the GNU GPL, version 2 or later. -* See the COPYING file in the top-level directory. -*/ - -#ifndef TARGET_I386_HAX_ACCEL_OPS_H -#define TARGET_I386_HAX_ACCEL_OPS_H - -#include "sysemu/cpus.h" - -#include "hax-interface.h" -#include "hax-i386.h" - -int hax_init_vcpu (CPUState *cpu); -int hax_smp_cpu_exec (CPUState *cpu); -int hax_populate_ram (uint64_t va,uint64_t size); - -void hax_cpu_synchronize_state (CPUState *cpu); -void hax_cpu_synchronize_post_reset (CPUState *cpu); -void hax_cpu_synchronize_post_init (CPUState *cpu); -void hax_cpu_synchronize_pre_loadvm (CPUState *cpu); - -int hax_vcpu_destroy (CPUState *cpu); -void hax_raise_event (CPUState *cpu); -void hax_reset_vcpu_state (void *opaque); - -#endif /* TARGET_I386_HAX_ACCEL_OPS_H */
target/i386/hax/hax-i386.h deleted +0 -98
98 lines not on this page · raw message
target/i386/hax/hax-interface.h deleted +0 -369
369 lines not on this page · raw message
target/i386/hax/hax-posix.h deleted +0 -61
61 lines not on this page · raw message
target/i386/hax/hax-windows.h deleted +0 -88
88 lines not on this page · raw message
accel/stubs/hax-stub.c deleted +0 -24
@@ -1,24 +0,0 @@ -/* -* QEMU HAXM support -* -* Copyright (c) 2015, Intel Corporation -* -* Copyright 2016 Google, Inc. -* -* This software is licensed under the terms of the GNU General Public -* License version 2, as published by the Free Software Foundation, and -* may be copied, distributed, and modified under those terms. -* -* See the COPYING file in the top-level directory. -* -*/ - -#include "qemu/osdep.h" -#include "sysemu/hax.h" - -bool hax_allowed; - -int hax_sync_vcpus (void ) -{ -return 0 ; -}
hw/intc/apic_common.c +1 -2
@@ -28,7 +28,6 @@#include "hw/intc/kvm_irqcount.h" #include "trace.h" #include "hw/boards.h" -#include "sysemu/hax.h" #include "sysemu/kvm.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h"
@@ -271,7 +270,7 @@ static void apic_common_realize(DeviceState *dev, Error **errp)/* Note: We need at least 1M to map the VAPIC option ROM */ if (!vapic && s->vapic_control &VAPIC_ENABLE_MASK && - !hax_enabled () && current_machine->ram_size >=1024 *1024 ) { + current_machine->ram_size >=1024 *1024 ) { vapic =sysbus_create_simple ("kvmvapic" ,-1 ,NULL ); } s->vapic = vapic;
softmmu/cpus.c +0 -6
@@ -427,12 +427,6 @@ void qemu_wait_io_event(CPUState *cpu)qemu_plugin_vcpu_resume_cb (cpu); } -#ifdef _WIN32 -/* Eat dummy APC queued by cpus_kick_thread. */ -if (hax_enabled ()) { -SleepEx (0 , TRUE); - } -#endif qemu_wait_io_event_common (cpu); }
softmmu/vl.c +0 -6
@@ -86,7 +86,6 @@#include "migration/colo.h" #include "migration/postcopy-ram.h" #include "sysemu/kvm.h" -#include "sysemu/hax.h" #include "qapi/qobject-input-visitor.h" #include "qemu/option.h" #include "qemu/config-file.h"
@@ -2546,11 +2545,6 @@ static void qemu_init_board(void)drive_check_orphaned ();realtime_init (); - -if (hax_enabled ()) { -/* FIXME: why isn't cpu_synchronize_all_post_init enough? */ -hax_sync_vcpus (); - } }static void qemu_create_cli_devices (void )
target/i386/hax/hax-accel-ops.c deleted +0 -105
105 lines not on this page · raw message
target/i386/hax/hax-all.c deleted +0 -1141
1,141 lines not on this page · raw message
target/i386/hax/hax-mem.c deleted +0 -323
323 lines not on this page · raw message
target/i386/hax/hax-posix.c deleted +0 -305
305 lines not on this page · raw message
target/i386/hax/hax-windows.c deleted +0 -485
233 lines not on this page · raw message
scripts/ci/org.centos/stream/8/x86_64/configure +0 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.41.0
Part of the diff is not shown here. View the raw message.
[PULL 02/41] accel/tcg: spelling fixes
In reply to Philippe Mathieu-DaudéFrom: Michael Tokarev <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
--- include/hw/core/tcg-cpu-ops.h | 2 +- include/tcg/helper-info.h | 2 +- include/tcg/tcg.h | 4 ++-- include/user/safe-syscall.h | 2 +- accel/tcg/tb-maint.c | 2 +- contrib/plugins/cache.c | 2 +- contrib/plugins/lockstep.c | 2 +- linux-user/flatload.c | 2 +- linux-user/syscall.c | 4 ++-- semihosting/config.c | 2 +- semihosting/syscalls.c | 4 ++-- softmmu/icount.c | 2 +- softmmu/ioport.c | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-)
include/hw/core/tcg-cpu-ops.h +1 -1
@@ -14,7 +14,7 @@struct TCGCPUOps {/** -* @initialize: Initalize TCG state +* @initialize: Initialize TCG state * * Called when the first CPU is realized. */
include/tcg/helper-info.h +1 -1
@@ -1,5 +1,5 @@/* -* TCG Helper Infomation Structure +* TCG Helper Information Structure * * Copyright (c) 2023 Linaro Ltd *
include/tcg/tcg.h +2 -2
@@ -879,7 +879,7 @@ enum {/* Instruction operands are 64-bits (otherwise 32-bits). */ TCG_OPF_64BIT =0x10 ,/* Instruction is optional and not implemented by the host, or insn -is generic and should not be implemened by the host. */ +is generic and should not be implemented by the host. */ TCG_OPF_NOT_PRESENT =0x20 ,/* Instruction operands are vectors. */ TCG_OPF_VECTOR = 0x40,
@@ -1123,7 +1123,7 @@ static inline int tcg_can_emit_vec_op(TCGOpcode o, TCGType t, unsigned ve)/* Expand the tuple (opc, type, vece) on the given arguments. */ void tcg_expand_vec_op (TCGOpcode ,TCGType ,unsigned ,TCGArg , ...); -/* Replicate a constant C accoring to the log2 of the element size. */ +/* Replicate a constant C according to the log2 of the element size. */ uint64_t dup_const (unsigned vece,uint64_t c);#define dup_const (VECE ,C ) \
include/user/safe-syscall.h +1 -1
@@ -91,7 +91,7 @@* * The basic setup is that we make the host syscall via a known * section of host native assembly. If a signal occurs, our signal -* handler checks the interrupted host PC against the addresse of that +* handler checks the interrupted host PC against the address of that * known section. If the PC is before or at the address of the syscall * instruction then we change the PC to point at a "return * -QEMU_ERESTARTSYS" code path instead, and then exit the signal handler
accel/tcg/tb-maint.c +1 -1
@@ -1,5 +1,5 @@/* -* Translation Block Maintaince +* Translation Block Maintenance * * Copyright (c) 2003 Fabrice Bellard *
contrib/plugins/cache.c +1 -1
@@ -350,7 +350,7 @@ static int in_cache(Cache *cache, uint64_t addr)* @cache: The cache under simulation * @addr: The address of the requested memory location * -* Returns true if the requsted data is hit in the cache and false when missed. +* Returns true if the requested data is hit in the cache and false when missed. * The cache is updated on miss for the next access. */ static bool access_cache (Cache *cache,uint64_t addr)
contrib/plugins/lockstep.c +1 -1
@@ -108,7 +108,7 @@ static void report_divergance(ExecState *us, ExecState *them)/* * If we have diverged before did we get back on track or are we -* totally loosing it? +* totally losing it? */ if (divergence_log) {DivergeState *last = (DivergeState *) divergence_log->data;
linux-user/flatload.c +1 -1
@@ -780,7 +780,7 @@ int load_flt_binary(struct linux_binprm *bprm, struct image_info *info)/* Enforce final stack alignment of 16 bytes. This is sufficient for all current targets, and excess alignment is harmless. */ stack_len = bprm->envc + bprm->argc +2 ; - stack_len +=flat_argvp_envp_on_stack () ?2 :0 ;/* arvg, argp */ + stack_len +=flat_argvp_envp_on_stack () ?2 :0 ;/* argv, argp */ stack_len +=1 ;/* argc */ stack_len *=sizeof (abi_ulong); sp -= (sp - stack_len) &15 ;
linux-user/syscall.c +2 -2
@@ -1809,7 +1809,7 @@ static inline abi_long target_to_host_cmsg(struct msghdr *msgh,uint32_t *dst = (uint32_t *)data;memcpy (dst, target_data, len); -/* fix endianess of first 32-bit word */ +/* fix endianness of first 32-bit word */ if (len >=sizeof (uint32_t )) { *dst =tswap32 (*dst); }
@@ -2920,7 +2920,7 @@ get_timeout:unlock_user (results, optval_addr,0 );return ret; } -/* swap host endianess to target endianess. */ +/* swap host endianness to target endianness. */ for (i =0 ; i < (len /sizeof (uint32_t )); i++) { results[i] =tswap32 (results[i]); }
semihosting/config.c +1 -1
@@ -8,7 +8,7 @@* targets that support it. Architecture specific handling is handled * in target/HW/HW-semi.c * -* Semihosting is sightly strange in that it is also supported by some +* Semihosting is slightly strange in that it is also supported by some * linux-user targets. However in that use case no configuration of * the outputs and command lines is supported. *
semihosting/syscalls.c +2 -2
@@ -720,7 +720,7 @@ void semihost_sys_read_gf(CPUState *cs, gdb_syscall_complete_cb complete, GuestFD *gf, target_ulong buf, target_ulong len) {/* -* Bound length for 64-bit guests on 32-bit hosts, not overlowing ssize_t. +* Bound length for 64-bit guests on 32-bit hosts, not overflowing ssize_t. * Note the Linux kernel does this with MAX_RW_COUNT, so it's not a bad * idea to do this unconditionally. */
@@ -761,7 +761,7 @@ void semihost_sys_write_gf(CPUState *cs, gdb_syscall_complete_cb complete, GuestFD *gf, target_ulong buf, target_ulong len) {/* -* Bound length for 64-bit guests on 32-bit hosts, not overlowing ssize_t. +* Bound length for 64-bit guests on 32-bit hosts, not overflowing ssize_t. * Note the Linux kernel does this with MAX_RW_COUNT, so it's not a bad * idea to do this unconditionally. */
softmmu/icount.c +1 -1
@@ -325,7 +325,7 @@ void icount_start_warp_timer(void)* vCPU is sleeping and warp can't be started. * It is probably a race condition: notification sent * to vCPU was processed in advance and vCPU went to sleep. -* Therefore we have to wake it up for doing someting. +* Therefore we have to wake it up for doing something. */ if (replay_has_event ()) {qemu_clock_notify (QEMU_CLOCK_VIRTUAL );
softmmu/ioport.c +1 -1
@@ -22,7 +22,7 @@* THE SOFTWARE. */ /* -* splitted out ioport related stuffs from vl.c. +* split out ioport related stuffs from vl.c. */ #include "qemu/osdep.h"
Signature · 1 line
2.41.0
[PULL 04/41] bulk: Do not declare function prototypes using 'extern' keyword
In reply to Philippe Mathieu-DaudéBy default, C function prototypes declared in headers are visible, so there is no need to declare them as 'extern' functions. Remove this redundancy in a single bulk commit; do not modify:
- meson.build (used to check function availability at runtime)
- pc-bios/
- libdecnumber/
- tests/
- *.c
Message-Id: <[email protected]>
--- bsd-user/bsd-file.h | 6 ++--- crypto/hmacpriv.h | 13 +++++------ hw/xen/xen_pt.h | 8 +++---- include/crypto/secret_common.h | 14 +++++------- include/exec/page-vary.h | 4 ++-- include/hw/misc/aspeed_scu.h | 2 +- include/hw/nvram/npcm7xx_otp.h | 4 ++-- include/hw/qdev-core.h | 4 ++-- include/qemu/crc-ccitt.h | 4 ++-- include/qemu/osdep.h | 4 ++-- include/qemu/rcu.h | 14 ++++++------ include/qemu/sys_membarrier.h | 4 ++-- include/qemu/uri.h | 6 ++--- include/sysemu/accel-blocker.h | 14 ++++++------ include/sysemu/os-win32.h | 4 ++-- include/user/safe-syscall.h | 4 ++-- target/i386/sev.h | 6 ++--- target/mips/cpu.h | 4 ++-- tcg/tcg-internal.h | 4 ++-- include/exec/memory_ldst.h.inc | 42 +++++++++++++++++----------------- 20 files changed, 79 insertions(+), 86 deletions(-)
bsd-user/bsd-file.h +2 -4
@@ -51,10 +51,8 @@ do { \unlock_user (p1, arg1,0 ); \ }while (0 ) -extern struct iovec *lock_iovec(int type, abi_ulong target_addr, int count, -int copy); -extern void unlock_iovec (struct iovec *vec,abi_ulong target_addr,int count, -int copy); +struct iovec *lock_iovec(int type, abi_ulong target_addr, int count, int copy); +void unlock_iovec (struct iovec *vec,abi_ulong target_addr,int count,int copy);int safe_open (const char *path,int flags,mode_t mode);int safe_openat (int fd,const char *path,int flags,mode_t mode);
crypto/hmacpriv.h +6 -7
@@ -28,19 +28,18 @@ struct QCryptoHmacDriver {void (*hmac_free)(QCryptoHmac *hmac); }; -extern void *qcrypto_hmac_ctx_new (QCryptoHashAlgorithm alg, -const uint8_t *key,size_t nkey, -Error **errp); +void *qcrypto_hmac_ctx_new (QCryptoHashAlgorithm alg, +const uint8_t *key,size_t nkey, +Error **errp);extern QCryptoHmacDriver qcrypto_hmac_lib_driver;#ifdef CONFIG_AF_ALG #include "afalgpriv.h" -extern QCryptoAFAlg * -qcrypto_afalg_hmac_ctx_new (QCryptoHashAlgorithm alg, -const uint8_t *key,size_t nkey, -Error **errp); +QCryptoAFAlg *qcrypto_afalg_hmac_ctx_new (QCryptoHashAlgorithm alg, +const uint8_t *key,size_t nkey, +Error **errp);extern QCryptoHmacDriver qcrypto_hmac_afalg_driver;#endif
hw/xen/xen_pt.h +3 -5
@@ -340,11 +340,9 @@ static inline bool xen_pt_has_msix_mapping(XenPCIPassthroughState *s, int bar)return s->msix && s->msix->bar_index == bar; } -extern void *pci_assign_dev_load_option_rom (PCIDevice *dev, -int *size, -unsigned int domain, -unsigned int bus,unsigned int slot, -unsigned int function); +void *pci_assign_dev_load_option_rom (PCIDevice *dev,int *size, +unsigned int domain,unsigned int bus, +unsigned int slot,unsigned int function);static inline bool is_igd_vga_passthrough (XenHostPCIDevice *dev) { return (xen_igd_gfx_pt_enabled()
include/crypto/secret_common.h +6 -8
@@ -48,13 +48,11 @@ struct QCryptoSecretCommonClass { }; -extern int qcrypto_secret_lookup (const char *secretid, -uint8_t **data, -size_t *datalen, -Error **errp); -extern char *qcrypto_secret_lookup_as_utf8 (const char *secretid, -Error **errp); -extern char *qcrypto_secret_lookup_as_base64 (const char *secretid, -Error **errp); +int qcrypto_secret_lookup (const char *secretid, +uint8_t **data, +size_t *datalen, +Error **errp); +char *qcrypto_secret_lookup_as_utf8 (const char *secretid,Error **errp); +char *qcrypto_secret_lookup_as_base64 (const char *secretid,Error **errp);#endif /* QCRYPTO_SECRET_COMMON_H */
include/exec/page-vary.h +2 -2
@@ -27,8 +27,8 @@ typedef struct { } TargetPageBits;#ifdef IN_PAGE_VARY -extern bool set_preferred_target_page_bits_common (int bits); -extern void finalize_target_page_bits_common (int min); +bool set_preferred_target_page_bits_common (int bits); +void finalize_target_page_bits_common (int min);#endif /**
include/hw/misc/aspeed_scu.h +1 -1
@@ -51,7 +51,7 @@ struct AspeedSCUState {#define ASPEED_IS_AST2500 (si_rev) ((((si_rev) >> 24) & 0xff) == 0x04) -extern bool is_supported_silicon_rev (uint32_t silicon_rev); +bool is_supported_silicon_rev (uint32_t silicon_rev);struct AspeedSCUClass {
include/hw/nvram/npcm7xx_otp.h +2 -2
@@ -73,7 +73,7 @@ typedef struct NPCM7xxOTPClass NPCM7xxOTPClass;* Each nibble of data is encoded into a byte, so the number of bytes written * to the array will be @len * 2. */ -extern void npcm7xx_otp_array_write (NPCM7xxOTPState *s,const void *data, -unsigned int offset,unsigned int len); +void npcm7xx_otp_array_write (NPCM7xxOTPState *s,const void *data, +unsigned int offset,unsigned int len);#endif /* NPCM7XX_OTP_H */
include/hw/qdev-core.h +2 -2
@@ -1086,7 +1086,7 @@ typedef enum MachineInitPhase {PHASE_MACHINE_READY , } MachineInitPhase; -extern bool phase_check (MachineInitPhase phase); -extern void phase_advance (MachineInitPhase phase); +bool phase_check (MachineInitPhase phase); +void phase_advance (MachineInitPhase phase);#endif
include/qemu/crc-ccitt.h +2 -2
@@ -17,8 +17,8 @@extern uint16_t const crc_ccitt_table[256 ];extern uint16_t const crc_ccitt_false_table[256 ]; -extern uint16_t crc_ccitt (uint16_t crc,const uint8_t *buffer,size_t len); -extern uint16_t crc_ccitt_false (uint16_t crc,const uint8_t *buffer,size_t len); +uint16_t crc_ccitt (uint16_t crc,const uint8_t *buffer,size_t len); +uint16_t crc_ccitt_false (uint16_t crc,const uint8_t *buffer,size_t len);static inline uint16_t crc_ccitt_byte (uint16_t crc,const uint8_t c) {
include/qemu/osdep.h +2 -2
@@ -250,7 +250,7 @@ extern "C" {* supports QEMU_ERROR, this will be reported at compile time; otherwise * this will be reported at link time due to the missing symbol. */ -G_NORETURN extern +G_NORETURN void QEMU_ERROR("code path is reachable")qemu_build_not_reached_always (void);#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
@@ -506,7 +506,7 @@ void qemu_anon_ram_free(void *ptr, size_t size);* See MySQL bug #7156 (http://bugs.mysql.com/bug.php?id=7156) for discussion * about Solaris missing the madvise() prototype. */ -extern int madvise (char *,size_t ,int ); +int madvise (char *,size_t ,int );#endif #if defined(CONFIG_LINUX )
include/qemu/rcu.h +7 -7
@@ -118,19 +118,19 @@ static inline void rcu_read_unlock(void) } } -extern void synchronize_rcu (void ); +void synchronize_rcu (void );/* * Reader thread registration. */ -extern void rcu_register_thread (void ); -extern void rcu_unregister_thread (void ); +void rcu_register_thread (void ); +void rcu_unregister_thread (void );/* * Support for fork(). fork() support is enabled at startup. */ -extern void rcu_enable_atfork (void ); -extern void rcu_disable_atfork (void ); +void rcu_enable_atfork (void ); +void rcu_disable_atfork (void );struct rcu_head ;typedef void RCUCBFunc (struct rcu_head *head);
@@ -140,8 +140,8 @@ struct rcu_head {RCUCBFunc *func; }; -extern void call_rcu1 (struct rcu_head *head,RCUCBFunc *func); -extern void drain_call_rcu (void ); +void call_rcu1 (struct rcu_head *head,RCUCBFunc *func); +void drain_call_rcu (void );/* The operands of the minus operator must have the same type, * which must be the one that we specify in the cast.
include/qemu/sys_membarrier.h +2 -2
@@ -14,8 +14,8 @@* side. The slow side forces processor-level ordering on all other cores * through a system call. */ -extern void smp_mb_global_init (void ); -extern void smp_mb_global (void ); +void smp_mb_global_init (void ); +void smp_mb_global (void );#define smp_mb_placeholder () barrier()#else /* Keep it simple, execute a real memory barrier on both sides. */
include/qemu/uri.h +3 -3
@@ -96,8 +96,8 @@ typedef struct QueryParams { QueryParam *p; /* array of parameters */ } QueryParams; -QueryParams *query_params_new (int init_alloc); -extern QueryParams *query_params_parse (const char *query); -extern void query_params_free (QueryParams *ps); +QueryParams *query_params_new (int init_alloc); +QueryParams *query_params_parse (const char *query); +void query_params_free (QueryParams *ps);#endif /* QEMU_URI_H */
include/sysemu/accel-blocker.h +7 -7
@@ -16,7 +16,7 @@#include "sysemu/cpus.h" -extern void accel_blocker_init (void ); +void accel_blocker_init (void );/* * accel_{cpu_}ioctl_begin/end:
@@ -26,10 +26,10 @@ extern void accel_blocker_init(void);* called, preventing new ioctls to run. They will continue only after * accel_ioctl_inibith_end(). */ -extern void accel_ioctl_begin (void ); -extern void accel_ioctl_end (void ); -extern void accel_cpu_ioctl_begin (CPUState *cpu); -extern void accel_cpu_ioctl_end (CPUState *cpu); +void accel_ioctl_begin (void ); +void accel_ioctl_end (void ); +void accel_cpu_ioctl_begin (CPUState *cpu); +void accel_cpu_ioctl_end (CPUState *cpu);/* * accel_ioctl_inhibit_begin: start critical section
@@ -42,7 +42,7 @@ extern void accel_cpu_ioctl_end(CPUState *cpu);* This allows the caller to access shared data or perform operations without * worrying of concurrent vcpus accesses. */ -extern void accel_ioctl_inhibit_begin (void ); +void accel_ioctl_inhibit_begin (void );/* * accel_ioctl_inhibit_end: end critical section started by
@@ -50,6 +50,6 @@ extern void accel_ioctl_inhibit_begin(void);* * This function allows blocked accel_{cpu_}ioctl_begin() to continue. */ -extern void accel_ioctl_inhibit_end (void ); +void accel_ioctl_inhibit_end (void );#endif /* ACCEL_BLOCKER_H */
include/sysemu/os-win32.h +2 -2
@@ -66,8 +66,8 @@ extern "C" {* setjmp to _setjmpex instead. However, they are still defined in libmingwex.a, * which gets linked automatically. */ -extern int __mingw_setjmp (jmp_buf ); -extern void __attribute__((noreturn))__mingw_longjmp (jmp_buf ,int ); +int __mingw_setjmp (jmp_buf ); +void __attribute__((noreturn))__mingw_longjmp (jmp_buf ,int );#define setjmp (env) __mingw_setjmp(env)#define longjmp (env, val) __mingw_longjmp(env, val)#elif defined(_WIN64)
include/user/safe-syscall.h +2 -2
@@ -126,8 +126,8 @@*/ /* The core part of this function is implemented in assembly */ -extern long safe_syscall_base (int *pending,long number, ...); -extern long safe_syscall_set_errno_tail (int value); +long safe_syscall_base (int *pending,long number, ...); +long safe_syscall_set_errno_tail (int value);/* These are defined by the safe-syscall.inc.S file */ extern char safe_syscall_start[];
target/i386/sev.h +3 -3
@@ -46,9 +46,9 @@ bool sev_es_enabled(void);#define sev_es_enabled () 0#endif -extern uint32_t sev_get_cbit_position (void ); -extern uint32_t sev_get_reduced_phys_bits (void ); -extern bool sev_add_kernel_loader_hashes (SevKernelLoaderContext *ctx,Error **errp); +uint32_t sev_get_cbit_position (void ); +uint32_t sev_get_reduced_phys_bits (void ); +bool sev_add_kernel_loader_hashes (SevKernelLoaderContext *ctx,Error **errp);int sev_encrypt_flash (uint8_t *ptr,uint64_t len,Error **errp); int sev_inject_launch_secret(const char *hdr, const char *secret,
target/mips/cpu.h +2 -2
@@ -1224,8 +1224,8 @@ void mips_cpu_list(void);#define cpu_list mips_cpu_list -extern void cpu_wrdsp (uint32_t rs,uint32_t mask_num,CPUMIPSState *env); -extern uint32_t cpu_rddsp (uint32_t mask_num,CPUMIPSState *env); +void cpu_wrdsp (uint32_t rs,uint32_t mask_num,CPUMIPSState *env); +uint32_t cpu_rddsp (uint32_t mask_num,CPUMIPSState *env);/* * MMU modes definitions. We carefully match the indices with our
tcg/tcg-internal.h +2 -2
@@ -64,8 +64,8 @@ static inline TCGv_i32 TCGV_HIGH(TCGv_i64 t)return temp_tcgv_i32 (tcgv_i64_temp (t) + !HOST_BIG_ENDIAN ); }#else -extern TCGv_i32 TCGV_LOW(TCGv_i64) QEMU_ERROR("32-bit code path is reachable"); -extern TCGv_i32 TCGV_HIGH(TCGv_i64) QEMU_ERROR("32-bit code path is reachable"); +TCGv_i32 TCGV_LOW(TCGv_i64) QEMU_ERROR("32-bit code path is reachable"); +TCGv_i32 TCGV_HIGH(TCGv_i64) QEMU_ERROR("32-bit code path is reachable");#endif static inline TCGv_i64 TCGV128_LOW (TCGv_i128 t)
include/exec/memory_ldst.h.inc +21 -21
69 lines not on this page · raw message
Signature · 1 line
2.41.0
[PULL 03/41] qemu/uri: Use QueryParams type definition
In reply to Philippe Mathieu-DaudéFollow QEMU CODING_STYLE, use the type definition, making that prototype match the following two.
Message-Id: <[email protected]>
--- include/qemu/uri.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/qemu/uri.h +1 -1
@@ -96,7 +96,7 @@ typedef struct QueryParams {QueryParam *p;/* array of parameters */ } QueryParams; -struct QueryParams *query_params_new (int init_alloc); +QueryParams *query_params_new (int init_alloc);extern QueryParams *query_params_parse (const char *query);extern void query_params_free (QueryParams *ps);
Signature · 1 line
2.41.0
[PULL 05/41] hw/net/i82596: Include missing 'exec/address-spaces.h' header
In reply to Philippe Mathieu-Daudéhw/net/i82596.c access the global 'address_space_memory' calling the ld/st_phys() API. address_space_memory is declared in "exec/address-spaces.h". Currently this header is indirectly pulled in via another header. Explicitly include it to avoid when refactoring unrelated headers:
hw/net/i82596.c:91:23: error: use of undeclared identifier 'address_space_memory'; did you mean 'address_space_destroy'?
return ldub_phys(&address_space_memory, addr);
^~~~~~~~~~~~~~~~~~~~
address_space_destroyMessage-Id: <[email protected]>
--- hw/net/i82596.c | 1 + 1 file changed, 1 insertion(+)
hw/net/i82596.c +1 -0
@@ -15,6 +15,7 @@#include "hw/irq.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "exec/address-spaces.h" #include "qemu/module.h" #include "trace.h" #include "i82596.h"
Signature · 1 line
2.41.0
[PULL 22/41] hw/char/pl011: Display register name in trace events
In reply to Philippe Mathieu-DaudéTo avoid knowing the register addresses by heart, display their name along in the trace events.
Since the MMIO region is 4K wide (0x1000 bytes), displaying the address with 3 digits is enough, so reduce the address format.
Message-Id: <[email protected]>
--- hw/char/pl011.c | 25 ++++++++++++++++++++++--- hw/char/trace-events | 4 ++-- 2 files changed, 24 insertions(+), 5 deletions(-)
hw/char/pl011.c +22 -3
@@ -51,6 +51,7 @@ DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr)#define PL011_INT_TX 0x20#define PL011_INT_RX 0x10 +/* Flag Register, UARTFR */ #define PL011_FLAG_TXFE 0x80#define PL011_FLAG_RXFF 0x40#define PL011_FLAG_TXFF 0x20
@@ -76,6 +77,24 @@ static const unsigned char pl011_id_arm[8] =static const unsigned char pl011_id_luminary[8 ] = {0x11 ,0x00 ,0x18 ,0x01 ,0x0d ,0xf0 ,0x05 ,0xb1 }; +static const char *pl011_regname (hwaddr offset) +{ +static const char *const rname[] = { + [0 ] ="DR" , [1 ] ="RSR" , [6 ] ="FR" , [8 ] ="ILPR" , [9 ] ="IBRD" , + [10 ] ="FBRD" , [11 ] ="LCRH" , [12 ] ="CR" , [13 ] ="IFLS" , [14 ] ="IMSC" , + [15 ] ="RIS" , [16 ] ="MIS" , [17 ] ="ICR" , [18 ] ="DMACR" , + }; +unsigned idx = offset >>2 ; + +if (idx <ARRAY_SIZE (rname) && rname[idx]) { +return rname[idx]; + } +if (idx >=0x3f8 && idx <=0x400 ) { +return "ID" ; + } +return "UNKN" ; +} +/* Which bits in the interrupt status matter for each outbound IRQ line ? */ static const uint32_t irqmask[] = {INT_E |INT_MS |INT_RT |INT_TX |INT_RX ,/* combined IRQ */
@@ -191,7 +210,7 @@ static uint64_t pl011_read(void *opaque, hwaddr offset,break ; } -trace_pl011_read (offset, r); +trace_pl011_read (offset, r,pl011_regname (offset));return r; }
@@ -234,7 +253,7 @@ static void pl011_write(void *opaque, hwaddr offset,PL011State *s = (PL011State *)opaque;unsigned char ch; -trace_pl011_write (offset, value); +trace_pl011_write (offset, value,pl011_regname (offset));switch (offset >>2 ) {case 0 :/* UARTDR */
@@ -252,7 +271,7 @@ static void pl011_write(void *opaque, hwaddr offset,case 6 :/* UARTFR */ /* Writes to Flag register are ignored. */ break ; -case 8 :/* UARTUARTILPR */ +case 8 :/* UARTILPR */ s->ilpr = value;break ;case 9 :/* UARTIBRD */
hw/char/trace-events +2 -2
@@ -54,9 +54,9 @@ escc_sunmouse_event(int dx, int dy, int buttons_state) "dx=%d dy=%d buttons=0x%0 # pl011.c pl011_irq_state(int level) "irq state %d" -pl011_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" +pl011_read(uint32_t addr, uint32_t value, const char *regname) "addr 0x%03x value 0x%08x reg %s" pl011_read_fifo(int read_count) "FIFO read, read_count now %d" -pl011_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" +pl011_write(uint32_t addr, uint32_t value, const char *regname) "addr 0x%03x value 0x%08x reg %s" pl011_can_receive(uint32_t lcr, int read_count, int r) "LCR 0x%08x read_count %d returning %d" pl011_put_fifo(uint32_t c, int read_count) "new char 0x%x read_count now %d" pl011_put_fifo_full(void) "FIFO now full, RXFF set"
Signature · 1 line
2.41.0
[PULL 07/41] exec/address-spaces.h: Remove unuseful 'exec/memory.h' include
In reply to Philippe Mathieu-Daudé"exec/address-spaces.h" declares get_system_io() and get_system_memory(), both returning a MemoryRegion pointer. MemoryRegion is forward declared in "qemu/typedefs.h", so we don't need any declaration from "exec/memory.h" here. Remove it.
Message-Id: <[email protected]>
--- include/exec/address-spaces.h | 2 -- 1 file changed, 2 deletions(-)
include/exec/address-spaces.h +0 -2
@@ -19,8 +19,6 @@* you're one of them. */ -#include "exec/memory.h" -#ifndef CONFIG_USER_ONLY /* Get the root memory region. This interface should only be used temporarily
Signature · 1 line
2.41.0
[PULL 23/41] hw/char/pl011: Remove duplicated PL011_INT_[RT]X definitions
In reply to Philippe Mathieu-DaudéPL011_INT_TX duplicates INT_TX, and PL011_INT_RX INT_RX. Follow other register fields definitions from this file, keep the shorter form.
Message-Id: <[email protected]>
--- hw/char/pl011.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
hw/char/pl011.c +3 -6
@@ -48,9 +48,6 @@ DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr)return dev; } -#define PL011_INT_TX 0x20 -#define PL011_INT_RX 0x10 -/* Flag Register, UARTFR */ #define PL011_FLAG_TXFE 0x80#define PL011_FLAG_RXFF 0x40
@@ -157,7 +154,7 @@ static uint64_t pl011_read(void *opaque, hwaddr offset, s->flags |=PL011_FLAG_RXFE ; }if (s->read_count == s->read_trigger -1 ) - s->int_level &= ~PL011_INT_RX ; + s->int_level &= ~INT_RX ;trace_pl011_read_fifo (s->read_count); s->rsr = c >>8 ;pl011_update (s);
@@ -262,7 +259,7 @@ static void pl011_write(void *opaque, hwaddr offset,/* XXX this blocks entire thread. Rewrite to use * qemu_chr_fe_write and background I/O callbacks */ qemu_chr_fe_write_all (&s->chr, &ch,1 ); - s->int_level |=PL011_INT_TX ; + s->int_level |=INT_TX ;pl011_update (s);break ;case 1 :/* UARTRSR/UARTECR */
@@ -350,7 +347,7 @@ static void pl011_put_fifo(void *opaque, uint32_t value) s->flags |=PL011_FLAG_RXFF ; }if (s->read_count == s->read_trigger) { - s->int_level |=PL011_INT_RX ; + s->int_level |=INT_RX ;pl011_update (s); } }
Signature · 1 line
2.41.0
[PULL 24/41] hw/char/pl011: Replace magic values by register field definitions
In reply to Philippe Mathieu-Daudé0x400 is Data Register Break Error (DR_BE), 0x10 is Line Control Register Fifo Enabled (LCR_FEN) and 0x1 is Send Break (LCR_BRK).
Message-Id: <[email protected]>
--- hw/char/pl011.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
hw/char/pl011.c +15 -7
@@ -54,6 +54,9 @@ DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr)#define PL011_FLAG_TXFF 0x20#define PL011_FLAG_RXFE 0x10 +/* Data Register, UARTDR */ +#define DR_BE (1 << 10) +/* Interrupt status bits in UARTRIS, UARTMIS, UARTIMSC */ #define INT_OE (1 << 10)#define INT_BE (1 << 9)
@@ -69,6 +72,10 @@ DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr)#define INT_E (INT_OE | INT_BE | INT_PE | INT_FE)#define INT_MS (INT_RI | INT_DSR | INT_DCD | INT_CTS) +/* Line Control Register, UARTLCR_H */ +#define LCR_FEN (1 << 4) +#define LCR_BRK (1 << 0) +static const unsigned char pl011_id_arm[8 ] = {0x11 ,0x10 ,0x14 ,0x00 ,0x0d ,0xf0 ,0x05 ,0xb1 }; static const unsigned char pl011_id_luminary[8] =
@@ -116,7 +123,7 @@ static void pl011_update(PL011State *s)static bool pl011_is_fifo_enabled (PL011State *s) { -return (s->lcr &0x10 ) !=0 ; +return (s->lcr &LCR_FEN ) !=0 ; }static inline unsigned pl011_get_fifo_depth (PL011State *s)
@@ -218,7 +225,7 @@ static void pl011_set_read_trigger(PL011State *s)the threshold. However linux only reads the FIFO in response to an interrupt. Triggering the interrupt when the FIFO is non-empty seems to make things work. */ -if (s->lcr &0x10 ) +if (s->lcr &LCR_FEN ) s->read_trigger = (s->ifl >>1 ) &0x1c ; else#endif
@@ -281,11 +288,11 @@ static void pl011_write(void *opaque, hwaddr offset,break ;case 11 :/* UARTLCR_H */ /* Reset the FIFO state on FIFO enable or disable */ -if ((s->lcr ^ value) &0x10 ) { +if ((s->lcr ^ value) &LCR_FEN ) {pl011_reset_fifo (s); } -if ((s->lcr ^ value) &0x1 ) { -int break_enable = value &0x1 ; +if ((s->lcr ^ value) &LCR_BRK ) { +int break_enable = value &LCR_BRK ;qemu_chr_fe_ioctl (&s->chr,CHR_IOCTL_SERIAL_SET_BREAK , &break_enable); }
@@ -359,8 +366,9 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size)static void pl011_event (void *opaque,QEMUChrEvent event) { -if (event ==CHR_EVENT_BREAK ) -pl011_put_fifo (opaque,0x400 ); +if (event ==CHR_EVENT_BREAK ) { +pl011_put_fifo (opaque,DR_BE ); + } }static void pl011_clock_update (void *opaque,ClockEvent event)
Signature · 1 line
2.41.0
[PULL 06/41] hw/dma/etraxfs: Include missing 'exec/memory.h' header
In reply to Philippe Mathieu-DaudéThe 'fs_dma_ctrl' structure has a MemoryRegion 'mmio' field which is initialized in etraxfs_dmac_init() calling memory_region_init_io() and memory_region_add_subregion().
These functions are declared in "exec/memory.h", along with the MemoryRegion structure. Include the missing header.
Message-Id: <[email protected]>
--- hw/dma/etraxfs_dma.c | 1 + 1 file changed, 1 insertion(+)
hw/dma/etraxfs_dma.c +1 -0
@@ -28,6 +28,7 @@#include "qemu/main-loop.h" #include "sysemu/runstate.h" #include "exec/address-spaces.h" +#include "exec/memory.h" #include "hw/cris/etraxfs_dma.h"
Signature · 1 line
2.41.0
[PULL 33/41] hw/i386: Remove unuseful kvmclock_create() stub
In reply to Philippe Mathieu-DaudéWe shouldn't call kvmclock_create() when KVM is not available or disabled:
- check for kvm_enabled() before calling it
- assert KVM is enabled once called
Since the call is elided when KVM is not available, we can remove the stub (it is never compiled).
Message-Id: <[email protected]>
--- include/hw/kvm/clock.h | 10 ---------- hw/i386/kvm/clock.c | 4 +++- hw/i386/microvm.c | 4 +++- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 4 +++- 5 files changed, 10 insertions(+), 14 deletions(-)
include/hw/kvm/clock.h +0 -10
@@ -13,16 +13,6 @@#ifndef HW_KVM_CLOCK_H #define HW_KVM_CLOCK_H -#ifdef CONFIG_KVM -void kvmclock_create (bool create_always); -#else /* CONFIG_KVM */ - -static inline void kvmclock_create (bool create_always) -{ -} - -#endif /* !CONFIG_KVM */ -#endif
hw/i386/kvm/clock.c +3 -1
@@ -332,8 +332,10 @@ void kvmclock_create(bool create_always) { X86CPU *cpu = X86_CPU(first_cpu); - if (!kvm_enabled() || !kvm_has_adjust_clock()) + assert(kvm_enabled()); + if (!kvm_has_adjust_clock()) { return; + } if (create_always || cpu->env.features[FEAT_KVM] & ((1ULL << KVM_FEATURE_CLOCKSOURCE) |
hw/i386/microvm.c +3 -1
@@ -180,7 +180,9 @@ static void microvm_devices_init(MicrovmMachineState *mms) x86ms->ioapic2 =ioapic_init_secondary (gsi_state); } -kvmclock_create (true); +if (kvm_enabled ()) { +kvmclock_create (true); + } mms->virtio_irq_base =5 ; mms->virtio_num_transports =8 ;
hw/i386/pc_piix.c +1 -1
@@ -192,7 +192,7 @@ static void pc_init1(MachineState *machine,pc_machine_init_sgx_epc (pcms);x86_cpus_init (x86ms, pcmc->default_cpu_version); -if (pcmc->kvmclock_enabled) { +if (kvm_enabled () && pcmc->kvmclock_enabled) {kvmclock_create (pcmc->kvmclock_create_always); }
hw/i386/pc_q35.c +3 -1
@@ -183,7 +183,9 @@ static void pc_q35_init(MachineState *machine)pc_machine_init_sgx_epc (pcms);x86_cpus_init (x86ms, pcmc->default_cpu_version); -kvmclock_create (pcmc->kvmclock_create_always); +if (kvm_enabled ()) { +kvmclock_create (pcmc->kvmclock_create_always); + }/* pci enabled */ if (pcmc->pci_enabled) {
Signature · 1 line
2.41.0
[PULL 31/41] hw/usb: spelling fixes
In reply to Philippe Mathieu-DaudéFrom: Michael Tokarev <[email protected]>
Message-ID: <[email protected]>
--- hw/usb/quirks.h | 2 +- hw/usb/ccid-card-emulated.c | 2 +- hw/usb/hcd-ehci.c | 6 +++--- hw/usb/hcd-ohci.c | 2 +- hw/usb/redirect.c | 2 +- hw/usb/xen-usb.c | 2 +- hw/usb/trace-events | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-)
hw/usb/quirks.h +1 -1
@@ -67,7 +67,7 @@ static const struct usb_device_id usbredir_raw_serial_ids[] = { { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */ { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */ { USB_DEVICE(0x10C4, 0x8044) }, /* Cygnal Debug Adapter */ - { USB_DEVICE(0x10C4, 0x804E) }, /* Software Bisque Paramount ME build-in converter */ + { USB_DEVICE(0x10C4, 0x804E) }, /* Software Bisque Paramount ME built-in converter */ { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */ { USB_DEVICE(0x10C4, 0x8054) }, /* Enfora GSM2228 */ { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */
hw/usb/ccid-card-emulated.c +1 -1
@@ -518,7 +518,7 @@ static void emulated_realize(CCIDCardState *base, Error **errp) goto out2; } -/* TODO: a passthru backened that works on local machine. third card type?*/ +/* TODO: a passthru backend that works on local machine. third card type?*/ if (card->backend ==BACKEND_CERTIFICATES ) {if (card->cert1 !=NULL && card->cert2 !=NULL && card->cert3 !=NULL ) { ret =emulated_initialize_vcard_from_certificates (card);
hw/usb/hcd-ehci.c +3 -3
@@ -1464,7 +1464,7 @@ static int ehci_process_itd(EHCIState *ehci,usb_handle_packet (dev, &ehci->ipacket);usb_packet_unmap (&ehci->ipacket, &ehci->isgl); }else { -DPRINTF ("ISOCH: attempt to addess non-iso endpoint\n" ); +DPRINTF ("ISOCH: attempt to address non-iso endpoint\n" ); ehci->ipacket.status =USB_RET_NAK ; ehci->ipacket.actual_length =0 ; }
@@ -1513,7 +1513,7 @@ static int ehci_process_itd(EHCIState *ehci,/* This state is the entry point for asynchronous schedule -* processing. Entry here consitutes a EHCI start event state (4.8.5) +* processing. Entry here constitutes a EHCI start event state (4.8.5) */ static int ehci_state_waitlisthead (EHCIState *ehci,int async) {
@@ -2458,7 +2458,7 @@ static void usb_ehci_vm_state_change(void *opaque, bool running, RunState state)/* * The schedule rebuilt from guest memory could cause the migration dest * to miss a QH unlink, and fail to cancel packets, since the unlinked QH -* will never have existed on the destination. Therefor we must flush the +* will never have existed on the destination. Therefore we must flush the * async schedule on savevm to catch any not yet noticed unlinks. */ if (state ==RUN_STATE_SAVE_VM ) {
hw/usb/hcd-ohci.c +1 -1
@@ -1355,7 +1355,7 @@ static uint32_t ohci_get_frame_remaining(OHCIState *ohci)if ((ohci->ctl &OHCI_CTL_HCFS ) !=OHCI_USB_OPERATIONAL ) {return ohci->frt <<31 ; } -/* Being in USB operational state guarnatees sof_time was set already. */ +/* Being in USB operational state guarantees sof_time was set already. */ tks =qemu_clock_get_ns (QEMU_CLOCK_VIRTUAL ) - ohci->sof_time;if (tks <0 ) { tks =0 ;
hw/usb/redirect.c +1 -1
@@ -471,7 +471,7 @@ static int bufp_alloc(USBRedirDevice *dev, uint8_t *data, uint16_t len,DPRINTF ("bufpq overflow, dropping packets ep %02X\n" , ep); dev->endpoint[EP2I (ep)].bufpq_dropping_packets =1 ; } -/* Since we're interupting the stream anyways, drop enough packets to get +/* Since we're interrupting the stream anyways, drop enough packets to get back to our target buffer size */ if (dev->endpoint[EP2I (ep)].bufpq_dropping_packets) { if (dev->endpoint[EP2I(ep)].bufpq_size >
hw/usb/xen-usb.c +1 -1
@@ -451,7 +451,7 @@ static int usbback_check_and_submit(struct usbback_req *usbback_req) wValue =le16_to_cpu (ctrl->wValue);/* -* When the device is first connected or resetted, USB device has no +* When the device is first connected or reset, USB device has no * address. In this initial state, following requests are sent to device * address (#0), *
hw/usb/trace-events +1 -1
@@ -248,7 +248,7 @@ usb_set_device_feature(int addr, int feature, int ret) "dev %d, feature %d, ret # dev-hub.c usb_hub_reset(int addr) "dev %d" -usb_hub_control(int addr, int request, int value, int index, int length) "dev %d, req 0x%x, value %d, index %d, langth %d" +usb_hub_control(int addr, int request, int value, int index, int length) "dev %d, req 0x%x, value %d, index %d, length %d" usb_hub_get_port_status(int addr, int nr, int status, int changed) "dev %d, port %d, status 0x%x, changed 0x%x" usb_hub_set_port_feature(int addr, int nr, const char *f) "dev %d, port %d, feature %s" usb_hub_clear_port_feature(int addr, int nr, const char *f) "dev %d, port %d, feature %s"
Signature · 1 line
2.41.0
[PULL 34/41] hw/i386: Rename 'hw/kvm/clock.h' -> 'hw/i386/kvm/clock.h'
In reply to Philippe Mathieu-Daudékvmclock_create() is only implemented in hw/i386/kvm/clock.h. Restrict the "hw/kvm/clock.h" header to i386 by moving it to hw/i386/.
Message-Id: <[email protected]>
---
{include/hw => hw/i386}/kvm/clock.h | 4 ++--
hw/i386/kvm/clock.c | 2 +-
hw/i386/microvm.c | 2 +-
hw/i386/pc_piix.c | 2 +-
hw/i386/pc_q35.c | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
rename {include/hw => hw/i386}/kvm/clock.h (85%)hw/i386/kvm/clock.h renamed from include/hw/kvm/clock.h +2 -2
@@ -10,8 +10,8 @@* See the COPYING file in the top-level directory. */ -#ifndef HW_KVM_CLOCK_H -#define HW_KVM_CLOCK_H +#ifndef HW_I386_KVM_CLOCK_H +#define HW_I386_KVM_CLOCK_H void kvmclock_create (bool create_always);
hw/i386/kvm/clock.c +1 -1
@@ -22,7 +22,7 @@#include "kvm/kvm_i386.h" #include "migration/vmstate.h" #include "hw/sysbus.h" -#include "hw/kvm/clock.h" +#include "hw/i386/kvm/clock.h" #include "hw/qdev-properties.h" #include "qapi/error.h"
hw/i386/microvm.c +1 -1
@@ -32,7 +32,7 @@#include "hw/loader.h" #include "hw/irq.h" -#include "hw/kvm/clock.h" +#include "hw/i386/kvm/clock.h" #include "hw/i386/microvm.h" #include "hw/i386/x86.h" #include "target/i386/cpu.h"
hw/i386/pc_piix.c +1 -1
@@ -46,7 +46,7 @@#include "hw/ide/piix.h" #include "hw/irq.h" #include "sysemu/kvm.h" -#include "hw/kvm/clock.h" +#include "hw/i386/kvm/clock.h" #include "hw/sysbus.h" #include "hw/i2c/smbus_eeprom.h" #include "exec/memory.h"
hw/i386/pc_q35.c +1 -1
@@ -35,7 +35,7 @@#include "hw/i2c/smbus_eeprom.h" #include "hw/rtc/mc146818rtc.h" #include "sysemu/kvm.h" -#include "hw/kvm/clock.h" +#include "hw/i386/kvm/clock.h" #include "hw/pci-host/q35.h" #include "hw/pci/pcie_port.h" #include "hw/qdev-properties.h"
Signature · 1 line
2.41.0
[PULL 35/41] util/fifo8: Fix typo in fifo8_push_all() description
In reply to Philippe Mathieu-DaudéMessage-Id: <[email protected]>
--- include/qemu/fifo8.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/qemu/fifo8.h +1 -1
@@ -46,7 +46,7 @@ void fifo8_push(Fifo8 *fifo, uint8_t data);* fifo8_push_all: * @fifo: FIFO to push to * @data: data to push -* @size: number of bytes to push +* @num: number of bytes to push * * Push a byte array to the FIFO. Behaviour is undefined if the FIFO is full. * Clients are responsible for checking the space left in the FIFO using
Signature · 1 line
2.41.0
[PULL 38/41] docs/style: permit inline loop variables
In reply to Philippe Mathieu-DaudéFrom: Alex Bennée <[email protected]>
I've already wasted enough of my time debugging aliased variables in deeply nested loops. While not scattering variable declarations around is a good aim I think we can make an exception for stuff used inside a loop.
Message-ID: <[email protected]>
--- docs/devel/style.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
docs/devel/style.rst +8 -1
@@ -204,7 +204,14 @@ Declarations Mixed declarations (interleaving statements and declarations within blocks) are generally not allowed; declarations should be at the beginning -of blocks. +of blocks. To avoid accidental re-use it is permissible to declare +loop variables inside for loops: + +.. code-block:: c + + for (int i = 0; i < ARRAY_SIZE(thing); i++) { + /* do something loopy */ + } Every now and then, an exception is made for declarations inside a #ifdef or #ifndef block: if the code looks nicer, such declarations can
Signature · 1 line
2.41.0
[PULL 41/41] tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc
In reply to Philippe Mathieu-DaudéSince commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented as the Coding Style:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename 'bti-crt.inc.c' as 'bti-crt.c.inc'.
Message-Id: <[email protected]>
---
tests/tcg/aarch64/bti-1.c | 2 +-
tests/tcg/aarch64/bti-3.c | 2 +-
tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} | 0
3 files changed, 2 insertions(+), 2 deletions(-)
rename tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} (100%)tests/tcg/aarch64/bti-1.c +1 -1
@@ -2,7 +2,7 @@* Branch target identification, basic notskip cases. */ -#include "bti-crt.inc.c" +#include "bti-crt.c.inc" static void skip2_sigill (int sig,siginfo_t *info,ucontext_t *uc) {
tests/tcg/aarch64/bti-3.c +1 -1
@@ -2,7 +2,7 @@* BTI vs PACIASP */ -#include "bti-crt.inc.c" +#include "bti-crt.c.inc" static void skip2_sigill (int sig,siginfo_t *info,ucontext_t *uc) {
tests/tcg/aarch64/bti-crt.c.inc renamed from tests/tcg/aarch64/bti-crt.inc.c +0 -0
Signature · 1 line
2.41.0
[PULL 13/41] target/helpers: Remove unnecessary 'exec/cpu_ldst.h' header
In reply to Philippe Mathieu-DaudéThese files don't use the CPU ld/st API, remove the unnecessary "exec/cpu_ldst.h" header.
Message-Id: <[email protected]>
--- target/riscv/pmu.h | 1 - target/cris/op_helper.c | 1 - target/mips/tcg/fpu_helper.c | 1 - target/mips/tcg/sysemu/lcsr_helper.c | 1 - target/s390x/tcg/excp_helper.c | 1 - target/s390x/tcg/fpu_helper.c | 1 - target/xtensa/mmu_helper.c | 1 - target/xtensa/op_helper.c | 1 - 8 files changed, 8 deletions(-)
target/riscv/pmu.h +0 -1
@@ -18,7 +18,6 @@#include "cpu.h" #include "qemu/main-loop.h" -#include "exec/exec-all.h" bool riscv_pmu_ctr_monitor_instructions (CPURISCVState *env,uint32_t target_ctr);
target/cris/op_helper.c +0 -1
@@ -24,7 +24,6 @@#include "exec/helper-proto.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" //#define CRIS_OP_HELPER_DEBUG
target/mips/tcg/fpu_helper.c +0 -1
@@ -25,7 +25,6 @@#include "internal.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" #include "fpu/softfloat.h" #include "fpu_helper.h"
target/mips/tcg/sysemu/lcsr_helper.c +0 -1
@@ -13,7 +13,6 @@#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" #define GET_MEMTXATTRS (cas) \ ((MemTxAttrs){.requester_id = env_cpu(cas)->cpu_index})
target/s390x/tcg/excp_helper.c +0 -1
@@ -23,7 +23,6 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" #include "s390x-internal.h" #include "tcg_s390x.h" #ifndef CONFIG_USER_ONLY
target/s390x/tcg/fpu_helper.c +0 -1
@@ -23,7 +23,6 @@#include "s390x-internal.h" #include "tcg_s390x.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h"
target/xtensa/mmu_helper.c +0 -1
@@ -34,7 +34,6 @@#include "exec/helper-proto.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" #define XTENSA_MPU_SEGMENT_MASK 0x0000001f#define XTENSA_MPU_ACC_RIGHTS_MASK 0x00000f00
target/xtensa/op_helper.c +0 -1
@@ -31,7 +31,6 @@#include "exec/helper-proto.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" #include "qemu/timer.h" #ifndef CONFIG_USER_ONLY
Signature · 1 line
2.41.0
[PULL 08/41] target/ppc/pmu: Include missing 'qemu/timer.h' header
In reply to Philippe Mathieu-DaudéSince commit c2eff582a3 ("target/ppc: PMU basic cycle count for pseries TCG") pmu_update_cycles() uses QEMU_CLOCK_VIRTUAL and calls qemu_clock_get_ns(), both defined in "qemu/timer.h".
Message-Id: <[email protected]>
--- target/ppc/power8-pmu.c | 1 + 1 file changed, 1 insertion(+)
target/ppc/power8-pmu.c +1 -0
@@ -16,6 +16,7 @@#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "qemu/error-report.h" +#include "qemu/timer.h" #include "qemu/main-loop.h" #include "hw/ppc/ppc.h" #include "power8-pmu.h"
Signature · 1 line
2.41.0
[PULL 09/41] target/riscv/pmu: Restrict 'qemu/log.h' include to source
In reply to Philippe Mathieu-DaudéDeclarations from "riscv/pmu.h" don't need anything from "qemu/log.h", reduce it's inclusion to the source.
Message-Id: <[email protected]>
--- target/riscv/pmu.h | 1 - target/riscv/pmu.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
target/riscv/pmu.h +0 -1
@@ -16,7 +16,6 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "qemu/log.h" #include "cpu.h" #include "qemu/main-loop.h" #include "exec/exec-all.h"
target/riscv/pmu.c +1 -0
@@ -17,6 +17,7 @@*/ #include "qemu/osdep.h" +#include "qemu/log.h" #include "cpu.h" #include "pmu.h" #include "sysemu/cpu-timers.h"
Signature · 1 line
2.41.0
[PULL 20/41] hw/char: Have FEWatchFunc handlers return G_SOURCE_CONTINUE/REMOVE
In reply to Philippe Mathieu-DaudéGLib recommend to use G_SOURCE_REMOVE / G_SOURCE_CONTINUE for GSourceFunc callbacks. Our FEWatchFunc is a GSourceFunc returning such value. Use such definitions which are "more memorable" [*].
[*] https://docs.gtk.org/glib/callback.SourceFunc.html#return-value
Message-Id: <[email protected]>
--- hw/char/cadence_uart.c | 8 ++++---- hw/char/cmsdk-apb-uart.c | 6 +++--- hw/char/ibex_uart.c | 8 ++++---- hw/char/nrf51_uart.c | 4 ++-- hw/char/serial.c | 2 +- hw/char/virtio-console.c | 2 +- hw/usb/redirect.c | 2 +- monitor/monitor.c | 2 +- net/vhost-user.c | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-)
hw/char/cadence_uart.c +4 -4
@@ -307,11 +307,11 @@ static gboolean cadence_uart_xmit(void *do_not_use, GIOCondition cond,/* instant drain the fifo when there's no back-end */ if (!qemu_chr_fe_backend_connected (&s->chr)) { s->tx_count =0 ; -return FALSE; +return G_SOURCE_REMOVE ; }if (!s->tx_count) { -return FALSE; +return G_SOURCE_REMOVE ; } ret =qemu_chr_fe_write (&s->chr, s->tx_fifo, s->tx_count);
@@ -326,12 +326,12 @@ static gboolean cadence_uart_xmit(void *do_not_use, GIOCondition cond, cadence_uart_xmit, s);if (!r) { s->tx_count =0 ; -return FALSE; +return G_SOURCE_REMOVE ; } }uart_update_status (s); -return FALSE; +return G_SOURCE_REMOVE ; } static void uart_write_tx_fifo(CadenceUARTState *s, const uint8_t *buf,
hw/char/cmsdk-apb-uart.c +3 -3
@@ -199,7 +199,7 @@ static gboolean uart_transmit(void *do_not_use, GIOCondition cond, void *opaque) s->watch_tag =0 ;if (!(s->ctrl &R_CTRL_TX_EN_MASK ) || !(s->state &R_STATE_TXFULL_MASK )) { -return FALSE; +return G_SOURCE_REMOVE ; } ret =qemu_chr_fe_write (&s->chr, &s->txbuf,1 );
@@ -215,7 +215,7 @@ static gboolean uart_transmit(void *do_not_use, GIOCondition cond, void *opaque) }/* Transmit pending */ trace_cmsdk_apb_uart_tx_pending (); -return FALSE; +return G_SOURCE_REMOVE ; } buffer_drained:
@@ -227,7 +227,7 @@ buffer_drained: s->intstatus |=R_INTSTATUS_TX_MASK ; }cmsdk_apb_uart_update (s); -return FALSE; +return G_SOURCE_REMOVE ; }static void uart_cancel_transmit (CMSDKAPBUART *s)
hw/char/ibex_uart.c +4 -4
@@ -147,7 +147,7 @@ static gboolean ibex_uart_xmit(void *do_not_use, GIOCondition cond,/* instant drain the fifo when there's no back-end */ if (!qemu_chr_fe_backend_connected (&s->chr)) { s->tx_level =0 ; -return FALSE; +return G_SOURCE_REMOVE ; }if (!s->tx_level) {
@@ -156,7 +156,7 @@ static gboolean ibex_uart_xmit(void *do_not_use, GIOCondition cond, s->uart_intr_state |=R_INTR_STATE_TX_EMPTY_MASK ; s->uart_intr_state &= ~R_INTR_STATE_TX_WATERMARK_MASK ;ibex_uart_update_irqs (s); -return FALSE; +return G_SOURCE_REMOVE ; } ret =qemu_chr_fe_write (&s->chr, s->tx_fifo, s->tx_level);
@@ -171,7 +171,7 @@ static gboolean ibex_uart_xmit(void *do_not_use, GIOCondition cond, ibex_uart_xmit, s);if (!r) { s->tx_level =0 ; -return FALSE; +return G_SOURCE_REMOVE ; } }
@@ -192,7 +192,7 @@ static gboolean ibex_uart_xmit(void *do_not_use, GIOCondition cond, }ibex_uart_update_irqs (s); -return FALSE; +return G_SOURCE_REMOVE ; } static void uart_write_tx_fifo(IbexUartState *s, const uint8_t *buf,
hw/char/nrf51_uart.c +2 -2
@@ -93,13 +93,13 @@ static gboolean uart_transmit(void *do_not_use, GIOCondition cond, void *opaque)*/ goto buffer_drained; } -return FALSE; +return G_SOURCE_REMOVE ; } buffer_drained: s->reg[R_UART_TXDRDY ] =1 ; s->pending_tx_byte = false; -return FALSE; +return G_SOURCE_REMOVE ; }static void uart_cancel_transmit (NRF51UARTState *s)
hw/char/serial.c +1 -1
@@ -226,7 +226,7 @@ static gboolean serial_watch_cb(void *do_not_use, GIOCondition cond,SerialState *s = opaque; s->watch_tag =0 ;serial_xmit (s); -return FALSE; +return G_SOURCE_REMOVE ; }static void serial_xmit (SerialState *s)
hw/char/virtio-console.c +1 -1
@@ -45,7 +45,7 @@ static gboolean chr_write_unblocked(void *do_not_use, GIOCondition cond, vcon->watch =0 ;virtio_serial_throttle_port (VIRTIO_SERIAL_PORT (vcon), false); -return FALSE; +return G_SOURCE_REMOVE ; }/* Callback function that's called when the guest sends us data */
hw/usb/redirect.c +1 -1
@@ -278,7 +278,7 @@ static gboolean usbredir_write_unblocked(void *do_not_use, GIOCondition cond, dev->watch =0 ;usbredirparser_do_write (dev->parser); -return FALSE; +return G_SOURCE_REMOVE ; }static int usbredir_write (void *priv,uint8_t *data,int count)
monitor/monitor.c +1 -1
@@ -144,7 +144,7 @@ static gboolean monitor_unblocked(void *do_not_use, GIOCondition cond,QEMU_LOCK_GUARD (&mon->mon_lock); mon->out_watch =0 ;monitor_flush_locked (mon); -return FALSE; +return G_SOURCE_REMOVE ; }/* Caller must hold mon->mon_lock */
net/vhost-user.c +1 -1
@@ -239,7 +239,7 @@ static gboolean net_vhost_user_watch(void *do_not_use, GIOCondition cond,qemu_chr_fe_disconnect (&s->chr); -return TRUE; +return G_SOURCE_CONTINUE ; }static void net_vhost_user_event (void *opaque,QEMUChrEvent event);
Signature · 1 line
2.41.0
[PULL 10/41] target/translate: Include missing 'exec/cpu_ldst.h' header
In reply to Philippe Mathieu-DaudéAll these files access the CPU LD/ST API declared in "exec/cpu_ldst.h".
Message-Id: <[email protected]>
--- target/avr/helper.c | 1 + target/i386/tcg/fpu_helper.c | 1 + target/i386/tcg/sysemu/excp_helper.c | 1 + target/loongarch/cpu.c | 1 + target/mips/tcg/ldst_helper.c | 1 + target/mips/tcg/msa_helper.c | 1 + target/riscv/op_helper.c | 1 + target/riscv/vector_helper.c | 1 + 8 files changed, 8 insertions(+)
target/avr/helper.c +1 -0
@@ -24,6 +24,7 @@#include "cpu.h" #include "hw/core/tcg-cpu-ops.h" #include "exec/exec-all.h" +#include "exec/cpu_ldst.h" #include "exec/address-spaces.h" #include "exec/helper-proto.h"
target/i386/tcg/fpu_helper.c +1 -0
@@ -21,6 +21,7 @@#include <math.h> #include "cpu.h" #include "tcg-cpu.h" +#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h" #include "fpu/softfloat-macros.h"
target/i386/tcg/sysemu/excp_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/cpu_ldst.h" #include "exec/exec-all.h" #include "tcg/helper-tcg.h"
target/loongarch/cpu.c +1 -0
@@ -11,6 +11,7 @@#include "qapi/error.h" #include "qemu/module.h" #include "sysemu/qtest.h" +#include "exec/cpu_ldst.h" #include "exec/exec-all.h" #include "cpu.h" #include "internals.h"
target/mips/tcg/ldst_helper.c +1 -0
@@ -24,6 +24,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" +#include "exec/cpu_ldst.h" #include "exec/memop.h" #include "internal.h"
target/mips/tcg/msa_helper.c +1 -0
@@ -22,6 +22,7 @@#include "internal.h" #include "tcg/tcg.h" #include "exec/exec-all.h" +#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "exec/memop.h" #include "fpu/softfloat.h"
target/riscv/op_helper.c +1 -0
@@ -23,6 +23,7 @@#include "internals.h" #include "qemu/main-loop.h" #include "exec/exec-all.h" +#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" /* Exceptions processing helpers */
target/riscv/vector_helper.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "exec/memop.h" #include "exec/exec-all.h" +#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h" #include "tcg/tcg-gvec-desc.h"
Signature · 1 line
2.41.0
[PULL 27/41] hw/ide: spelling fixes
In reply to Philippe Mathieu-DaudéFrom: Michael Tokarev <[email protected]>
Message-ID: <[email protected]>
--- hw/ide/ahci_internal.h | 4 ++-- hw/ide/cmd646.c | 2 +- hw/ide/core.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
hw/ide/ahci_internal.h +2 -2
@@ -61,13 +61,13 @@ enum AHCIHostReg {AHCI_HOST_REG_CTL =1 ,/* GHC: global host control */ AHCI_HOST_REG_IRQ_STAT =2 ,/* IS: interrupt status */ AHCI_HOST_REG_PORTS_IMPL =3 ,/* PI: bitmap of implemented ports */ -AHCI_HOST_REG_VERSION =4 ,/* VS: AHCI spec. version compliancy */ +AHCI_HOST_REG_VERSION =4 ,/* VS: AHCI spec. version compliance */ AHCI_HOST_REG_CCC_CTL =5 ,/* CCC_CTL: CCC Control */ AHCI_HOST_REG_CCC_PORTS =6 ,/* CCC_PORTS: CCC Ports */ AHCI_HOST_REG_EM_LOC =7 ,/* EM_LOC: Enclosure Mgmt Location */ AHCI_HOST_REG_EM_CTL =8 ,/* EM_CTL: Enclosure Mgmt Control */ AHCI_HOST_REG_CAP2 =9 ,/* CAP2: host capabilities, extended */ -AHCI_HOST_REG_BOHC =10 ,/* BOHC: firmare/os handoff ctrl & status */ +AHCI_HOST_REG_BOHC =10 ,/* BOHC: firmware/os handoff ctrl & status */ AHCI_HOST_REG__COUNT =11 };
hw/ide/cmd646.c +1 -1
@@ -257,7 +257,7 @@ static void pci_cmd646_ide_realize(PCIDevice *dev, Error **errp) pci_conf[CNTRL ] =CNTRL_EN_CH0 ;// enable IDE0 if (d->secondary) { -/* XXX: if not enabled, really disable the seconday IDE controller */ +/* XXX: if not enabled, really disable the secondary IDE controller */ pci_conf[CNTRL ] |=CNTRL_EN_CH1 ;/* enable IDE1 */ }
hw/ide/core.c +1 -1
@@ -1698,7 +1698,7 @@ static bool cmd_set_features(IDEState *s, uint8_t cmd)put_le16 (identify_data +63 ,0x07 );put_le16 (identify_data +88 ,0x3f );break ; -case 0x02 :/* sigle word dma mode*/ +case 0x02 :/* single word dma mode */ put_le16 (identify_data +62 ,0x07 | (1 << (val +8 )));put_le16 (identify_data +63 ,0x07 );put_le16 (identify_data +88 ,0x3f );
Signature · 1 line
2.41.0
[PULL 25/41] hw/i2c/pmbus_device: Fix modifying QOM class internals from instance
In reply to Philippe Mathieu-DaudéQOM object instance should not modify its class state (because all other objects instanciated from this class get affected).
Instead of modifying the PMBusDeviceClass 'device_num_pages' field the first time a instance is initialized (in pmbus_pages_alloc), introduce a new pmbus_pages_num() helper which returns the page number from the class without modifying the class state.
The code logic become slighly simplified.
Message-Id: <[email protected]>
--- hw/i2c/pmbus_device.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
hw/i2c/pmbus_device.c +10 -7
@@ -190,15 +190,18 @@ static void pmbus_quick_cmd(SMBusDevice *smd, uint8_t read) } } +static uint8_t pmbus_pages_num (PMBusDevice *pmdev) +{ +const PMBusDeviceClass *k =PMBUS_DEVICE_GET_CLASS (pmdev); + +/* some PMBus devices don't use the PAGE command, so they get 1 page */ +return k->device_num_pages ? :1 ; +} +static void pmbus_pages_alloc (PMBusDevice *pmdev) { -/* some PMBus devices don't use the PAGE command, so they get 1 page */ -PMBusDeviceClass *k =PMBUS_DEVICE_GET_CLASS (pmdev); -if (k->device_num_pages ==0 ) { - k->device_num_pages =1 ; - } - pmdev->num_pages = k->device_num_pages; - pmdev->pages =g_new0 (PMBusPage, k->device_num_pages); + pmdev->num_pages =pmbus_pages_num (pmdev); + pmdev->pages =g_new0 (PMBusPage, pmdev->num_pages); }void pmbus_check_limits (PMBusDevice *pmdev)
Signature · 1 line
2.41.0
[PULL 12/41] target/translate: Restrict 'exec/cpu_ldst.h' to user emulation
In reply to Philippe Mathieu-DaudéOnly handle_sigsegv_accerr_write(), declared with user emulation, requires "exec/cpu_ldst.h" (for the abi_ptr typedef).
Message-Id: <[email protected]>
--- include/exec/exec-all.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/exec-all.h +1 -1
@@ -21,7 +21,7 @@#define EXEC_ALL_H #include "cpu.h" -#ifdef CONFIG_TCG +#if defined(CONFIG_USER_ONLY )#include "exec/cpu_ldst.h" #endif #include "exec/translation-block.h"
Signature · 1 line
2.41.0
[PULL 11/41] target/translate: Remove unnecessary 'exec/cpu_ldst.h' header
In reply to Philippe Mathieu-DaudéAll these files only access the translator_ld/st API declared in "exec/translator.h". The CPU ld/st API from declared in "exec/cpu_ldst.h" is not used, remove it.
Message-Id: <[email protected]>
--- target/alpha/translate.c | 1 - target/hexagon/translate.c | 1 - target/hppa/translate.c | 1 - target/m68k/translate.c | 1 - target/microblaze/translate.c | 1 - target/nios2/translate.c | 1 - target/openrisc/translate.c | 1 - target/ppc/translate.c | 1 - target/sh4/translate.c | 1 - target/sparc/translate.c | 1 - 10 files changed, 10 deletions(-)
target/alpha/translate.c +0 -1
@@ -24,7 +24,6 @@#include "qemu/host-utils.h" #include "exec/exec-all.h" #include "tcg/tcg-op.h" -#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/translator.h"
target/hexagon/translate.c +0 -1
@@ -23,7 +23,6 @@#include "exec/helper-gen.h" #include "exec/helper-proto.h" #include "exec/translation-block.h" -#include "exec/cpu_ldst.h" #include "exec/log.h" #include "internal.h" #include "attribs.h"
target/hppa/translate.c +0 -1
@@ -23,7 +23,6 @@#include "qemu/host-utils.h" #include "exec/exec-all.h" #include "tcg/tcg-op.h" -#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/translator.h"
target/m68k/translate.c +0 -1
@@ -25,7 +25,6 @@#include "tcg/tcg-op.h" #include "qemu/log.h" #include "qemu/qemu-print.h" -#include "exec/cpu_ldst.h" #include "exec/translator.h" #include "exec/helper-proto.h"
target/microblaze/translate.c +0 -1
@@ -24,7 +24,6 @@#include "exec/exec-all.h" #include "tcg/tcg-op.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" #include "exec/helper-gen.h" #include "exec/translator.h" #include "qemu/qemu-print.h"
target/nios2/translate.c +0 -1
@@ -29,7 +29,6 @@#include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/log.h" -#include "exec/cpu_ldst.h" #include "exec/translator.h" #include "qemu/qemu-print.h" #include "semihosting/semihost.h"
target/openrisc/translate.c +0 -1
@@ -26,7 +26,6 @@#include "qemu/log.h" #include "qemu/bitops.h" #include "qemu/qemu-print.h" -#include "exec/cpu_ldst.h" #include "exec/translator.h" #include "exec/helper-proto.h"
target/ppc/translate.c +0 -1
@@ -27,7 +27,6 @@#include "tcg/tcg-op-gvec.h" #include "qemu/host-utils.h" #include "qemu/main-loop.h" -#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h"
target/sh4/translate.c +0 -1
@@ -22,7 +22,6 @@#include "disas/disas.h" #include "exec/exec-all.h" #include "tcg/tcg-op.h" -#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/translator.h"
target/sparc/translate.c +0 -1
@@ -25,7 +25,6 @@#include "exec/helper-proto.h" #include "exec/exec-all.h" #include "tcg/tcg-op.h" -#include "exec/cpu_ldst.h" #include "exec/helper-gen.h"
Signature · 1 line
2.41.0
[PULL 15/41] target/mips: Remove unused headers in lcsr_helper.c
In reply to Philippe Mathieu-DaudéThis files only access the address_space_ld/st API, declared in "exec/cpu-all.h", already included by "cpu.h".
Message-Id: <[email protected]>
--- target/mips/tcg/sysemu/lcsr_helper.c | 3 --- 1 file changed, 3 deletions(-)
target/mips/tcg/sysemu/lcsr_helper.c +0 -3
@@ -8,10 +8,7 @@#include "qemu/osdep.h" #include "cpu.h" -#include "internal.h" -#include "qemu/host-utils.h" #include "exec/helper-proto.h" -#include "exec/exec-all.h" #define GET_MEMTXATTRS (cas) \ ((MemTxAttrs){.requester_id = env_cpu(cas)->cpu_index})
Signature · 1 line
2.41.0
[PULL 39/41] meson: Fix MESONINTROSPECT parsing
In reply to Philippe Mathieu-DaudéFrom: Akihiko Odaki <[email protected]>
The arguments in MESONINTROSPECT are quoted with shlex.quote() so it must be parsed with shlex.split().
Message-ID: <[email protected]>
--- scripts/symlink-install-tree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/symlink-install-tree.py +2 -1
@@ -4,6 +4,7 @@ import errno import json import os +import shlex import subprocess import sys
@@ -14,7 +15,7 @@ def destdir_join(d1: str, d2: str) -> str: return str(PurePath(d1, *PurePath(d2).parts[1:])) introspect = os.environ.get('MESONINTROSPECT') -out = subprocess.run([*introspect.split(' '), '--installed'], +out = subprocess.run([*shlex.split(introspect), '--installed'], stdout=subprocess.PIPE, check=True).stdout for source, dest in json.loads(out).items(): bundle_dest = destdir_join('qemu-bundle', dest)
Signature · 1 line
2.41.0
Re: [PULL 39/41] meson: Fix MESONINTROSPECT parsing
Quoted 30 lines · Philippe Mathieu-Daudé
From: Akihiko Odaki <[email protected]>
The arguments in MESONINTROSPECT are quoted with
shlex.quote()so it must be parsed withshlex.split().Fixes cf60ccc330 ("cutils: Introduce bundle mechanism")Reported-by Michael Tokarev <[email protected]>Signed-off-by Akihiko Odaki <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Michael Tokarev <[email protected]>Tested-by Michael Tokarev <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>Message-ID: <[email protected]>
--- scripts/symlink-install-tree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)scripts/symlink-install-tree.py +1
-0@@ -4,6 +4,7 @@ import errno import json import os +import shlex import subprocess import sys
scripts/symlink-install-tree.py def destdir_join(d1: str, d2: str) -> str: · line 19
Quoted 6 lines
scripts/symlink-install-tree.py +1
-1@@ -14,7 +15,7 @@ def destdir_join(d1: str, d2: str) -> str: return str(PurePath(d1, *PurePath(d2).parts[1:])) introspect = os.environ.get('MESONINTROSPECT') -out = subprocess.run([*introspect.split(' '), '--installed'], +out = subprocess.run([*shlex.split(introspect), '--installed'], stdout=subprocess.PIPE, check=True).stdout
This turned out to be wrong on windows.
/mjt
Re: [PULL 39/41] meson: Fix MESONINTROSPECT parsing
Quoted 29 lines · Michael Tokarev
Quoted 28 lines · Philippe Mathieu-Daudé
From: Akihiko Odaki <[email protected]>
The arguments in MESONINTROSPECT are quoted with
shlex.quote()so it must be parsed withshlex.split().Fixes cf60ccc330 ("cutils: Introduce bundle mechanism")Reported-by Michael Tokarev <[email protected]>Signed-off-by Akihiko Odaki <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Michael Tokarev <[email protected]>Tested-by Michael Tokarev <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>Message-ID: <[email protected]>
---
scripts/symlink-install-tree.py| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)scripts/symlink-install-tree.py +0
-0@@ -4,6 +4,7 @@import errno
import json
import os
+import shlex
import subprocess
import sys
Quoted 8 lines
Quoted 6 lines
scripts/symlink-install-tree.py +1
-1@@ -14,7 +15,7 @@ def destdir_join(d1: str, d2: str) -> str: return str(PurePath(d1, *PurePath(d2).parts[1:])) introspect = os.environ.get('MESONINTROSPECT') -out = subprocess.run([*introspect.split(' '), '--installed'], +out = subprocess.run([*shlex.split(introspect), '--installed'],stdout=subprocess.PIPE, check=True).stdout
This turned out to be wrong on windows.
Doh, thanks for reporting, I haven't noticed on the list.
I'll repost without this patch.
Regards,
Phil.
[PULL 17/41] qemu/processor: Remove unused 'qemu/atomic.h' header
In reply to Philippe Mathieu-DaudéMessage-Id: <[email protected]>
--- include/qemu/processor.h | 2 -- 1 file changed, 2 deletions(-)
include/qemu/processor.h +0 -2
@@ -7,8 +7,6 @@#ifndef QEMU_PROCESSOR_H #define QEMU_PROCESSOR_H -#include "qemu/atomic.h" -#if defined(__i386__) || defined(__x86_64__)# define cpu_relax () asm volatile("rep; nop" ::: "memory")
Signature · 1 line
2.41.0
[PULL 26/41] hw/i2c: spelling fixes
In reply to Philippe Mathieu-DaudéFrom: Michael Tokarev <[email protected]>
Message-ID: <[email protected]>
--- include/hw/i2c/npcm7xx_smbus.h | 2 +- include/hw/misc/auxbus.h | 2 +- hw/i2c/pm_smbus.c | 2 +- hw/i2c/pmbus_device.c | 2 +- hw/i2c/smbus_slave.c | 2 +- hw/sensor/isl_pmbus_vr.c | 2 +- hw/sensor/max34451.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
include/hw/i2c/npcm7xx_smbus.h +1 -1
@@ -58,7 +58,7 @@ typedef enum NPCM7xxSMBusStatus {* @sclht: The SCL high time register. * @fif_ctl: The FIFO control register. * @fif_cts: The FIFO control status register. -* @fair_per: The fair preriod register. +* @fair_per: The fair period register. * @txf_ctl: The transmit FIFO control register. * @t_out: The SMBus timeout register. * @txf_sts: The transmit FIFO status register.
include/hw/misc/auxbus.h +1 -1
@@ -106,7 +106,7 @@ void aux_bus_realize(AUXBus *bus);* * Returns the reply of the request. * -* @bus Ths bus where the request happen. +* @bus The bus where the request happen. * @cmd The command requested. * @address The 20bits address of the slave. * @len The length of the read or write.
hw/i2c/pm_smbus.c +1 -1
@@ -1,6 +1,6 @@/* * PC SMBus implementation -* splitted from acpi.c +* split from acpi.c * * Copyright (c) 2006 Fabrice Bellard *
hw/i2c/pmbus_device.c +1 -1
@@ -1626,7 +1626,7 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_t *buf, uint8_t len)break ; passthrough: -/* Unimplimented registers get passed to the device */ +/* Unimplemented registers get passed to the device */ default :if (pmdc->write_data) { ret = pmdc->write_data (pmdev, buf, len);
hw/i2c/smbus_slave.c +1 -1
@@ -2,7 +2,7 @@* QEMU SMBus device emulation. * * This code is a helper for SMBus device emulation. It implements an -* I2C device inteface and runs the SMBus protocol from the device +* I2C device interface and runs the SMBus protocol from the device * point of view and maps those to simple calls to emulate. * * Copyright (c) 2007 CodeSourcery.
hw/sensor/isl_pmbus_vr.c +1 -1
@@ -101,7 +101,7 @@ static void isl_pmbus_vr_exit_reset(Object *obj) } } -/* The raa228000 uses different direct mode coefficents from most isl devices */ +/* The raa228000 uses different direct mode coefficients from most isl devices */ static void raa228000_exit_reset (Object *obj) {PMBusDevice *pmdev =PMBUS_DEVICE (obj);
hw/sensor/max34451.c +1 -1
@@ -734,7 +734,7 @@ static void max34451_init(Object *obj)/* * get and set the temperature of the internal temperature sensor in -* centidegrees Celcius i.e.: 2500 -> 25.00 C, max is 327.67 C +* centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C */ for (int i =0 ; i <MAX34451_NUM_TEMP_DEVICES ; i++) { object_property_add(obj, "temperature[*]", "uint16",
Signature · 1 line
2.41.0
[PULL 29/41] hw/mips: spelling fixes
In reply to Philippe Mathieu-DaudéFrom: Michael Tokarev <[email protected]>
Message-ID: <[email protected]>
--- hw/mips/malta.c | 2 +- target/mips/tcg/msa_helper.c | 12 ++++++------ target/mips/tcg/mxu_translate.c | 6 +++--- target/mips/cpu-defs.c.inc | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-)
hw/mips/malta.c +1 -1
@@ -627,7 +627,7 @@ static void bl_setup_gt64120_jump_kernel(void **p, uint64_t run_addr, 10, 10, 11, 11 /* PIIX IRQRC[A:D] */ }; -/* Bus endianess is always reversed */ +/* Bus endianness is always reversed */ #if TARGET_BIG_ENDIAN #define cpu_to_gt32 (x) (x)#else
target/mips/tcg/msa_helper.c +6 -6
@@ -803,9 +803,9 @@ void helper_msa_bset_d(CPUMIPSState *env, uint32_t wd, uint32_t ws, uint32_t wt)* | HADD_S.H | Vector Signed Horizontal Add (halfword) | * | HADD_S.W | Vector Signed Horizontal Add (word) | * | HADD_S.D | Vector Signed Horizontal Add (doubleword) | -* | HADD_U.H | Vector Unigned Horizontal Add (halfword) | -* | HADD_U.W | Vector Unigned Horizontal Add (word) | -* | HADD_U.D | Vector Unigned Horizontal Add (doubleword) | +* | HADD_U.H | Vector Unsigned Horizontal Add (halfword) | +* | HADD_U.W | Vector Unsigned Horizontal Add (word) | +* | HADD_U.D | Vector Unsigned Horizontal Add (doubleword) | * +---------------+----------------------------------------------------------+ */
@@ -3452,9 +3452,9 @@ void helper_msa_mulv_d(CPUMIPSState *env,* | HSUB_S.H | Vector Signed Horizontal Subtract (halfword) | * | HSUB_S.W | Vector Signed Horizontal Subtract (word) | * | HSUB_S.D | Vector Signed Horizontal Subtract (doubleword) | -* | HSUB_U.H | Vector Unigned Horizontal Subtract (halfword) | -* | HSUB_U.W | Vector Unigned Horizontal Subtract (word) | -* | HSUB_U.D | Vector Unigned Horizontal Subtract (doubleword) | +* | HSUB_U.H | Vector Unsigned Horizontal Subtract (halfword) | +* | HSUB_U.W | Vector Unsigned Horizontal Subtract (word) | +* | HSUB_U.D | Vector Unsigned Horizontal Subtract (doubleword) | * | SUBS_S.B | Vector Signed Saturated Subtract (of Signed) (byte) | * | SUBS_S.H | Vector Signed Saturated Subtract (of Signed) (halfword) | * | SUBS_S.W | Vector Signed Saturated Subtract (of Signed) (word) |
target/mips/tcg/mxu_translate.c +3 -3
@@ -2977,14 +2977,14 @@ static void gen_mxu_Q8ADD(DisasContext *ctx)* to another one in XRc, with zero extending * to 16-bit and put results as packed 16-bit data * into XRa and XRd. -* aptn2 manages action add or subract of pairs of data. +* aptn2 manages action add or subtract of pairs of data. * * Q8ACCE XRa, XRb, XRc, XRd, aptn2 * Add/subtract quadruple of 8-bit packed in XRb * to another one in XRc, with zero extending * to 16-bit and accumulate results as packed 16-bit data * into XRa and XRd. -* aptn2 manages action add or subract of pairs of data. +* aptn2 manages action add or subtract of pairs of data. */ static void gen_mxu_q8adde (DisasContext *ctx,bool accumulate) {
@@ -4056,7 +4056,7 @@ static void gen_mxu_s32sfl(DisasContext *ctx)/* * Q8SAD XRa, XRd, XRb, XRc -* Typical SAD opration for motion estimation. +* Typical SAD operation for motion estimation. */ static void gen_mxu_q8sad (DisasContext *ctx) {
target/mips/cpu-defs.c.inc +1 -1
@@ -1045,7 +1045,7 @@ static void mvp_init(CPUMIPSState *env) return; } - /* MVPConf1 implemented, TLB sharable, no gating storage support, + /* MVPConf1 implemented, TLB shareable, no gating storage support, programmable cache partitioning implemented, number of allocatable and shareable TLB entries, MVP has allocatable TCs, 2 VPEs implemented, 5 TCs implemented. */
Signature · 1 line
2.41.0
[PULL 40/41] build: Only define OS_OBJECT_USE_OBJC with gcc
In reply to Philippe Mathieu-DaudéFrom: Alexander Graf <[email protected]>
Recent versions of macOS use clang instead of gcc. The OS_OBJECT_USE_OBJC define is only necessary when building with gcc. Let's not define it when building with clang.
With this patch, I can successfully include GCD headers in QEMU when building with clang.
Message-ID: <[email protected]>
--- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meson.build +3 -1
@@ -223,7 +223,9 @@ qemu_ldflags = [] if targetos == 'darwin' # Disable attempts to use ObjectiveC features in os/object.h since they # won't work when we're compiling with gcc as a C compiler. - qemu_common_flags += '-DOS_OBJECT_USE_OBJC=0' + if compiler.get_id() == 'gcc' + qemu_common_flags += '-DOS_OBJECT_USE_OBJC=0' + endif elif targetos == 'solaris' # needed for CMSG_ macros in sys/socket.h qemu_common_flags += '-D_XOPEN_SOURCE=600'
Signature · 1 line
2.41.0
[PULL 30/41] hw/sd: spelling fixes
In reply to Philippe Mathieu-DaudéFrom: Michael Tokarev <[email protected]>
Message-ID: <[email protected]>
--- hw/sd/sd.c | 2 +- hw/sd/sdhci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/sd/sd.c +1 -1
@@ -1224,7 +1224,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) }break ; -/* Block read commands (Classs 2) */ +/* Block read commands (Class 2) */ case 16 :/* CMD16: SET_BLOCKLEN */ switch (sd->state) {case sd_transfer_state:
hw/sd/sdhci.c +1 -1
@@ -1811,7 +1811,7 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)* on i.MX, but since it is not used by QEMU we do not care. * * We don't want to call sdhci_write(.., SDHC_TRNMOD, ...) -* here becuase it will result in a call to +* here because it will result in a call to * sdhci_send_command(s) which we don't want. * */
Signature · 1 line
2.41.0
[PULL 28/41] hw/display: spelling fixes
In reply to Philippe Mathieu-DaudéFrom: Michael Tokarev <[email protected]>
Message-ID: <[email protected]>
--- hw/display/bochs-display.c | 2 +- hw/display/qxl.c | 2 +- hw/display/ssd0303.c | 2 +- hw/display/ssd0323.c | 2 +- hw/display/xlnx_dp.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
hw/display/bochs-display.c +1 -1
@@ -164,7 +164,7 @@ static int bochs_display_get_mode(BochsDisplayState *s,memset (mode,0 ,sizeof (*mode));switch (vbe[VBE_DISPI_INDEX_BPP ]) {case 16 : -/* best effort: support native endianess only */ +/* best effort: support native endianness only */ mode->format = PIXMAN_r5g6b5; mode->bytepp =2 ;break ;
hw/display/qxl.c +1 -1
@@ -1544,7 +1544,7 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm, } } -/* return 1 if surface destoy was initiated (in QXL_ASYNC case) or +/* return 1 if surface destroy was initiated (in QXL_ASYNC case) or * done (in QXL_SYNC case), 0 otherwise. */ static int qxl_destroy_primary (PCIQXLDevice *d,qxl_async_io async) {
hw/display/ssd0303.c +1 -1
@@ -8,7 +8,7 @@*/ /* The controller can support a variety of different displays, but we only -implement one. Most of the commends relating to brightness and geometry +implement one. Most of the commands relating to brightness and geometry setup are ignored. */ #include "qemu/osdep.h"
hw/display/ssd0323.c +1 -1
@@ -8,7 +8,7 @@*/ /* The controller can support a variety of different displays, but we only -implement one. Most of the commends relating to brightness and geometry +implement one. Most of the commands relating to brightness and geometry setup are ignored. */ #include "qemu/osdep.h"
hw/display/xlnx_dp.c +1 -1
@@ -380,7 +380,7 @@ static inline void xlnx_dp_audio_mix_buffer(XlnxDPState *s)static void xlnx_dp_audio_callback (void *opaque,int avail) {/* -* Get some data from the DPDMA and compute these datas. +* Get some data from the DPDMA and compute these data. * Then wait for QEMU's audio subsystem to call this callback. */ XlnxDPState *s =XLNX_DP (opaque);
Signature · 1 line
2.41.0
[PULL 21/41] hw/char/pl011: Restrict MemoryRegionOps implementation access sizes
In reply to Philippe Mathieu-DaudéThe pl011_read() and pl011_write() handlers shift the offset argument by 2, so are implemented on a 32-bit boundary.
Message-Id: <[email protected]>
--- hw/char/pl011.c | 2 ++ 1 file changed, 2 insertions(+)
hw/char/pl011.c +2 -0
@@ -358,6 +358,8 @@ static const MemoryRegionOps pl011_ops = { .read = pl011_read, .write = pl011_write, .endianness = DEVICE_NATIVE_ENDIAN, + .impl.min_access_size = 4, + .impl.max_access_size = 4, };static bool pl011_clock_needed (void *opaque)
Signature · 1 line
2.41.0
[PULL 18/41] exec/translation-block: Clean up includes
In reply to Philippe Mathieu-Daudé'qemu/atomic.h' and 'exec/target_page.h' are not used. 'qemu/interval-tree.h' is only required for user emulation.
Message-Id: <[email protected]>
--- include/exec/translation-block.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/exec/translation-block.h +3 -3
@@ -7,11 +7,11 @@#ifndef EXEC_TRANSLATION_BLOCK_H #define EXEC_TRANSLATION_BLOCK_H -#include "qemu/atomic.h" #include "qemu/thread.h" -#include "qemu/interval-tree.h" #include "exec/cpu-common.h" -#include "exec/target_page.h" +#ifdef CONFIG_USER_ONLY +#include "qemu/interval-tree.h" +#endif /* * Page tracking code uses ram addresses in system mode, and virtual
Signature · 1 line
2.41.0
[PULL 19/41] chardev/char-fe: Document FEWatchFunc typedef
In reply to Philippe Mathieu-DaudéMessage-Id: <[email protected]>
--- include/chardev/char-fe.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
include/chardev/char-fe.h +14 -0
@@ -175,6 +175,20 @@ void qemu_chr_fe_printf(CharBackend *be, const char *fmt, ...)G_GNUC_PRINTF (2 ,3 ); +/** +* FEWatchFunc: a #GSourceFunc called when any conditions requested by +* qemu_chr_fe_add_watch() is satisfied. +* @do_not_use: depending on the underlying chardev, a GIOChannel or a +* QIOChannel. DO NOT USE! +* @cond: bitwise combination of conditions watched and satisfied +* before calling this callback. +* @data: user data passed at creation to qemu_chr_fe_add_watch(). Can +* be NULL. +* +* Returns: G_SOURCE_REMOVE if the GSource should be removed from the +* main loop, or G_SOURCE_CONTINUE to leave the GSource in +* the main loop. +*/ typedef gboolean (*FEWatchFunc )(void *do_not_use,GIOCondition condition,void *data);/**
Signature · 1 line
2.41.0
[PULL 14/41] target/helpers: Remove unnecessary 'qemu/main-loop.h' header
In reply to Philippe Mathieu-Daudé"qemu/main-loop.h" declares functions related to QEMU's main loop mutex, which these files don't access. Remove the unused "qemu/main-loop.h" header.
Message-Id: <[email protected]>
--- target/riscv/pmu.h | 1 - target/loongarch/iocsr_helper.c | 1 - target/loongarch/op_helper.c | 1 - target/mips/tcg/sysemu/lcsr_helper.c | 1 - target/nios2/op_helper.c | 1 - target/ppc/int_helper.c | 1 - target/ppc/machine.c | 1 - target/ppc/mem_helper.c | 1 - target/ppc/mmu_common.c | 1 - target/ppc/mmu_helper.c | 1 - target/ppc/power8-pmu.c | 1 - target/ppc/translate.c | 1 - target/riscv/csr.c | 1 - target/riscv/m128_helper.c | 1 - target/riscv/op_helper.c | 1 - target/s390x/tcg/crypto_helper.c | 1 - target/s390x/tcg/misc_helper.c | 1 - target/xtensa/dbg_helper.c | 1 - target/xtensa/fpu_helper.c | 1 - target/xtensa/mmu_helper.c | 1 - target/xtensa/op_helper.c | 1 - target/xtensa/win_helper.c | 1 - 22 files changed, 22 deletions(-)
target/riscv/pmu.h +0 -1
@@ -17,7 +17,6 @@*/ #include "cpu.h" -#include "qemu/main-loop.h" bool riscv_pmu_ctr_monitor_instructions (CPURISCVState *env,uint32_t target_ctr);
target/loongarch/iocsr_helper.c +0 -1
@@ -6,7 +6,6 @@*/ #include "qemu/osdep.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h"
target/loongarch/op_helper.c +0 -1
@@ -7,7 +7,6 @@#include "qemu/osdep.h" #include "qemu/log.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h"
target/mips/tcg/sysemu/lcsr_helper.c +0 -1
@@ -7,7 +7,6 @@*/ #include "qemu/osdep.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "internal.h" #include "qemu/host-utils.h"
target/nios2/op_helper.c +0 -1
@@ -22,7 +22,6 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "qemu/main-loop.h" void helper_raise_exception (CPUNios2State *env,uint32_t index) {
target/ppc/int_helper.c +0 -1
@@ -21,7 +21,6 @@#include "cpu.h" #include "internal.h" #include "qemu/host-utils.h" -#include "qemu/main-loop.h" #include "qemu/log.h" #include "exec/helper-proto.h" #include "crypto/aes.h"
target/ppc/machine.c +0 -1
@@ -7,7 +7,6 @@#include "mmu-hash64.h" #include "migration/cpu.h" #include "qapi/error.h" -#include "qemu/main-loop.h" #include "kvm_ppc.h" #include "power8-pmu.h"
target/ppc/mem_helper.c +0 -1
@@ -21,7 +21,6 @@#include "cpu.h" #include "exec/exec-all.h" #include "qemu/host-utils.h" -#include "qemu/main-loop.h" #include "exec/helper-proto.h" #include "helper_regs.h" #include "exec/cpu_ldst.h"
target/ppc/mmu_common.c +0 -1
@@ -28,7 +28,6 @@#include "exec/log.h" #include "helper_regs.h" #include "qemu/error-report.h" -#include "qemu/main-loop.h" #include "qemu/qemu-print.h" #include "internal.h" #include "mmu-book3s-v3.h"
target/ppc/mmu_helper.c +0 -1
@@ -28,7 +28,6 @@#include "exec/log.h" #include "helper_regs.h" #include "qemu/error-report.h" -#include "qemu/main-loop.h" #include "qemu/qemu-print.h" #include "internal.h" #include "mmu-book3s-v3.h"
target/ppc/power8-pmu.c +0 -1
@@ -17,7 +17,6 @@#include "exec/helper-proto.h" #include "qemu/error-report.h" #include "qemu/timer.h" -#include "qemu/main-loop.h" #include "hw/ppc/ppc.h" #include "power8-pmu.h"
target/ppc/translate.c +0 -1
@@ -26,7 +26,6 @@#include "tcg/tcg-op.h" #include "tcg/tcg-op-gvec.h" #include "qemu/host-utils.h" -#include "qemu/main-loop.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h"
target/riscv/csr.c +0 -1
@@ -23,7 +23,6 @@#include "cpu.h" #include "pmu.h" #include "time_helper.h" -#include "qemu/main-loop.h" #include "exec/exec-all.h" #include "exec/tb-flush.h" #include "sysemu/cpu-timers.h"
target/riscv/m128_helper.c +0 -1
@@ -19,7 +19,6 @@#include "qemu/osdep.h" #include "cpu.h" -#include "qemu/main-loop.h" #include "exec/exec-all.h" #include "exec/helper-proto.h"
target/riscv/op_helper.c +0 -1
@@ -21,7 +21,6 @@#include "qemu/osdep.h" #include "cpu.h" #include "internals.h" -#include "qemu/main-loop.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/helper-proto.h"
target/s390x/tcg/crypto_helper.c +0 -1
@@ -13,7 +13,6 @@*/ #include "qemu/osdep.h" -#include "qemu/main-loop.h" #include "qemu/guest-random.h" #include "s390x-internal.h" #include "tcg_s390x.h"
target/s390x/tcg/misc_helper.c +0 -1
@@ -20,7 +20,6 @@#include "qemu/osdep.h" #include "qemu/cutils.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "s390x-internal.h" #include "qemu/host-utils.h"
target/xtensa/dbg_helper.c +0 -1
@@ -27,7 +27,6 @@#include "qemu/osdep.h" #include "qemu/log.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h"
target/xtensa/fpu_helper.c +0 -1
@@ -27,7 +27,6 @@#include "qemu/osdep.h" #include "qemu/log.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h"
target/xtensa/mmu_helper.c +0 -1
@@ -27,7 +27,6 @@#include "qemu/osdep.h" #include "qemu/log.h" -#include "qemu/main-loop.h" #include "qemu/qemu-print.h" #include "qemu/units.h" #include "cpu.h"
target/xtensa/op_helper.c +0 -1
@@ -26,7 +26,6 @@*/ #include "qemu/osdep.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h"
target/xtensa/win_helper.c +0 -1
@@ -27,7 +27,6 @@#include "qemu/osdep.h" #include "qemu/log.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h"
Signature · 1 line
2.41.0
[PULL 16/41] target/xtensa: Include missing 'qemu/atomic.h' header
In reply to Philippe Mathieu-DaudéSince commit fa92bd4af7 ("target/xtensa: fix access to the INTERRUPT SR") these files use QEMU atomic API. Explicit the header inclusion instead of relying on implicit and indirect inclusion.
Message-Id: <[email protected]>
--- hw/xtensa/pic_cpu.c | 1 + target/xtensa/exc_helper.c | 1 + target/xtensa/op_helper.c | 1 + 3 files changed, 3 insertions(+)
hw/xtensa/pic_cpu.c +1 -0
@@ -30,6 +30,7 @@#include "hw/irq.h" #include "qemu/log.h" #include "qemu/timer.h" +#include "qemu/atomic.h" void check_interrupts (CPUXtensaState *env) {
target/xtensa/exc_helper.c +1 -0
@@ -31,6 +31,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h" +#include "qemu/atomic.h" #include "exec/exec-all.h" void HELPER (exception )(CPUXtensaState *env,uint32_t excp)
target/xtensa/op_helper.c +1 -0
@@ -30,6 +30,7 @@#include "exec/helper-proto.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" +#include "qemu/atomic.h" #include "qemu/timer.h" #ifndef CONFIG_USER_ONLY
Signature · 1 line
2.41.0
[PULL 37/41] ui: spelling fixes
In reply to Philippe Mathieu-DaudéFrom: Michael Tokarev <[email protected]>
Message-ID: <[email protected]>
--- include/ui/kbd-state.h | 2 +- include/ui/spice-display.h | 2 +- ui/keymaps.h | 2 +- ui/vnc-enc-zywrle.h | 4 ++-- ui/sdl2-2d.c | 2 +- ui/sdl2.c | 2 +- ui/vnc-enc-zrle.c.inc | 2 +- ui/cocoa.m | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-)
include/ui/kbd-state.h +1 -1
@@ -65,7 +65,7 @@ void qkbd_state_key_event(QKbdState *kbd, QKeyCode qcode, bool down);* using qemu_input_event_send_key_delay(). * * @kbd: state tracker state. -* @delay_ms: the delay in miliseconds. +* @delay_ms: the delay in milliseconds. */ void qkbd_state_set_delay (QKbdState *kbd,int delay_ms);
include/ui/spice-display.h +1 -1
@@ -42,7 +42,7 @@#define NUM_MEMSLOTS_GROUPS 2/* -* Internal enum to differenciate between options for +* Internal enum to differentiate between options for * io calls that have a sync (old) version and an _async (new) * version: * QXL_SYNC: use the old version
ui/keymaps.h +1 -1
@@ -44,7 +44,7 @@ typedef struct {/* "up" flag */ #define SCANCODE_UP 0x80 -/* Additional modifiers to use if not catched another way. */ +/* Additional modifiers to use if not caught another way. */ #define SCANCODE_SHIFT 0x100#define SCANCODE_CTRL 0x200#define SCANCODE_ALT 0x400
ui/vnc-enc-zywrle.h +2 -2
@@ -485,7 +485,7 @@ static inline void wavelet(int *buf, int width, int height, int level)/* RGB <=> YUV conversion stuffs. -YUV coversion is explained as following formula in strict meaning: +YUV conversion is explained as following formula in strict meaning: Y = 0.299R + 0.587G + 0.114B ( 0<=Y<=255) U = -0.169R - 0.331G + 0.500B (-128<=U<=127) V = 0.500R - 0.419G - 0.081B (-128<=V<=127)
@@ -539,7 +539,7 @@ static inline void wavelet(int *buf, int width, int height, int level) +------+------+ So, we must transfer each sub images individually in strict meaning. - But at least ZRLE meaning, following one decompositon image is same as + But at least ZRLE meaning, following one decomposition image is same as avobe individual sub image. I use this format. (Strictly saying, transfer order is reverse(Hxy->Hy->Hx->L) for simplified procedure for any wavelet level.)
ui/sdl2-2d.c +1 -1
@@ -150,7 +150,7 @@ bool sdl2_2d_check_format(DisplayChangeListener *dcl, {/* * We let SDL convert for us a few more formats than, -* the native ones. Thes are the ones I have tested. +* the native ones. These are the ones I have tested. */ return (format == PIXMAN_x8r8g8b8 || format == PIXMAN_a8r8g8b8 ||
ui/sdl2.c +1 -1
@@ -860,7 +860,7 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)SDL_SetHint (SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR ,"0" );#endif #ifndef CONFIG_WIN32 -/* QEMU uses its own low level keyboard hook procecure on Windows */ +/* QEMU uses its own low level keyboard hook procedure on Windows */ SDL_SetHint (SDL_HINT_GRAB_KEYBOARD ,"1" );#endif #ifdef SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED
ui/vnc-enc-zrle.c.inc +1 -1
@@ -110,7 +110,7 @@ static void ZRLE_ENCODE_TILE(VncState *vs, ZRLE_PIXEL *data, int w, int h, ZRLE_PIXEL *end = ptr + h * w; *end = ~*(end-1); /* one past the end is different so the while loop ends */ - /* Real limit is 127 but we wan't a way to know if there is more than 127 */ + /* Real limit is 127 but we want a way to know if there is more than 127 */ palette_init(palette, 256, ZRLE_BPP); while (ptr < end) {
ui/cocoa.m +1 -1
@@ -2045,7 +2045,7 @@ static void cocoa_display_init(DisplayState *ds, DisplayOptions *opts) /* * Create the menu entries which depend on QEMU state (for consoles - * and removeable devices). These make calls back into QEMU functions, + * and removable devices). These make calls back into QEMU functions, * which is OK because at this point we know that the second thread * holds the iothread lock and is synchronously waiting for us to * finish.
Signature · 1 line
2.41.0
[PULL 36/41] util: spelling fixes
In reply to Philippe Mathieu-DaudéFrom: Michael Tokarev <[email protected]>
Message-ID: <[email protected]>
--- include/elf.h | 4 ++-- include/io/channel-socket.h | 4 ++-- include/io/task.h | 2 +- include/qemu/iova-tree.h | 4 ++-- include/qemu/yank.h | 2 +- util/cpuinfo-aarch64.c | 4 ++-- util/cpuinfo-i386.c | 4 ++-- util/cpuinfo-ppc.c | 2 +- util/main-loop.c | 2 +- util/oslib-posix.c | 2 +- util/qdist.c | 2 +- util/qemu-sockets.c | 2 +- util/rcu.c | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-)
include/elf.h +2 -2
@@ -1125,9 +1125,9 @@ typedef struct {#define EFA_PARISC_1_1 0x0210/* PA-RISC 1.1 big-endian. */ #define EFA_PARISC_2_0 0x0214/* PA-RISC 2.0 big-endian. */ -/* Additional section indeces. */ +/* Additional section indices. */ -#define SHN_PARISC_ANSI_COMMON 0xff00/* Section for tenatively declared +#define SHN_PARISC_ANSI_COMMON 0xff00/* Section for tentatively declared symbols in ANSI C. */ #define SHN_PARISC_HUGE_COMMON 0xff01/* Common blocks in huge model. */
include/io/channel-socket.h +2 -2
@@ -124,7 +124,7 @@ void qio_channel_socket_connect_async(QIOChannelSocket *ioc,* qio_channel_socket_listen_sync: * @ioc: the socket channel object * @addr: the address to listen to -* @num: the expected ammount of connections +* @num: the expected amount of connections * @errp: pointer to a NULL-initialized error object * * Attempt to listen to the address @addr. This method
@@ -141,7 +141,7 @@ int qio_channel_socket_listen_sync(QIOChannelSocket *ioc,* qio_channel_socket_listen_async: * @ioc: the socket channel object * @addr: the address to listen to -* @num: the expected ammount of connections +* @num: the expected amount of connections * @callback: the function to invoke on completion * @opaque: user data to pass to @callback * @destroy: the function to free @opaque
include/io/task.h +1 -1
@@ -145,7 +145,7 @@ typedef void (*QIOTaskWorker)(QIOTask *task,* The QIOTask module can also be used to perform operations * in a background thread context, while still reporting the * results in the main event thread. This allows code which -* cannot easily be rewritten to be asychronous (such as DNS +* cannot easily be rewritten to be asynchronous (such as DNS * lookups) to be easily run non-blocking. Reporting the * results in the main thread context means that the caller * typically does not need to be concerned about thread
include/qemu/iova-tree.h +2 -2
@@ -15,7 +15,7 @@* Currently the iova tree will only allow to keep ranges * information, and no extra user data is allowed for each element. A * benefit is that we can merge adjacent ranges internally within the -* tree. It can save a lot of memory when the ranges are splitted but +* tree. It can save a lot of memory when the ranges are split but * mostly continuous. * * Note that current implementation does not provide any thread
@@ -128,7 +128,7 @@ const DMAMap *iova_tree_find_address(const IOVATree *tree, hwaddr iova);* iova_tree_foreach: * * @tree: the iova tree to iterate on -* @iterator: the interator for the mappings, return true to stop +* @iterator: the iterator for the mappings, return true to stop * * Iterate over the iova tree. *
include/qemu/yank.h +1 -1
@@ -25,7 +25,7 @@ typedef void (YankFn)(void *opaque);* @instance: The instance. * @errp: Error object. * -* Returns true on success or false if an error occured. +* Returns true on success or false if an error occurred. */ bool yank_register_instance (const YankInstance *instance,Error **errp);
util/cpuinfo-aarch64.c +2 -2
@@ -1,6 +1,6 @@/* * SPDX-License-Identifier: GPL-2.0-or-later -* Host specific cpu indentification for AArch64. +* Host specific cpu identification for AArch64. */ #include "qemu/osdep.h"
@@ -33,7 +33,7 @@ static bool sysctl_for_bool(const char *name)/* * We might in the future ask for properties not present in older kernels, * but we're only asking about static properties, all of which should be -* 'int'. So we shouln't see ENOMEM (val too small), or any of the other +* 'int'. So we shouldn't see ENOMEM (val too small), or any of the other * more exotic errors. */ assert (errno ==ENOENT );
util/cpuinfo-i386.c +2 -2
@@ -1,6 +1,6 @@/* * SPDX-License-Identifier: GPL-2.0-or-later -* Host specific cpu indentification for x86. +* Host specific cpu identification for x86. */ #include "qemu/osdep.h"
@@ -74,7 +74,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void)* of their memory operands to be 16-byte aligned. * * AMD has provided an even stronger guarantee that processors -* with AVX provide 16-byte atomicity for all cachable, +* with AVX provide 16-byte atomicity for all cacheable, * naturally aligned single loads and stores, e.g. MOVDQU. * * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688
util/cpuinfo-ppc.c +1 -1
@@ -1,6 +1,6 @@/* * SPDX-License-Identifier: GPL-2.0-or-later -* Host specific cpu indentification for ppc. +* Host specific cpu identification for ppc. */ #include "qemu/osdep.h"
util/main-loop.c +1 -1
@@ -47,7 +47,7 @@*/ /* * Disable CFI checks. -* We are going to call a signal hander directly. Such handler may or may not +* We are going to call a signal handler directly. Such handler may or may not * have been defined in our binary, so there's no guarantee that the pointer * used to set the handler is a cfi-valid pointer. Since the handlers are * stored in kernel memory, changing the handler to an attacker-defined
util/oslib-posix.c +1 -1
@@ -671,7 +671,7 @@ void qemu_free_stack(void *stack, size_t sz)/* * Disable CFI checks. -* We are going to call a signal hander directly. Such handler may or may not +* We are going to call a signal handler directly. Such handler may or may not * have been defined in our binary, so there's no guarantee that the pointer * used to set the handler is a cfi-valid pointer. Since the handlers are * stored in kernel memory, changing the handler to an attacker-defined
util/qdist.c +1 -1
@@ -210,7 +210,7 @@ void qdist_bin__internal(struct qdist *to, const struct qdist *from, size_t n)/* * To avoid double-counting we capture [left, right) ranges, except for -* the righmost bin, which captures a [left, right] range. +* the rightmost bin, which captures a [left, right] range. */ while (j < from->n && (from->entries[j].x < right || i == n -1 )) {struct qdist_entry *o = &from->entries[j];
util/qemu-sockets.c +1 -1
@@ -929,7 +929,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,if (pathbuf !=NULL ) {/* -* This dummy fd usage silences the mktemp() unsecure warning. +* This dummy fd usage silences the mktemp() insecure warning. * Using mkstemp() doesn't make things more secure here * though. bind() complains about existing files, so we have * to unlink first and thus re-open the race window. The
util/rcu.c +1 -1
@@ -355,7 +355,7 @@ void drain_call_rcu(void)* * Note that since we have only one global queue of the RCU callbacks, * we also end up waiting for most of RCU callbacks that were registered -* on the other threads, but this is a side effect that shoudn't be +* on the other threads, but this is a side effect that shouldn't be * assumed. */
Signature · 1 line
2.41.0
[PULL 32/41] hw/usb/hcd-xhci: Avoid variable-length array in xhci_get_port_bandwidth()
In reply to Philippe Mathieu-DaudéFrom: Peter Maydell <[email protected]>
In xhci_get_port_bandwidth(), we use a variable-length array to construct the buffer to send back to the guest. Avoid the VLA by using dma_memory_set() to directly request the memory system to fill the guest memory with a string of '80's.
The codebase has very few VLAs, and if we can get rid of them all we can make the compiler error on new additions. This is a defensive measure against security bugs where an on-stack dynamic allocation isn't correctly size-checked (e.g. CVE-2021-3527).
Message-ID: <[email protected]>
--- hw/usb/hcd-xhci.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
hw/usb/hcd-xhci.c +4 -6
@@ -2434,7 +2434,6 @@ static void xhci_detach_slot(XHCIState *xhci, USBPort *uport)static TRBCCode xhci_get_port_bandwidth (XHCIState *xhci,uint64_t pctx) {dma_addr_t ctx; -uint8_t bw_ctx[xhci->numports+1 ];DPRINTF ("xhci_get_port_bandwidth()\n" );
@@ -2442,11 +2441,10 @@ static TRBCCode xhci_get_port_bandwidth(XHCIState *xhci, uint64_t pctx)DPRINTF ("xhci: bandwidth context at " DMA_ADDR_FMT "\n" , ctx); -/* TODO: actually implement real values here */ - bw_ctx[0 ] =0 ; -memset (&bw_ctx[1 ],80 , xhci->numports);/* 80% */ -if (dma_memory_write (xhci->as, ctx, bw_ctx,sizeof (bw_ctx), -MEMTXATTRS_UNSPECIFIED ) !=MEMTX_OK ) { +/* TODO: actually implement real values here. This is 80% for all ports. */ +if (stb_dma (xhci->as, ctx,0 ,MEMTXATTRS_UNSPECIFIED ) !=MEMTX_OK || +dma_memory_set (xhci->as, ctx +1 ,80 , xhci->numports, +MEMTXATTRS_UNSPECIFIED ) !=MEMTX_OK ) {qemu_log_mask (LOG_GUEST_ERROR ,"%s: DMA memory write failed!\n" , __func__);return CC_TRB_ERROR ;
Signature · 1 line
2.41.0