Re: [PATCH v3 33/33] target/ppc: Add a macro to check for page protection bit

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:35 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Wed May 8, 2024 at 10:15 AM AEST, BALATON Zoltan wrote: > >> Checking if a page protection bit is set for a given access type is a > >> common operation. Add a macro to avoid repeating the

Re: [PATCH v2 26/28] target/ppc/mmu_common.c: Move BookE MMU functions together

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:33 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Tue May 7, 2024 at 10:31 PM AEST, BALATON Zoltan wrote: > >> On Tue, 7 May 2024, Nicholas Piggin wrote: > >>> What do you think about adding mmu-book3e.c instead? > >> > >> I have

Re: [PATCH v3 26/33] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 1

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 1:25 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Wed May 8, 2024 at 10:15 AM AEST, BALATON Zoltan wrote: > >> Move setting error_code that appears in every case out in front and > >> hoist the common fall through case for BOOKE206 as

Re: [PATCH v3 33/33] target/ppc: Add a macro to check for page protection bit

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 1:23 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Wed May 8, 2024 at 10:15 AM AEST, BALATON Zoltan wrote: > >> Checking if a page protection bit is set for a given access type is a > >> common operation. Add a macro to avoid repeating the

Re: [PATCH v3 01/33] target/ppc: Fix gen_sc to use correct nip

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 1:17 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Wed May 8, 2024 at 10:14 AM AEST, BALATON Zoltan wrote: > >> Most exceptions are raised with nip pointing to the faulting > >> instruction but the sc instruction generating a syscall

Re: [PATCH] hw/virtio: Fix obtain the buffer id from the last descriptor

2024-05-08 Thread Eugenio Perez Martin
On Thu, May 9, 2024 at 4:20 AM Wafer wrote: > > > > On Thu, May, 2024 at 2:21 AM Michael S. Tsirkin wrote: > > > > On Wed, May 08, 2024 at 02:56:11PM +0200, Eugenio Perez Martin wrote: > > > On Mon, Apr 22, 2024 at 3:41 AM Wafer wrote: > > > > > > > > The virtio-1.3 specification > > > >

Re: [PATCH] hw/virtio: Fix obtain the buffer id from the last descriptor

2024-05-08 Thread Eugenio Perez Martin
On Thu, May 9, 2024 at 6:32 AM Wafer wrote: > > > > On Wed, May 08, 2024 at 12:01 PM Jason Wang wrote: > > > > On Mon, Apr 22, 2024 at 9:41 AM Wafer wrote: > > > > > > The virtio-1.3 specification > > > writes: > > > 2.8.6 Next

Re: [PATCH v8] virtio-pci: fix use of a released vector

2024-05-08 Thread Michael Tokarev
09.05.2024 04:43, Cindy Lu wrote: https://gitlab.com/qemu-project/qemu/-/issues/2321 https://gitlab.com/qemu-project/qemu/-/issues/2334 So something's not right here. I have checked the stack, seems there is a crash while set the vector to NO_VECTOER? #0 kvm_virtio_pci_vq_vector_release

RE: [PATCH] hw/virtio: Fix obtain the buffer id from the last descriptor

2024-05-08 Thread Wafer
On Wed, May 08, 2024 at 12:01 PM Jason Wang wrote: > > On Mon, Apr 22, 2024 at 9:41 AM Wafer wrote: > > > > The virtio-1.3 specification > > writes: > > 2.8.6 Next Flag: Descriptor Chaining > > Buffer ID is included in

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-08 Thread Zhao Liu
On Wed, May 08, 2024 at 04:23:00PM +0200, Philippe Mathieu-Daudé wrote: > Date: Wed, 8 May 2024 16:23:00 +0200 > From: Philippe Mathieu-Daudé > Subject: Re: [PATCH] scripts/simpletrace: Mark output with unstable > timestamp as WARN > > On 8/5/24 15:55, Zhao Liu wrote: > > Hi Philippe, > > > >

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-08 Thread Zhao Liu
On Wed, May 08, 2024 at 02:05:04PM -0400, Stefan Hajnoczi wrote: > Date: Wed, 8 May 2024 14:05:04 -0400 > From: Stefan Hajnoczi > Subject: Re: [PATCH] scripts/simpletrace: Mark output with unstable > timestamp as WARN > > On Wed, 8 May 2024 at 00:19, Zhao Liu wrote: > > > > In some trace log,

[PATCH 2/3] migration/colo: make colo_incoming_co() return void

2024-05-08 Thread Li Zhijian via
Currently, it always returns 0, no need to check the return value at all. In addition, enter colo coroutine only if migration_incoming_colo_enabled() is true. Once the destination side enters the COLO* state, the COLO process will take over the remaining processes until COLO exits. Signed-off-by:

