Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some occurrences of -Wshadow=local #87

Closed
wants to merge 218 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
2c109f2
simpletrace: add __all__ to define public interface
Baekalfen Sep 26, 2023
8405ec6
simpletrace: annotate magic constants from QEMU code
Baekalfen Sep 26, 2023
f7bd4f0
simpletrace: improve parsing of sys.argv; fix files never closed.
Baekalfen Sep 26, 2023
3b71b61
simpletrace: changed naming of edict and idtoname to improve readability
Baekalfen Sep 26, 2023
ce96eb3
simpletrace: update code for Python 3.11
Baekalfen Sep 26, 2023
d1f9259
simpletrace: improved error handling on struct unpack
Baekalfen Sep 26, 2023
1990fb9
simpletrace: define exception and add handling
Baekalfen Sep 26, 2023
87617b9
simpletrace: made Analyzer into context-manager
Baekalfen Sep 26, 2023
6f53641
simpletrace: refactor to separate responsibilities
Baekalfen Sep 26, 2023
b78234e
simpletrace: move logic of process into internal function
Baekalfen Sep 26, 2023
d1f89c2
simpletrace: move event processing to Analyzer class
Baekalfen Sep 26, 2023
3470fef
simpletrace: added simplified Analyzer2 class
Baekalfen Sep 26, 2023
8419726
MAINTAINERS: add maintainer of simpletrace.py
Baekalfen Sep 26, 2023
ff01470
scripts/analyse-locks-simpletrace.py: changed iteritems() to items()
Baekalfen Sep 26, 2023
d97fa9a
tests/tcg/tricore: Bump cpu to tc37x
bkoppelmann Sep 27, 2023
3e2a510
target/tricore: Implement CRCN insn
bkoppelmann Aug 28, 2023
ce64bab
target/tricore: Correctly handle FPU RM from PSW
bkoppelmann Aug 28, 2023
2bdbe35
target/tricore: Implement FTOU insn
bkoppelmann Aug 28, 2023
e43692b
target/tricore: Clarify special case for FTOUZ insn
bkoppelmann Aug 28, 2023
815061b
target/tricore: Implement ftohp insn
bkoppelmann Aug 28, 2023
5e0e06d
target/tricore: Implement hptof insn
bkoppelmann Aug 28, 2023
23fa6f5
target/tricore: Fix RCPW/RRPW_INSERT insns for width = 0
bkoppelmann Aug 28, 2023
222ff2d
target/tricore: Swap src and dst reg for RCRR_INSERT
bkoppelmann Aug 28, 2023
1f22db1
target/tricore: Replace cpu_*_code with translator_*
bkoppelmann Aug 28, 2023
4f79db4
target/tricore: Fix FTOUZ being ISA v1.3.1 up
bkoppelmann Aug 28, 2023
8c3cf3f
tests/tcg/tricore: Extended and non-extened regs now match
bkoppelmann Sep 13, 2023
f47a90d
accel/tcg: Avoid load of icount_decr if unused
rth7680 Sep 14, 2023
5d97e94
accel/tcg: Hoist CF_MEMI_ONLY check outside translation loop
rth7680 Sep 14, 2023
0ca41cc
accel/tcg: Track current value of can_do_io in the TB
rth7680 Sep 14, 2023
a2f99d4
accel/tcg: Improve setting of can_do_io at start of TB
rth7680 Sep 14, 2023
200c1f9
accel/tcg: Always set CF_LAST_IO with CF_NOIRQ
rth7680 Sep 14, 2023
18a536f
accel/tcg: Always require can_do_io
rth7680 Sep 13, 2023
bbde656
migration/rdma: Fix save_page method to fail on polling error
Sep 21, 2023
7f3de3f
migration: Clean up local variable shadowing
Sep 21, 2023
e33e66b
ui: Clean up local variable shadowing
Sep 21, 2023
6a0f7ff
block/dirty-bitmap: Clean up local variable shadowing
Sep 21, 2023
d25b99c
block/vdi: Clean up local variable shadowing
Sep 21, 2023
fb2575f
block: Clean up local variable shadowing
Sep 21, 2023
bb71846
qobject atomics osdep: Make a few macros more hygienic
Sep 21, 2023
6d55999
hw/tricore: Log failing test in testdevice
bkoppelmann Sep 13, 2023
76bc63d
tests/tcg: Reset result register after each test
bkoppelmann Sep 13, 2023
824b2cb
target/tricore: Remove CSFRs from cpu.h
bkoppelmann Sep 13, 2023
ceada00
target/tricore: Change effective address (ea) to target_ulong
bkoppelmann Sep 13, 2023
35ed01b
optionrom: Remove build-id section
Sep 26, 2023
7191f24
accel/kvm/kvm-all: Handle register access errors
akihikodaki Dec 1, 2022
fa4ec9f
e1000: remove old compatibility code
bonzini Sep 22, 2023
946f7c0
pc: remove short_root_bus property
bonzini Sep 22, 2023
f0df613
make-release: do not ship dtc sources
bonzini Sep 26, 2023
4c545a0
meson: clean up static_library keyword arguments
bonzini Sep 27, 2023
9a239c6
tcg: Clean up local variable shadowing
philmd Sep 4, 2023
d54deb2
target/arm/tcg: Clean up local variable shadowing
philmd Sep 4, 2023
5a3d2c3
target/arm/hvf: Clean up local variable shadowing
philmd Sep 4, 2023
92e0ef7
target/mips: Clean up local variable shadowing
philmd Sep 4, 2023
574d572
target/m68k: Clean up local variable shadowing
philmd Sep 4, 2023
81b8056
target/tricore: Clean up local variable shadowing
philmd Sep 4, 2023
807e4d1
hw/arm/armv7m: Clean up local variable shadowing
philmd Sep 4, 2023
c7f14e4
hw/arm/virt: Clean up local variable shadowing
philmd Sep 4, 2023
2f6037a
hw/arm/allwinner: Clean up local variable shadowing
philmd Sep 4, 2023
5f87ddd
hw/m68k: Clean up local variable shadowing
philmd Sep 4, 2023
4705c8e
hw/microblaze: Clean up local variable shadowing
philmd Sep 4, 2023
09e24b1
hw/nios2: Clean up local variable shadowing
philmd Sep 4, 2023
1728593
net/eth: Clean up local variable shadowing
philmd Sep 4, 2023
5f6d4f7
crypto/cipher-gnutls.c: Clean up local variable shadowing
philmd Sep 4, 2023
fbf58f2
util/vhost-user-server: Clean up local variable shadowing
philmd Sep 4, 2023
7f087a3
linux-user/strace: Clean up local variable shadowing
philmd Sep 4, 2023
720d6bc
sysemu/device_tree: Clean up local variable shadowing
philmd Sep 4, 2023
083f450
softmmu/memory: Clean up local variable shadowing
philmd Sep 4, 2023
6ba9b60
softmmu/physmem: Clean up local variable shadowing
philmd Sep 4, 2023
5e0528a
hw/core/machine: Clean up local variable shadowing
philmd Sep 4, 2023
1cc0c5d
hw/intc/openpic: Clean up local variable shadowing
philmd Sep 4, 2023
90231ce
hw/ppc: Clean up local variable shadowing in _FDT helper routine
legoater Sep 18, 2023
694616d
pnv/psi: Clean up local variable shadowing
legoater Sep 18, 2023
bd87a59
spapr: Clean up local variable shadowing in spapr_dt_cpus()
legoater Sep 18, 2023
c0b648d
spapr: Clean up local variable shadowing in spapr_init_cpus()
legoater Sep 18, 2023
01a78f2
spapr: Clean up local variable shadowing in spapr_get_fw_dev_path()
legoater Sep 18, 2023
bea3d6e
spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_co…
legoater Sep 18, 2023
15675f2
spapr/pci: Clean up local variable shadowing in spapr_phb_realize()
legoater Sep 18, 2023
8cf52ff
spapr/drc: Clean up local variable shadowing in prop_get_fdt()
legoater Sep 18, 2023
d857309
test-throttle: don't shadow 'index' variable in do_test_accounting()
bertogg Sep 22, 2023
7b393b7
hw/acpi: changes towards enabling -Wshadow=local
ani-sinha Sep 22, 2023
33b3b4a
hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd()
pm215 Sep 22, 2023
b2e7e20
hw/misc/arm_sysctl.c: Avoid shadowing local variable
pm215 Sep 22, 2023
9e2135e
hw/arm/smmuv3.c: Avoid shadowing variable
pm215 Sep 22, 2023
84abccd
hw/arm/smmuv3-internal.h: Don't use locals in statement macros
pm215 Sep 22, 2023
ce6c368
aspeed/i2c: Clean up local variable shadowing
legoater Sep 22, 2023
e8874c0
aspeed: Clean up local variable shadowing
legoater Sep 22, 2023
e407513
aspeed/i3c: Rename variable shadowing a local
legoater Sep 22, 2023
62fcc4e
aspeed/timer: Clean up local variable shadowing
legoater Sep 22, 2023
a082739
intel_iommu: Fix shadow local variables on "size"
xzpeter Sep 22, 2023
3cc9fe1
crypto: remove shadowed 'ret' variable
berrange Sep 22, 2023
0d57919
seccomp: avoid shadowing of 'action' variable
berrange Sep 22, 2023
e161785
qemu-nbd: changes towards enabling -Wshadow=local
ebblake Sep 22, 2023
010f555
hw/riscv: opentitan: Fixup local variables shadowing
alistair23 Sep 25, 2023
2933299
target/riscv: cpu: Fixup local variables shadowing
alistair23 Sep 25, 2023
f3f65c4
target/riscv: vector_helper: Fixup local variables shadowing
alistair23 Sep 25, 2023
5567fa8
softmmu/device_tree: Fixup local variables shadowing
alistair23 Sep 25, 2023
f193d0b
hw/nvme: Clean up local variable shadowing in nvme_ns_init()
birkelund Sep 25, 2023
4dba914
disas/m68k: clean up local variable shadowing
vivier Sep 25, 2023
71d3612
migration-test: Create kvm_opts
Jun 8, 2023
877cec6
migration-test: bootpath is the same for all tests and for all archs
Jun 8, 2023
0c690d3
migration-test: Add bootfile_create/delete() functions
Jun 8, 2023
22d3c6e
migration-test: dirtylimit checks for x86_64 arch before
Jun 8, 2023
0368ace
migration-test: simplify shmem_opts handling
Jun 8, 2023
f4e1b61
migration: Refactor repeated call of yank_unregister_instance
gktejus Jun 21, 2023
f16ecfa
migration: Use qemu_file_transferred_noflush() for block migration.
May 30, 2023
67c31c9
migration: Don't abuse qemu_file transferred for RDMA
May 15, 2023
19df4f3
migration/RDMA: It is accounting for zero/normal pages in two places
May 15, 2023
e337803
migration/rdma: Remove QEMUFile parameter when not used
May 15, 2023
2ebe5d4
migration/rdma: Don't use imaginary transfers
May 15, 2023
9f51fe9
migration: Remove unused qemu_file_credit_transfer()
May 15, 2023
9c53d36
migration/rdma: Simplify the function that saves a page
May 15, 2023
ce43e84
Makefile: build plugins before running TCG tests
bonzini Sep 28, 2023
5436f1b
Merge tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu …
stefanhaRH Oct 2, 2023
5b0d1a8
Merge tag 'pull-tcg-20230928' of https://gitlab.com/rth7680/qemu into…
stefanhaRH Oct 2, 2023
a3108b2
Merge tag 'pull-tricore-20230929' of https://github.com/bkoppelmann/q…
stefanhaRH Oct 2, 2023
5d7e601
Merge tag 'pull-shadow-2023-09-29' of https://repo.or.cz/qemu/armbru …
stefanhaRH Oct 2, 2023
50d0bfd
Merge tag 'migration-20231002-pull-request' of https://gitlab.com/jua…
stefanhaRH Oct 2, 2023
b86dc5c
esp: use correct type for esp_dma_enable() in sysbus_esp_gpio_demux()
mcayland Sep 13, 2023
77668e4
esp: restrict non-DMA transfer length to that of available data
mcayland Sep 13, 2023
be2b619
scsi-disk: ensure that FORMAT UNIT commands are terminated
mcayland Sep 13, 2023
0c1a529
crypto: only include tls-cipher-suites in emulators
bonzini Sep 28, 2023
9e58d7a
ui/vnc: Require audiodev= to enable audio
bonzini Sep 25, 2023
aaa6a6f
audio: Require AudioState in AUD_add_capture
nertpinx Apr 25, 2022
f606173
audio: allow returning an error from the driver init
bonzini Sep 22, 2023
176adaf
audio: return Error ** from audio_state_by_name
bonzini Sep 22, 2023
5c63d14
audio: commonize voice initialization
bonzini Sep 22, 2023
e329963
audio: simplify flow in audio_init
bonzini Sep 22, 2023
69a8027
audio: remove QEMU_AUDIO_* and -audio-help support
bonzini Sep 5, 2023
7a2c7da
Introduce machine property "audiodev"
nertpinx Apr 25, 2022
b8ab030
hw/arm: Support machine-default audiodev with fallback
nertpinx Sep 22, 2023
2b16397
hw/ppc: Support machine-default audiodev with fallback
nertpinx Apr 25, 2022
9dcb64c
vt82c686 machines: Support machine-default audiodev with fallback
bonzini Sep 21, 2023
cb94ff5
audio: propagate Error * out of audio_init
nertpinx Oct 2, 2023
9f8cf35
audio: forbid default audiodev backend with -nodefaults
bonzini Oct 2, 2023
0337e41
input: Allow to choose console with qemu_input_is_absolute
akihikodaki Sep 21, 2023
845fff1
ui/console: make qemu_console_is_multihead() static
lersek Sep 13, 2023
4ce2f97
ui/console: only walk QemuGraphicConsoles in qemu_console_is_multihead()
lersek Sep 13, 2023
2c0c4c1
ui/console: eliminate QOM properties from qemu_console_is_multihead()
lersek Sep 13, 2023
65d7ceb
ui/console: sanitize search in qemu_graphic_console_is_multihead()
lersek Sep 13, 2023
7db57a7
ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map
firstbread Sep 14, 2023
75b773d
win32: avoid discarding the exception handler
elmarco Sep 25, 2023
9bd4d3d
ui/gtk: fix UI info precondition
elmarco Sep 15, 2023
f1de309
analyze-migration: ignore RAM_SAVE_FLAG_MULTIFD_FLUSH
elmarco Sep 20, 2023
314e0a8
hw/core: remove needless includes
elmarco Oct 2, 2023
bf7e521
hw/pc: remove needless includes
elmarco Oct 2, 2023
e0288a7
hw/display/ramfb: plug slight guest-triggerable leak on mode setting
lersek Sep 19, 2023
4f7689f
chardev/char-pty: Avoid losing bytes when the other side just (re-)co…
huth Aug 16, 2023
da10340
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
stefanhaRH Oct 3, 2023
5783a53
bsd-user: define TARGET_RFSPAWN for rfork to use vfork(2) semantics, …
Sep 25, 2023
d314ae9
bsd-user: Define procctl(2) related structs
staceyson Sep 25, 2023
3f254cf
bsd-user: Implement host_to_target_siginfo.
staceyson Sep 25, 2023
cc47390
bsd-user: Add freebsd_exec_common and do_freebsd_procctl to qemu.h.
staceyson Sep 25, 2023
00bff01
bsd-user: add extern declarations for bsd-proc.c conversion functions
staceyson Sep 25, 2023
0caa376
bsd-user: Implement target_to_host_resource conversion function
staceyson Sep 25, 2023
550fc70
bsd-user: Implement target_to_host_rlim and host_to_target_rlim conve…
staceyson Sep 25, 2023
66c51d6
bsd-user: Implement host_to_target_rusage and host_to_target_wrusage.
staceyson Sep 25, 2023
3f44e27
bsd-user: Implement host_to_target_waitstatus conversion.
staceyson Sep 25, 2023
b623031
bsd-user: Get number of cpus.
kevans91 Sep 25, 2023
a478416
bsd-user: Implement getgroups(2) and setgroups(2) system calls.
staceyson Sep 25, 2023
82fe5f3
bsd-user: Implement umask(2), setlogin(2) and getlogin(2)
staceyson Sep 25, 2023
59e801e
bsd-user: Implement getrusage(2).
staceyson Sep 25, 2023
faba8e1
bsd-user: Implement getrlimit(2) and setrlimit(2)
staceyson Sep 25, 2023
e4446e0
bsd-user: Implement several get/set system calls:
staceyson Sep 25, 2023
932683c
bsd-user: Implement get/set[resuid/resgid/sid] and issetugid.
staceyson Sep 25, 2023
615ad41
bsd-user: Add stubs for profil(2), ktrace(2), utrace(2) and ptrace(2).
staceyson Sep 25, 2023
ff26637
bsd-user: Implement getpriority(2) and setpriority(2).
staceyson Sep 25, 2023
84d41c5
bsd-user: Implement get_filename_from_fd.
Sep 25, 2023
8632729
bsd-user: Implement freebsd_exec_common, used in implementing execve/…
staceyson Sep 25, 2023
dcaa3df
bsd-user: Implement procctl(2) along with necessary conversion functi…
staceyson Sep 25, 2023
36999e6
bsd-user: Implement execve(2) and fexecve(2) system calls.
Sep 25, 2023
ae50288
bsd-user: Implement wait4(2) and wait6(2) system calls.
staceyson Sep 25, 2023
159e5b0
bsd-user: Implement setloginclass(2) and getloginclass(2) system calls.
staceyson Sep 25, 2023
0571e3f
bsd-user: Implement pdgetpid(2) and the undocumented setugid.
staceyson Sep 25, 2023
831a5a7
bsd-user: Implement fork(2) and vfork(2) system calls.
staceyson Sep 25, 2023
510eecb
bsd-user: Implement rfork(2) system call.
staceyson Sep 25, 2023
6756ae2
bsd-user: Implement pdfork(2) system call.
staceyson Sep 25, 2023
61a8f11
bsd-user: Implement struct target_ipc_perm
staceyson Sep 25, 2023
695cb91
bsd-user: Implement struct target_shmid_ds
staceyson Sep 25, 2023
1d4c402
bsd-user: Declarations for ipc_perm and shmid_ds conversion functions
staceyson Sep 25, 2023
137d963
bsd-user: Introduce freebsd/os-misc.h to the source tree
staceyson Sep 25, 2023
0c35298
bsd-user: Implement shm_open2(2) system call
Sep 25, 2023
182ea72
bsd-user: Implement shm_rename(2) system call
kevans91 Sep 25, 2023
dde5f40
bsd-user: Add bsd-mem.c to meson.build
Sep 25, 2023
c9cdf0a
bsd-user: Implement target_set_brk function in bsd-mem.c instead of o…
staceyson Sep 25, 2023
86fbb44
bsd-user: Implement ipc_perm conversion between host and target.
staceyson Sep 25, 2023
bd2b731
bsd-user: Implement shmid_ds conversion between host and target.
staceyson Sep 25, 2023
6765e98
bsd-user: Introduce bsd-mem.h to the source tree
staceyson Sep 25, 2023
87dcb4a
bsd-user: Implement mmap(2) and munmap(2)
staceyson Sep 25, 2023
ecbe224
bsd-user: Implement mprotect(2)
staceyson Sep 25, 2023
f28a1e4
bsd-user: Implement msync(2)
staceyson Sep 25, 2023
0a49ef0
bsd-user: Implement mlock(2), munlock(2), mlockall(2), munlockall(2),…
staceyson Sep 25, 2023
0c1ced4
bsd-user: Implment madvise(2) to match the linux-user implementation.
Sep 25, 2023
83b045a
bsd-user: Implement mincore(2)
staceyson Sep 25, 2023
a99d740
bsd-user: Implement do_obreak function
staceyson Sep 25, 2023
4f0be68
bsd-user: Implement shm_open(2)
staceyson Sep 25, 2023
9d14db1
bsd-user: Implement shm_unlink(2) and shmget(2)
staceyson Sep 25, 2023
f9bbe3c
bsd-user: Implement shmctl(2)
staceyson Sep 25, 2023
4e00b7d
bsd-user: Implement shmat(2) and shmdt(2)
staceyson Sep 25, 2023
dfa1d91
bsd-user: Add stubs for vadvise(), sbrk() and sstk()
bsdimp Sep 25, 2023
969298f
migration/vmstate: Introduce vmstate_save_state_with_err
gktejus Oct 3, 2023
848a050
migration: Update error description outside migration.c
gktejus Oct 3, 2023
8ebcb4b
MAINTAINERS: Add entry for rdma migration
xzpeter Sep 25, 2023
2bace55
migration: Add co-maintainers for migration
xzpeter Oct 3, 2023
2ada4b6
migration/rdma: zore out head.repeat to make the error more clear
zhijianli88 Sep 26, 2023
67aeae7
i386/a-b-bootblock: factor test memory addresses out into constants
d-tatianin Sep 19, 2023
adc1914
i386/a-b-bootblock: zero the first byte of each page on start
d-tatianin Sep 19, 2023
b28e3ec
s390x/a-b-bios: zero the first byte of each page on start
d-tatianin Sep 19, 2023
2a9e2e5
migration: file URI
Sep 8, 2023
385f510
migration: file URI offset
Sep 8, 2023
579cedf
migration: Unify and trace vmstate field_exists() checks
xzpeter Sep 6, 2023
9afa888
osdep: set _FORTIFY_SOURCE=2 when optimization is enabled
berrange Oct 3, 2023
c7c907b
Merge tag 'misc-pull-request' of https://gitlab.com/marcandre.lureau/…
stefanhaRH Oct 4, 2023
80dcaf6
Merge tag 'bsd-user-mmap-pull-request' of https://gitlab.com/bsdimp/q…
stefanhaRH Oct 4, 2023
6dcf8a9
Merge tag 'migration-20231004-pull-request' of https://gitlab.com/jua…
stefanhaRH Oct 4, 2023
7598971
Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu in…
stefanhaRH Oct 4, 2023
4b64ad4
target/hexagon: move GETPC() calls to top level helpers
quic-mathbern Jul 11, 2023
a5bc4c2
target/hexagon: fix some occurrences of -Wshadow=local
androm3da Sep 28, 2023
28a2c4c
target/hexagon: avoid shadowing "vaddr" type
androm3da Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3170,6 +3170,7 @@ F: stubs/

