[PATCH 3/3] tests/qemu-iotests/197: add testcase for CoR with subclusters

2023-06-26 Thread Andrey Drobyshev via
Add testcase which checks that allocations during copy-on-read are performed on the subcluster basis when subclusters are enabled in target image. This testcase also triggers the following assert with previous commit not being applied, so we check that as well: qemu-io: ../block/io.c:1236: bdrv_c

[RESEND PATCH v5 4/5] tests/qtest/hd-geo-test: fix incorrect pcie-root-port usage and simplify test

2023-06-26 Thread Ani Sinha
The test attaches a SCSI controller to a non-zero slot and a pcie-to-pci bridge on slot 0 on the same pcie-root-port. Since a downstream device can be attached to a pcie-root-port only on slot 0, the above test configuration is not allowed. Additionally using pcie.0 as id for pcie-root-port is inco

[RESEND PATCH v5 0/5] test and QEMU fixes to ensure proper PCIE device usage

2023-06-26 Thread Ani Sinha
Patches 1-4: Fix tests so that devices do not use non-zero slots on the pcie root ports. PCIE ports only have one slot, so PCIE devices can only be plugged into slot 0 on a PCIE port. Patch 5: Enforce only one slot on PCIE port. The test fixes must be applied before the QEMU change that checks fo

[RESEND PATCH v5 3/5] tests/acpi/bios-tables-test: update acpi blob q35/DSDT.noacpihp

2023-06-26 Thread Ani Sinha
Some fixes were committed in bios-tables-test in the previous commit. Update the acpi blob and clear bios-tables-test-allowed-diff.h so that the test continues to pass with the changes in the bios-tables-test. Following is the asl diff between the old and the newly updated blob: @@ -1,30 +1,30 @@

[RESEND PATCH v5 2/5] tests/acpi/bios-tables-test: use the correct slot on the pcie-root-port

2023-06-26 Thread Ani Sinha
PCIE ports only have one slot, slot 0. Hence, non-zero slots are not available for PCIE devices on PCIE root ports. Fix test_acpi_q35_tcg_no_acpi_hotplug() so that the test does not use them. Signed-off-by: Ani Sinha Reviewed-by: Igor Mammedov --- tests/qtest/bios-tables-test.c | 4 ++-- 1 file

[RESEND PATCH v5 5/5] hw/pci: ensure PCIE devices are plugged into only slot 0 of PCIE port

2023-06-26 Thread Ani Sinha
PCI Express ports only have one slot, so PCI Express devices can only be plugged into slot 0 on a PCIE port. Enforce it. CC: jus...@redhat.com CC: imamm...@redhat.com Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2128929 Signed-off-by: Ani Sinha Reviewed-by: Julia Suvorova --- hw/pci/pc

[RESEND PATCH v5 1/5] tests/acpi: allow changes in DSDT.noacpihp table blob

2023-06-26 Thread Ani Sinha
We are going to fix bio-tables-test in the next patch and hence need to make sure the acpi tests continue to pass. Signed-off-by: Ani Sinha Acked-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-al

Re: [PULL v2 1/3] target/hppa: Fix OS reboot issues

2023-06-26 Thread Helge Deller
On 6/26/23 14:22, Michael Tokarev wrote: 25.06.2023 14:20, Helge Deller wrote: Is this a -stable material?  It applies cleanly to 8.0 and 7.2. Yes, please. At least for 8.0 I think it should be added. I didn't tested 7.2, but can do and would prefer it if could be added there too. Just test

Re: [PATCH 3/3] vfio/migration: Make VFIO migration non-experimental

2023-06-26 Thread Jason Gunthorpe
On Mon, Jun 26, 2023 at 05:26:42PM +0200, Cédric Le Goater wrote: > Since dirty tracking is a must-have to implement migration support > for any existing and future VFIO PCI variant driver, anything else > would be experimental code and we are trying to remove the flag ! > Please correct me if I a

Re: [PULL v2 1/3] target/hppa: Fix OS reboot issues

2023-06-26 Thread Michael Tokarev
26.06.2023 19:20, Helge Deller wrote: .. starting in both branches (staging-7.2 and staging-8.0) this works for me: git cherry-pick bb9c998ca9343d445c76b69fa15dea9db692f526 git cherry-pick 50ba97e928b44ff5bc731c9ffe68d86acbe44639 git cherry-pick 069d296669448b9eef72c6332ae84af962d9582c git cherr

Re: [PATCH 3/3] vfio/migration: Make VFIO migration non-experimental