[PATCH 3/3] migration/colo: Tidy up bql_unlock() around bdrv_activate_all()

2024-05-08 Thread Li Zhijian via
Make the code more tight. Cc: Michael Tokarev Signed-off-by: Li Zhijian --- This change/comment suggested by "Michael Tokarev " came a bit late at that time, let's update it together in these minor set this time. --- migration/colo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[PATCH 1/3] migration/colo: Minor fix for colo error message

2024-05-08 Thread Li Zhijian via
- Explicitly show the missing module name: replication - Fix capability name to x-colo Signed-off-by: Li Zhijian --- migration/migration.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 6502e169a3..b4a09c561c 100644

RE: [PATCH] hw/virtio: Fix obtain the buffer id from the last descriptor

2024-05-08 Thread Wafer
On Thu, May, 2024 at 2:21 AM Michael S. Tsirkin wrote: > > On Wed, May 08, 2024 at 02:56:11PM +0200, Eugenio Perez Martin wrote: > > On Mon, Apr 22, 2024 at 3:41 AM Wafer wrote: > > > > > > The virtio-1.3 specification > > >

Re: [PATCH v8] virtio-pci: fix use of a released vector

2024-05-08 Thread Cindy Lu
On Thu, May 9, 2024 at 4:18 AM Michael Tokarev wrote: > > 15.04.2024 12:34, Michael S. Tsirkin wrote: > > From: Cindy Lu > > > > During the booting process of the non-standard image, the behavior of the > > called function in qemu is as follows: > > > > 1. vhost_net_stop() was triggered by guest

Re: [PATCH RESEND 0/2] Fix crash of VMs configured with the CDROM device

2024-05-08 Thread Yong Huang
Ping2 Make sure that this patchset is not overlooked. Yong On Tue, Apr 23, 2024 at 9:45 AM Yong Huang wrote: > Ping. > I would appreciate comments on this series. Thanks, > > Yong > > On Mon, Apr 8, 2024 at 8:08 PM Hyman Huang wrote: > >> This patchset fixes the crash of VMs configured with

[PATCH 2/2] hw/usb/hcd-ohci: Fix ohci_service_td: accept valid TDs

2024-05-08 Thread David Hubbard
From: Cord Amfmgm This changes the way the ohci emulation handles a Transfer Descriptor with "Current Buffer Pointer" set to "Buffer End" + 1. The OHCI spec 4.3.1.2 Table 4-2 allows td.cbp to be one byte more than td.be to signal the buffer has zero length. Currently qemu only accepts

[PATCH 1/2] hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-05-08 Thread David Hubbard
From: Cord Amfmgm This changes the ohci validation to not assert if invalid data is fed to the ohci controller. The poc in https://bugs.launchpad.net/qemu/+bug/1907042 and migrated to bug #303 does the following to feed it a SETUP pid (valid) at an EndPt of 1 (invalid - all SETUP pids must be

[PATCH v4 28/33] target/ppc: Remove id_tlbs flag from CPU env

2024-05-08 Thread BALATON Zoltan
This flag for split instruction/data TLBs is only set for 6xx soft TLB MMU model and not used otherwise so no need to have a separate flag for that. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- hw/ppc/pegasos2.c| 2 +- target/ppc/cpu.h | 5 -

[PATCH v4 30/33] target/ppc/mmu-hash32.c: Drop a local variable

2024-05-08 Thread BALATON Zoltan
In ppc_hash32_xlate() the value of need_prop is checked in two places but precalculating it does not help because when we reach the first check we always return and not reach the second place so the value will only be used once. We can drop the local variable and calculate it when needed, which

[PATCH v4 32/33] target/ppc: Add a macro to check for page protection bit

2024-05-08 Thread BALATON Zoltan
Checking if a page protection bit is set for a given access type is a common operation. Add a macro to avoid repeating the same check at multiple places and also avoid a function call. As this relies on access type and page protection bit values having certain relation also add an assert to ensure

[PATCH v4 08/33] target/ppc/mmu_common.c: Drop cases for unimplemented MPC8xx MMU

2024-05-08 Thread BALATON Zoltan
Drop MPC8xx cases from get_physical_address_wtlb() and ppc_jumbo_xlate(). The default case would still catch this and abort the same way and there is still a warning about it in ppc_tlb_invalidate_all() which is called in ppc_cpu_reset_hold() so likely we never get here but to make sure add a case

[PATCH v4 01/33] target/ppc: Fix gen_sc to use correct nip

