[PULL 26/29] libvhost-user: Add extra compiler warnings

2023-01-10 Thread Paolo Bonzini
From: Marcel Holtmann In case libvhost-user is used externally, that projects compiler warnings might be more strict. Enforce an extra set of compiler warnings to catch issues early on. Signed-off-by: Marcel Holtmann Suggested-by: Paolo Bonzini Message-Id: <737ebf2e697f8640558e6f73d96a692711f

[PATCH 08/18] hw/arm: Move units to softmmu[] by replacing "{target -> hw}/arm/cpu.h"

2023-01-10 Thread Philippe Mathieu-Daudé
The following units only require the definitions exposed by "hw/arm/cpu.", not "target/arm/cpu.h": - highbank.c - integratorcp.c - mainstone.c - musicpal.c - palm.c - spitz.c - strongarm.c Once the "target/arm/cpu.h" replaced, we can move the units from meson's arm_ss[] to softmmu_ss[] to

[PATCH 11/18] hw/arm/digic: Remove unnecessary target_long use

2023-01-10 Thread Philippe Mathieu-Daudé
load_image_targphys(), declared in "hw/loader.h", returns a ssize_t. Remove the 'target_long' type which size changes per target. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/digic_boards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/digic_boards.c b/hw/arm/di

[PATCH 17/18] hw/arm/fsl-imx6: Replace object_initialize(ARMCPU) by object_new()

2023-01-10 Thread Philippe Mathieu-Daudé
Replace the ARMCPU field in FslIMX6[UL]State by a reference to an allocated ARMCPU. Instead of initializing the field with object_initialize(), allocate it with object_new(). As we don't access ARMCPU internal fields or size, we can move from arm_ss[] to the more generic softmmu_ss[] the followin

[PATCH 09/18] hw/arm/armv7m: Remove 'target/arm/cpu.h' from NVIC header

2023-01-10 Thread Philippe Mathieu-Daudé
"hw/intc/armv7m_nvic.h" only requires the HW definitions exposed by the "hw/arm/cpu.h" header. Move the "target/arm/cpu.h" header inclusion to armv7m.c which is the single unit requiring it. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/armv7m.c | 2 ++ include/hw/intc/armv7m_n

[PATCH 04/18] hw/arm: Use full "target/arm/cpu.h" path to include target's "cpu.h"

2023-01-10 Thread Philippe Mathieu-Daudé
First we want to introduce a new "cpu.h" header in the "hw/arm/" namespace; second we would like to get rid of '-I target/$ARCH/' in the CPPFLAGS. Use the full path to "cpu.h": "target/arm/cpu.h". Signed-off-by: Philippe Mathieu-Daudé --- include/hw/arm/digic.h | 2 +- include/hw/arm/fsl-im

[PULL 28/29] target/i386: fix operand size of unary SSE operations

2023-01-10 Thread Paolo Bonzini
VRCPSS, VRSQRTSS and VCVTSx2Sx have a 32-bit or 64-bit memory operand, which is represented in the decoding tables by X86_VEX_REPScalar. Add it to the tables, and make validate_vex() handle the case of an instruction that is in exception type 4 without the REP prefix and exception type 5 with it;

Re: [RFC PATCH v1 00/15] Xen PV backend support for KVM/Xen guests

2023-01-10 Thread Joao Martins
On 10/01/2023 16:52, David Woodhouse wrote: > On Tue, 2023-01-10 at 15:43 +, Joao Martins wrote: >> On 10/01/2023 12:37, David Woodhouse wrote: >> The only user of multi-gref mapping is the block xen driver ... and only for >> mapping the shared ring if I understood correctly. But even there yo

[PATCH 18/26] cpu: free cpu->tb_jmp_cache with RCU

2023-01-10 Thread Alex Bennée
From: Emilio Cota Fixes the appended use-after-free. The root cause is that during tb invalidation we use CPU_FOREACH, and therefore to safely free a vCPU we must wait for an RCU grace period to elapse. $ x86_64-linux-user/qemu-x86_64 tests/tcg/x86_64-linux-user/munmap-pthread ==

[PATCH 04/26] tests/unit: drop hacky race avoidance in test-io-channel-command

2023-01-10 Thread Alex Bennée
We don't need to play timing games to ensure one socat wins over the other, just create the fifo they both can use before spawning the processes. However in the process we need to disable two tests for Windows platforms as we don't have an abstraction for mkfifo(). Resolves: https://gitlab.com/qem

[PULL 14/29] enforce use of G_GNUC_PRINTF attributes

2023-01-10 Thread Paolo Bonzini
From: Daniel P. Berrangé We've been very gradually adding G_GNUC_PRINTF annotations to functions over years. This has been useful in detecting certain malformed printf strings, or cases where we pass user data as the printf format which is a potential security flaw. Given the inherant memory cor

[PATCH 15/18] hw/arm/fsl-imx31: Replace object_initialize(ARMCPU) by object_new()

2023-01-10 Thread Philippe Mathieu-Daudé
Replace the ARMCPU field in FslIMX25State by a reference to an allocated ARMCPU. Instead of initializing the field with object_initialize(), allocate it with object_new(). As we don't access ARMCPU internal fields or size, we can move from arm_ss[] to the more generic softmmu_ss[] the followin uni

[PATCH 22/26] plugins: make qemu_plugin_user_exit's locking order consistent with fork_start's