2023-06-26 Thread Joao Martins
On 26/06/2023 16:26, Cédric Le Goater wrote: > On 6/26/23 15:40, Joao Martins wrote: >> On 26/06/2023 14:20, Cédric Le Goater wrote: >>> On 6/26/23 10:23, Avihai Horon wrote: +    error_setg(&vbasedev->migration_blocker, +   "%s: Migration couldn't be initialized for V

Re: [PATCH 3/3] vfio/migration: Make VFIO migration non-experimental

2023-06-26 Thread Cédric Le Goater
On 6/26/23 18:19, Jason Gunthorpe wrote: On Mon, Jun 26, 2023 at 05:26:42PM +0200, Cédric Le Goater wrote: Since dirty tracking is a must-have to implement migration support for any existing and future VFIO PCI variant driver, anything else would be experimental code and we are trying to remove

[PATCH v4 1/4] virtio-gpu: refactor generate_edid function to virtio_gpu_base

2023-06-26 Thread Erico Nunes
This functionality can be shared with upcoming use in vhost-user-gpu, so move it to the shared file to avoid duplicating it. Signed-off-by: Erico Nunes Reviewed-by: Marc-André Lureau --- hw/display/virtio-gpu-base.c | 17 + hw/display/virtio-gpu.c| 20 +

[PATCH v4 2/4] docs: vhost-user-gpu: add protocol changes for EDID

2023-06-26 Thread Erico Nunes
VHOST_USER_GPU_GET_EDID is defined as a message from the backend to the frontend to retrieve the EDID data for a given scanout. The VHOST_USER_GPU_PROTOCOL_F_EDID protocol feature is defined as a way to check whether this new message is supported or not. Signed-off-by: Erico Nunes Reviewed-by: M

[PATCH v4 3/4] contrib/vhost-user-gpu: implement get_edid feature

2023-06-26 Thread Erico Nunes
Implement the virtio-gpu feature in contrib/vhost-user-gpu, which was unsupported until now. In this implementation, the feature is enabled inconditionally to avoid creating another optional config argument. Similarly to get_display_info, vhost-user-gpu sends a message back to the frontend to have

[PATCH v4 4/4] vhost-user-gpu: implement get_edid frontend feature

2023-06-26 Thread Erico Nunes
Implement the frontend side of the get_edid feature in the qemu vhost-user-gpu frontend device. Signed-off-by: Erico Nunes Reviewed-by: Marc-André Lureau --- hw/display/vhost-user-gpu.c | 32 1 file changed, 32 insertions(+) diff --git a/hw/display/vhost-user-g

[PATCH v4 0/4] vhost-user-gpu get_edid feature

2023-06-26 Thread Erico Nunes
This adds support to the virtio-gpu get_edid command in qemu as the frontend as well as the vhost-user-gpu implementation in contrib/. So far, qemu has been outputting the following message: EDID requested but the backend doesn't support it. when using that implementation. This is tested with vh

which CPUs should call aarch64_add_{sve,pauth,sme}_properties() ?

2023-06-26 Thread Peter Maydell
At the moment: * aarch64_a64fx_initfn() calls aarch64_add_sve_properties() * aarch64_max_tcg_initfn() calls all of aarch64_add_pauth_properties(), aarch64_add_sve_properties(), aarch64_add_sme_properties() and it happens that (ignoring 'max') we only have a64fx implementing SVE and no CPUs

Re: [PATCH 3/3] vfio/migration: Make VFIO migration non-experimental

2023-06-26 Thread Alex Williamson
On Mon, 26 Jun 2023 17:26:42 +0200 Cédric Le Goater wrote: > On 6/26/23 15:40, Joao Martins wrote: > > On 26/06/2023 14:20, Cédric Le Goater wrote: > >> Hello Avihai, > >> > >> On 6/26/23 10:23, Avihai Horon wrote: > >>> The major parts of VFIO migration are supported today in QEMU. This > >>

Re: [PATCH v3 16/19] target/riscv/cpu.c: create KVM mock properties

2023-06-26 Thread Daniel Henrique Barboza
On 6/24/23 04:41, Andrew Jones wrote: On Fri, Jun 23, 2023 at 11:28:03AM -0300, Daniel Henrique Barboza wrote: ... I think we should actually fail with an error when the user tries to enable an extension KVM doesn't support. Otherwise a user may be confused as to why their Zawrs=on didn't pro

Re: [PULL 00/22] tcg patch queue

2023-06-26 Thread Richard Henderson
https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230626 for you to fetch changes up to a0eaae08c7c6a59c185cf646b02f4167b2ac6ec0: accel/tcg: Renumber TLB_DISCARD_WRITE (2023-06-26 17:33:00 +0200) accel/tcg: Replace targe

[PATCH 1/6] migration: Set migration status early in incoming side

2023-06-26 Thread Fabiano Rosas
We are sending a migration event of MIGRATION_STATUS_SETUP at qemu_start_incoming_migration but never actually setting the state. This creates a window between qmp_migrate_incoming and process_incoming_migration_co where the migration status is still MIGRATION_STATUS_NONE. Calling query-migrate du

[PATCH 4/6] tests/qtest: migration: Use migrate_incoming_qmp where appropriate

2023-06-26 Thread Fabiano Rosas
Use the new migrate_incoming_qmp helper in the places that currently open-code calling migrate-incoming. Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build | 1 + tests/qtest/migration-test.c | 12 ++--- tests/qtest/virtio-net-failover.c | 77 ---

[PATCH 5/6] tests/qtest: migration: Add support for negative testing of qmp_migrate

2023-06-26 Thread Fabiano Rosas
There is currently no way to write a test for errors that happened in qmp_migrate before the migration has started. Add a version of qmp_migrate that ensures an error happens and tests the error message. To make use of it a test needs to declare: MigrateCommon args = { .result = MIG_T

[PATCH 6/6] tests/qtest: migration-test: Add tests for file-based migration

2023-06-26 Thread Fabiano Rosas
From: Nikolay Borisov Add basic tests for file-based migration. Signed-off-by: Nikolay Borisov Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 66 1 file changed, 66 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/mig

[PATCH 2/6] tests/qtest: migration: Expose migrate_set_capability

2023-06-26 Thread Fabiano Rosas
The following patch will make use of this function from within migrate-helpers.c, so move it there. Signed-off-by: Fabiano Rosas --- tests/qtest/migration-helpers.c | 11 +++ tests/qtest/migration-helpers.h | 3 +++ tests/qtest/migration-test.c| 11 --- 3 files changed, 14 i

[PATCH 3/6] tests/qtest: migration: Add migrate_incoming_qmp helper

2023-06-26 Thread Fabiano Rosas
file-based migration requires the target to initiate its migration after the source has finished writing out the data in the file. Currently there's no easy way to initiate 'migrate-incoming', allow this by introducing migrate_incoming_qmp helper, similarly to migrate_qmp. Also make sure migration

[PATCH 0/6] migration: Test the new "file:" migration

2023-06-26 Thread Fabiano Rosas
Based-on: [PATCH V3 0/2] migration file URI https://lore.kernel.org/r/1687466251-310524-1-git-send-email-steven.sist...@oracle.com Here's the test for the file: migration. I hit an issue with the setting of migration status. If we call query-migrate too soon after migrate-incoming, the query retu

Re: [PATCH V1 2/3] migration: fix suspended runstate

2023-06-26 Thread Peter Xu
On Fri, Jun 23, 2023 at 02:25:05PM -0400, Steven Sistare wrote: > On 6/21/2023 4:28 PM, Peter Xu wrote: > > On Wed, Jun 21, 2023 at 03:15:42PM -0400, Steven Sistare wrote: > >> On 6/20/2023 5:46 PM, Peter Xu wrote: > >>> On Thu, Jun 15, 2023 at 01:26:39PM -0700, Steve Sistare wrote: > Migratio

[Stable-8.0.3 05/54] ui/gtk: fix passing y0_top parameter to scanout

2023-06-26 Thread Michael Tokarev
From: Erico Nunes The dmabuf->y0_top flag is passed to .dpy_gl_scanout_dmabuf(), however in the gtk ui both implementations dropped it when doing the next scanout_texture call. Fixes flipped linux console using vhost-user-gpu with the gtk ui display. Signed-off-by: Erico Nunes Reviewed-by: Mar

[Stable-8.0.3 15/54] target/arm: Explicitly select short-format FSR for M-profile

2023-06-26 Thread Michael Tokarev
From: Peter Maydell For M-profile, there is no guest-facing A-profile format FSR, but we still use the env->exception.fsr field to pass fault information from the point where a fault is raised to the code in arm_v7m_cpu_do_interrupt() which interprets it and sets the M-profile specific fault stat

[Stable-8.0.3 10/54] ui/sdl2: Grab Alt+Tab also in fullscreen mode

2023-06-26 Thread Michael Tokarev
From: Bernhard Beschow By default, SDL grabs Alt+Tab only in non-fullscreen mode. This causes Alt+Tab to switch tasks on the host rather than in the VM in fullscreen mode while it switches tasks in non-fullscreen mode in the VM. Fix this confusing behavior by grabbing Alt+Tab in fullscreen mode,

[Stable-8.0.3 07/54] ui/gtk-egl: fix scaling for cursor position in scanout mode

2023-06-26 Thread Michael Tokarev
From: Erico Nunes vc->gfx.w and vc->gfx.h are not updated appropriately in this code path, which leads to a different scaling factor for rendering the cursor on some edge cases (e.g. the focus has left and re-entered the gtk window). This can be reproduced using vhost-user-gpu with the gtk ui on

[Stable-8.0.3 17/54] target/s390x: Fix LCBB overwriting the top 32 bits

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich LCBB is supposed to overwrite only the bottom 32 bits, but QEMU erroneously overwrites the entire register. Fixes: 6d9303322ed9 ("s390x/tcg: Implement LOAD COUNT TO BLOCK BOUNDARY") Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich Message-Id: <20230526181240.142

[Stable-8.0.3 13/54] hw/dma/xilinx_axidma: Check DMASR.HALTED to prevent infinite loop.

2023-06-26 Thread Michael Tokarev
From: Tommy Wu When we receive a packet from the xilinx_axienet and then try to s2mem through the xilinx_axidma, if the descriptor ring buffer is full in the xilinx axidma driver, we’ll assert the DMASR.HALTED in the function : stream_process_s2mem and return 0. In the end, we’ll be stuck in an i

[Stable-8.0.3 06/54] ui/gtk: use widget size for cursor motion event

2023-06-26 Thread Michael Tokarev
From: Erico Nunes The gd_motion_event size has some calculations for the cursor position, which also take into account things like different size of the framebuffer compared to the window size. The use of window size makes things more difficult though, as at least in the case of Wayland includes

[Stable-8.0.3 08/54] ui/sdl2: fix surface_gl_update_texture: Assertion 'gls' failed

2023-06-26 Thread Michael Tokarev
From: Marc-André Lureau Before sdl2_gl_update() is called, sdl2_gl_switch() may decide to destroy the console window and its associated shaders. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1644 Fixes: c84ab0a500a8 ("ui/console: optionally update after gfx switch") Signed-off-by: Mar

[Stable-8.0.3 02/54] scripts/device-crash-test: Add a parameter to run with TCG only

2023-06-26 Thread Michael Tokarev
From: Thomas Huth We're currently facing the problem that the device-crash-test script runs twice as long in the CI when a runner supports KVM - which sometimes results in a timeout of the CI job. To get a more deterministic runtime here, add an option to the script that allows to run it with TCG

[Stable-8.0.3 24/54] tests/tcg/s390x: Test MXDB and MXDBR

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich Add a small test to prevent regressions. Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich Message-Id: <20230601223027.795501-3-...@linux.ibm.com> Acked-by: David Hildenbrand Signed-off-by: Thomas Huth (cherry picked from commit 2b956244a9d1b18b9653bf7453870c2d

[Stable-8.0.3 16/54] tests/tcg/s390x: Test EXECUTE of relative branches

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Acked-by: Richard Henderson Message-Id: <20230426235813.198183-3-...@linux.ibm.com> Signed-off-by: Thomas Huth (cherry picked from commit bfa72590df14e4c94c03d2464f3abe18bf2e5dac) Signed-off-by: Mi

[Stable-8.0.3 19/54] target/s390x: Fix LOCFHR taking the wrong half of R2

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich LOCFHR should write top-to-top, but QEMU erroneously writes bottom-to-top. Fixes: 45aa9aa3b773 ("target/s390x: Implement load-on-condition-2 insns") Cc: qemu-sta...@nongnu.org Reported-by: Mikhail Mitskevich Closes: https://gitlab.com/qemu-project/qemu/-/issues/1668 Signe

[Stable-8.0.3 01/54] gitlab-ci: Avoid to re-run "configure" in the device-crash-test jobs

2023-06-26 Thread Michael Tokarev
From: Thomas Huth After "make check-venv" had been added to these jobs, they started to re-run "configure" each time since our logic in the makefile thinks that some files are out of date here. Avoid it with the same trick that we are using in buildtest-template.yml already by disabling the up-to

[Stable-8.0.3 30/54] qga: Fix suspend on Linux guests without systemd

2023-06-26 Thread Michael Tokarev
From: Mark Somerville Allow the Linux guest agent to attempt each of the suspend methods (systemctl, pm-* and writing to /sys) in turn. Prior to this guests without systemd failed to suspend due to `guest_suspend` returning early regardless of the return value of `systemd_supports_mode`. Signed

[Stable-8.0.3 18/54] tests/tcg/s390x: Test LCBB

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich Add a test to prevent regressions. Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich Message-Id: <20230526181240.1425579-3-...@linux.ibm.com> Reviewed-by: David Hildenbrand Acked-by: Richard Henderson Signed-off-by: Thomas Huth (cherry picked from commit 05d00

[Stable-8.0.3 43/54] target/tricore: Fix out-of-bounds index in imask instruction

2023-06-26 Thread Michael Tokarev
From: Siqi Chen When translating "imask" instruction of Tricore architecture, QEMU did not check whether the register index was out of bounds, resulting in a global-buffer-overflow. Reviewed-by: Bastian Koppelmann Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1698 Reported-by: Siqi

[Stable-8.0.3 34/54] target/ppc: Fix lqarx to set cpu_reserve

2023-06-26 Thread Michael Tokarev
From: Nicholas Piggin lqarx does not set cpu_reserve, which causes stqcx. to never succeed. Cc: qemu-sta...@nongnu.org Fixes: 94bf2658676 ("target/ppc: Use atomic load for LQ and LQARX") Fixes: 57b38ffd0c6 ("target/ppc: Use tcg_gen_qemu_{ld,st}_i128 for LQARX, LQ, STQ") Signed-off-by: Nicholas

[Stable-8.0.3 03/54] target/ppc: Fix fallback to MFSS for MFFS* instructions on pre 3.0 ISAs

2023-06-26 Thread Michael Tokarev
From: Richard Purdie The following commits changed the code such that the fallback to MFSS for MFFSCRN, MFFSCRNI, MFFSCE and MFFSL on pre 3.0 ISAs was removed and became an illegal instruction: bf8adfd88b547680aa857c46098f3a1e94373160 - target/ppc: Move mffscrn[i] to decodetree 394c2e2fda

[Stable-8.0.3 46/54] pc-bios/keymaps: Use the official xkb name for Arabic layout, not the legacy synonym

2023-06-26 Thread Michael Tokarev
From: Peter Maydell The xkb official name for the Arabic keyboard layout is 'ara'. However xkb has for at least the past 15 years also permitted it to be named via the legacy synonym 'ar'. In xkeyboard-config 2.39 this synoynm was removed, which breaks compilation of QEMU: FAILED: pc-bios/keyma

[Stable-8.0.3 47/54] target/hppa: Fix OS reboot issues

2023-06-26 Thread Michael Tokarev
From: Helge Deller When the OS triggers a reboot, the reset helper function sends a qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET) together with an EXCP_HLT exception to halt the CPUs. So, at reboot when initializing the CPUs again, make sure to set all instruction pointers to the firmwar

[Stable-8.0.3 12/54] ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows

2023-06-26 Thread Michael Tokarev
From: Volker Rümelin Windows sends an extra left control key up/down input event for every right alt key up/down input event for keyboards with international layout. Since commit 830473455f ("ui/sdl2: fix handling of AltGr key on Windows") QEMU uses a Windows low level keyboard hook procedure to

[Stable-8.0.3 14/54] hw/arm/xlnx-zynqmp: fix unsigned error when checking the RPUs number

2023-06-26 Thread Michael Tokarev
From: Clément Chigot When passing --smp with a number lower than XLNX_ZYNQMP_NUM_APU_CPUS, the expression (ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS) will result in a positive number as ms->smp.cpus is a unsigned int. This will raise the following error afterwards, as Qemu will try to instantiate s

[Stable-8.0.3 22/54] tests/tcg/s390x: Test single-stepping SVC

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Acked-by: Alex Bennée Message-Id: <20230510230213.330134-3-...@linux.ibm.com> Signed-off-by: Thomas Huth (cherry picked from commit be4a4cb429617a8b6893733b37b6203e4b7bf35b) Signed-off-by: Michael

[Stable-8.0.3 40/54] target/arm: Return correct result for LDG when ATA=0

2023-06-26 Thread Michael Tokarev
From: Peter Maydell The LDG instruction loads the tag from a memory address (identified by [Xn + offset]), and then merges that tag into the destination register Xt. We implemented this correctly for the case when allocation tags are enabled, but didn't get it right when ATA=0: instead of merging

[Stable-8.0.3 42/54] hw/timer/nrf51_timer: Don't lose time when timer is queried in tight loop

2023-06-26 Thread Michael Tokarev
From: Peter Maydell The nrf51_timer has a free-running counter which we implement using the pattern of using two fields (update_counter_ns, counter) to track the last point at which we calculated the counter value, and the counter value at that time. Then we can find the current counter value by

[Stable-8.0.3 04/54] hw/ppc/prep: Fix wiring of PIC -> CPU interrupt

2023-06-26 Thread Michael Tokarev
From: Bernhard Beschow Commit cef2e7148e32 ("hw/isa/i82378: Remove intermediate IRQ forwarder") passes s->cpu_intr to i8259_init() in i82378_realize() directly. However, s- >cpu_intr isn't initialized yet since that happens after the south bridge's pci_realize_and_unref() in board code. Fix this

[Stable-8.0.3 20/54] tests/tcg/s390x: Test LOCFHR

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich Add a small test to prevent regressions. Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich Message-Id: <20230526181240.1425579-5-...@linux.ibm.com> Reviewed-by: Richard Henderson Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth (cherry picked from com

[Stable-8.0.3 32/54] hw/remote: Fix vfu_cfg trace offset format

2023-06-26 Thread Michael Tokarev
From: Mattias Nissler The printed offset value is prefixed with 0x, but was actually printed in decimal. To spare others the confusion, adjust the format specifier to hexadecimal. Signed-off-by: Mattias Nissler Reviewed-by: Jagannathan Raman Reviewed-by: Philippe Mathieu-Daudé Signed-off-by:

[Stable-8.0.3 23/54] target/s390x: Fix MXDB and MXDBR

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich These instructions multiply 64 bits by 64 bits, not 128 bits by 64 bits. Reported-by: Tulio Magno Quites Machado Filho Fixes: 2b91240f95fd ("target/s390x: Use Int128 for passing float128") Cc: qemu-sta...@nongnu.org Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=221

[Stable-8.0.3 54/54] vhost-vdpa: do not cleanup the vdpa/vhost-net structures if peer nic is present

2023-06-26 Thread Michael Tokarev
From: Ani Sinha When a peer nic is still attached to the vdpa backend, it is too early to free up the vhost-net and vdpa structures. If these structures are freed here, then QEMU crashes when the guest is being shut down. The following call chain would result in an assertion failure since the poi

[Stable-8.0.3 45/54] host-utils: Avoid using __builtin_subcll on buggy versions of Apple Clang

2023-06-26 Thread Michael Tokarev
From: Peter Maydell We use __builtin_subcll() to do a 64-bit subtract with borrow-in and borrow-out when the host compiler supports it. Unfortunately some versions of Apple Clang have a bug in their implementation of this intrinsic which means it returns the wrong value. The effect is that a QE

[Stable-8.0.3 49/54] target/hppa: New SeaBIOS-hppa version 7

2023-06-26 Thread Michael Tokarev
From: Helge Deller Update SeaBIOS-hppa to version 7 which fixes a boot problem with Debian-12 install CD images. The problem with Debian-12 is, that the ramdisc got bigger than what the firmware could load in one call to the LSI scsi driver. Signed-off-by: Helge Deller (cherry picked from comm

[Stable-8.0.3 51/54] vhost: release memory_listener object in error path

2023-06-26 Thread Michael Tokarev
From: Prasad Pandit vhost_dev_start function does not release memory_listener object in case of an error. This may crash the guest when vhost is unable to set memory table: stack trace of thread 125653: Program terminated with signal SIGSEGV, Segmentation fault #0 memory_listener_register

[Stable-8.0.3 41/54] hw/intc/allwinner-a10-pic: Handle IRQ levels other than 0 or 1

2023-06-26 Thread Michael Tokarev
From: Peter Maydell In commit 2c5fa0778c3b430 we fixed an endianness bug in the Allwinner A10 PIC model; however in the process we introduced a regression. This is because the old code was robust against the incoming 'level' argument being something other than 0 or 1, whereas the new code was not

[Stable-8.0.3 52/54] vhost: release virtqueue objects in error path

2023-06-26 Thread Michael Tokarev
From: Prasad Pandit vhost_dev_start function does not release virtqueue objects when event_notifier_init() function fails. Release virtqueue objects and log a message about function failure. Signed-off-by: Prasad Pandit Message-Id: <20230529114333.31686-3-ppan...@redhat.com> Reviewed-by: Michae

[Stable-8.0.3 35/54] target/ppc: Fix nested-hv HEAI delivery

2023-06-26 Thread Michael Tokarev
From: Nicholas Piggin ppc hypervisors turn HEAI interrupts into program interrupts injected into the guest that executed the illegal instruction, if the hypervisor doesn't handle it some other way. The nested-hv implementation failed to account for this HEAI->program conversion. The virtual hype

[Stable-8.0.3 11/54] ui/sdl2: Grab Alt+F4 also under Windows

2023-06-26 Thread Michael Tokarev
From: Bernhard Beschow SDL doesn't grab Alt+F4 under Windows by default. Pressing Alt+F4 thus closes the VM immediately without confirmation, possibly leading to data loss. Fix this by always grabbing Alt+F4 on Windows hosts, too. Signed-off-by: Bernhard Beschow Reviewed-by: Volker Rümelin Mes

[Stable-8.0.3 27/54] hw/xen: Fix memory leak in libxenstore_open() for Xen

2023-06-26 Thread Michael Tokarev
From: David Woodhouse There was a superfluous allocation of the XS handle, leading to it being leaked on both the error path and the success path (where it gets allocated again). Spotted by Coverity (CID 1508098). Fixes: ba2a92db1ff6 ("hw/xen: Add xenstore operations to allow redirection to in

[Stable-7.2.4 13/43] target/arm: Explicitly select short-format FSR for M-profile

2023-06-26 Thread Michael Tokarev
From: Peter Maydell For M-profile, there is no guest-facing A-profile format FSR, but we still use the env->exception.fsr field to pass fault information from the point where a fault is raised to the code in arm_v7m_cpu_do_interrupt() which interprets it and sets the M-profile specific fault stat

[Stable-8.0.3 53/54] vdpa: fix not using CVQ buffer in case of error

2023-06-26 Thread Michael Tokarev
From: Eugenio Pérez Bug introducing when refactoring. Otherway, the guest never received the used buffer. Fixes: be4278b65fc1 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail") Signed-off-by: Eugenio Pérez Message-Id: <20230602173451.1917999-1-epere...@redhat.com>

[Stable-8.0.3 44/54] target/tricore: Add CHECK_REG_PAIR() for insn accessing 64 bit regs

2023-06-26 Thread Michael Tokarev
From: Bastian Koppelmann some insns were not checking if an even index was used to access a 64 bit register. In the worst case that could lead to a buffer overflow as reported in https://gitlab.com/qemu-project/qemu/-/issues/1698. Reported-by: Siqi Chen Signed-off-by: Bastian Koppelmann Messag

[Stable-8.0.3 09/54] ui/dbus: fix compilation when GBM && !OPENGL

2023-06-26 Thread Michael Tokarev
From: Marc-André Lureau commit 4814d3cbf ("ui/dbus: restrict opengl to gbm-enabled config") assumes that whenever GBM is available, OpenGL is. This is not always the case, let's further restrict opengl-related paths and fix some compilation issues. Signed-off-by: Marc-André Lureau Message-Id: <

[Stable-7.2.4 06/43] ui/gtk-egl: fix scaling for cursor position in scanout mode

2023-06-26 Thread Michael Tokarev
From: Erico Nunes vc->gfx.w and vc->gfx.h are not updated appropriately in this code path, which leads to a different scaling factor for rendering the cursor on some edge cases (e.g. the focus has left and re-entered the gtk window). This can be reproduced using vhost-user-gpu with the gtk ui on

[Stable-8.0.3 26/54] hw/mips/malta: Fix the malta machine on big endian hosts

2023-06-26 Thread Michael Tokarev
From: Thomas Huth Booting a Linux kernel with the malta machine is currently broken on big endian hosts. The cpu_to_gt32 macro wants to byteswap a value for little endian targets only, but uses the wrong way to do this: cpu_to_[lb]e32 works the other way round on big endian hosts! Fix it by using

[Stable-7.2.4 03/43] hw/ppc/prep: Fix wiring of PIC -> CPU interrupt

2023-06-26 Thread Michael Tokarev
From: Bernhard Beschow Commit cef2e7148e32 ("hw/isa/i82378: Remove intermediate IRQ forwarder") passes s->cpu_intr to i8259_init() in i82378_realize() directly. However, s- >cpu_intr isn't initialized yet since that happens after the south bridge's pci_realize_and_unref() in board code. Fix this

[Stable-8.0.3 29/54] docs: fix multi-process QEMU documentation

2023-06-26 Thread Michael Tokarev
From: Jagannathan Raman Fix a typo in the system documentation for multi-process QEMU. Signed-off-by: Jagannathan Raman Reviewed-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi (cherry picked from commit 7771e8b86335968ee46538d1afd44246e7a062bc) Signed-off-by: Michael Tokarev diff --git

[Stable-8.0.3 33/54] vnc: move assert in vnc_worker_thread_loop

2023-06-26 Thread Michael Tokarev
From: Anastasia Belova job may be NULL if queue->exit is true. Check it before dereference job. Fixes: f31f9c1080 ("vnc: add magic cookie to VncState") Signed-off-by: Anastasia Belova Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev (cherry picked from commit bdfca8a22f41e7ad47fd2d

[Stable-8.0.3 21/54] linux-user/s390x: Fix single-stepping SVC

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich Currently single-stepping SVC executes two instructions. The reason is that EXCP_DEBUG for the SVC instruction itself is masked by EXCP_SVC. Fix by re-raising EXCP_DEBUG. Signed-off-by: Ilya Leoshkevich Message-Id: <20230510230213.330134-2-...@linux.ibm.com> Signed-off-by

[Stable-7.2.4 11/43] hw/dma/xilinx_axidma: Check DMASR.HALTED to prevent infinite loop.

2023-06-26 Thread Michael Tokarev
From: Tommy Wu When we receive a packet from the xilinx_axienet and then try to s2mem through the xilinx_axidma, if the descriptor ring buffer is full in the xilinx axidma driver, we’ll assert the DMASR.HALTED in the function : stream_process_s2mem and return 0. In the end, we’ll be stuck in an i

[Stable-8.0.3 25/54] s390x/tcg: Fix CPU address returned by STIDP

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich In qemu-user-s390x, /proc/cpuinfo contains: processor 0: version = 00, identification = 00, machine = 8561 processor 1: version = 00, identification = 40, machine = 8561 The highest nibble is supposed to contain the CPU address, but it's off by

[Stable-8.0.3 36/54] target/ppc: Fix PMU hflags calculation

2023-06-26 Thread Michael Tokarev
From: Nicholas Piggin Some of the PMU hflags bits can go out of synch, for example a store to MMCR0 with PMCjCE=1 fails to update hflags correctly and results in hflags mismatch: qemu: fatal: TCG hflags mismatch (current:0x2408003d rebuilt:0x240a003d) This can be reproduced by running perf on

[Stable-7.2.4 04/43] ui/gtk: fix passing y0_top parameter to scanout

2023-06-26 Thread Michael Tokarev
From: Erico Nunes The dmabuf->y0_top flag is passed to .dpy_gl_scanout_dmabuf(), however in the gtk ui both implementations dropped it when doing the next scanout_texture call. Fixes flipped linux console using vhost-user-gpu with the gtk ui display. Signed-off-by: Erico Nunes Reviewed-by: Mar

[Stable-7.2.4 09/43] ui/sdl2: Grab Alt+F4 also under Windows

2023-06-26 Thread Michael Tokarev
From: Bernhard Beschow SDL doesn't grab Alt+F4 under Windows by default. Pressing Alt+F4 thus closes the VM immediately without confirmation, possibly leading to data loss. Fix this by always grabbing Alt+F4 on Windows hosts, too. Signed-off-by: Bernhard Beschow Reviewed-by: Volker Rümelin Mes

[Stable-8.0.3 39/54] target/arm: Fix return value from LDSMIN/LDSMAX 8/16 bit atomics

2023-06-26 Thread Michael Tokarev
From: Peter Maydell The atomic memory operations are supposed to return the old memory data value in the destination register. This value is not sign-extended, even if the operation is the signed minimum or maximum. (In the pseudocode for the instructions the returned data value is passed to Ze

[Stable-7.2.4 42/43] vdpa: fix not using CVQ buffer in case of error

2023-06-26 Thread Michael Tokarev
From: Eugenio Pérez Bug introducing when refactoring. Otherway, the guest never received the used buffer. Fixes: be4278b65fc1 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail") Signed-off-by: Eugenio Pérez Message-Id: <20230602173451.1917999-1-epere...@redhat.com>

[Stable-7.2.4 36/43] pc-bios/keymaps: Use the official xkb name for Arabic layout, not the legacy synonym

2023-06-26 Thread Michael Tokarev
From: Peter Maydell The xkb official name for the Arabic keyboard layout is 'ara'. However xkb has for at least the past 15 years also permitted it to be named via the legacy synonym 'ar'. In xkeyboard-config 2.39 this synoynm was removed, which breaks compilation of QEMU: FAILED: pc-bios/keyma

[Stable-7.2.4 08/43] ui/sdl2: Grab Alt+Tab also in fullscreen mode

2023-06-26 Thread Michael Tokarev
From: Bernhard Beschow By default, SDL grabs Alt+Tab only in non-fullscreen mode. This causes Alt+Tab to switch tasks on the host rather than in the VM in fullscreen mode while it switches tasks in non-fullscreen mode in the VM. Fix this confusing behavior by grabbing Alt+Tab in fullscreen mode,

[Stable-7.2.4 32/43] target/arm: Return correct result for LDG when ATA=0

2023-06-26 Thread Michael Tokarev
From: Peter Maydell The LDG instruction loads the tag from a memory address (identified by [Xn + offset]), and then merges that tag into the destination register Xt. We implemented this correctly for the case when allocation tags are enabled, but didn't get it right when ATA=0: instead of merging

[Stable-7.2.4 29/43] hw/riscv: qemu crash when NUMA nodes exceed available CPUs

2023-06-26 Thread Michael Tokarev
From: Yin Wang Command "qemu-system-riscv64 -machine virt -m 2G -smp 1 -numa node,mem=1G -numa node,mem=1G" would trigger this problem.Backtrace with: #0 0x55b5b1a4 in riscv_numa_get_default_cpu_node_id at ../hw/riscv/numa.c:211 #1 0x558ce510 in machine_numa_finish_cpu_init

[Stable-7.2.4 10/43] ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows

2023-06-26 Thread Michael Tokarev
From: Volker Rümelin Windows sends an extra left control key up/down input event for every right alt key up/down input event for keyboards with international layout. Since commit 830473455f ("ui/sdl2: fix handling of AltGr key on Windows") QEMU uses a Windows low level keyboard hook procedure to

[Stable-7.2.4 21/43] docs: fix multi-process QEMU documentation

2023-06-26 Thread Michael Tokarev
From: Jagannathan Raman Fix a typo in the system documentation for multi-process QEMU. Signed-off-by: Jagannathan Raman Reviewed-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi (cherry picked from commit 7771e8b86335968ee46538d1afd44246e7a062bc) Signed-off-by: Michael Tokarev diff --git

[Stable-7.2.4 02/43] scripts/device-crash-test: Add a parameter to run with TCG only

2023-06-26 Thread Michael Tokarev
From: Thomas Huth We're currently facing the problem that the device-crash-test script runs twice as long in the CI when a runner supports KVM - which sometimes results in a timeout of the CI job. To get a more deterministic runtime here, add an option to the script that allows to run it with TCG

[Stable-8.0.3 48/54] target/hppa: Provide qemu version via fw_cfg to firmware

2023-06-26 Thread Michael Tokarev
From: Helge Deller Give current QEMU version string to SeaBIOS-hppa via fw_cfg interface so that the firmware can show the QEMU version in the boot menu info. Signed-off-by: Helge Deller (cherry picked from commit 069d296669448b9eef72c6332ae84af962d9582c) Signed-off-by: Michael Tokarev diff -

[Stable-7.2.4 05/43] ui/gtk: use widget size for cursor motion event

2023-06-26 Thread Michael Tokarev
From: Erico Nunes The gd_motion_event size has some calculations for the cursor position, which also take into account things like different size of the framebuffer compared to the window size. The use of window size makes things more difficult though, as at least in the case of Wayland includes

[Stable-7.2.4 12/43] hw/arm/xlnx-zynqmp: fix unsigned error when checking the RPUs number

2023-06-26 Thread Michael Tokarev
From: Clément Chigot When passing --smp with a number lower than XLNX_ZYNQMP_NUM_APU_CPUS, the expression (ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS) will result in a positive number as ms->smp.cpus is a unsigned int. This will raise the following error afterwards, as Qemu will try to instantiate s

[Stable-8.0.3 37/54] hw/riscv: qemu crash when NUMA nodes exceed available CPUs

2023-06-26 Thread Michael Tokarev
From: Yin Wang Command "qemu-system-riscv64 -machine virt -m 2G -smp 1 -numa node,mem=1G -numa node,mem=1G" would trigger this problem.Backtrace with: #0 0x55b5b1a4 in riscv_numa_get_default_cpu_node_id at ../hw/riscv/numa.c:211 #1 0x558ce510 in machine_numa_finish_cpu_init

[Stable-7.2.4 01/43] gitlab-ci: Avoid to re-run "configure" in the device-crash-test jobs

2023-06-26 Thread Michael Tokarev
From: Thomas Huth After "make check-venv" had been added to these jobs, they started to re-run "configure" each time since our logic in the makefile thinks that some files are out of date here. Avoid it with the same trick that we are using in buildtest-template.yml already by disabling the up-to

[Stable-7.2.4 31/43] target/arm: Fix return value from LDSMIN/LDSMAX 8/16 bit atomics

2023-06-26 Thread Michael Tokarev
From: Peter Maydell The atomic memory operations are supposed to return the old memory data value in the destination register. This value is not sign-extended, even if the operation is the signed minimum or maximum. (In the pseudocode for the instructions the returned data value is passed to Ze

[Stable-8.0.3 50/54] target/hppa: Update to SeaBIOS-hppa version 8

2023-06-26 Thread Michael Tokarev
From: Helge Deller Update SeaBIOS-hppa to version 8. Fixes: - boot of HP-UX with SMP, and - reboot of Linux and HP-UX with SMP Enhancements: - show qemu version in boot menu - adds exit menu entry in boot menu to quit emulation - allow to trace PCD_CHASSIS codes & machine run status Signed-off

[Stable-7.2.4 38/43] target/hppa: Provide qemu version via fw_cfg to firmware

2023-06-26 Thread Michael Tokarev
From: Helge Deller Give current QEMU version string to SeaBIOS-hppa via fw_cfg interface so that the firmware can show the QEMU version in the boot menu info. Signed-off-by: Helge Deller (cherry picked from commit 069d296669448b9eef72c6332ae84af962d9582c) Signed-off-by: Michael Tokarev diff -

[Stable-7.2.4 15/43] tests/tcg/s390x: Test LCBB

2023-06-26 Thread Michael Tokarev
From: Ilya Leoshkevich Add a test to prevent regressions. Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich Message-Id: <20230526181240.1425579-3-...@linux.ibm.com> Reviewed-by: David Hildenbrand Acked-by: Richard Henderson Signed-off-by: Thomas Huth (cherry picked from commit 05d00

<    1   2   3   4   5   6   >