Tracing
M: Stefan Hajnoczi <[email protected]>
R: Mads Ynddal <[email protected]>
S: Maintained
F: trace/
F: trace-events
Expand All @@ -3182,6 +3183,11 @@ F: docs/tools/qemu-trace-stap.rst
F: docs/devel/tracing.rst
T: git https://github.com/stefanha/qemu.git tracing

Simpletrace
M: Mads Ynddal <[email protected]>
S: Maintained
F: scripts/simpletrace.py

TPM
M: Stefan Berger <[email protected]>
S: Maintained
Expand All @@ -3201,7 +3207,8 @@ F: scripts/checkpatch.pl

Migration
M: Juan Quintela <[email protected]>
R: Peter Xu <[email protected]>
M: Peter Xu <[email protected]>
M: Fabiano Rosas <[email protected]>
R: Leonardo Bras <[email protected]>
S: Maintained
F: hw/core/vmstate-if.c
Expand All @@ -3216,6 +3223,15 @@ F: docs/devel/migration.rst
F: qapi/migration.json
F: tests/migration/
F: util/userfaultfd.c
X: migration/rdma*

RDMA Migration
M: Juan Quintela <[email protected]>
R: Li Zhijian <[email protected]>
R: Peter Xu <[email protected]>
R: Leonardo Bras <[email protected]>
S: Odd Fixes
F: migration/rdma*

