]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
2 years agobsd-user/mmap.c: check pread's return value to fix warnings with _FORTIFY_SOURCE
Mikaël Urankar [Thu, 16 Sep 2021 23:45:05 +0000 (17:45 -0600)]
bsd-user/mmap.c: check pread's return value to fix warnings with _FORTIFY_SOURCE

Simmilar to the equivalent linux-user: commit fb7e378cf9c, which added
checking to pread's return value. Update to current qemu standards with
{} around the if statement.

Signed-off-by: Mikaël Urankar <mikael.urankar@gmail.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
2 years agobsd-user/mmap.c: Always zero MAP_ANONYMOUS memory in mmap_frag()
Mikaël Urankar [Sat, 8 Jul 2017 11:13:31 +0000 (13:13 +0200)]
bsd-user/mmap.c: Always zero MAP_ANONYMOUS memory in mmap_frag()

Similar to the equivalent linux-user commit e6deac9cf99

When mapping MAP_ANONYMOUS memory fragments, still need notice about to
set it zero, or it will cause issues.

Signed-off-by: Mikaël Urankar <mikael.urankar@gmail.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
2 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-tcg-20211016' into staging
Richard Henderson [Sat, 16 Oct 2021 18:16:28 +0000 (11:16 -0700)]
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20211016' into staging

Move gdb singlestep to generic code
Fix cpu_common_props

# gpg: Signature made Sat 16 Oct 2021 11:13:54 AM PDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* remotes/rth/tags/pull-tcg-20211016: (24 commits)
  Revert "cpu: Move cpu_common_props to hw/core/cpu.c"
  target/xtensa: Drop check for singlestep_enabled
  target/tricore: Drop check for singlestep_enabled
  target/sh4: Drop check for singlestep_enabled
  target/s390x: Drop check for singlestep_enabled
  target/rx: Drop checks for singlestep_enabled
  target/riscv: Remove exit_tb and lookup_and_goto_ptr
  target/riscv: Remove dead code after exception
  target/ppc: Drop exit checks for singlestep_enabled
  target/openrisc: Drop checks for singlestep_enabled
  target/mips: Drop exit checks for singlestep_enabled
  target/mips: Fix single stepping
  target/microblaze: Drop checks for singlestep_enabled
  target/microblaze: Check CF_NO_GOTO_TB for DISAS_JUMP
  target/m68k: Drop checks for singlestep_enabled
  target/i386: Drop check for singlestep_enabled
  target/i386: Check CF_NO_GOTO_TB for dc->jmp_opt
  target/hppa: Drop checks for singlestep_enabled
  target/arm: Drop checks for singlestep_enabled
  target/hexagon: Drop checks for singlestep_enabled
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agoRevert "cpu: Move cpu_common_props to hw/core/cpu.c"
Richard Henderson [Sun, 22 Aug 2021 07:25:28 +0000 (00:25 -0700)]
Revert "cpu: Move cpu_common_props to hw/core/cpu.c"

This reverts commit 1b36e4f5a5de585210ea95f2257839c2312be28f.

Despite a comment saying why cpu_common_props cannot be placed in
a file that is compiled once, it was moved anyway.  Revert that.

Since then, Property is not defined in hw/core/cpu.h, so it is now
easier to declare a function to install the properties rather than
the Property array itself.

Cc: Eduardo Habkost <ehabkost@redhat.com>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/xtensa: Drop check for singlestep_enabled
Richard Henderson [Tue, 20 Jul 2021 01:02:11 +0000 (15:02 -1000)]
target/xtensa: Drop check for singlestep_enabled

GDB single-stepping is now handled generically.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/tricore: Drop check for singlestep_enabled
Richard Henderson [Tue, 20 Jul 2021 00:59:06 +0000 (14:59 -1000)]
target/tricore: Drop check for singlestep_enabled

GDB single-stepping is now handled generically.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/sh4: Drop check for singlestep_enabled
Richard Henderson [Tue, 20 Jul 2021 00:54:55 +0000 (14:54 -1000)]
target/sh4: Drop check for singlestep_enabled

GDB single-stepping is now handled generically.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/s390x: Drop check for singlestep_enabled
Richard Henderson [Tue, 20 Jul 2021 00:52:20 +0000 (14:52 -1000)]
target/s390x: Drop check for singlestep_enabled

GDB single-stepping is now handled generically.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/rx: Drop checks for singlestep_enabled
Richard Henderson [Tue, 20 Jul 2021 00:41:55 +0000 (14:41 -1000)]
target/rx: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/riscv: Remove exit_tb and lookup_and_goto_ptr
Richard Henderson [Tue, 20 Jul 2021 00:35:18 +0000 (14:35 -1000)]
target/riscv: Remove exit_tb and lookup_and_goto_ptr

GDB single-stepping is now handled generically, which means
we don't need to do anything in the wrappers.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/riscv: Remove dead code after exception
Richard Henderson [Tue, 20 Jul 2021 00:34:13 +0000 (14:34 -1000)]
target/riscv: Remove dead code after exception

We have already set DISAS_NORETURN in generate_exception,
which makes the exit_tb unreachable.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/ppc: Drop exit checks for singlestep_enabled
Richard Henderson [Tue, 20 Jul 2021 00:26:48 +0000 (14:26 -1000)]
target/ppc: Drop exit checks for singlestep_enabled

GDB single-stepping is now handled generically.
Reuse gen_debug_exception to handle architectural debug exceptions.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/openrisc: Drop checks for singlestep_enabled
Richard Henderson [Tue, 20 Jul 2021 00:07:10 +0000 (14:07 -1000)]
target/openrisc: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/mips: Drop exit checks for singlestep_enabled
Richard Henderson [Tue, 20 Jul 2021 00:04:32 +0000 (14:04 -1000)]
target/mips: Drop exit checks for singlestep_enabled

GDB single-stepping is now handled generically.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/mips: Fix single stepping
Richard Henderson [Tue, 20 Jul 2021 00:01:49 +0000 (14:01 -1000)]
target/mips: Fix single stepping