2024-05-08 Thread BALATON Zoltan
Most exceptions are raised with nip pointing to the faulting instruction but the sc instruction generating a syscall exception leaves nip pointing to next instruction. Fix gen_sc to not use gen_exception_err() which sets nip back but correctly set nip to pc_next so we don't have to patch this in

[PATCH v4 00/33] Misc PPC exception and BookE MMU clean ups

2024-05-08 Thread BALATON Zoltan
This series does some further clean up mostly around BookE MMU to untangle it from other MMU models. It also contains some other changes that I've come up with while working on this. The Simplify ppc_booke_xlate() part 1 and part 2 patches could be squashed together but left them separate for

[PATCH v4 10/33] target/ppc/mmu_common.c: Move else branch to avoid large if block

2024-05-08 Thread BALATON Zoltan
In mmu6xx_get_physical_address() we have a large if block with a two line else branch that effectively returns. Invert the condition and move the else there to allow deindenting the large if block to make the flow easier to follow. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin ---

[PATCH v4 09/33] target/ppc/mmu_common.c: Introduce mmu6xx_get_physical_address()

2024-05-08 Thread BALATON Zoltan
Repurpose get_segment_6xx_tlb() to do the whole address translation for POWERPC_MMU_SOFT_6xx MMU model by moving the BAT check there and renaming it to match other similar functions. These are only called once together so no need to keep these separate functions and combining them simplifies the

[PATCH v4 25/33] target/ppc/mmu_common.c: Split off BookE handling from ppc_jumbo_xlate()

2024-05-08 Thread BALATON Zoltan
Introduce ppc_booke_xlate() to handle BookE and BookE 2.06 cases to reduce ppc_jumbo_xlate() further. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 148 ++-- 1 file changed, 98 insertions(+), 50 deletions(-) diff --git a/target/ppc/mmu_common.c

[PULL v2 10/13] migration: Remove block migration

2024-05-08 Thread Fabiano Rosas
The block migration has been considered obsolete since QEMU 8.2 in favor of the more flexible storage migration provided by the blockdev-mirror driver. Two releases have passed so now it's time to remove it. Deprecation commit 66db46ca83 ("migration: Deprecate block migration"). Reviewed-by:

[PATCH v4 04/33] target/ppc: Remove unused helper

2024-05-08 Thread BALATON Zoltan
The helper_rac function is defined but not used, remove it. Fixes: 005b69fdcc (target/ppc: Remove PowerPC 601 CPUs) Signed-off-by: BALATON Zoltan Reviwed-by: Nicholas Piggin --- target/ppc/helper.h | 2 -- target/ppc/mmu_helper.c | 24 2 files changed, 26

[PATCH v4 19/33] target/ppc/mmu_common.c: Don't use mmu_ctx_t for mmu40x_get_physical_address()

2024-05-08 Thread BALATON Zoltan
mmu40x_get_physical_address() only uses the raddr and prot fields from mmu_ctx_t. Pass these directly instead of using a ctx struct. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 38 -- 1 file changed, 16 insertions(+), 22 deletions(-) diff

[PULL v2 02/13] migration: move trace-point from migrate_fd_error to migrate_set_error

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy Cover more cases by trace-point. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 4 +++- migration/trace-events | 2 +- 2 files changed, 4

[PATCH v4 22/33] target/ppc/mmu_common.c: Make get_physical_address_wtlb() static

2024-05-08 Thread BALATON Zoltan
This function is not used from any other files so make it static and fix the maybe used uninitialised warnings this has uncovered. Also remove mmu_ctx_t definition from internal.h as this type is only used within this file. Signed-off-by: BALATON Zoltan --- target/ppc/internal.h | 17

[PULL v2 05/13] migration: process_incoming_migration_co(): rework error reporting

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by:

[PULL v2 07/13] migration: Remove 'skipped' field from MigrationStats

2024-05-08 Thread Fabiano Rosas
The 'skipped' field of the MigrationStats struct has been deprecated in 8.1. Time to remove it. Deprecation commit 7b24d32634 ("migration: skipped field is really obsolete."). Reviewed-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- docs/about/deprecated.rst

[PULL v2 01/13] migration/ram.c: API Conversion qemu_mutex_lock(), and qemu_mutex_unlock() to WITH_QEMU_LOCK_GUARD macro

2024-05-08 Thread Fabiano Rosas
From: Will Gyda migration/ram.c: API Conversion qemu_mutex_lock(), and qemu_mutex_unlock() to WITH_QEMU_LOCK_GUARD macro Signed-off-by: Will Gyda Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/ram.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff

[PATCH v4 31/33] target/ppc/mmu-radix64.c: Drop a local variable

2024-05-08 Thread BALATON Zoltan
The value is only used once so no need to introduce a local variable for it. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu-radix64.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c

