Re: [PATCH v4 12/12] tests/qtest/vhost-user-test: add a test case for memory-backend-shm

2024-05-09 Thread Thomas Huth
On 08/05/2024 09.44, Stefano Garzarella wrote: `memory-backend-shm` can be used with vhost-user devices, so let's add a new test case for it. Signed-off-by: Stefano Garzarella --- tests/qtest/vhost-user-test.c | 23 +++ 1 file changed, 23 insertions(+) diff --git

Re: [PATCH v4 11/12] tests/qtest/vhost-user-blk-test: use memory-backend-shm

2024-05-09 Thread Thomas Huth
On 08/05/2024 09.44, Stefano Garzarella wrote: `memory-backend-memfd` is available only on Linux while the new `memory-backend-shm` can be used on any POSIX-compliant operating system. Let's use it so we can run the test in multiple environments. Signed-off-by: Stefano Garzarella ---

Re: [PATCH 13/13] tests/qtest: arm: fix operation in a build without any boards or devices

2024-05-09 Thread Thomas Huth
On 09/05/2024 19.00, Paolo Bonzini wrote: ARM/aarch64 are easy to fix because they already have to pass a machine type by hand. Just guard the tests with a check that the machine actually exists. Signed-off-by: Paolo Bonzini --- tests/qtest/arm-cpu-features.c | 4

Re: [PATCH 03/13] s390: move css_migration_enabled from machine to css.c

2024-05-09 Thread Thomas Huth
On 09/05/2024 19.00, Paolo Bonzini wrote: The CSS subsystem uses global variables, just face the truth and use a variable also for whether the CSS vmstate is in use; remove the indirection of fetching it from the machine type, which makes the TCG code depend unnecessarily on the virtio-ccw

Re: [PULL 0/3] loongarch-to-apply queue

2024-05-09 Thread Richard Henderson
tags/pull-loongarch-20240509 for you to fetch changes up to 5872966db7abaa7f8753541b7a9f242df9752b50: target/loongarch: Put cpucfg operation before CSR register (2024-05-09 15:19:22 +0800) pull-loongarch-20240509 Applied

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

2024-05-09 Thread Richard Henderson
On 5/9/24 01:35, Fabiano Rosas wrote: The following changes since commit 4e66a08546a2588a4667766a1edab9caccf24ce3: Merge tag 'for-upstream' ofhttps://gitlab.com/bonzini/qemu into staging (2024-05-07 09:26:30 -0700) are available in the Git repository at:

Re: [PATCH 05/13] tests/qtest: s390x: fix operation in a build without any boards or devices

2024-05-09 Thread Thomas Huth
On 09/05/2024 19.00, Paolo Bonzini wrote: Do the bare minimum to ensure that at least a vanilla --without-default-devices build works for all targets except i386, x86_64 and ppc64. In particular this fixes s390x-softmmu; i386 and x86_64 have about a dozen failing tests that do not pass -M and

Re: [PATCH 04/13] s390x: select correct components for no-board build

2024-05-09 Thread Thomas Huth
On 09/05/2024 19.00, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/buildtest.yml | 4 ++-- target/s390x/Kconfig | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index

Re: [PATCH 02/13] s390_flic: add migration-enabled property

2024-05-09 Thread Thomas Huth
On 09/05/2024 19.00, Paolo Bonzini wrote: Instead of mucking with css_migration_enabled(), add a property specific to the FLIC device, similar to what is done for TYPE_S390_STATTRIB. Signed-off-by: Paolo Bonzini --- include/hw/s390x/s390_flic.h | 1 + hw/intc/s390_flic.c | 6 +-

Re: [PATCH 01/13] s390x: move s390_cpu_addr2state to target/s390x/sigp.c

2024-05-09 Thread Thomas Huth
On 09/05/2024 19.00, Paolo Bonzini wrote: This function has no dependency on the virtio-ccw machine type, though it assumes that the CPU address corresponds to the core_id and the index. If there is any need of something different or more fancy (unlikely) S390 can include a MachineClass

Re: [PATCH v2] tests/qtest: Add some test cases support on LoongArch