As per an ancient comment in mips_tr_translate_insn about the
expectations of gdb, when restarting the insn in a delay slot
we also re-execute the branch.  Which means that we are
expected to execute two insns in this case.

This has been broken since 8b86d6d2580, where we forced max_insns
to 1 while single-stepping.  This resulted in an exit from the
translator loop after the branch but before the delay slot is
translated.

Increase the max_insns to 2 for this case.  In addition, bypass
the end-of-page check, for when the branch itself ends the page.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/microblaze: Drop checks for singlestep_enabled
Richard Henderson [Mon, 19 Jul 2021 16:17:20 +0000 (06:17 -1000)]
target/microblaze: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/microblaze: Check CF_NO_GOTO_TB for DISAS_JUMP
Richard Henderson [Mon, 19 Jul 2021 16:16:42 +0000 (06:16 -1000)]
target/microblaze: Check CF_NO_GOTO_TB for DISAS_JUMP

We were using singlestep_enabled as a proxy for whether
translator_use_goto_tb would always return false.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/m68k: Drop checks for singlestep_enabled
Richard Henderson [Mon, 19 Jul 2021 07:27:53 +0000 (21:27 -1000)]
target/m68k: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Acked-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/i386: Drop check for singlestep_enabled
Richard Henderson [Tue, 20 Jul 2021 02:04:29 +0000 (16:04 -1000)]
target/i386: Drop check for singlestep_enabled

GDB single-stepping is now handled generically.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/i386: Check CF_NO_GOTO_TB for dc->jmp_opt
Richard Henderson [Tue, 20 Jul 2021 01:59:08 +0000 (15:59 -1000)]
target/i386: Check CF_NO_GOTO_TB for dc->jmp_opt

We were using singlestep_enabled as a proxy for whether
translator_use_goto_tb would always return false.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/hppa: Drop checks for singlestep_enabled
Richard Henderson [Mon, 19 Jul 2021 07:19:26 +0000 (21:19 -1000)]
target/hppa: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/arm: Drop checks for singlestep_enabled
Richard Henderson [Mon, 19 Jul 2021 07:12:59 +0000 (21:12 -1000)]
target/arm: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/hexagon: Drop checks for singlestep_enabled
Richard Henderson [Mon, 19 Jul 2021 07:02:03 +0000 (21:02 -1000)]
target/hexagon: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/cris: Drop checks for singlestep_enabled
Richard Henderson [Mon, 19 Jul 2021 06:58:53 +0000 (20:58 -1000)]
target/cris: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/avr: Drop checks for singlestep_enabled
Richard Henderson [Mon, 19 Jul 2021 06:56:46 +0000 (20:56 -1000)]
target/avr: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Tested-by: Michael Rolnik <mrolnik@gmail.com>
Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/alpha: Drop checks for singlestep_enabled
Richard Henderson [Mon, 19 Jul 2021 01:25:13 +0000 (15:25 -1000)]
target/alpha: Drop checks for singlestep_enabled

GDB single-stepping is now handled generically.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agoaccel/tcg: Handle gdb singlestep in cpu_tb_exec
Richard Henderson [Mon, 19 Jul 2021 01:12:12 +0000 (15:12 -1000)]
accel/tcg: Handle gdb singlestep in cpu_tb_exec

Currently the change in cpu_tb_exec is masked by the debug exception
being raised by the translators.  But this allows us to remove that code.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agoMerge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2021-10-15' into staging
Richard Henderson [Fri, 15 Oct 2021 21:16:28 +0000 (14:16 -0700)]
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2021-10-15' into staging

nbd patches for 2021-10-15

- Vladimir Sementsov-Ogievskiy: Consistent use of 64-bit parameters in
  block operations
- Hanna Reitz: Silence 32-bit compiler warning

# gpg: Signature made Fri 15 Oct 2021 02:08:10 PM PDT
# gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
# gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
# gpg:                 aka "[jpeg image of size 6874]" [full]

* remotes/ericb/tags/pull-nbd-2021-10-15:
  block-backend: update blk_co_pwrite() and blk_co_pread() wrappers
  block-backend: fix blk_co_flush prototype to mention coroutine_fn
  block-backend: drop INT_MAX restriction from blk_check_byte_request()
  block-backend: blk_pread, blk_pwrite: rename count parameter to bytes
  block-backend: convert blk_aio_ functions to int64_t bytes paramter
  block-backend: convert blk_co_copy_range to int64_t bytes
  block-backend: convert blk_foo wrappers to use int64_t bytes parameter
  block-backend: drop blk_prw, use block-coroutine-wrapper
  block-coroutine-wrapper.py: support BlockBackend first argument
  block-backend: rename _do_ helper functions to _co_do_
  block-backend: convert blk_co_pdiscard to int64_t bytes
  block-backend: convert blk_co_pwritev_part to int64_t bytes
  block-backend: make blk_co_preadv() 64bit
  block-backend: blk_check_byte_request(): int64_t bytes
  qcow2: Silence clang -m32 compiler warning

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agoblock-backend: update blk_co_pwrite() and blk_co_pread() wrappers
Vladimir Sementsov-Ogievskiy [Thu, 7 Oct 2021 17:52:43 +0000 (19:52 +0200)]
block-backend: update blk_co_pwrite() and blk_co_pread() wrappers

Make bytes argument int64_t to be consistent with modern block-layer.
Callers should be OK with it as type becomes wider.

What is inside functions?

- Conversion from int64_t to size_t. Still, we
can't have a buffer larger than SIZE_MAX, therefore bytes should not be
larger than SIZE_MAX as well. Add an assertion.

- Passing to blk_co_pwritev() / blk_co_preadv() which already has
  int64_t bytes argument.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211007175243.642516-2-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: spelling fix]
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: fix blk_co_flush prototype to mention coroutine_fn
Vladimir Sementsov-Ogievskiy [Thu, 7 Oct 2021 17:52:42 +0000 (19:52 +0200)]
block-backend: fix blk_co_flush prototype to mention coroutine_fn