[PATCH v4 26/33] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 1

2024-05-08 Thread BALATON Zoltan
Move setting error_code that appears in every case out in front and hoist the common fall through case for BOOKE206 as well which allows removing the nested switches. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 41

[PATCH v4 06/33] target/ppc/mmu_common.c: Remove unneeded local variable

2024-05-08 Thread BALATON Zoltan
In mmubooke_check_tlb() and mmubooke206_check_tlb() we can assign the value directly the the destination, no need to have a separate local variable for it. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 30 +- 1 file

[PULL v2 11/13] migration: Remove non-multifd compression

2024-05-08 Thread Fabiano Rosas
The 'compress' migration capability enables the old compression code which has shown issues over the years and is thought to be less stable and tested than the more recent multifd-based compression. The old compression code has been deprecated in 8.2 and now is time to remove it. Deprecation

[PATCH v4 33/33] target/ppc: Move out BookE and related MMU functions from mmu_common.c

2024-05-08 Thread BALATON Zoltan
Add a new mmu-booke.c file for BookE and related MMU bits from mmu_common.c. Signed-off-by: BALATON Zoltan --- target/ppc/cpu.h| 4 - target/ppc/meson.build | 1 + target/ppc/mmu-booke.c | 532 target/ppc/mmu-booke.h | 17 ++

[PATCH v4 15/33] target/ppc/mmu_common.c: Inline and remove check_physical()

2024-05-08 Thread BALATON Zoltan
This function just does two assignments and and unnecessary check that is always true so inline it in the only caller left and remove it. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 26 +++--- 1 file changed, 3 insertions(+), 23

[PATCH v4 03/33] target/ppc: Simplify syscall exception handlers

2024-05-08 Thread BALATON Zoltan
After previous changes the hypercall handling in 7xx and 74xx exception handlers can be folded into one if statement to simplify this code. Also add "unlikely" to mark the less frequently used branch for the compiler. Signed-off-by: BALATON Zoltan Reviewed-by: Harsh Prateek Bora ---

[PATCH v4 11/33] target/ppc/mmu_common.c: Move some debug logging

2024-05-08 Thread BALATON Zoltan
Move the debug logging within ppc6xx_tlb_check() from after its only call to simplify the caller. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 54 ++--- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/target/ppc/mmu_common.c

[PULL v2 12/13] migration: Deprecate fd: for file migration

2024-05-08 Thread Fabiano Rosas
The fd: URI can currently trigger two different types of migration, a TCP migration using sockets and a file migration using a plain file. This is in conflict with the recently introduced (8.2) QMP migrate API that takes structured data as JSON-like format. We cannot keep the same backend for both

[PATCH v4 29/33] target/ppc: Split off common embedded TLB init

2024-05-08 Thread BALATON Zoltan
Several 4xx CPUs and e200 share the same TLB settings enclosed in an ifdef. Split it off in a common function to reduce code duplication and the number of ifdefs. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/cpu_init.c | 46

[PATCH v4 18/33] target/ppc/mmu_common.c: Replace hard coded constants in ppc_jumbo_xlate()

2024-05-08 Thread BALATON Zoltan
The "2" in booke206_update_mas_tlb_miss() call corresponds to MMU_INST_FETCH which is the value of access_type in this branch; mmubooke206_esr() only checks for MMU_DATA_STORE and it's called from code access so using MMU_DATA_LOAD here seems wrong so replace it with access_type here as well that

[PATCH v4 02/33] target/ppc: Move patching nip from exception handler to helper_scv

2024-05-08 Thread BALATON Zoltan
From: Nicholas Piggin Unlike sc, for scv a facility unavailable interrupt must be generated if FSCR[SCV]=0 so we can't raise the exception with nip set to next instruction but we can move advancing nip if the FSCR check passes to helper_scv so the exception handler does not need to change it.

[PULL v2 13/13] hmp/migration: Fix "migrate" command's documentation

2024-05-08 Thread Fabiano Rosas
From: Peter Xu Peter missed the Sphinx HMP document for the "resume/-r" flag in commit 7a4da28b26 ("qmp: hmp: add migrate "resume" option"). Add it. When at it, slightly cleanup the lines around: - Move "detach/-d" to a separate section rather than appending it at the end of the command

[PATCH v4 13/33] target/ppc/mmu_common.c: Split out BookE cases before checking real mode

2024-05-08 Thread BALATON Zoltan
BookE does not have real mode so split off and handle it first in get_physical_address_wtlb() before checking for real mode for other MMU models. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 14 +++--- 1 file changed, 7 insertions(+), 7

[PATCH v4 12/33] target/ppc/mmu_common.c: Eliminate ret from mmu6xx_get_physical_address()