Migration dirty limit and dirty page rate
M: Hyman Huang <[email protected]>
Expand Down
32 changes: 28 additions & 4 deletions accel/kvm/kvm-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,13 @@ bool kvm_cpu_check_are_resettable(void)
static void do_kvm_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data arg)
{
if (!cpu->vcpu_dirty) {
kvm_arch_get_registers(cpu);
int ret = kvm_arch_get_registers(cpu);
if (ret) {
error_report("Failed to get registers: %s", strerror(-ret));
cpu_dump_state(cpu, stderr, CPU_DUMP_CODE);
vm_stop(RUN_STATE_INTERNAL_ERROR);
}

cpu->vcpu_dirty = true;
}
}
Expand All @@ -2865,7 +2871,13 @@ void kvm_cpu_synchronize_state(CPUState *cpu)

static void do_kvm_cpu_synchronize_post_reset(CPUState *cpu, run_on_cpu_data arg)
{
kvm_arch_put_registers(cpu, KVM_PUT_RESET_STATE);
int ret = kvm_arch_put_registers(cpu, KVM_PUT_RESET_STATE);
if (ret) {
error_report("Failed to put registers after reset: %s", strerror(-ret));
cpu_dump_state(cpu, stderr, CPU_DUMP_CODE);
vm_stop(RUN_STATE_INTERNAL_ERROR);
}

cpu->vcpu_dirty = false;
}