We already have this marker for the blk_co_flush function declaration in
block/block-backend.c. Add it in the header too.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211007175243.642516-1-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: wording tweak]
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: drop INT_MAX restriction from blk_check_byte_request()
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:18 +0000 (15:17 +0200)]
block-backend: drop INT_MAX restriction from blk_check_byte_request()

blk_check_bytes_request is called from blk_co_do_preadv,
blk_co_do_pwritev_part, blk_co_do_pdiscard and blk_co_copy_range
before (maybe) calling throttle_group_co_io_limits_intercept() (which
has int64_t argument) and then calling corresponding bdrv_co_ function.
bdrv_co_ functions are OK with int64_t bytes as well.

So dropping the check for INT_MAX we just get same restrictions as in
bdrv_ layer: discard and write-zeroes goes through
bdrv_check_qiov_request() and are allowed to be 64bit. Other requests
go through bdrv_check_request32() and still restricted by INT_MAX
boundary.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-13-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: blk_pread, blk_pwrite: rename count parameter to bytes
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:17 +0000 (15:17 +0200)]
block-backend: blk_pread, blk_pwrite: rename count parameter to bytes

To be consistent with declarations in include/sysemu/block-backend.h.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-12-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: convert blk_aio_ functions to int64_t bytes paramter
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:16 +0000 (15:17 +0200)]
block-backend: convert blk_aio_ functions to int64_t bytes paramter

1. Convert bytes in BlkAioEmAIOCB:
  aio->bytes is only passed to already int64_t interfaces, and set in
  blk_aio_prwv, which is updated here.

2. For all updated functions the parameter type becomes wider so callers
   are safe.

3. In blk_aio_prwv we only store bytes to BlkAioEmAIOCB, which is
   updated here.

4. Other updated functions are wrappers on blk_aio_prwv.

Note that blk_aio_preadv and blk_aio_pwritev become safer: before this
commit, it's theoretically possible to pass qiov with size exceeding
INT_MAX, which than converted to int argument of blk_aio_prwv. Now it's
converted to int64_t which is a lot better. Still add assertions.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-11-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: tweak assertion and grammar]
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: convert blk_co_copy_range to int64_t bytes
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:15 +0000 (15:17 +0200)]
block-backend: convert blk_co_copy_range to int64_t bytes

Function is updated so that parameter type becomes wider, so all
callers should be OK with it.

Look at blk_co_copy_range() itself: bytes is passed only to
blk_check_byte_request() and bdrv_co_copy_range(), which already have
int64_t bytes parameter, so we are OK.

Note that requests exceeding INT_MAX are still restricted by
blk_check_byte_request().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-10-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: convert blk_foo wrappers to use int64_t bytes parameter
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:14 +0000 (15:17 +0200)]
block-backend: convert blk_foo wrappers to use int64_t bytes parameter

Convert blk_pdiscard, blk_pwrite_compressed, blk_pwrite_zeroes.
These are just wrappers for functions with int64_t argument, so allow
passing int64_t as well. Parameter type becomes wider so all callers
should be OK with it.

Note that requests exceeding INT_MAX are still restricted by
blk_check_byte_request().

Note also that we don't (and are not going to) convert blk_pwrite and
blk_pread: these functions return number of bytes on success, so to
update them, we should change return type to int64_t as well, which
will lead to investigating and updating all callers which is too much.

So, blk_pread and blk_pwrite remain unchanged.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-9-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: drop blk_prw, use block-coroutine-wrapper
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:13 +0000 (15:17 +0200)]
block-backend: drop blk_prw, use block-coroutine-wrapper

Let's drop hand-made coroutine wrappers and use coroutine wrapper
generation like in block/io.c.

Now, blk_foo() functions are written in same way as blk_co_foo() ones,
but wrap blk_do_foo() instead of blk_co_do_foo().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-8-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: spelling fix]
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-coroutine-wrapper.py: support BlockBackend first argument
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:12 +0000 (15:17 +0200)]
block-coroutine-wrapper.py: support BlockBackend first argument

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-7-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: rename _do_ helper functions to _co_do_
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:11 +0000 (15:17 +0200)]
block-backend: rename _do_ helper functions to _co_do_

This is a preparation to the following commit, to use automatic
coroutine wrapper generation.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-6-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: convert blk_co_pdiscard to int64_t bytes
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:10 +0000 (15:17 +0200)]
block-backend: convert blk_co_pdiscard to int64_t bytes

We updated blk_do_pdiscard() and its wrapper blk_co_pdiscard(). Both
functions are updated so that the parameter type becomes wider, so all
callers should be OK with it.

Look at blk_do_pdiscard(): bytes is passed only to
blk_check_byte_request() and bdrv_co_pdiscard(), which already have
int64_t bytes parameter, so we are OK.

Note that requests exceeding INT_MAX are still restricted by
blk_check_byte_request().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-5-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: convert blk_co_pwritev_part to int64_t bytes
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:09 +0000 (15:17 +0200)]
block-backend: convert blk_co_pwritev_part to int64_t bytes

We convert blk_do_pwritev_part() and some wrappers:
blk_co_pwritev_part(), blk_co_pwritev(), blk_co_pwrite_zeroes().

All functions are converted so that the parameter type becomes wider, so
all callers should be OK with it.

Look at blk_do_pwritev_part() body:
bytes is passed to:

 - trace_blk_co_pwritev (we update it here)
 - blk_check_byte_request, throttle_group_co_io_limits_intercept,
   bdrv_co_pwritev_part - all already have int64_t argument.

Note that requests exceeding INT_MAX are still restricted by
blk_check_byte_request().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-4-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: make blk_co_preadv() 64bit
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:08 +0000 (15:17 +0200)]
block-backend: make blk_co_preadv() 64bit

For both updated functions, the type of bytes becomes wider, so all callers
should be OK with it.

blk_co_preadv() only passes its arguments to blk_do_preadv().

blk_do_preadv() passes bytes to:

 - trace_blk_co_preadv, which is updated too
 - blk_check_byte_request, throttle_group_co_io_limits_intercept,
   bdrv_co_preadv, which are already int64_t.