2024-05-08 Thread BALATON Zoltan
Return directly, which is simpler than dragging a return value through multpile if and else blocks. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 84 +++-- 1 file changed, 39 insertions(+), 45 deletions(-) diff

[PATCH v4 05/33] target/ppc/mmu_common.c: Move calculation of a value closer to its usage

2024-05-08 Thread BALATON Zoltan
In mmubooke_check_tlb() and mmubooke206_check_tlb() prot2 is calculated first but only used after an unrelated check that can return before tha value is used. Move the calculation after the check, closer to where it is used, to keep them together and avoid computing it when not needed.

[PATCH v4 07/33] target/ppc/mmu_common.c: Simplify checking for real mode

2024-05-08 Thread BALATON Zoltan
In get_physical_address_wtlb() the real_mode flag depends on either the MSR[IR] or MSR[DR] bit depending on access_type. Extract just the needed bit in a more straight forward way instead of doing unnecessary computation. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin ---

[PATCH v4 16/33] target/ppc/mmu_common.c: Fix misindented qemu_log_mask() calls

2024-05-08 Thread BALATON Zoltan
Fix several qemu_log_mask() calls that are misindented. Signed-off-by: BALATON Zoltan Acked-by: Nicholas Piggin --- target/ppc/mmu_common.c | 42 - 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/target/ppc/mmu_common.c

[PULL v2 08/13] migration: Remove 'inc' option from migrate command

2024-05-08 Thread Fabiano Rosas
The block incremental option for block migration has been deprecated in 8.2 in favor of using the block-mirror feature. Remove it now. Deprecation commit 40101f320d ("migration: migrate 'inc' command option is deprecated."). Reviewed-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by:

[PATCH v4 23/33] target/ppc: Remove pp_check() and reuse ppc_hash32_pp_prot()

2024-05-08 Thread BALATON Zoltan
The ppc_hash32_pp_prot() function in mmu-hash32.c is the same as pp_check() in mmu_common.c, merge these to remove duplicated code. Define the common function in internal.h as static lnline otherwise exporting the function from mmu-hash32.c would stop the compiler inlining it which results in

[PATCH v4 20/33] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke_get_physical_address()

2024-05-08 Thread BALATON Zoltan
mmubooke_get_physical_address() only uses the raddr and prot fields from mmu_ctx_t. Pass these directly instead of using a ctx struct. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 30 ++ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git

[PATCH v4 24/33] target/ppc/mmu_common.c: Remove BookE from direct store handling

2024-05-08 Thread BALATON Zoltan
As BookE never returns -4 we can drop BookE from the direct store case in ppc_jumbo_xlate(). Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/ppc/mmu_common.c

[PATCH v4 21/33] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke206_get_physical_address()

2024-05-08 Thread BALATON Zoltan
mmubooke206_get_physical_address() only uses the raddr and prot fields from mmu_ctx_t. Pass these directly instead of using a ctx struct. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-) diff

[PULL v2 03/13] migration: process_incoming_migration_co(): complete cleanup on failure

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy Make call to migration_incoming_state_destroy(), instead of doing only partial of it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 5 + 1 file

[PATCH v4 27/33] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 2

2024-05-08 Thread BALATON Zoltan
Merge the code fetch and data access cases in a common switch. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 52 - 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c index

[PULL v2 04/13] migration: process_incoming_migration_co(): fix reporting s->error

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy It's bad idea to leave critical section with error object freed, but s->error still set, this theoretically may lead to use-after-free crash. Let's avoid it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu

[PATCH v4 17/33] target/ppc/mmu_common.c: Deindent ppc_jumbo_xlate()

2024-05-08 Thread BALATON Zoltan
Instead of putting a large block of code in an if, invert the condition and return early to be able to deindent the code block. Signed-off-by: BALATON Zoltan Acked-by: Nicholas Piggin --- target/ppc/mmu_common.c | 319 1 file changed, 159 insertions(+),

[PATCH v4 14/33] target/ppc/mmu_common.c: Split off real mode cases in get_physical_address_wtlb()

2024-05-08 Thread BALATON Zoltan
The real mode handling is identical in the remaining switch cases. Split off these common real mode cases into a separate conditional to leave only the else branches in the switch that are different. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 34

[PULL v2 09/13] migration: Remove 'blk/-b' option from migrate commands

2024-05-08 Thread Fabiano Rosas
The block migration is considered obsolete and has been deprecated in 8.2. Remove the migrate command option that enables it. This only affects the QMP and HMP commands, the feature can still be accessed by setting the migration 'block' capability. The whole feature will be removed in a future