Expand All @@ -2876,7 +2888,12 @@ void kvm_cpu_synchronize_post_reset(CPUState *cpu)

static void do_kvm_cpu_synchronize_post_init(CPUState *cpu, run_on_cpu_data arg)
{
kvm_arch_put_registers(cpu, KVM_PUT_FULL_STATE);
int ret = kvm_arch_put_registers(cpu, KVM_PUT_FULL_STATE);
if (ret) {
error_report("Failed to put registers after init: %s", strerror(-ret));
exit(1);
}

cpu->vcpu_dirty = false;
}

Expand Down Expand Up @@ -2969,7 +2986,14 @@ int kvm_cpu_exec(CPUState *cpu)
MemTxAttrs attrs;

if (cpu->vcpu_dirty) {
kvm_arch_put_registers(cpu, KVM_PUT_RUNTIME_STATE);
ret = kvm_arch_put_registers(cpu, KVM_PUT_RUNTIME_STATE);
if (ret) {
error_report("Failed to put registers after init: %s",
strerror(-ret));
ret = -1;
break;
}

cpu->vcpu_dirty = false;
}

Expand Down
2 changes: 1 addition & 1 deletion accel/tcg/cpu-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
&& cpu_neg(cpu)->icount_decr.u16.low + cpu->icount_extra == 0) {
/* Execute just one insn to trigger exception pending in the log */
cpu->cflags_next_tb = (curr_cflags(cpu) & ~CF_USE_ICOUNT)
| CF_NOIRQ | 1;
| CF_LAST_IO | CF_NOIRQ | 1;
}
#endif
return false;
Expand Down
9 changes: 5 additions & 4 deletions accel/tcg/tb-maint.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,12 @@ static PageDesc *page_find_alloc(tb_page_addr_t index, bool alloc)
{
PageDesc *pd;
void **lp;
int i;

/* Level 1. Always allocated. */
lp = l1_map + ((index >> v_l1_shift) & (v_l1_size - 1));

/* Level 2..N-1. */
for (i = v_l2_levels; i > 0; i--) {
for (int i = v_l2_levels; i > 0; i--) {
void **p = qatomic_rcu_read(lp);

if (p == NULL) {
Expand Down Expand Up @@ -1083,7 +1082,8 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc)
if (current_tb_modified) {
/* Force execution of one insn next time. */
CPUState *cpu = current_cpu;
cpu->cflags_next_tb = 1 | CF_NOIRQ | curr_cflags(current_cpu);
cpu->cflags_next_tb =
1 | CF_LAST_IO | CF_NOIRQ | curr_cflags(current_cpu);
return true;
}
return false;
Expand Down Expand Up @@ -1153,7 +1153,8 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages,
if (current_tb_modified) {
page_collection_unlock(pages);
/* Force execution of one insn next time. */
current_cpu->cflags_next_tb = 1 | CF_NOIRQ | curr_cflags(current_cpu);
current_cpu->cflags_next_tb =
1 | CF_LAST_IO | CF_NOIRQ | curr_cflags(current_cpu);
mmap_unlock();
cpu_loop_exit_noexc(current_cpu);
}
Expand Down
72 changes: 34 additions & 38 deletions accel/tcg/translator.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,19 @@
#include "tcg/tcg-op-common.h"
#include "internal.h"

static void gen_io_start(void)
static void set_can_do_io(DisasContextBase *db, bool val)
{
tcg_gen_st_i32(tcg_constant_i32(1), cpu_env,
offsetof(ArchCPU, parent_obj.can_do_io) -
offsetof(ArchCPU, env));
if (db->saved_can_do_io != val) {
db->saved_can_do_io = val;
tcg_gen_st_i32(tcg_constant_i32(val), cpu_env,
offsetof(ArchCPU, parent_obj.can_do_io) -
offsetof(ArchCPU, env));
}
}

bool translator_io_start(DisasContextBase *db)
{
uint32_t cflags = tb_cflags(db->tb);

if (!(cflags & CF_USE_ICOUNT)) {
return false;
}
if (db->num_insns == db->max_insns && (cflags & CF_LAST_IO)) {
/* Already started in translator_loop. */
return true;
}

gen_io_start();
set_can_do_io(db, true);

/*
* Ensure that this instruction will be the last in the TB.
Expand All @@ -47,14 +40,17 @@ bool translator_io_start(DisasContextBase *db)
return true;
}

static TCGOp *gen_tb_start(uint32_t cflags)
static TCGOp *gen_tb_start(DisasContextBase *db, uint32_t cflags)
{
TCGv_i32 count = tcg_temp_new_i32();
TCGv_i32 count = NULL;
TCGOp *icount_start_insn = NULL;

tcg_gen_ld_i32(count, cpu_env,
offsetof(ArchCPU, neg.icount_decr.u32) -
offsetof(ArchCPU, env));
if ((cflags & CF_USE_ICOUNT) || !(cflags & CF_NOIRQ)) {
count = tcg_temp_new_i32();
tcg_gen_ld_i32(count, cpu_env,
offsetof(ArchCPU, neg.icount_decr.u32) -
offsetof(ArchCPU, env));
}

if (cflags & CF_USE_ICOUNT) {
/*
Expand Down Expand Up @@ -84,18 +80,15 @@ static TCGOp *gen_tb_start(uint32_t cflags)
tcg_gen_st16_i32(count, cpu_env,
offsetof(ArchCPU, neg.icount_decr.u16.low) -
offsetof(ArchCPU, env));
/*
* cpu->can_do_io is cleared automatically here at the beginning of
* each translation block. The cost is minimal and only paid for
* -icount, plus it would be very easy to forget doing it in the
* translator. Doing it here means we don't need a gen_io_end() to
* go with gen_io_start().
*/
tcg_gen_st_i32(tcg_constant_i32(0), cpu_env,
offsetof(ArchCPU, parent_obj.can_do_io) -
offsetof(ArchCPU, env));
}

/*
* cpu->can_do_io is set automatically here at the beginning of
* each translation block. The cost is minimal, plus it would be
* very easy to forget doing it in the translator.
*/
set_can_do_io(db, db->max_insns == 1 && (cflags & CF_LAST_IO));

return icount_start_insn;
}

Expand Down Expand Up @@ -144,18 +137,25 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns,
db->num_insns = 0;
db->max_insns = *max_insns;
db->singlestep_enabled = cflags & CF_SINGLE_STEP;
db->saved_can_do_io = -1;
db->host_addr[0] = host_pc;
db->host_addr[1] = NULL;

ops->init_disas_context(db, cpu);
tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */

/* Start translating. */
icount_start_insn = gen_tb_start(cflags);
icount_start_insn = gen_tb_start(db, cflags);
ops->tb_start(db, cpu);
tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */

plugin_enabled = plugin_gen_tb_start(cpu, db, cflags & CF_MEMI_ONLY);
if (cflags & CF_MEMI_ONLY) {
/* We should only see CF_MEMI_ONLY for io_recompile. */
assert(cflags & CF_LAST_IO);
plugin_enabled = plugin_gen_tb_start(cpu, db, true);
} else {
plugin_enabled = plugin_gen_tb_start(cpu, db, false);
}

while (true) {
*max_insns = ++db->num_insns;
Expand All @@ -172,13 +172,9 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns,
the next instruction. */
if (db->num_insns == db->max_insns && (cflags & CF_LAST_IO)) {
/* Accept I/O on the last instruction. */
gen_io_start();
ops->translate_insn(db, cpu);
} else {
/* we should only see CF_MEMI_ONLY for io_recompile */
tcg_debug_assert(!(cflags & CF_MEMI_ONLY));
ops->translate_insn(db, cpu);
set_can_do_io(db, true);
}
ops->translate_insn(db, cpu);

/*
* We can't instrument after instructions that change control
Expand Down
3 changes: 1 addition & 2 deletions audio/alsaaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ static void alsa_init_per_direction(AudiodevAlsaPerDirectionOptions *apdo)
}
}

static void *alsa_audio_init(Audiodev *dev)
static void *alsa_audio_init(Audiodev *dev, Error **errp)
{
AudiodevAlsaOptions *aopts;
assert(dev->driver == AUDIODEV_DRIVER_ALSA);
Expand Down Expand Up @@ -960,7 +960,6 @@ static struct audio_driver alsa_audio_driver = {
.init = alsa_audio_init,
.fini = alsa_audio_fini,
.pcm_ops = &alsa_pcm_ops,
.can_be_default = 1,
.max_voices_out = INT_MAX,
.max_voices_in = INT_MAX,
.voice_size_out = sizeof (ALSAVoiceOut),
Expand Down
6 changes: 4 additions & 2 deletions audio/audio-hmp-cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "audio/audio.h"
#include "monitor/hmp.h"
#include "monitor/monitor.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"

static QLIST_HEAD (capture_list_head, CaptureState) capture_head;
Expand Down Expand Up @@ -65,10 +66,11 @@ void hmp_wavcapture(Monitor *mon, const QDict *qdict)
int nchannels = qdict_get_try_int(qdict, "nchannels", 2);
const char *audiodev = qdict_get_str(qdict, "audiodev");
CaptureState *s;
AudioState *as = audio_state_by_name(audiodev);
Error *local_err = NULL;
AudioState *as = audio_state_by_name(audiodev, &local_err);

if (!as) {
monitor_printf(mon, "Audiodev '%s' not found\n", audiodev);
error_report_err(local_err);
return;
}

Expand Down
Loading