Note that requests exceeding INT_MAX are still restricted by
blk_check_byte_request().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-3-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoblock-backend: blk_check_byte_request(): int64_t bytes
Vladimir Sementsov-Ogievskiy [Wed, 6 Oct 2021 13:17:07 +0000 (15:17 +0200)]
block-backend: blk_check_byte_request(): int64_t bytes

Rename size and make it int64_t to correspond to modern block layer,
which always uses int64_t for offset and bytes (not in blk layer yet,
which is a task for following commits).

All callers pass int or unsigned int.

So, for bytes in [0, INT_MAX] nothing is changed, for negative bytes we
now fail on "bytes < 0" check instead of "bytes > INT_MAX" check.

Note, that blk_check_byte_request() still doesn't allow requests
exceeding INT_MAX.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-2-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoqcow2: Silence clang -m32 compiler warning
Hanna Reitz [Mon, 11 Oct 2021 15:50:31 +0000 (17:50 +0200)]
qcow2: Silence clang -m32 compiler warning

With -m32, size_t is generally only a uint32_t.  That makes clang
complain that in the assertion

  assert(qiov->size <= INT64_MAX);

the range of the type of qiov->size (size_t) is too small for any of its
values to ever exceed INT64_MAX.

Cast qiov->size to uint64_t to silence clang.

Fixes: f7ef38dd1310d7d9db76d0aa16899cbc5744f36d
       ("block: use int64_t instead of uint64_t in driver read
       handlers")
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20211011155031.149158-1-hreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2 years agoMerge remote-tracking branch 'remotes/kwolf/tags/for-upstream' into staging
Richard Henderson [Fri, 15 Oct 2021 19:08:54 +0000 (12:08 -0700)]
Merge remote-tracking branch 'remotes/kwolf/tags/for-upstream' into staging

qdev: Add JSON -device

- Add a JSON mode to the -device command line option
- net/vhost-{user,vdpa}: Fix device compatibility check
- Minor iotests fixes

# gpg: Signature made Fri 15 Oct 2021 07:41:22 AM PDT
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]

* remotes/kwolf/tags/for-upstream:
  vl: Enable JSON syntax for -device
  qdev: Base object creation on QDict rather than QemuOpts
  virtio-net: Avoid QemuOpts in failover_find_primary_device()
  virtio-net: Store failover primary opts pointer locally
  qdev: Add Error parameter to hide_device() callbacks
  qemu-option: Allow deleting opts during qemu_opts_foreach()
  softmmu/qdev-monitor: add error handling in qdev_set_id
  qdev: Make DeviceState.id independent of QemuOpts
  qdev: Avoid using string visitor for properties
  iotests/051: Fix typo
  iotests/245: Fix type for iothread property
  qom: Reduce use of error_propagate()
  net/vhost-vdpa: Fix device compatibility check
  net/vhost-user: Fix device compatibility check
  net: Introduce NetClientInfo.check_peer_type()

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agoMerge remote-tracking branch 'remotes/thuth/tags/pull-request-2021-10-15' into staging
Richard Henderson [Fri, 15 Oct 2021 16:19:45 +0000 (09:19 -0700)]
Merge remote-tracking branch 'remotes/thuth/tags/pull-request-2021-10-15' into staging

* Check kernel command line size on s390x
* Simplification of one of the SIGP instructions on s390x
* Cornelia stepping down as maintainer in some subsystems
* Update the dtc submodule to a proper release version

# gpg: Signature made Fri 15 Oct 2021 02:11:13 AM PDT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]

* remotes/thuth/tags/pull-request-2021-10-15:
  dtc: Update to version 1.6.1
  s390x virtio-ccw machine: step down as maintainer
  s390x/kvm: step down as maintainer
  vfio-ccw: step down as maintainer
  s390x: sigp: Force Set Architecture to return Invalid Parameter
  s390x/ipl: check kernel command line size

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agovl: Enable JSON syntax for -device
Kevin Wolf [Fri, 8 Oct 2021 13:34:42 +0000 (15:34 +0200)]
vl: Enable JSON syntax for -device

Like we already do for -object, introduce support for JSON syntax in
-device, which can be kept stable in the long term and guarantees that a
single code path with identical behaviour is used for both QMP and the
command line. Compared to the QemuOpts based code, the parser contains
less surprises and has support for non-scalar options (lists and
structs). Switching management tools to JSON means that we can more
easily change the "human" CLI syntax from QemuOpts to the keyval parser
later.

In the QAPI schema, a feature flag is added to the device-add command to
allow management tools to detect support for this.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20211008133442.141332-16-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agoqdev: Base object creation on QDict rather than QemuOpts
Kevin Wolf [Fri, 8 Oct 2021 13:34:41 +0000 (15:34 +0200)]
qdev: Base object creation on QDict rather than QemuOpts

QDicts are both what QMP natively uses and what the keyval parser
produces. Going through QemuOpts isn't useful for either one, so switch
the main device creation function to QDicts. By sharing more code with
the -object/object-add code path, we can even reduce the code size a
bit.

This commit doesn't remove the detour through QemuOpts from any code
path yet, but it allows the following commits to do so.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-15-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agovirtio-net: Avoid QemuOpts in failover_find_primary_device()
Kevin Wolf [Fri, 8 Oct 2021 13:34:40 +0000 (15:34 +0200)]
virtio-net: Avoid QemuOpts in failover_find_primary_device()

Don't go through the global QemuOptsList, it is state of the legacy
command line parser and we will create devices that are not contained
in it. It is also just the command line configuration and not
necessarily the current runtime state.

Instead, look at the qdev device tree which has the current state of all
existing devices.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-14-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agovirtio-net: Store failover primary opts pointer locally
Kevin Wolf [Fri, 8 Oct 2021 13:34:39 +0000 (15:34 +0200)]
virtio-net: Store failover primary opts pointer locally

Instead of accessing the global QemuOptsList, which really belong to the
command line parser and shouldn't be accessed from devices, store a
pointer to the QemuOpts in a new VirtIONet field.