2024-05-09 Thread Thomas Huth
On 09/05/2024 10.47, Bibo Mao wrote: Add boot-serial-test and filter test cases support on LoongArch system. Signed-off-by: Bibo Mao --- v1 ... v2: 1. Refresh the changelog, adding filter test case support also. 2. Adjust order of loongarch qtest in alphabetical order. --- Reviewed-by:

Re: [RFC 0/2] Identify aliased maps in vdpa SVQ iova_tree

2024-05-09 Thread Jason Wang
On Thu, May 9, 2024 at 3:10 PM Eugenio Perez Martin wrote: > > On Thu, May 9, 2024 at 8:27 AM Jason Wang wrote: > > > > On Thu, May 9, 2024 at 1:16 AM Eugenio Perez Martin > > wrote: > > > > > > On Wed, May 8, 2024 at 4:29 AM Jason Wang wrote: > > > > > > > > On Tue, May 7, 2024 at 6:57 PM

[PATCH] fix: correct typo in ext_zvkb configuration variable Signed-off-by: Kaiyao Duan

2024-05-09 Thread inspireMeNow
--- target/riscv/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index eb1a2e7d6d..13cd34adbd 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1535,7 +1535,7 @@ const RISCVCPUMultiExtConfig riscv_cpu_extensions[] = {

Re: [PATCH] target/i386: add feature dependency for XSAVE

2024-05-09 Thread Zhao Liu
On Thu, May 09, 2024 at 05:39:52PM +0200, Paolo Bonzini wrote: > Date: Thu, 9 May 2024 17:39:52 +0200 > From: Paolo Bonzini > Subject: [PATCH] target/i386: add feature dependency for XSAVE > X-Mailer: git-send-email 2.45.0 > > The XSAVEOPT, XSAVEC, XGETBV1, XSAVES features make no sense if you

Re: [PATCH] target/i386: fix feature dependency for WAITPKG

2024-05-09 Thread Zhao Liu
On Thu, May 09, 2024 at 05:39:50PM +0200, Paolo Bonzini wrote: > Date: Thu, 9 May 2024 17:39:50 +0200 > From: Paolo Bonzini > Subject: [PATCH] target/i386: fix feature dependency for WAITPKG > X-Mailer: git-send-email 2.45.0 > > The VMX feature bit depends on general availability of WAITPKG, >

Re: Re: [PATCH 1/9] block: add persistent reservation in/out api

2024-05-09 Thread zhenwei pi
On 5/10/24 02:22, Stefan Hajnoczi wrote: On Wed, May 08, 2024 at 05:36:21PM +0800, Changqi Lu wrote: [SNIP] + +/** + * Persist Through Power Loss(PTPL) is considered as required in QEMU + * block layer, the block driver need always enable PTPL. + */ What is the reasoning

RE: [PATCH] vfio: container: Fix missing allocation of VFIOSpaprContainer

2024-05-09 Thread Duan, Zhenzhong
>-Original Message- >From: Shivaprasad G Bhat >Subject: [PATCH] vfio: container: Fix missing allocation of >VFIOSpaprContainer > >The commit 6ad359ec29 "(vfio/spapr: Move prereg_listener into >spapr container)" began to use the newly introduced VFIOSpaprContainer >structure. > >After

Re: hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-05-09 Thread BALATON Zoltan
On Thu, 9 May 2024, Cord Amfmgm wrote: On Thu, May 9, 2024 at 12:48 PM Peter Maydell wrote: On Wed, 8 May 2024 at 16:29, Cord Amfmgm wrote: On Wed, May 8, 2024 at 3:45 AM Thomas Huth wrote: Your Signed-off-by line does not match the From: line ... could you please fix this? (see

[PATCH v5 23/32] target/ppc/mmu_common.c: Move mmu_ctx_t type to mmu_common.c

2024-05-09 Thread BALATON Zoltan
Remove mmu_ctx_t definition from internal.h as this type is only used within mmu_common.c. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/internal.h | 12 target/ppc/mmu_common.c | 11 +++ 2 files changed, 11 insertions(+), 12 deletions(-)

[PATCH v5 17/32] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke_get_physical_address()

2024-05-09 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 Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 30 ++ 1 file changed, 10 insertions(+),

[PATCH v5 16/32] target/ppc/mmu_common.c: Don't use mmu_ctx_t for mmu40x_get_physical_address()

2024-05-09 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 Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 37 +++-- 1 file changed, 15

[PATCH v5 20/32] target/ppc/mmu_common.c: Remove BookE from direct store handling

2024-05-09 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 v5 27/32] target/ppc: Split off common embedded TLB init

2024-05-09 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 v5 08/32] target/ppc/mmu_common.c: Move some debug logging