2023-01-10 Thread Alex Bennée
From: Emilio Cota To fix potential deadlocks as reported by tsan. Reviewed-by: Richard Henderson Signed-off-by: Emilio Cota Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230109224954.161672-6-c...@braap.org> Signed-off-by: Alex Bennée --- plugins/core.c | 16 +++- 1 file ch

[PULL 07/29] chardev: clean up chardev-parallel.c

2023-01-10 Thread Paolo Bonzini
Replace HAVE_CHARDEV_PARPORT with a Meson conditional, remove unnecessary defines, and close the file descriptor on FreeBSD/DragonFly. Signed-off-by: Paolo Bonzini --- chardev/char-parallel.c | 15 ++- chardev/meson.build | 5 - include/qemu/osdep.h| 5 - 3 files ch

[PATCH 11/26] lcitool: drop perl from QEMU project/dependencies

2023-01-10 Thread Alex Bennée
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20230110132700.833690-8-marcandre.lur...@redhat.com> Signed-off-by: Alex Bennée --- .gitlab-ci.d/cirrus/freebsd-12.vars | 2 +- .gitlab-ci.d/cirrus/freebsd-13.vars

[PULL 12/29] util/error: add G_GNUC_PRINTF for various functions

2023-01-10 Thread Paolo Bonzini
From: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221219130205.687815-5-berra...@redhat.com> Signed-off-by: Paolo Bonzini --- util/error-report.c | 1 + util/error.c| 1 + 2 files changed, 2 insertions(+) diff --git a/util/e

Re: [PATCH] Makefile: allow 'make uninstall'

2023-01-10 Thread Paolo Bonzini
Queued, thanks. Paolo

[PATCH 21/26] util/qht: use striped locks under TSAN