[PULL v2 06/13] qapi: introduce exit-on-error parameter for migrate-incoming

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy Now we do set MIGRATION_FAILED state, but don't give a chance to orchestrator to query migration state and get the error. Let's provide a possibility for QMP-based orchestrators to get an error like with outgoing migration. For hmp_migrate_incoming(), let's

Re: [PATCH v3 33/33] target/ppc: Add a macro to check for page protection bit

2024-05-08 Thread BALATON Zoltan
On Wed, 8 May 2024, Nicholas Piggin wrote: On Wed May 8, 2024 at 10:15 AM AEST, BALATON Zoltan wrote: Checking if a page protection bit is set for a given access type is a common operation. Add a macro to avoid repeating the same check at multiple places and also avoid a function call. As this

[PULL v2 00/13] Migration patches for 2024-05-08

2024-05-08 Thread Fabiano Rosas
The following changes since commit 4e66a08546a2588a4667766a1edab9caccf24ce3: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-05-07 09:26:30 -0700) are available in the Git repository at: https://gitlab.com/farosas/qemu.git tags/migration-20240508-pull-request

Re: [PATCH v2 26/28] target/ppc/mmu_common.c: Move BookE MMU functions together

2024-05-08 Thread BALATON Zoltan
On Wed, 8 May 2024, Nicholas Piggin wrote: On Tue May 7, 2024 at 10:31 PM AEST, BALATON Zoltan wrote: On Tue, 7 May 2024, Nicholas Piggin wrote: What do you think about adding mmu-book3e.c instead? I have considered that but found that some functions have to be in the same file and declared

Re: [PATCH] gitlab: Update msys2-64bit runner tags

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 10:28, Philippe Mathieu-Daudé wrote: On 7/5/24 19:53, Richard Henderson wrote: Gitlab has deprecated and removed support for windows-1809 and shared-windows.  Update to saas-windows-medium-amd64 per

[PULL v2 16/28] hw/i386/x86: Extract x86_isa_bios_init() from x86_bios_rom_init()

2024-05-08 Thread Philippe Mathieu-Daudé
From: Bernhard Beschow The function is inspired by pc_isa_bios_init() and should eventually replace it. Using x86_isa_bios_init() rather than pc_isa_bios_init() fixes pflash commands to work in the isa-bios region. While at it convert the magic number 0x10 (== 1MiB) to increase readability.

[PULL v2 14/28] hw/i386/x86: Don't leak "isa-bios" memory regions

2024-05-08 Thread Philippe Mathieu-Daudé
From: Bernhard Beschow Fix the leaking in x86_bios_rom_init() and pc_isa_bios_init() by adding an "isa_bios" attribute to X86MachineState. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Message-ID:

[PULL v2 15/28] hw/i386/x86: Don't leak "pc.bios" memory region

2024-05-08 Thread Philippe Mathieu-Daudé
From: Bernhard Beschow Fix the leaking in x86_bios_rom_init() by adding a "bios" attribute to X86MachineState. Note that it is only used in the -bios case. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Message-ID: <20240508175507.22270-5-shen...@gmail.com> Signed-off-by:

[PULL v2 00/28] Misc HW patches for 2024-05-08

2024-05-08 Thread Philippe Mathieu-Daudé
/hw-misc-20240508 for you to fetch changes up to 8b4d80bb53af30db5de91749216d0bb73fa93cab: misc: Use QEMU header path relative to include/ directory (2024-05-09 00:07:21 +0200) Misc HW patches - Few more g_memdup() replaced

Re: [PATCH v3 0/6] X86: Alias isa-bios area and clean up

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 19:55, Bernhard Beschow wrote: v3: * Add comments for bios memory regions (Phil) Bernhard Beschow (6): hw/i386/x86: Eliminate two if statements in x86_bios_rom_init() hw/i386: Have x86_bios_rom_init() take X86MachineState rather than MachineState hw/i386/x86: Don't

Re: [PATCH v4 0/5] Add migration test for loongarch64

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 05:11, Bibo Mao wrote: Bibo Mao (5): hw/loongarch: Rename LOONGARCH_MACHINE with LOONGARCH_VIRT_MACHINE hw/loongarch: Rename LoongArchMachineState with LoongArchVirtMachineState Patches 1 & 2 queued to hw-misc so far, thanks.

Re: [PATCH] hw/mips/loongson3_virt: Emulate suspend function

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 23:54, Philippe Mathieu-Daudé wrote: On 8/5/24 19:28, Jiaxun Yang wrote: 在2024年5月8日五月 下午5:48,Philippe Mathieu-Daudé写道: On 8/5/24 17:35, Philippe Mathieu-Daudé wrote: On 8/5/24 11:31, Jiaxun Yang wrote: Suspend function is emulated as what hardware actually do. Doorbell register