2024-05-09 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 Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 54 ++--- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git

[PATCH v5 32/32] target/ppc/mmu_common.c: Remove work around for spurious warnings

2024-05-09 Thread BALATON Zoltan
Now that some functions are external again the warnings don't appear any more so the work around added earlier can be removed again. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c

[PATCH v5 06/32] target/ppc/mmu_common.c: Introduce mmu6xx_get_physical_address()

2024-05-09 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 v5 24/32] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 1

2024-05-09 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 v5 13/32] target/ppc/mmu_common.c: Fix misindented qemu_log_mask() calls

2024-05-09 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

[PATCH v5 25/32] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 2

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

[PATCH v5 26/32] target/ppc: Remove id_tlbs flag from CPU env

2024-05-09 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 v5 29/32] target/ppc/mmu-radix64.c: Drop a local variable

2024-05-09 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 v5 19/32] target/ppc: Remove pp_check() and reuse ppc_hash32_pp_prot()

2024-05-09 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 v5 21/32] target/ppc/mmu_common.c: Split off BookE handling from ppc_jumbo_xlate()

2024-05-09 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 Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 148 ++-- 1 file changed, 98 insertions(+), 50 deletions(-) diff

[PATCH v5 15/32] target/ppc/mmu_common.c: Replace hard coded constants in ppc_jumbo_xlate()

2024-05-09 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 v5 11/32] target/ppc/mmu_common.c: Split off real mode cases in get_physical_address_wtlb()

2024-05-09 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

[PATCH v5 05/32] target/ppc/mmu_common.c: Drop cases for unimplemented MPC8xx MMU

2024-05-09 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 v5 03/32] target/ppc/mmu_common.c: Remove unneeded local variable

2024-05-09 Thread BALATON Zoltan
In mmubooke_check_tlb() and mmubooke206_check_tlb() we can assign the value of prot2 directly to 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

[PATCH v5 07/32] target/ppc/mmu_common.c: Move else branch to avoid large if block

2024-05-09 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 v5 18/32] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke206_get_physical_address()

2024-05-09 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 Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 32 ++-- 1 file changed, 10

[PATCH v5 10/32] target/ppc/mmu_common.c: Split out BookE cases before checking real mode

2024-05-09 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 v5 12/32] target/ppc/mmu_common.c: Inline and remove check_physical()

2024-05-09 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 v5 30/32] target/ppc: Add a function to check for page protection bit

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

Re: [PATCH 1/3] target/riscv: Save counter values during countinhibit update

2024-05-09 Thread Atish Kumar Patra
On Thu, May 2, 2024 at 5:39 AM Andrew Jones wrote: > > On Tue, Apr 30, 2024 at 03:00:45PM GMT, Daniel Henrique Barboza wrote: > > > > > > On 4/29/24 16:28, Atish Patra wrote: > > > Currently, if a counter monitoring cycle/instret is stopped via > > > mcountinhibit we just update the state while

[PATCH v5 22/32] target/ppc/mmu_common.c: Eliminate get_physical_address_wtlb()

2024-05-09 Thread BALATON Zoltan
Inline get_physical_address_wtlb() in its only caller and remove it. Signed-off-by: BALATON Zoltan --- target/ppc/internal.h | 5 +--- target/ppc/mmu_common.c | 66 + 2 files changed, 28 insertions(+), 43 deletions(-) diff --git

[PATCH v5 28/32] target/ppc/mmu-hash32.c: Drop a local variable

2024-05-09 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 v5 14/32] target/ppc/mmu_common.c: Deindent ppc_jumbo_xlate()

2024-05-09 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 v5 31/32] target/ppc: Move out BookE and related MMU functions from mmu_common.c