2023-01-10 Thread Alex Bennée
From: Emilio Cota Fixes this tsan crash, easy to reproduce with any large enough program: $ tests/unit/test-qht 1..2 ThreadSanitizer: CHECK failed: sanitizer_deadlock_detector.h:67 "((n_all_locks_)) < (((sizeof(all_locks_with_contexts_)/sizeof((all_locks_with_contexts_)[0]" (0x40, 0x40) (

[PATCH 00/26] current maintainer trees (testing/semihosting/plugins)

2023-01-10 Thread Alex Bennée
Hi All, I've wrapped up all my maintainer trees into a single branch to minimise the disruption of multiple pull requests. Most stuff has already been reviewed but in short we have: - some cleanups and tweaks for gitlab - a new playbook to install gitlab runners - a proposed re-org of the f

[PATCH 14/26] semihosting: add O_BINARY flag in host_open for NT compatibility

2023-01-10 Thread Alex Bennée
From: Evgeny Iakovlev Windows open(2) implementation opens files in text mode by default and needs a Windows-only O_BINARY flag to open files as binary. QEMU already knows about that flag in osdep and it is defined to 0 on non-Windows, so we can just add it to the host_flags for better compatibil

[PATCH 05/18] target/arm: Move CPU QOM type definitions to "hw/arm/cpu.h"

2023-01-10 Thread Philippe Mathieu-Daudé
Units including "target/arm/cpu.h" can't be built once via meson's softmmu_ss[] source set. Since this header depends on specific definitions such the word size (32 or 64-bit), for ARM such units must go to the per-target arm_ss[]. We want to expose few architectural definitions to hardware models

[PATCH 1/2] Revert "linux-user: add more compat ioctl definitions"

2023-01-10 Thread Daniel P . Berrangé
This reverts commit c5495f4ecb0cdaaf2e9dddeb48f1689cdb520ca0. glibc has fixed (in 2.36.9000-40-g774058d729) the problem that caused a clash when both sys/mount.h annd linux/mount.h are included, and backported this to the 2.36 stable release too: https://sourceware.org/glibc/wiki/Release/2.36#

[PATCH 23/26] plugins: fix optimization in plugin_gen_disable_mem_helpers

2023-01-10 Thread Alex Bennée
From: Emilio Cota We were mistakenly checking tcg_ctx->plugin_insn as a canary to know whether the TB had emitted helpers that might have accessed memory. The problem is that tcg_ctx->plugin_insn gets updated on every instruction in the TB, which results in us wrongly performing the optimization

[PATCH 19/26] util/qht: add missing atomic_set(hashes[i])

2023-01-10 Thread Alex Bennée
From: Emilio Cota We forgot to add this one in "a890643958 util/qht: atomically set b->hashes". Detected with tsan. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Emilio Cota Reviewed-by: Alex Bennée Message-Id: <20230109224954.161672-3-c...@braap.org> Sig

[PATCH 07/26] configure: replace Perl usage with sed

2023-01-10 Thread Alex Bennée
From: Marc-André Lureau Let's try to reduce our Perl usage during config/build-time. Note: this patch might be dropped if "configure: remove backwards-compatibility code" is merged earlier. Signed-off-by: Marc-André Lureau Tested-by: Thomas Huth Message-Id: <20230110132700.833690-4-marcandre.

[PATCH 08/26] meson: replace Perl usage with Python

2023-01-10 Thread Alex Bennée
From: Marc-André Lureau Let's try to remove Perl usage during build time. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20230110132700.833690-5-marcandre.lur...@redhat.com> Signed-off-by: Alex Bennée --- tests/qapi-schema/meson.build | 7 --- 1 file change

[PATCH 0/2] linux-user: revert previous workaround for glibc >= 2.36

2023-01-10 Thread Daniel P . Berrangé
It didn't appear that glibc was going to fix the problem breaking includes of linux/mount.h vs sys/mount.h, so QEMU applied a workaround copying the symbols/structs we need into a local header. Since then Linux modified linux/btrfs.h to pull in linux/fs.h which caused a clash with our workaround.

[PATCH 16/26] semihosting: add semihosting section to the docs

2023-01-10 Thread Alex Bennée
The main reason to do this is to document our O_BINARY implementation decision somewhere. However I've also moved some of the implementation details out of qemu-options and added links between the two. As a bonus I've highlighted the scary warnings about host access with the appropriate RST tags.

[PATCH 2/2] Revert "linux-user: fix compat with glibc >= 2.36 sys/mount.h"

2023-01-10 Thread Daniel P . Berrangé
This reverts commit 3cd3df2a9584e6f753bb62a0028bd67124ab5532. glibc has fixed (in 2.36.9000-40-g774058d729) the problem that caused a clash when both sys/mount.h annd linux/mount.h are included, and backported this to the 2.36 stable release too: https://sourceware.org/glibc/wiki/Release/2.36#

[PULL 13/29] tests: add G_GNUC_PRINTF for various functions

2023-01-10 Thread Paolo Bonzini
From: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé Message-Id: <20221219130205.687815-6-berra...@redhat.com> Signed-off-by: Paolo Bonzini --- tests/qtest/ahci-test.c | 3 +++ tests/qtest/arm-cpu-features.c| 1 + tests/qtest/erst-test.c | 2 +- tests/qtest/ide

Re: make vm-build-freebsd appears to require . in PATH

2023-01-10 Thread Peter Maydell
On Tue, 10 Jan 2023 at 16:26, Markus Armbruster wrote: > Peter Maydell writes: > > Does it actually require '.' on the PATH, or does it just want > > a qemu-img binary on the PATH? (eg your distro one in /usr/bin). > > I don't have '.' on my PATH and it works for me. > > Do we want to use qemu-im

Re: [PULL 08/29] gitlab: remove redundant setting of PKG_CONFIG_PATH

2023-01-10 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 05:02:12PM +0100, Paolo Bonzini wrote: > From: Daniel P. Berrang?? > > The PKG_CONFIG_PATH variable is not defined in GitLab CI > envs and even if it was, we don't need to set it to its > existing value. > > Signed-off-by: Daniel P. Berrang?? This has mangled my name -

[PATCH 06/26] .gitlab-ci.d/windows: do not disable opengl

2023-01-10 Thread Alex Bennée
From: Marc-André Lureau The previous patch should fix shader compilation. Signed-off-by: Marc-André Lureau Reviewed-by: Thomas Huth Message-Id: <20230110132700.833690-3-marcandre.lur...@redhat.com> Signed-off-by: Alex Bennée --- .gitlab-ci.d/windows.yml | 5 ++--- 1 file changed, 2 insertion

Re: [PATCH 12/18] hw/arm/digic: Replace object_initialize(ARMCPU) by object_new(ARMCPU)

2023-01-10 Thread Peter Maydell
On Tue, 10 Jan 2023 at 16:45, Philippe Mathieu-Daudé wrote: > > Replace the ARMCPU field in DigicState by a reference to > an allocated ARMCPU. Instead of initializing the field > with object_initialize(), allocate it with object_new(). > > As we don't access ARMCPU internal fields or size, we can

[PATCH 00/18] hw/arm: Move various objects to softmmu_ss to build them once (part 1)

2023-01-10 Thread Philippe Mathieu-Daudé
Hi, This series unifies various objects from libqemu-arm-softmmu.fa.p and libqemu-aarch64-softmmu.fa.p into libcommon.fa.p. So instead of building each object twice, one for 32-bit ARM ARM and another for 64-bit Aarch64, hardware-related objects are built once. Part #1 is the low hanging fruits

[PATCH 25/26] tcg: exclude lookup_tb_ptr from helper instrumentation

2023-01-10 Thread Alex Bennée
From: Emilio Cota It is internal to TCG and therefore we know it does not access guest memory. Related: #1381 Signed-off-by: Emilio Cota Message-Id: <20230108164731.61469-4-c...@braap.org> Signed-off-by: Alex Bennée --- tcg/tcg.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) d

[PATCH 10/18] hw/arm: Move various armv7m-related units to softmmu_ss[]

2023-01-10 Thread Philippe Mathieu-Daudé
In the previous commit we remove the indirect dependency on "target/arm/cpu.h" from all these ARMv7-M units: - armsse.c - msf2-som.c - microbit.c - mps2-tz.c - mps2.c - msf2-soc.c - musca.c - netduino2.c - netduinoplus2.c - nrf51_soc.c - stellaris.c - stm32f100_soc.c - stm32f205_soc.c

Re: [PATCH v2 0/3] python/qemu/machine: fix potential hang in QMP accept

2023-01-10 Thread John Snow
On Tue, Jan 10, 2023 at 2:05 AM Marc-André Lureau wrote: > > Hi John > > On Tue, Jan 10, 2023 at 1:06 AM John Snow wrote: > > > > On Mon, Jul 25, 2022 at 7:23 AM Marc-André Lureau > > wrote: > > > > > > Hi > > > > > > On Fri, Jul 1, 2022 at 2:51 AM John Snow wrote: > > >> > > >> On Thu, Jun 30,

[PATCH 02/26] gitlab: add FF_SCRIPT_SECTIONS for timings

2023-01-10 Thread Alex Bennée
From: Mark Cave-Ayland Suggested-by: Mark Cave-Ayland Signed-off-by: Alex Bennée --- .gitlab-ci.d/base.yml | 5 + 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml index 69b36c148a..50fb59e147 100644 --- a/.gitlab-ci.d/base.yml +++ b/.gitlab-ci.d/b

[PATCH 09/26] docs: drop texinfo options

2023-01-10 Thread Alex Bennée
From: Marc-André Lureau It looks like this is no longer wanted, we only build the html output. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20230110132700.833690-6-marcandre.lur...@redhat.com> Signed-off-by: Alex Bennée --- docs/conf.py | 13 - 1

Re: [PULL 00/51] virtio,pc,pci: features, cleanups, fixes

2023-01-10 Thread Markus Armbruster
Markus Armbruster writes: > "Michael S. Tsirkin" writes: > >> On Fri, Jan 06, 2023 at 03:29:01PM +, Peter Maydell wrote: >>> On Thu, 5 Jan 2023 at 21:53, Michael S. Tsirkin wrote: >>> > >>> > On Thu, Jan 05, 2023 at 09:04:37PM +, Peter Maydell wrote: > > [...] > >>> > > Compile failures

[PATCH 20/26] thread: de-const qemu_spin_destroy

2023-01-10 Thread Alex Bennée
From: Emilio Cota Signed-off-by: Emilio Cota Reviewed-by: Alex Bennée Message-Id: <20230109224954.161672-4-c...@braap.org> Signed-off-by: Alex Bennée --- include/qemu/thread.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/qemu/thread.h b/include/qemu/thread.

[PATCH 26/26] cpu-exec: assert that plugin_mem_cbs is NULL after execution

2023-01-10 Thread Alex Bennée
From: Emilio Cota Fixes: #1381 Signed-off-by: Emilio Cota Message-Id: <20230108165107.62488-1-c...@braap.org> [AJB: manually applied follow-up fix] Signed-off-by: Alex Bennée --- include/qemu/plugin.h | 4 accel/tcg/cpu-exec.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/inclu

[PULL 09/29] disas: add G_GNUC_PRINTF to gstring_printf

2023-01-10 Thread Paolo Bonzini
From: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé Message-Id: <20221219130205.687815-2-berra...@redhat.com> Signed-off-by: Paolo Bonzini --- disas.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/disas.c b/disas.c index 94d3b4504260..3b31315f4038 100644 --- a/di

[PATCH 12/26] lcitool: drop texinfo from QEMU project/dependencies

2023-01-10 Thread Alex Bennée
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20230110132700.833690-9-marcandre.lur...@redhat.com> Signed-off-by: Alex Bennée --- .gitlab-ci.d/cirrus/freebsd-12.vars | 2 +- .gitlab-ci.d/cirrus/freebsd-13.vars

[PULL 10/29] hw/xen: use G_GNUC_PRINTF/SCANF for various functions

2023-01-10 Thread Paolo Bonzini
From: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé Acked-by: Anthony PERARD Message-Id: <20221219130205.687815-3-berra...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/xen/xen-bus.c| 1 + hw/xen/xen_pvdev.c | 1 + include/hw/xen/xen-bus-helper.h | 6

[PATCH 17/26] tests/tcg: add memory-sve test for aarch64

2023-01-10 Thread Alex Bennée
This will be helpful in debugging problems with tracking SVE memory accesses via the TCG plugins system. Signed-off-by: Alex Bennée Cc: Robert Henry Cc: Aaron Lindsay --- tests/tcg/aarch64/Makefile.softmmu-target | 7 +++ tests/tcg/aarch64/system/boot.S | 3 ++- 2 files changed,

Re: [PATCH] Makefile: allow 'make uninstall'

2023-01-10 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 03:13:18PM +, Peter Maydell wrote: > Meson supports an "uninstall", so we can easily allow it to work by > not suppressing the forwarding of it from Make to meson. > > We originally suppressed this because Meson's 'uninstall' has a hole > in it: it will remove everythin

[PATCH 18/18] hw/arm/allwinner: Replace object_initialize(ARMCPU) by object_new()

2023-01-10 Thread Philippe Mathieu-Daudé
Replace the ARMCPU field in both AwA10State / AwH3State by a reference to an allocated ARMCPU. Instead of initializing the field with object_initialize(), allocate it with object_new(). As we don't access ARMCPU internal fields or size, we can move from arm_ss[] to the more generic softmmu_ss[] th

Re: [PATCH] python: QEMUMachine: enable qmp accept timeout by default

2023-01-10 Thread John Snow
On Tue, Jan 10, 2023, 3:53 AM Vladimir Sementsov-Ogievskiy < vsement...@yandex-team.ru> wrote: > On 7/12/22 00:21, John Snow wrote: > > On Mon, Jul 11, 2022 at 5:16 PM John Snow wrote: > >> > >> On Fri, Jun 24, 2022 at 3:53 PM Vladimir Sementsov-Ogievskiy > >> wrote: > >>> > >>> I've spent much

[PATCH 05/26] build-sys: fix crlf-ending C code

2023-01-10 Thread Alex Bennée
From: Marc-André Lureau On msys2, the shader-to-C script produces bad C: ./ui/shader/texture-blit-vert.h:2:5: error: missing terminating " character [-Werror] Fix it by changing the line ending from crlf to lf, and convert the script to Python (qemu build seems perl-free after that). Signed-of

[PULL 01/29] configure: fix GLIB_VERSION for cross-compilation

2023-01-10 Thread Paolo Bonzini
configure uses "pkg-config" directly so that GLIB_VERSION is always based on host glib version. To correctly handle cross-compilation it should use "$pkg_config" and take GLIB_VERSION from the cross-compiled glib. Reported-by: Валентин Resolves: https://gitlab.com/qemu-project/qemu/-/issues/141

Re: intermittent hang, s390x host, bios-tables-test test, TPM

2023-01-10 Thread Stefan Berger
On 1/6/23 10:16, Stefan Berger wrote: On 1/6/23 07:10, Peter Maydell wrote: I'm seeing an intermittent hang on the s390 CI runner in the bios-tables-test test. It looks like we've deadlocked because:   * the TPM device is waiting for data on its socket that never arrives,     and it's hold

Re: [PATCH] python: QEMUMachine: enable qmp accept timeout by default

2023-01-10 Thread John Snow
On Tue, Jan 10, 2023 at 12:06 PM John Snow wrote: > > > > On Tue, Jan 10, 2023, 3:53 AM Vladimir Sementsov-Ogievskiy > wrote: >> >> On 7/12/22 00:21, John Snow wrote: >> > On Mon, Jul 11, 2022 at 5:16 PM John Snow wrote: >> >> >> >> On Fri, Jun 24, 2022 at 3:53 PM Vladimir Sementsov-Ogievskiy >

Re: [PATCH] Makefile: allow 'make uninstall'

2023-01-10 Thread Thomas Huth
On 10/01/2023 16.13, Peter Maydell wrote: Meson supports an "uninstall", so we can easily allow it to work by not suppressing the forwarding of it from Make to meson. We originally suppressed this because Meson's 'uninstall' has a hole in it: it will remove everything that is installed by a mech

[PATCH 13/26] semihosting: Write back semihosting data before completion callback

2023-01-10 Thread Alex Bennée
From: Keith Packard 'lock_user' allocates a host buffer to shadow a target buffer, 'unlock_user' copies that host buffer back to the target and frees the host memory. If the completion function uses the target buffer, it must be called after unlock_user to ensure the data are present. This cause

Re: Postcopy migration failed with "qemu-system-x86_64: postcopy_ram_listen_thread: loadvm failed: -5"

2023-01-10 Thread Dr. David Alan Gilbert
* Kei IKEDA (s2280...@st.go.tuat.ac.jp) wrote: > Hi! > > I am experimenting with post-copy by modifying qemu-6.0.0 in my research. > I transfer a VM between two machines but it fails most of the time with > these error messages. > > ``` > qemu-system-x86_64: postcopy_ram_listen_thread: loadvm fai

[PATCH 24/26] translator: always pair plugin_gen_insn_{start, end} calls

2023-01-10 Thread Alex Bennée
From: Emilio Cota Related: #1381 Signed-off-by: Emilio Cota Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230108164731.61469-3-c...@braap.org> Signed-off-by: Alex Bennée --- accel/tcg/translator.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/accel

[PATCH v6 48/51] i386/xen: handle HVMOP_get_param

2023-01-10 Thread David Woodhouse
From: Joao Martins Which is used to fetch xenstore PFN and port to be used by the guest. This is preallocated by the toolstack when guest will just read those and use it straight away. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 39 ++

[PULL 02/29] i386: Emit correct error code for 64-bit IDT entry

2023-01-10 Thread Paolo Bonzini
From: Joe Richey When in 64-bit mode, IDT entiries are 16 bytes, so `intno * 16` is used for base/limit/offset calculations. However, even in 64-bit mode, the exception error code still uses bits [3,16) for the invlaid interrupt index. This means the error code should still be `intno * 8 + 2` ev

Re: [PULL 06/29] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2023-01-10 Thread Eric Auger
Hi Paolo, On 1/10/23 17:02, Paolo Bonzini wrote: > From: Eric Auger > > To avoid compilation errors when -Werror=maybe-uninitialized is used, > replace 'case 3' by 'default'. > > Otherwise we get: > > ../target/i386/ops_sse.h: In function ‘helper_vpermdq_ymm’: > ../target/i386/ops_sse.h:2495:

Re: [PATCH] Makefile: allow 'make uninstall'

2023-01-10 Thread Christian Borntraeger
Am 10.01.23 um 16:13 schrieb Peter Maydell: Meson supports an "uninstall", so we can easily allow it to work by not suppressing the forwarding of it from Make to meson. We originally suppressed this because Meson's 'uninstall' has a hole in it: it will remove everything that is installed by a me

Re: [PATCH v4 04/11] iotests: QemuStorageDaemon: add cmd() method like in QEMUMachine.

2023-01-10 Thread John Snow
On Tue, Jan 10, 2023 at 3:38 AM Vladimir Sementsov-Ogievskiy wrote: > > Add similar method for consistency. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-iotests/iotests.py | 4 > 1 file changed, 4 insertions(+) > > diff --git a/tests/qemu-iotests/iotests.py b/tests/qem

[PATCH 10/26] Update lcitool and fedora to 37

2023-01-10 Thread Alex Bennée
From: Marc-André Lureau Fedora 35 is EOL. Update to upstream lcitool, that dropped f35 and added f37. Signed-off-by: Marc-André Lureau Reviewed-by: Thomas Huth Message-Id: <20230110132700.833690-7-marcandre.lur...@redhat.com> Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/fedora-wi

Re: [PATCH qemu v3] x86: don't let decompressed kernel image clobber setup_data

2023-01-10 Thread Michael S. Tsirkin
On Tue, Jan 10, 2023 at 04:34:49PM +0100, Jason A. Donenfeld wrote: > Hi Michael, > > Could you queue up this patch and mark it as a fix for 7.2.1? It is a > straight-up bug fix for a 7.2 regression that's now affected several > users. OK. In the future pls cc me if you want me to merge a patch.

[PULL 03/29] accel: introduce accelerator blocker API

2023-01-10 Thread Paolo Bonzini
From: Emanuele Giuseppe Esposito This API allows the accelerators to prevent vcpus from issuing new ioctls while execting a critical section marked with the accel_ioctl_inhibit_begin/end functions. Note that all functions submitting ioctls must mark where the ioctl is being called with accel_{cp

[RFC PATCH v1 05/15] hw/xen: Add foreignmem operations to allow redirection to internal emulation

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Signed-off-by: Paul Durrant --- hw/char/xen_console.c| 8 ++-- hw/display/xenfb.c | 20 +- hw/xen/xen-operations.c | 63 include/hw/xen/xen_backend_ops.h | 26 +

[PATCH v6 37/51] hw/xen: Implement EVTCHNOP_reset

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 29 + hw/i386/kvm/xen_evtchn.h | 3 +++ target/i386/kvm/xen-emu.c | 17 + 3 files changed, 49 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen

[PATCH v6 31/51] hw/xen: Implement EVTCHNOP_bind_virq

2023-01-10 Thread David Woodhouse
From: David Woodhouse Add the array of virq ports to each vCPU so that we can deliver timers, debug ports, etc. Global virqs are allocated against vCPU 0 initially, but can be migrated to other vCPUs (when we implement that). The kernel needs to know about VIRQ_TIMER in order to accelerate timer

Re: intermittent hang, s390x host, bios-tables-test test, TPM

2023-01-10 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 01:50:26PM -0500, Stefan Berger wrote: > > > On 1/6/23 10:16, Stefan Berger wrote: >> This here seems to be the root cause. An unknown control channel >> command was received from the TPM emulator backend by the control channel >> thread and we end up in g_assert_not_reac

Re: intermittent hang, s390x host, bios-tables-test test, TPM

2023-01-10 Thread Daniel P . Berrangé
On Fri, Jan 06, 2023 at 03:39:31PM +, Peter Maydell wrote: > On Fri, 6 Jan 2023 at 15:16, Stefan Berger wrote: > > > > > > > > On 1/6/23 07:10, Peter Maydell wrote: > > > I'm seeing an intermittent hang on the s390 CI runner in the > > > bios-tables-test test. It looks like we've deadlocked be

[PATCH 03/26] gitlab: just use plain --cc=clang for custom runner build

2023-01-10 Thread Alex Bennée
I think this was because older Ubuntu's didn't alias clang to whatever the latest version was. They do now so lets use that and not break. Signed-off-by: Alex Bennée --- .gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitl

[PATCH 01/26] scripts/ci: update gitlab-runner playbook to use latest runner

2023-01-10 Thread Alex Bennée
We were using quite and old runner on our machines and running into issues with stalling jobs. Gitlab in the meantime now reliably provide the latest packaged versions of the runner under a stable URL. This update: - creates a per-arch subdir for builds - switches from binary tarballs to deb p

Re: intermittent hang, s390x host, bios-tables-test test, TPM

2023-01-10 Thread Daniel P . Berrangé
On Fri, Jan 06, 2023 at 10:16:36AM -0500, Stefan Berger wrote: > > > On 1/6/23 07:10, Peter Maydell wrote: > > I'm seeing an intermittent hang on the s390 CI runner in the > > bios-tables-test test. It looks like we've deadlocked because: > > > > * the TPM device is waiting for data on its soc

Re: intermittent hang, s390x host, bios-tables-test test, TPM

2023-01-10 Thread Stefan Berger
On 1/10/23 14:27, Daniel P. Berrangé wrote: On Tue, Jan 10, 2023 at 01:50:26PM -0500, Stefan Berger wrote: On 1/6/23 10:16, Stefan Berger wrote: This here seems to be the root cause. An unknown control channel command was received from the TPM emulator backend by the control channel threa

Re: [PATCH 1/1] hw/arm/sbsa-ref.c: Start APs powered off

2023-01-10 Thread Rebecca Cran
On 1/5/23 10:34, Peter Maydell wrote: This board disables QEMU's own PSCI implementation and relies on a guest EL3 firmware to provide PSCI. So how will that EL3 firmware implement the "power on" to bring up the secondaries? QEMU has the APIs to allow implementation of a model of a hardware powe

Re: [RFC] Reducing NEED_CPU_H usage

2023-01-10 Thread Richard Henderson
On 12/28/22 08:16, Alessandro Di Federico wrote: ## `target_ulong` `target_ulong` is `uint32_t` in 32-bit targets and `uint64_t` in 64-bit targets. Problem: This is used in many many places to represent addresses in code that could become target-independent. Proposed solution: we can convert i

Re: [PATCH v3 1/6] migration: Allow immutable device state to be migrated early (i.e., before RAM)

2023-01-10 Thread Peter Xu
On Tue, Jan 10, 2023 at 12:52:32PM +0100, David Hildenbrand wrote: > The following seems to work, That looks much better at least from the diffstat pov (comparing to the existing patch 1+5 and the framework changes), thanks. > but makes analyze-migration.py angry: > > $ ./scripts/analyze-migrati

[PATCH 1/2] target/riscv/cpu: set cpu->cfg in register_cpu_props()

2023-01-10 Thread Daniel Henrique Barboza
There is an informal contract between the cpu_init() functions and riscv_cpu_realize(): if cpu->env.misa_ext is zero, assume that the default settings were loaded via register_cpu_props() and do validations to set env.misa_ext. If it's not zero, skip this whole process and assume that the board so

[PATCH 0/2] target/riscv/cpu: fix sifive_u 32/64bits boot in riscv-to-apply.next

2023-01-10 Thread Daniel Henrique Barboza
Hi, I found this bug when testing my avocado changes in riscv-to-apply.next. The sifive_u board, both 32 and 64 bits, stopped booting OpenSBI. The guest hangs indefinitely. Git bisect points that this patch broke things: 8c3f35d25e7e98655c609b6c1e9f103b9240f8f8 is the first bad commit commit 8c3

[PATCH 2/2] target/riscv/cpu.c: do not skip misa logic in riscv_cpu_realize()

2023-01-10 Thread Daniel Henrique Barboza
All RISCV CPUs are setting cpu->cfg during their cpu_init() functions, meaning that there's no reason to skip all the misa validation and setup if misa_ext was set beforehand - especially since we're setting an updated value in set_misa() in the end. Put this code chunk into a new riscv_cpu_valida

Re: [PATCH v5 10/11] hw/riscv/boot.c: consolidate all kernel init in riscv_load_kernel()

2023-01-10 Thread Daniel Henrique Barboza
On 1/10/23 08:43, Daniel Henrique Barboza wrote: On 1/8/23 00:33, Bin Meng wrote: On Mon, Jan 2, 2023 at 7:55 PM Daniel Henrique Barboza wrote: The microchip_icicle_kit, sifive_u, spike and virt boards are now doing the same steps when '-kernel' is used: - execute load_kernel() - load in

Re: [PATCH v2 4/5] util/qht: use striped locks under TSAN

2023-01-10 Thread Alex Bennée
Emilio Cota writes: > Fixes this tsan crash, easy to reproduce with any large enough program: > > $ tests/unit/test-qht > 1..2 > ThreadSanitizer: CHECK failed: sanitizer_deadlock_detector.h:67 > "((n_all_locks_)) < > (((sizeof(all_locks_with_contexts_)/sizeof((all_locks_with_contexts_)[0]

[PATCH] bulk: Rename TARGET_FMT_plx -> HWADDR_FMT_plx

2023-01-10 Thread Philippe Mathieu-Daudé
The 'hwaddr' type is defined in "exec/hwaddr.h" as: hwaddr is the type of a physical address (its size can be different from 'target_ulong'). All definitions use the 'HWADDR_' prefix, except TARGET_FMT_plx: $ fgrep define include/exec/hwaddr.h #define HWADDR_H #define HWADDR_BITS 64 #

Re: intermittent hang, s390x host, bios-tables-test test, TPM

2023-01-10 Thread Stefan Berger
On 1/10/23 14:47, Stefan Berger wrote: On 1/10/23 14:27, Daniel P. Berrangé wrote: On Tue, Jan 10, 2023 at 01:50:26PM -0500, Stefan Berger wrote: On 1/6/23 10:16, Stefan Berger wrote: This here seems to be the root cause. An unknown control channel command was received from the TPM emul

Re: [PATCH] bulk: Rename TARGET_FMT_plx -> HWADDR_FMT_plx

2023-01-10 Thread BALATON Zoltan
On Tue, 10 Jan 2023, Philippe Mathieu-Daudé wrote: The 'hwaddr' type is defined in "exec/hwaddr.h" as: hwaddr is the type of a physical address (its size can be different from 'target_ulong'). All definitions use the 'HWADDR_' prefix, except TARGET_FMT_plx: $ fgrep define include/exec/hwa

Re: [PULL 00/29] Misc patches for 2023-01-10

2023-01-10 Thread Peter Maydell
On Tue, 10 Jan 2023 at 18:29, Paolo Bonzini wrote: > > The following changes since commit 3d83b78285d6e96636130f7d449fd02e2d4deee0: > > Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging > (2023-01-08 14:27:40 +) > > are available in the Git repository at: > > https:

Re: intermittent hang, s390x host, bios-tables-test test, TPM

2023-01-10 Thread Peter Maydell
On Tue, 10 Jan 2023 at 19:25, Daniel P. Berrangé wrote: > > On Fri, Jan 06, 2023 at 03:39:31PM +, Peter Maydell wrote: > > Yeah. It would be good if we didn't deadlock without printing > > the assertion, though... > > > > I guess we could improve qtest_kill_qemu() so it doesn't wait > > indefi

Re: [PATCH v7 1/7] input/adb: Only include header where needed

2023-01-10 Thread Mark Cave-Ayland
On 04/01/2023 21:59, BALATON Zoltan wrote: The header hw/input/adb.h is included by some files that don't need it. Clean it up and include only where necessary. Signed-off-by: BALATON Zoltan --- hw/misc/macio/cuda.c | 2 -- hw/misc/macio/pmu.c | 3 --- hw/misc/mos6522.c

Re: [PATCH v7 2/7] mac_{old, new}world: Use local variable instead of qdev_get_machine()

2023-01-10 Thread Mark Cave-Ayland
On 04/01/2023 21:59, BALATON Zoltan wrote: We already have machine in a local variable so no need to use qdev_get_machine(), also remove now unneded line break. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 3 +-- hw/ppc/mac_oldworld.c | 3 +-- 2 files changed, 2 insertions(+),

Re: [PATCH v7 3/7] mac_{old,new}world: Pass MacOS VGA NDRV in card ROM instead of fw_cfg

2023-01-10 Thread Mark Cave-Ayland
On 04/01/2023 21:59, BALATON Zoltan wrote: OpenBIOS cannot run FCode ROMs yet but it can detect NDRV in VGA card ROM and add it to the device tree for MacOS. Pass the NDRV this way instead of via fw_cfg. This solves the problem with OpenBIOS also adding the NDRV to ati-vga which it does not work

Re: [PATCH 0/2] target/riscv/cpu: fix sifive_u 32/64bits boot in riscv-to-apply.next

2023-01-10 Thread Daniel Henrique Barboza
Hi, I mentioned that the bug were found in riscv-to-apply.next but forgot to mentioned that the patches were also based on top of it as well: https://github.com/alistair23/qemu/tree/riscv-to-apply.next Thanks, Daniel On 1/10/23 17:14, Daniel Henrique Barboza wrote: Hi, I found this bug wh

Re: [PATCH v5 01/11] tests/avocado: add RISC-V OpenSBI boot test

2023-01-10 Thread Alistair Francis
On Mon, Jan 2, 2023 at 9:53 PM Daniel Henrique Barboza wrote: > > This test is used to do a quick sanity check to ensure that we're able > to run the existing QEMU FW image. > > 'sifive_u', 'spike' and 'virt' riscv64 machines, and 'sifive_u' and > 'virt' 32 bit machines are able to run the default

Re: [PATCH v5 04/11] hw/riscv/boot.c: exit early if filename is NULL in load functions

2023-01-10 Thread Alistair Francis
On Mon, Jan 2, 2023 at 9:54 PM Daniel Henrique Barboza wrote: > > riscv_load_firmware(), riscv_load_initrd() and riscv_load_kernel() works > under the assumption that a 'filename' parameter is always not NULL. > > This is currently the case since all callers of these functions are > checking for N

Re: [PATCH v5 06/11] hw/riscv: write initrd 'chosen' FDT inside riscv_load_initrd()

2023-01-10 Thread Alistair Francis
On Mon, Jan 2, 2023 at 9:54 PM Daniel Henrique Barboza wrote: > > riscv_load_initrd() returns the initrd end addr while also writing a > 'start' var to mark the addr start. These informations are being used > just to write the initrd FDT node. Every existing caller of > riscv_load_initrd() is writ

Re: [PATCH v5 07/11] hw/riscv: write bootargs 'chosen' FDT after riscv_load_kernel()

2023-01-10 Thread Alistair Francis
On Mon, Jan 2, 2023 at 9:55 PM Daniel Henrique Barboza wrote: > > The sifive_u, spike and virt machines are writing the 'bootargs' FDT > node during their respective create_fdt(). > > Given that bootargs is written only when '-append' is used, and this > option is only allowed with the '-kernel' o

Re: [PATCH v5 08/11] hw/riscv/boot.c: use MachineState in riscv_load_initrd()

2023-01-10 Thread Alistair Francis
On Mon, Jan 2, 2023 at 9:55 PM Daniel Henrique Barboza wrote: > > 'filename', 'mem_size' and 'fdt' from riscv_load_initrd() can all be > retrieved by the MachineState object for all callers. > > Cc: Palmer Dabbelt > Signed-off-by: Daniel Henrique Barboza > Reviewed-by: Philippe Mathieu-Daudé >

Re: [PATCH v5 09/11] hw/riscv/boot.c: use MachineState in riscv_load_kernel()

2023-01-10 Thread Alistair Francis
On Mon, Jan 2, 2023 at 9:55 PM Daniel Henrique Barboza wrote: > > All callers are using kernel_filename as machine->kernel_filename. > > This will also simplify the changes in riscv_load_kernel() that we're > going to do next. > > Cc: Palmer Dabbelt > Signed-off-by: Daniel Henrique Barboza > Rev

Re: [PATCH v5 11/11] hw/riscv/boot.c: make riscv_load_initrd() static

2023-01-10 Thread Alistair Francis
On Mon, Jan 2, 2023 at 9:57 PM Daniel Henrique Barboza wrote: > > The only remaining caller is riscv_load_kernel_and_initrd() which > belongs to the same file. > > Signed-off-by: Daniel Henrique Barboza > Reviewed-by: Philippe Mathieu-Daudé > Reviewed-by: Bin Meng Reviewed-by: Alistair Francis

Re: [PATCH v5 10/11] hw/riscv/boot.c: consolidate all kernel init in riscv_load_kernel()

2023-01-10 Thread Alistair Francis
On Mon, Jan 2, 2023 at 9:55 PM Daniel Henrique Barboza wrote: > > The microchip_icicle_kit, sifive_u, spike and virt boards are now doing > the same steps when '-kernel' is used: > > - execute load_kernel() > - load init_rd() > - write kernel_cmdline > > Let's fold everything inside riscv_load_ker

<    1   2   3   4   >