This is not the final state, but just an intermediate step to get rid of
QemuOpts in devices. It will later be replaced with an options QDict.

Before this patch, two "primary" devices could be hidden for the same
standby device, but only one of them would actually be enabled and the
other one would be kept hidden forever, so this doesn't make sense.
After this patch, configuring a second primary device is an error.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-13-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agoqdev: Add Error parameter to hide_device() callbacks
Kevin Wolf [Fri, 8 Oct 2021 13:34:38 +0000 (15:34 +0200)]
qdev: Add Error parameter to hide_device() callbacks

hide_device() is used for virtio-net failover, where the standby virtio
device delays creation of the primary device. It only makes sense to
have a single primary device for each standby device. Adding a second
one should result in an error instead of hiding it and never using it
afterwards.

Prepare for this by adding an Error parameter to the hide_device()
callback where virtio-net is informed about adding a primary device.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-12-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agoqemu-option: Allow deleting opts during qemu_opts_foreach()
Kevin Wolf [Fri, 8 Oct 2021 13:34:37 +0000 (15:34 +0200)]
qemu-option: Allow deleting opts during qemu_opts_foreach()

Use QTAILQ_FOREACH_SAFE() so that the current QemuOpts can be deleted
while iterating through the whole list.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211008133442.141332-11-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agosoftmmu/qdev-monitor: add error handling in qdev_set_id
Damien Hedde [Fri, 8 Oct 2021 13:34:36 +0000 (15:34 +0200)]
softmmu/qdev-monitor: add error handling in qdev_set_id

qdev_set_id() is mostly used when the user adds a device (using
-device cli option or device_add qmp command). This commit adds
an error parameter to handle the case where the given id is
already taken.

Also document the function and add a return value in order to
be able to capture success/failure: the function now returns the
id in case of success, or NULL in case of failure.

The commit modifies the 2 calling places (qdev-monitor and
xen-legacy-backend) to add the error object parameter.

Note that the id is, right now, guaranteed to be unique because
all ids came from the "device" QemuOptsList where the id is used
as key. This addition is a preparation for a future commit which
will relax the uniqueness.

Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-10-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agoqdev: Make DeviceState.id independent of QemuOpts
Kevin Wolf [Fri, 8 Oct 2021 13:34:35 +0000 (15:34 +0200)]
qdev: Make DeviceState.id independent of QemuOpts

DeviceState.id is a pointer to a string that is stored in the QemuOpts
object DeviceState.opts and freed together with it. We want to create
devices without going through QemuOpts in the future, so make this a
separately allocated string.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211008133442.141332-9-kwolf@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agoqdev: Avoid using string visitor for properties
Kevin Wolf [Fri, 8 Oct 2021 13:34:34 +0000 (15:34 +0200)]
qdev: Avoid using string visitor for properties

The only thing the string visitor adds compared to a keyval visitor is
list support. git grep for 'visit_start_list' and 'visit.*List' shows
that devices don't make use of this.

In a world with a QAPIfied command line interface, the keyval visitor is
used to parse the command line. In order to make sure that no devices
start using this feature that would make backwards compatibility harder,
just switch away from object_property_parse(), which internally uses the
string visitor, to a keyval visitor and object_property_set().

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20211008133442.141332-8-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agoiotests/051: Fix typo
Kevin Wolf [Fri, 8 Oct 2021 13:34:33 +0000 (15:34 +0200)]
iotests/051: Fix typo

The iothread isn't called 'iothread0', but 'thread0'. Depending on the
order that properties are parsed, the error message may change from the
expected one to another one saying that the iothread doesn't exist.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211008133442.141332-7-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agoiotests/245: Fix type for iothread property
Kevin Wolf [Fri, 8 Oct 2021 13:34:32 +0000 (15:34 +0200)]
iotests/245: Fix type for iothread property

iothread is a string property, so None (= JSON null) is not a valid
value for it. Pass the empty string instead to get the default iothread.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211008133442.141332-6-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agoqom: Reduce use of error_propagate()
Kevin Wolf [Fri, 8 Oct 2021 13:34:31 +0000 (15:34 +0200)]
qom: Reduce use of error_propagate()

ERRP_GUARD() makes debugging easier by making sure that &error_abort
still fails at the real origin of the error instead of
error_propagate().

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-5-kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agonet/vhost-vdpa: Fix device compatibility check
Kevin Wolf [Fri, 8 Oct 2021 13:34:30 +0000 (15:34 +0200)]
net/vhost-vdpa: Fix device compatibility check

vhost-vdpa works only with specific devices. At startup, it second
guesses what the command line option handling will do and error out if
it thinks a non-virtio device will attach to them.

This second guessing is not only ugly, it can lead to wrong error
messages ('-device floppy,netdev=foo' should complain about an unknown
property, not about the wrong kind of network device being attached) and
completely ignores hotplugging.

Drop the old checks and implement .check_peer_type() instead to fix
this. As a nice side effect, it also removes one more dependency on the
legacy QemuOpts infrastructure and even reduces the code size.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-4-kwolf@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agonet/vhost-user: Fix device compatibility check
Kevin Wolf [Fri, 8 Oct 2021 13:34:29 +0000 (15:34 +0200)]
net/vhost-user: Fix device compatibility check

vhost-user works only with specific devices. At startup, it second
guesses what the command line option handling will do and error out if
it thinks a non-virtio device will attach to them.

This second guessing is not only ugly, it can lead to wrong error
messages ('-device floppy,netdev=foo' should complain about an unknown
property, not about the wrong kind of network device being attached) and
completely ignores hotplugging.

Drop the old checks and implement .check_peer_type() instead to fix
this. As a nice side effect, it also removes one more dependency on the
legacy QemuOpts infrastructure and even reduces the code size.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-3-kwolf@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agonet: Introduce NetClientInfo.check_peer_type()
Kevin Wolf [Fri, 8 Oct 2021 13:34:28 +0000 (15:34 +0200)]
net: Introduce NetClientInfo.check_peer_type()