2024-05-09 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 Acked-by: Nicholas Piggin --- target/ppc/cpu.h| 4 - target/ppc/meson.build | 1 + target/ppc/mmu-booke.c | 531

[PATCH v5 01/32] target/ppc: Remove unused helper

2024-05-09 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 v5 02/32] target/ppc/mmu_common.c: Move calculation of a value closer to its usage

2024-05-09 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 v5 04/32] target/ppc/mmu_common.c: Simplify checking for real mode

2024-05-09 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 v5 00/32] Misc PPC exception and BookE MMU clean ups

2024-05-09 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 v5 09/32] target/ppc/mmu_common.c: Eliminate ret from mmu6xx_get_physical_address()

2024-05-09 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

Re: [PATCH v4 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 09:44:44AM +0200, Stefano Garzarella wrote: > v1: https://patchew.org/QEMU/20240228114759.44758-1-sgarz...@redhat.com/ > v2: https://patchew.org/QEMU/20240326133936.125332-1-sgarz...@redhat.com/ > v3: https://patchew.org/QEMU/20240404122330.92710-1-sgarz...@redhat.com/ >

Re: [PATCH V1 26/26] migration: only-migratable-modes

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > Add the only-migratable-modes option as a generalization of only-migratable. > Only devices that support all requested modes are allowed. > > Signed-off-by: Steve Sistare > --- > include/migration/misc.h | 3 +++ > include/sysemu/sysemu.h| 1 - >

[PATCH] vfio: container: Fix missing allocation of VFIOSpaprContainer

2024-05-09 Thread Shivaprasad G Bhat
The commit 6ad359ec29 "(vfio/spapr: Move prereg_listener into spapr container)" began to use the newly introduced VFIOSpaprContainer structure. After several refactors, today the container_of(container, VFIOSpaprContainer, ABC) is used when VFIOSpaprContainer is actually not allocated. On PPC64

Re: [PATCH 5/9] hw/scsi: add persistent reservation in/out api for scsi device

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:25PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations in the > SCSI device layer. By introducing the persistent > reservation in/out api, this enables the SCSI device > to perform reservation-related tasks, including querying > keys, querying

Re: [PATCH 0/9] Support persistent reservation operations

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:20PM +0800, Changqi Lu wrote: > Hi, > > I am going to introduce persistent reservation for QEMU block. > There are three parts in this series: > > Firstly, at the block layer, the commit abstracts seven APIs related to > the persistent reservation command. These

Re: [PATCH 7/9] hw/nvme: add helper functions for converting reservation types

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:27PM +0800, Changqi Lu wrote: > This commit introduces two helper functions > that facilitate the conversion between the > reservation types used in the NVME protocol > and those used in the block layer. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi >

Re: [PATCH 6/9] block/nvme: add reservation command protocol constants

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:26PM +0800, Changqi Lu wrote: > Add constants for the NVMe persistent command protocol. > The constants include the reservation command opcode and > reservation type values defined in section 7 of the NVMe > 2.0 specification. > > Signed-off-by: Changqi Lu >

Re: [PATCH 5/9] hw/scsi: add persistent reservation in/out api for scsi device

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:25PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations in the > SCSI device layer. By introducing the persistent > reservation in/out api, this enables the SCSI device > to perform reservation-related tasks, including querying > keys, querying

Re: [PATCH V1 25/26] migration: fix mismatched GPAs during cpr-exec

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > For cpr-exec mode, ramblock_is_ignored is always true, and the address of > each migrated memory region must match the address of the statically > initialized region on the target. However, for a PCI rom block, the region > address is set when the guest writes to a BAR

Re: [PATCH 4/9] scsi/util: add helper functions for persistent reservation types conversion

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:24PM +0800, Changqi Lu wrote: > This commit introduces two helper functions > that facilitate the conversion between the > persistent reservation types used in the SCSI > protocol and those used in the block layer. > > Signed-off-by: Changqi Lu > Signed-off-by:

Re: [PATCH 3/9] scsi/constant: add persistent reservation in/out protocol constants

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:23PM +0800, Changqi Lu wrote: > Add constants for the persistent reservation in/out protocol > in the scsi/constant module. The constants include the persistent > reservation command, type, and scope values defined in sections > 6.13 and 6.14 of the SCSI Primary

Re: [PATCH 2/9] block/raw: add persistent reservation in/out driver

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:22PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations for raw driver. > The following methods are implemented: bdrv_co_pr_read_keys, > bdrv_co_pr_read_reservation, bdrv_co_pr_register, bdrv_co_pr_reserve, > bdrv_co_pr_release, bdrv_co_pr_clear

Re: [PATCH 1/9] block: add persistent reservation in/out api

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:21PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations > at the block level. The following operations > are included: > > - read_keys:retrieves the list of registered keys. > - read_reservation: retrieves the current reservation status.

Re: hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-05-09 Thread Cord Amfmgm
On Thu, May 9, 2024 at 12:48 PM Peter Maydell wrote: > On Wed, 8 May 2024 at 16:29, Cord Amfmgm wrote: > > On Wed, May 8, 2024 at 3:45 AM Thomas Huth wrote: > >> > >> Your Signed-off-by line does not match the From: line ... could you > please > >> fix this? (see > >> >

Re: [PATCH V1 24/26] seccomp: cpr-exec blocker

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > cpr-exec mode needs permission to exec. Block it if permission is denied. > > Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas

Re: [PATCH V1 23/26] migration: misc cpr-exec blockers

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > Add blockers for cpr-exec migration mode for devices and options that do > not support it. > > Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas

Re: [PATCH V1 22/26] migration: ram block cpr-exec blockers

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > Unlike cpr-reboot mode, cpr-exec mode cannot save volatile ram blocks in the > migration stream file and recreate them later, because the physical memory for > the blocks is pinned and registered for vfio. Add an exec-mode blocker for > volatile ram blocks. > > Also add

Re: hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-05-09 Thread Peter Maydell
On Wed, 8 May 2024 at 16:29, Cord Amfmgm wrote: > On Wed, May 8, 2024 at 3:45 AM Thomas Huth wrote: >> >> Your Signed-off-by line does not match the From: line ... could you please >> fix this? (see >>

Re: [PATCH V1 21/26] migration: migrate_add_blocker_mode

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > Define a convenience function to add a migration blocker for a single mode. > > Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas

[PATCH v5 5/8] softmmu: Replace check for RAMBlock offset 0 with xen_mr_is_memory

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" For xen, when checking for the first RAM (xen_memory), use xen_mr_is_memory() rather than checking for a RAMBlock with offset 0. All Xen machines create xen_memory first so this has no functional change for existing machines. Signed-off-by: Edgar E. Iglesias ---

[PATCH v5 6/8] xen: mapcache: Pass the ram_addr offset to xen_map_cache()

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Pass the ram_addr offset to xen_map_cache. This is in preparation for adding grant mappings that need to compute the address within the RAMBlock. No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 16 +++-

[PATCH v5 2/8] xen: mapcache: Unmap first entries in buckets

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" When invalidating memory ranges, if we happen to hit the first entry in a bucket we were never unmapping it. This was harmless for foreign mappings but now that we're looking to reuse the mapcache for transient grant mappings, we must unmap entries when invalidated.

[PATCH v5 7/8] xen: mapcache: Add support for grant mappings

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add a second mapcache for grant mappings. The mapcache for grants needs to work with XC_PAGE_SIZE granularity since we can't map larger ranges than what has been granted to us. Like with foreign mappings (xen_memory), machines using grants are expected to initialize

[PATCH v5 3/8] xen: Add xen_mr_is_memory()

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add xen_mr_is_memory() to abstract away tests for the xen_memory MR. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Acked-by: David Hildenbrand --- hw/xen/xen-hvm-common.c | 10 -- include/sysemu/xen.h| 8

[PATCH v5 0/8] xen: Support grant mappings

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Hi, Grant mappings are a mechanism in Xen for guests to grant each other permissions to map and share pages. These grants can be temporary so both map and unmaps must be respected. See here for more info:

[PATCH v5 4/8] softmmu: xen: Always pass offset + addr to xen_map_cache

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Always pass address with offset to xen_map_cache(). This is in preparation for support for grant mappings. Since this is within a block that checks for offset == 0, this has no functional changes. Signed-off-by: Edgar E. Iglesias --- system/physmem.c | 3 ++- 1 file

[PATCH v5 1/8] xen: mapcache: Make MCACHE_BUCKET_SHIFT runtime configurable

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Make MCACHE_BUCKET_SHIFT runtime configurable per cache instance. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/xen/xen-mapcache.c | 54 ++- 1 file changed, 33 insertions(+), 21 deletions(-) diff

[PATCH v5 8/8] hw/arm: xen: Enable use of grant mappings

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/xen_arm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 15fa7dfa84..6fad829ede 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@

Re: [PATCH] target/riscv: Remove experimental prefix from "B" extension

2024-05-09 Thread Daniel Henrique Barboza
On 5/8/24 08:22, Andrew Jones wrote: On Tue, May 07, 2024 at 11:27:21AM GMT, Rob Bradford wrote: This extension has now been ratified: https://jira.riscv.org/browse/RVS-2006 so the "x-" prefix can be removed. Signed-off-by: Rob Bradford --- target/riscv/cpu.c | 2 +- 1 file changed, 1

[PATCH 13/13] tests/qtest: arm: fix operation in a build without any boards or devices

2024-05-09 Thread Paolo Bonzini
ARM/aarch64 are easy to fix because they already have to pass a machine type by hand. Just guard the tests with a check that the machine actually exists. Signed-off-by: Paolo Bonzini --- tests/qtest/arm-cpu-features.c | 4 tests/qtest/migration-test.c | 6 ++ tests/qtest/numa-test.c

[PATCH 01/13] s390x: move s390_cpu_addr2state to target/s390x/sigp.c

2024-05-09 Thread Paolo Bonzini
This function has no dependency on the virtio-ccw machine type, though it assumes that the CPU address corresponds to the core_id and the index. If there is any need of something different or more fancy (unlikely) S390 can include a MachineClass subclass and implement it there. For now, move it

[PATCH 08/13] i386: correctly select code in hw/i386 that depends on other components

2024-05-09 Thread Paolo Bonzini
fw_cfg.c and vapic.c are currently included unconditionally but depend on other components. vapic.c depends on the local APIC, while fw_cfg.c includes a piece of AML builder code that depends on CONFIG_ACPI. Signed-off-by: Paolo Bonzini --- hw/i386/fw_cfg.c| 2 ++ hw/i386/meson.build | 2

[PATCH 12/13] i386: select correct components for no-board build

2024-05-09 Thread Paolo Bonzini
The local APIC is a part of the CPU and has callbacks that are invoked from multiple accelerators. The IOAPIC on the other hand is optional, but ioapic_eoi_broadcast is used by common x86 code to implement the IOAPIC's implicit EOI mode. Add a stub in case the IOAPIC device is not included but

[PATCH 07/13] xen: register legacy backends via xen_backend_init

2024-05-09 Thread Paolo Bonzini
It is okay to register legacy backends in the middle of xen_bus_init(). All that the registration does is record the existence of the backend in xenstore. This makes it possible to remove them from the build without introducing undefined symbols in xen_be_init(). It also removes the need for the

[PATCH 02/13] s390_flic: add migration-enabled property

2024-05-09 Thread Paolo Bonzini
Instead of mucking with css_migration_enabled(), add a property specific to the FLIC device, similar to what is done for TYPE_S390_STATTRIB. Signed-off-by: Paolo Bonzini --- include/hw/s390x/s390_flic.h | 1 + hw/intc/s390_flic.c | 6 +- hw/s390x/s390-virtio-ccw.c | 1 + 3 files

[PATCH 03/13] s390: move css_migration_enabled from machine to css.c

2024-05-09 Thread Paolo Bonzini
The CSS subsystem uses global variables, just face the truth and use a variable also for whether the CSS vmstate is in use; remove the indirection of fetching it from the machine type, which makes the TCG code depend unnecessarily on the virtio-ccw machine. Signed-off-by: Paolo Bonzini ---

[PATCH 06/13] xen: initialize legacy backends from xen_bus_init()

2024-05-09 Thread Paolo Bonzini
Prepare for moving the calls to xen_be_register() under the control of xen_bus_init(), using the normal xen_backend_init() method that is used by the "modern" backends. This requires the xenstore global variable to be initialized, which is done by xen_be_init(). To ensure that everything is

[PATCH 00/13] fix --without-default-devices build and (mostly) tests

2024-05-09 Thread Paolo Bonzini
The recent change to make boards "default y" made them go away from a --without-default-devices build, because the boards are not anymore enabled explicitly in configs/devices/. This is a problem for some targets that were not fully ready for this and have generic target code that needs symbols

[PATCH 05/13] tests/qtest: s390x: fix operation in a build without any boards or devices

2024-05-09 Thread Paolo Bonzini
Do the bare minimum to ensure that at least a vanilla --without-default-devices build works for all targets except i386, x86_64 and ppc64. In particular this fixes s390x-softmmu; i386 and x86_64 have about a dozen failing tests that do not pass -M and therefore require a default machine type;

[PATCH 11/13] hw/i386: move rtc-reset-reinjection command out of hw/rtc

2024-05-09 Thread Paolo Bonzini
The rtc-reset-reinjection QMP command is specific to x86, other boards do not have the ACK tracking functionality that is needed for RTC interrupt reinjection. Therefore the QMP command is only included in x86, but qmp_rtc_reset_reinjection() is implemented by hw/rtc/mc146818rtc.c and requires

[PATCH 10/13] hw/i386: split x86.c in multiple parts

2024-05-09 Thread Paolo Bonzini
Keep the basic X86MachineState definition in x86.c. Move out functions that are only needed by other files: x86-common.c for the pc and microvm machines, x86-cpu.c for those used by accelerator code. Signed-off-by: Paolo Bonzini --- include/hw/i386/x86.h |6 +- hw/i386/x86-common.c | 1007

[PATCH 09/13] i386: pc: remove unnecessary MachineClass overrides

2024-05-09 Thread Paolo Bonzini
There is no need to override these fields of MachineClass because they are already set to the right value in the superclass. Signed-off-by: Paolo Bonzini --- include/hw/i386/x86.h | 4 hw/i386/pc.c | 3 --- hw/i386/x86.c | 6 +++--- 3 files changed, 3 insertions(+), 10

[PATCH 04/13] s390x: select correct components for no-board build

2024-05-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/buildtest.yml | 4 ++-- target/s390x/Kconfig | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 13afd0df1f0..f8502905203 100644 --- a/.gitlab-ci.d/buildtest.yml

[PATCH] target/i386: add feature dependency for XSAVE

2024-05-09 Thread Paolo Bonzini
The XSAVEOPT, XSAVEC, XGETBV1, XSAVES features make no sense if you cannot enable XSAVE in the first place. Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f2ea6899e39..6f5ff71c6ee 100644 ---

[PATCH] target/i386: fix feature dependency for WAITPKG

2024-05-09 Thread Paolo Bonzini
The VMX feature bit depends on general availability of WAITPKG, not the other way round. Fixes: 33cc88261c3 ("target/i386: add support for VMX_SECONDARY_EXEC_ENABLE_USER_WAIT_PAUSE", 2023-08-28) Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 ++-- 1 file

[PATCH] target/i386: move prefetch and multi-byte UD/NOP to new decoder

2024-05-09 Thread Paolo Bonzini
These are trivial to add, and moving them to the new decoder fixes some corner cases: raising #UD instead of an instruction fetch page fault for the undefined opcodes, and incorrectly rejecting 0F 18 prefetches with register operands (which are treated as reserved NOPs). Signed-off-by: Paolo

[PATCH] target/i386: fix operand size for DATA16 REX.W POPCNT

2024-05-09 Thread Paolo Bonzini
According to the manual, 32-bit vs 64-bit is governed by REX.W and REX ignores the 0x66 prefix. This can be confirmed with this program: #include int main() { int x = 0x1234; int y; asm("popcntl %1, %0" : "=r" (y) : "r" (x)); printf("%x\n", y);

[PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt

2024-05-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/tcg/i386/test-i386.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c index 864c4e620d5..ce3bf74b5a8 100644 --- a/tests/tcg/i386/test-i386.c +++

  1   2   >