Re: [PATCH] hw/mips/loongson3_virt: Emulate suspend function

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 19:28, Jiaxun Yang wrote: 在2024年5月8日五月 下午5:48,Philippe Mathieu-Daudé写道: On 8/5/24 17:35, Philippe Mathieu-Daudé wrote: On 8/5/24 11:31, Jiaxun Yang wrote: Suspend function is emulated as what hardware actually do. Doorbell register fields are updates to include suspend value,

Re: [PATCH 0/5] hw/mips/loongson3_virt: Implement IPI support

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 15:06, Jiaxun Yang wrote: Hi all, This series enabled IPI support for loongson3 virt board, loosely based on my previous work[1]. It generalized loongarch_ipi device to share among both loongarch and MIPS machines. Signed-off-by: Jiaxun Yang --- Jiaxun Yang (5):

Re: [PATCH] hw/clock: Expose 'freq-hz' QOM property

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 19:46, Peter Maydell wrote: On Wed, 8 May 2024 at 15:13, Philippe Mathieu-Daudé wrote: Expose the clock frequency via the QOM 'freq-hz' property, as it might be useful for QTests. HMP example: $ qemu-system-mips -S -monitor stdio -M mipssim (qemu) qom-get /machine/cpu-refclk

Re: [PATCH v3 00/28] glib: Replace g_memdup() by g_memdup2()

2024-05-08 Thread Philippe Mathieu-Daudé
On 3/9/21 19:44, Philippe Mathieu-Daudé wrote: Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to

Re: [PATCH v10 0/7] Support message-based DMA in vfio-user server

2024-05-08 Thread Mattias Nissler
On Wed, May 8, 2024 at 11:16 PM Philippe Mathieu-Daudé wrote: > > On 7/5/24 16:34, Mattias Nissler wrote: > > This series adds basic support for message-based DMA in qemu's vfio-user > > server. This is useful for cases where the client does not provide file > > descriptors for accessing system

Re: [PATCH] hw/loongarch/virt: Fix memory leak

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 04:22, Song Gao wrote: The char pointer 'ramName' point to a block of memory, but never free it. Use 'g_autofree' to automatically free it. Resolves: Coverity CID 1544773 Fixes: 0cf1478d6 ("hw/loongarch: Add numa support") Signed-off-by: Song Gao --- hw/loongarch/virt.c | 3 +--

Re: [PATCH v2] ppc: Deprecate 'ref405ep' machine and 405 CPUs

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 14:33, Cédric Le Goater wrote: The 'ref405ep' machine and PPC 405 CPU have no known users, firmware images are not available, OpenWRT dropped support in 2019, U-Boot in 2017, Linux also is dropping support in 2024. It is time to let go of this ancient hardware and focus on newer CPUs

Re: [PATCH v10 0/7] Support message-based DMA in vfio-user server

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 16:34, Mattias Nissler wrote: This series adds basic support for message-based DMA in qemu's vfio-user server. This is useful for cases where the client does not provide file descriptors for accessing system memory via memory mappings. My motivating use case is to hook up device models

Re: [PATCH] misc: Use QEMU header path relative to include/ directory

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 16:27, Philippe Mathieu-Daudé wrote: QEMU headers are relative to the include/ directory, not to the project root directory. Remove "include/". See also: https://www.qemu.org/docs/master/devel/style.html#include-directives Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH] loongarch64: move memory map to boot.c

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 16:51, Paolo Bonzini wrote: Ensure that it can be used even if virt.c is not included in the build, as is the case for --without-default-devices. Signed-off-by: Paolo Bonzini --- include/hw/loongarch/boot.h | 10 ++ include/hw/loongarch/virt.h | 10 --

Re: [PATCH 2/9] migration: Fix file migration with fdset

2024-05-08 Thread Fabiano Rosas
Daniel P. Berrangé writes: > On Fri, Apr 26, 2024 at 11:20:35AM -0300, Fabiano Rosas wrote: >> When the migration using the "file:" URI was implemented, I don't >> think any of us noticed that if you pass in a file name with the >> format "/dev/fdset/N", this allows a file descriptor to be

Re: [PATCH 8/9] migration: Add support for fdset with multifd + file

2024-05-08 Thread Fabiano Rosas
Peter Xu writes: > On Wed, May 08, 2024 at 09:53:48AM +0100, Daniel P. Berrangé wrote: >> On Fri, Apr 26, 2024 at 11:20:41AM -0300, Fabiano Rosas wrote: >> > Allow multifd to use an fdset when migrating to a file. This is useful >> > for the scenario where the management layer wants to have

Re: [PATCH v3 0/6] X86: Alias isa-bios area and clean up