Some network backends (vhost-user and vhost-vdpa) work only with
specific devices. At startup, they second guess what the command line
option handling will do and error out if they think a non-virtio device
will attach to them.

This second guessing is not only ugly, it can lead to wrong error
messages ('-device floppy,netdev=foo' should complain about an unknown
property, not about the wrong kind of network device being attached) and
completely ignores hotplugging.

Add a callback where backends can check compatibility with a device when
it actually tries to attach, even on hotplug.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-2-kwolf@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Richard Henderson [Thu, 14 Oct 2021 17:49:38 +0000 (10:49 -0700)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* Meson conversions + introspection-based command line parser

# gpg: Signature made Thu 14 Oct 2021 12:51:54 AM PDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]

* remotes/bonzini/tags/for-upstream: (26 commits)
  configure: automatically parse command line for meson -D options
  meson-buildoptions: include list of tracing backends
  configure: prepare for auto-generated option parsing
  configure: accept "internal" for --enable-capstone/slirp/fdt
  configure: remove deprecated --{enable, disable}-git-update
  configure, meson: move more compiler checks to Meson
  configure: remove obsolete Solaris ar check
  configure, meson: move Spice configure handling to meson
  configure, meson: move netmap detection to meson
  configure, meson: move vde detection to meson
  configure, meson: move libaio check to meson.build
  configure, meson: move pthread_setname_np checks to Meson
  configure, meson: move remaining HAVE_* compiler tests to Meson
  meson: HAVE_GDB_BIN is not used by C code
  configure, meson: remove CONFIG_GCOV from config-host.mak
  configure, meson: get HOST_WORDS_BIGENDIAN via the machine object
  configure, meson: move CONFIG_HOST_DSOSUF to Meson
  trace: move configuration from configure to Meson
  trace: simple: pass trace_file unmodified to config-host.h
  configure, meson: move fuzzing configuration to Meson
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agoconfigure: automatically parse command line for meson -D options
Paolo Bonzini [Thu, 7 Oct 2021 13:08:29 +0000 (15:08 +0200)]
configure: automatically parse command line for meson -D options

Right now meson_options.txt lists about 90 options.  Each option
needs code in configure to parse it and pass the option down to Meson as
a -D command-line argument; in addition the default must be duplicated
between configure and meson_options.txt.  This series tries to remove
the code duplication by generating the case statement for those --enable
and --disable options, as well as the corresponding help text.

About 80% of the options can be handled completely by the new mechanism.
Eight meson options are not of the --enable/--disable kind.  Six more need
to be parsed in configure for various reasons documented in the patch,
but they still have their help automatically generated.

The advantages are:

- less code in configure

- parsing and help is more consistent (for example --enable-blobs was
  not supported)

- options are described entirely in one place, meson_options.txt.
  This make it more attractive to use Meson options instead of
  hand-crafted configure options and config-host.mak

A few options change name: --enable-tcmalloc and --enable-jemalloc
become --enable-malloc={tcmalloc,jemalloc}; --disable-blobs becomes
--disable-install-blobs; --enable-trace-backend becomes
--enable-trace-backends.  However, the old names are allowed
for backwards compatibility.

Message-Id: <20211007130829.632254-19-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agomeson-buildoptions: include list of tracing backends
Paolo Bonzini [Wed, 13 Oct 2021 07:51:47 +0000 (09:51 +0200)]
meson-buildoptions: include list of tracing backends

Manually patch the introspection data to include the tracing backends.
This works around a deficiency in Meson that will be fixed by
https://github.com/mesonbuild/meson/pull/9395.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure: prepare for auto-generated option parsing
Paolo Bonzini [Thu, 7 Oct 2021 13:08:28 +0000 (15:08 +0200)]
configure: prepare for auto-generated option parsing

Prepare the configure script and Makefile for automatically generated
help and parsing.

Because we need to run the script to generate the full help, we
cannot rely on the user supplying the path to a Python interpreter
with --python; therefore, the introspection output is parsed into
shell functions and stored in scripts/.  The converter is written
in Python as standard for QEMU, and this commit contains a stub.

Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20211007130829.632254-18-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure: accept "internal" for --enable-capstone/slirp/fdt
Paolo Bonzini [Thu, 7 Oct 2021 13:08:27 +0000 (15:08 +0200)]
configure: accept "internal" for --enable-capstone/slirp/fdt

Options such as "--enable-capstone=git" do not make much sense when building
from a tarball.  Accept "internal" for consistency with the meson options.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-17-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure: remove deprecated --{enable, disable}-git-update
Paolo Bonzini [Thu, 7 Oct 2021 13:08:26 +0000 (15:08 +0200)]
configure: remove deprecated --{enable, disable}-git-update

The options were deprecated in 6.0.  That said, we do not really have a
formal deprecation cycle for build-time changes, since they do not affect
users.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-16-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move more compiler checks to Meson
Paolo Bonzini [Thu, 7 Oct 2021 13:08:25 +0000 (15:08 +0200)]
configure, meson: move more compiler checks to Meson

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-15-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure: remove obsolete Solaris ar check
Paolo Bonzini [Thu, 7 Oct 2021 13:08:24 +0000 (15:08 +0200)]
configure: remove obsolete Solaris ar check

Meson already has its own logic to find the "ar" binary, so remove the
Solaris specific check.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20211007130829.632254-14-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move Spice configure handling to meson
Marc-André Lureau [Thu, 7 Oct 2021 13:08:23 +0000 (15:08 +0200)]
configure, meson: move Spice configure handling to meson

Add meson feature options for Spice and Spice protocol, and move
detection logic out of configure.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007102453.978041-1-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20211007130829.632254-13-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move netmap detection to meson
Paolo Bonzini [Thu, 7 Oct 2021 13:08:22 +0000 (15:08 +0200)]
configure, meson: move netmap detection to meson

Message-Id: <20211007130829.632254-12-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move vde detection to meson
Paolo Bonzini [Thu, 7 Oct 2021 13:08:21 +0000 (15:08 +0200)]
configure, meson: move vde detection to meson

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-11-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move libaio check to meson.build
Paolo Bonzini [Thu, 7 Oct 2021 13:08:20 +0000 (15:08 +0200)]
configure, meson: move libaio check to meson.build

Message-Id: <20211007130829.632254-10-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move pthread_setname_np checks to Meson
Paolo Bonzini [Thu, 7 Oct 2021 13:08:19 +0000 (15:08 +0200)]
configure, meson: move pthread_setname_np checks to Meson

This makes the pthreads check dead in configure, so remove it
as well.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-9-pbonzini@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move remaining HAVE_* compiler tests to Meson
Paolo Bonzini [Thu, 7 Oct 2021 13:08:18 +0000 (15:08 +0200)]
configure, meson: move remaining HAVE_* compiler tests to Meson

Remove some special cases by moving them to Meson.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-8-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agomeson: HAVE_GDB_BIN is not used by C code
Paolo Bonzini [Wed, 13 Oct 2021 08:04:24 +0000 (10:04 +0200)]
meson: HAVE_GDB_BIN is not used by C code

It is only used by the TCG tests, remove it from config-host.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: remove CONFIG_GCOV from config-host.mak
Paolo Bonzini [Thu, 7 Oct 2021 13:08:17 +0000 (15:08 +0200)]
configure, meson: remove CONFIG_GCOV from config-host.mak

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-7-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: get HOST_WORDS_BIGENDIAN via the machine object
Paolo Bonzini [Thu, 7 Oct 2021 13:08:16 +0000 (15:08 +0200)]
configure, meson: get HOST_WORDS_BIGENDIAN via the machine object

No need to pass it in config-host.mak.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211007130829.632254-6-pbonzini@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move CONFIG_HOST_DSOSUF to Meson
Paolo Bonzini [Thu, 7 Oct 2021 13:08:15 +0000 (15:08 +0200)]
configure, meson: move CONFIG_HOST_DSOSUF to Meson

This is just a constant string, there is no need to pass it in config-host.mak.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211007130829.632254-5-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agotrace: move configuration from configure to Meson
Paolo Bonzini [Thu, 7 Oct 2021 13:08:14 +0000 (15:08 +0200)]
trace: move configuration from configure to Meson

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-4-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agotrace: simple: pass trace_file unmodified to config-host.h
Paolo Bonzini [Thu, 7 Oct 2021 13:08:13 +0000 (15:08 +0200)]
trace: simple: pass trace_file unmodified to config-host.h

Add the suffix directly in trace/simple.c, so that quoting is done
properly by Meson.

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-3-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move fuzzing configuration to Meson
Paolo Bonzini [Thu, 7 Oct 2021 13:08:12 +0000 (15:08 +0200)]
configure, meson: move fuzzing configuration to Meson

Cc: Alexander Oleinik <alxndr@bu.edu>
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20211007130829.632254-2-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agokconfig: split CONFIG_SPARSE_MEM from fuzzing
Paolo Bonzini [Thu, 7 Oct 2021 13:08:11 +0000 (15:08 +0200)]
kconfig: split CONFIG_SPARSE_MEM from fuzzing

Pass CONFIG_FUZZ via host_kconfig, and use it to select the
sparse-mem device.

Cc: Alexander Oleinik <alxndr@bu.edu>
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20211007130829.632254-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure: add command line options for audio drivers
Paolo Bonzini [Thu, 7 Oct 2021 13:06:11 +0000 (15:06 +0200)]
configure: add command line options for audio drivers

Handle the choice of audio drivers the same as all other dependencies.

Cc: Gerd Hoffman <kraxel@redhat.com>
Cc: Volker Rümelin <vr_qemu@t-online.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130630.632028-6-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agomeson: define symbols for all available audio drivers
Paolo Bonzini [Thu, 7 Oct 2021 13:06:10 +0000 (15:06 +0200)]
meson: define symbols for all available audio drivers

All drivers are now built by default if the corresponding libraries
are available, similar to how all other modules behave;
--audio-drv-list only governs the default choice of the audio driver.

Adjust the CONFIG_AUDIO_* preprocessor symbols so that they are
based on library availability rather than --audio-drv-list, so that
the tests and -audiodev help follow the new logic.

Cc: Gerd Hoffman <kraxel@redhat.com>
Cc: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20211007130630.632028-5-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move audio driver detection to Meson
Paolo Bonzini [Thu, 7 Oct 2021 13:06:09 +0000 (15:06 +0200)]
configure, meson: move audio driver detection to Meson

This brings a change that makes audio drivers more similar to all
other modules.  All drivers are built by default, while
--audio-drv-list only governs the default choice of the audio driver.

Meson options are added to disable the drivers, and the next patches
will fix the help messages and command line options, and especially
make the non-default drivers available via -audiodev.

Cc: Gerd Hoffman <kraxel@redhat.com>
Cc: Volker Rümelin <vr_qemu@t-online.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130630.632028-4-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoaudio: remove CONFIG_AUDIO_WIN_INT
Paolo Bonzini [Thu, 7 Oct 2021 13:06:08 +0000 (15:06 +0200)]
audio: remove CONFIG_AUDIO_WIN_INT

Ever since winwaveaudio was removed in 2015, CONFIG_AUDIO_WIN_INT
is only set if dsound is in use, so use CONFIG_AUDIO_DSOUND directly.

Cc: Gerd Hoffman <kraxel@redhat.com>
Cc: Volker Rümelin <vr_qemu@t-online.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130630.632028-3-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure: remove --oss-lib
Paolo Bonzini [Thu, 7 Oct 2021 13:06:07 +0000 (15:06 +0200)]
configure: remove --oss-lib

OSS is a kernel API, so the option should not be needed.  The library
is used on NetBSD, where OSS is emulated, so keep the variable.

Cc: Gerd Hoffman <kraxel@redhat.com>
Cc: Volker Rümelin <vr_qemu@t-online.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20211007130630.632028-2-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agodtc: Update to version 1.6.1
Thomas Huth [Fri, 27 Aug 2021 12:09:01 +0000 (14:09 +0200)]
dtc: Update to version 1.6.1

The dtc submodule is currently pointing to non-release commit. It's nicer
if submodules point to release versions instead and since dtc 1.6.1 is
available now, let's update to that version.

Message-Id: <20210827120901.150276-4-thuth@redhat.com>
Acked-by: Greg Kurz <groug@kaod.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-tcg-20211013' into staging
Richard Henderson [Wed, 13 Oct 2021 18:43:29 +0000 (11:43 -0700)]
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20211013' into staging

Use MO_128 for 16-byte atomic memory operations.
Add cpu_ld/st_mmu memory primitives.
Move helper_ld/st memory helpers out of tcg.h.
Canonicalize alignment flags in MemOp.

# gpg: Signature made Wed 13 Oct 2021 10:48:45 AM PDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* remotes/rth/tags/pull-tcg-20211013:
  tcg: Canonicalize alignment flags in MemOp
  tcg: Move helper_*_mmu decls to tcg/tcg-ldst.h
  target/arm: Use cpu_*_mmu instead of helper_*_mmu
  target/sparc: Use cpu_*_mmu instead of helper_*_mmu
  target/s390x: Use cpu_*_mmu instead of helper_*_mmu
  target/mips: Use 8-byte memory ops for msa load/store
  target/mips: Use cpu_*_data_ra for msa load/store
  accel/tcg: Move cpu_atomic decls to exec/cpu_ldst.h
  accel/tcg: Add cpu_{ld,st}*_mmu interfaces
  target/hexagon: Implement cpu_mmu_index
  target/s390x: Use MO_128 for 16 byte atomics
  target/ppc: Use MO_128 for 16 byte atomics
  target/i386: Use MO_128 for 16 byte atomics
  target/arm: Use MO_128 for 16 byte atomics
  memory: Log access direction for invalid accesses

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-axp-20211013' into staging
Richard Henderson [Wed, 13 Oct 2021 17:37:52 +0000 (10:37 -0700)]
Merge remote-tracking branch 'remotes/rth/tags/pull-axp-20211013' into staging

Cleanup alpha memory ops prior to prctl PR_SET_UNALIGN

# gpg: Signature made Wed 13 Oct 2021 10:34:10 AM PDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* remotes/rth/tags/pull-axp-20211013:
  target/alpha: Reorg integer memory operations
  target/alpha: Reorg fp memory operations

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/alpha: Reorg integer memory operations
Richard Henderson [Sat, 31 Jul 2021 06:15:31 +0000 (20:15 -1000)]
target/alpha: Reorg integer memory operations

Pass in the MemOp instead of a callback.
Drop the fp argument; add a locked argument.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/alpha: Reorg fp memory operations
Richard Henderson [Sat, 31 Jul 2021 05:56:06 +0000 (19:56 -1000)]
target/alpha: Reorg fp memory operations

Pass in the context to each mini-helper, instead of an
incorrectly named "flags".  Separate gen_load_fp and
gen_store_fp, away from the integer helpers.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotcg: Canonicalize alignment flags in MemOp
Richard Henderson [Wed, 4 Aug 2021 05:26:30 +0000 (08:26 +0300)]
tcg: Canonicalize alignment flags in MemOp

Having observed e.g. al8+leq in dumps, canonicalize to al+leq.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotcg: Move helper_*_mmu decls to tcg/tcg-ldst.h
Richard Henderson [Tue, 27 Jul 2021 21:10:22 +0000 (11:10 -1000)]
tcg: Move helper_*_mmu decls to tcg/tcg-ldst.h

These functions have been replaced by cpu_*_mmu as the
most proper interface to use from target code.

Hide these declarations from code that should not use them.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/arm: Use cpu_*_mmu instead of helper_*_mmu
Richard Henderson [Tue, 27 Jul 2021 21:00:20 +0000 (11:00 -1000)]
target/arm: Use cpu_*_mmu instead of helper_*_mmu

The helper_*_mmu functions were the only thing available
when this code was written.  This could have been adjusted
when we added cpu_*_mmuidx_ra, but now we can most easily
use the newest set of interfaces.

Cc: qemu-arm@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/sparc: Use cpu_*_mmu instead of helper_*_mmu
Richard Henderson [Tue, 27 Jul 2021 20:48:09 +0000 (10:48 -1000)]
target/sparc: Use cpu_*_mmu instead of helper_*_mmu

The helper_*_mmu functions were the only thing available
when this code was written.  This could have been adjusted
when we added cpu_*_mmuidx_ra, but now we can most easily
use the newest set of interfaces.

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/s390x: Use cpu_*_mmu instead of helper_*_mmu
Richard Henderson [Tue, 27 Jul 2021 20:32:40 +0000 (10:32 -1000)]
target/s390x: Use cpu_*_mmu instead of helper_*_mmu

The helper_*_mmu functions were the only thing available
when this code was written.  This could have been adjusted
when we added cpu_*_mmuidx_ra, but now we can most easily
use the newest set of interfaces.

Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/mips: Use 8-byte memory ops for msa load/store
Richard Henderson [Tue, 27 Jul 2021 20:15:44 +0000 (10:15 -1000)]
target/mips: Use 8-byte memory ops for msa load/store

Rather than use 4-16 separate operations, use 2 operations
plus some byte reordering as necessary.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agotarget/mips: Use cpu_*_data_ra for msa load/store
Richard Henderson [Tue, 27 Jul 2021 18:57:05 +0000 (08:57 -1000)]
target/mips: Use cpu_*_data_ra for msa load/store

We should not have been using the helper_ret_* set of
functions, as they are supposed to be private to tcg.
Nor should we have been using the plain cpu_*_data set
of functions, as they do not handle unwinding properly.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2 years agoaccel/tcg: Move cpu_atomic decls to exec/cpu_ldst.h
Richard Henderson [Tue, 5 Oct 2021 00:40:58 +0000 (17:40 -0700)]
accel/tcg: Move cpu_atomic decls to exec/cpu_ldst.h

The previous placement in tcg/tcg.h was not logical.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>