2024-05-08 Thread BALATON Zoltan
On Wed, 8 May 2024, Bernhard Beschow wrote: This series changes the "isa-bios" MemoryRegion to be an alias rather than a copy in the pflash case. This fixes issuing pflash commands in the isa-bios region which matches real hardware and which some real-world legacy bioses I'm running rely on.

Re: [PATCH v8] virtio-pci: fix use of a released vector

2024-05-08 Thread Michael Tokarev
15.04.2024 12:34, Michael S. Tsirkin wrote: From: Cindy Lu During the booting process of the non-standard image, the behavior of the called function in qemu is as follows: 1. vhost_net_stop() was triggered by guest image. This will call the function virtio_pci_set_guest_notifiers() with

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-08 Thread Stefan Hajnoczi
On Wed, 8 May 2024 at 00:19, Zhao Liu wrote: > > In some trace log, there're unstable timestamp breaking temporal > ordering of trace records. For example: > > kvm_run_exit -0.015 pid=3289596 cpu_index=0x0 reason=0x6 > kvm_vm_ioctl -0.020 pid=3289596 type=0xc008ae67 arg=0x7ffeefb5aa60 >

Re: [PATCH 8/9] migration: Add support for fdset with multifd + file

2024-05-08 Thread Peter Xu
On Wed, May 08, 2024 at 09:53:48AM +0100, Daniel P. Berrangé wrote: > On Fri, Apr 26, 2024 at 11:20:41AM -0300, Fabiano Rosas wrote: > > Allow multifd to use an fdset when migrating to a file. This is useful > > for the scenario where the management layer wants to have control over > > the

Re: [PATCH] hw/virtio: Fix obtain the buffer id from the last descriptor

2024-05-08 Thread Michael S. Tsirkin
On Wed, May 08, 2024 at 02:56:11PM +0200, Eugenio Perez Martin wrote: > On Mon, Apr 22, 2024 at 3:41 AM Wafer wrote: > > > > The virtio-1.3 specification > > writes: > > 2.8.6 Next Flag: Descriptor Chaining > > Buffer ID is

[PATCH v14 3/6] ui/console: Use qemu_dmabuf_get_..() helpers instead

2024-05-08 Thread dongwon . kim
From: Dongwon Kim This commit updates all instances where fields within the QemuDmaBuf struct are directly accessed, replacing them with calls to these new helper functions. v6: fix typos in helper names in ui/spice-display.c v7: removed prefix, "dpy_gl_" from all helpers v8: Introduction of

Re: [PATCH v2 0/6] This series changes the "isa-bios" MemoryRegion to be an alias rather than a

2024-05-08 Thread Bernhard Beschow
Am 8. Mai 2024 14:53:49 UTC schrieb "Philippe Mathieu-Daudé" : >On 30/4/24 17:06, Bernhard Beschow wrote: > >> Bernhard Beschow (6): >>hw/i386/x86: Eliminate two if statements in x86_bios_rom_init() >>hw/i386: Have x86_bios_rom_init() take X86MachineState rather than >>

[PATCH v14 6/6] ui/console: move QemuDmaBuf struct def to dmabuf.c

2024-05-08 Thread dongwon . kim
From: Dongwon Kim To complete privatizing process of QemuDmaBuf, QemuDmaBuf struct def is moved to dmabuf.c Suggested-by: Marc-André Lureau Reviewed-by: Marc-André Lureau Cc: Philippe Mathieu-Daudé Cc: Daniel P. Berrangé Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim ---

[PATCH v14 0/6] ui/console: Private QemuDmaBuf struct

2024-05-08 Thread dongwon . kim
From: Dongwon Kim This series introduces privacy enhancements to the QemuDmaBuf struct and its contained data to bolster security. it accomplishes this by introducing of helper functions for allocating, deallocating, and accessing individual fields within the struct and replacing all direct

[PATCH v14 4/6] ui/console: Use qemu_dmabuf_set_..() helpers instead

2024-05-08 Thread dongwon . kim
From: Dongwon Kim This commit updates all occurrences where these fields were set directly have been updated to utilize helper functions. v7: removed prefix, "dpy_gl_" from all helpers v8: Introduction of helpers was removed as those were already added by the previous commit Suggested-by:

[PATCH v14 5/6] ui/console: Use qemu_dmabuf_new() and free() helpers instead

2024-05-08 Thread dongwon . kim
From: Dongwon Kim This commit introduces utility functions for the creation and deallocation of QemuDmaBuf instances. Additionally, it updates all relevant sections of the codebase to utilize these new utility functions. v7: remove prefix, "dpy_gl_" from all helpers qemu_dmabuf_free()

  1   2   3   4   >