Re: [PULL 05/11] ui/console: Use qemu_dmabuf_get_..() helpers instead

2024-05-15 Thread Cédric Le Goater
On 5/15/24 14:38, Richard Henderson wrote: On 5/14/24 15:17, marcandre.lur...@redhat.com wrote: --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -70,6 +70,7 @@ void gd_egl_draw(VirtualConsole *vc)   QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;   #endif   int ww, wh, ws; +    int fence_fd;  

Re: [PATCH v5 01/10] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-15 Thread Avihai Horon
On 15/05/2024 15:36, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/15/24 14:29, Avihai Horon wrote: On 15/05/2024 15:25, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/15/24 14:17, Avihai Horon wrote: On 13/

Re: [PATCH v2 06/15] hw/riscv/virt.c: support for RISC-V IOMMU PCIDevice hotplug

2024-05-15 Thread Eric Cheng
On 3/8/2024 12:03 AM, Daniel Henrique Barboza wrote: From: Tomasz Jeznach Generate device tree entry for riscv-iommu PCI device, along with mapping all PCI device identifiers to the single IOMMU device instance. Signed-off-by: Tomasz Jeznach Signed-off-by: Daniel Henrique Barboza --- hw/ri

Re: [PATCH v2 02/15] hw/riscv: add riscv-iommu-bits.h

2024-05-15 Thread Eric Cheng
On 3/8/2024 12:03 AM, Daniel Henrique Barboza wrote: From: Tomasz Jeznach This header will be used by the RISC-V IOMMU emulation to be added in the next patch. Due to its size it's being sent in separate for an easier review. One thing to notice is that this header can be replaced by the futur

Re: [PATCH] physmem: allow debug writes to MMIO regions

2024-05-15 Thread Philippe Mathieu-Daudé
Hi Perry, On 14/5/24 01:33, Perry Hung wrote: Writes from GDB to memory-mapped IO regions are currently silently dropped. cpu_memory_rw_debug() calls address_space_write_rom(), which calls address_space_write_rom_internal(), which ignores all non-ram/rom regions. Add a check for MMIO regions an

Re: [PATCH 4/9] migration: Add direct-io parameter

2024-05-15 Thread Fabiano Rosas
Markus Armbruster writes: > Fabiano Rosas writes: > >> Markus Armbruster writes: >> >>> Peter Xu writes: >>> On Fri, May 03, 2024 at 05:49:32PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Fri, Apr 26, 2024 at 11:20:37AM -0300, Fabiano Rosas wrote: > >> Add th

Re: [PATCH 02/17] Fix load_image error check for mmap

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:53, Richard Henderson wrote: mmap does not return null on failure, but MAP_FAILED. Signed-off-by: Richard Henderson --- risu.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 05/17] Remove return value from reginfo_dump

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:53, Richard Henderson wrote: No uses actually checked the error indication. Even if we wanted to check ferror on the stream, we should do that generically rather than per arch. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- risu.h | 4 ++--

Re: [PULL 05/11] ui/console: Use qemu_dmabuf_get_..() helpers instead

2024-05-15 Thread Richard Henderson
On 5/15/24 14:42, Cédric Le Goater wrote: On 5/15/24 14:38, Richard Henderson wrote: On 5/14/24 15:17, marcandre.lur...@redhat.com wrote: --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -70,6 +70,7 @@ void gd_egl_draw(VirtualConsole *vc)   QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;   #endif    

Re: [PATCH 07/17] ppc64: Compare all bits of CCR

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:53, Richard Henderson wrote: There are 32 bits in this register, and they are all valid comparision destinations. Signed-off-by: Richard Henderson --- risu_reginfo_ppc64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 10/17] aarch64: Tidy reginfo dumping ahead of ZA state

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:53, Richard Henderson wrote: A misalignment for sve_vl, plus add a bit more space on the left for the ZA[n] field name. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- risu_reginfo_aarch64.c | 29 ++--- 1 file changed, 18 insertions(+),

Re: [PATCH 13/17] Use bool for reginfo_is_eq

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:53, Richard Henderson wrote: The function result is more naturally boolean. Signed-off-by: Richard Henderson --- risu.h | 4 ++-- risu_reginfo_aarch64.c | 4 ++-- risu_reginfo_arm.c | 4 ++-- risu_reginfo_i386.c| 4 ++-- risu_regin

Re: [PATCH 14/17] aarch64: Use bool for sve_{z,p}reg_is_eq

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:53, Richard Henderson wrote: The functions results are more naturally boolean. Signed-off-by: Richard Henderson --- risu_reginfo_aarch64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PULL 00/43] target/hppa: Misc improvements

2024-05-15 Thread Richard Henderson
https://gitlab.com/rth7680/qemu.git tags/pull-hppa-20240515 for you to fetch changes up to 9e035f00788c52a6f51529c54371a611d9f8b089: target/hppa: Log cpu state on return-from-interrupt (2024-05-15 10:03:45 +0200) target/hppa

Re: [PULL 00/34] tcg patch queue

2024-05-15 Thread Richard Henderson
https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20240515 for you to fetch changes up to c9290dfebfdba5c13baa5e1f10e13a1c876b0643: tcg/loongarch64: Fill out tcg_out_{ld,st} for vector regs (2024-05-15 08:57:39 +0200) tcg/loongarch64

Re: [PATCH 15/17] risu: Allow use of ELF test files

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:53, Richard Henderson wrote: By using elf files, we make it easier to disassemble the test file, to match comparison failures to code. Signed-off-by: Richard Henderson --- risu.c | 53 + 1 file changed, 53 insertions(+) diff

Re: [PATCH 16/17] configure: Enable loongarch64

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:53, Richard Henderson wrote: Signed-off-by: Richard Henderson --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 17/17] Build elf test cases instead of raw binaries

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:54, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Makefile | 19 ++- test.ld| 12 test_aarch64.s | 4 ++-- test_arm.s | 16 +++- test_i386.S| 4 +++- Maybe briefly mention why the .S changes. R

Re: [PATCH 16/17] configure: Enable loongarch64

2024-05-15 Thread Philippe Mathieu-Daudé
On 11/5/24 13:53, Richard Henderson wrote: Signed-off-by: Richard Henderson --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 2f7c580..39275a2 100755 --- a/configure +++ b/configure @@ -54,6 +54,8 @@ guess_arch() { ARCH=

Re: [PATCH 01/17] ppc64: Fix include order

2024-05-15 Thread Philippe Mathieu-Daudé
Hi Richard, On 11/5/24 13:53, Richard Henderson wrote: Signed-off-by: Richard Henderson --- risu_ppc64.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/risu_ppc64.c b/risu_ppc64.c index 9df8d58..62cf6aa 100644 --- a/risu_ppc64.c +++ b/risu_ppc64.c @@ -11,9 +11,8 @@

Re: [RFC PATCH v3 07/18] hw/arm/smmuv3: Translate CD and TT using stage-2 table

2024-05-15 Thread Eric Auger
Hi Mostafa, On 4/29/24 05:23, Mostafa Saleh wrote: > According to ARM SMMU architecture specification (ARM IHI 0070 F.b), > In "5.2 Stream Table Entry": > [51:6] S1ContextPtr > If Config[1] == 1 (stage 2 enabled), this pointer is an IPA translated by > stage 2 and the programmed value must be w

[PATCH v3 1/4] qapi/vfio: Add VFIO migration QAPI event

2024-05-15 Thread Avihai Horon
Add a new QAPI event for VFIO migration. This event will be emitted when a VFIO device changes its migration state, for example, during migration or when stopping/starting the guest. This event can be used by management applications to get updates on the current state of the VFIO device for their

[PATCH v3 0/4] qapi/vfio: Add VFIO migration QAPI event

2024-05-15 Thread Avihai Horon
Hello, This series adds a new QAPI event for VFIO device migration state change. This event will be emitted when a VFIO device changes its state, for example, during migration or when stopping/starting the guest. This event can be used by management applications to get updates on the current sta

[PATCH v3 4/4] vfio/migration: Enhance VFIO migration state tracing

2024-05-15 Thread Avihai Horon
Move trace_vfio_migration_set_state() to the top of the function, add recover_state to it, and add a new trace event to vfio_migration_set_device_state(). This improves tracing of device state changes as state changes are now also logged when vfio_migration_set_state() fails (covering recover stat

[PATCH v3 2/4] vfio/migration: Emit VFIO migration QAPI event

2024-05-15 Thread Avihai Horon
Emit VFIO migration QAPI event when a VFIO device changes its migration state. This can be used by management applications to get updates on the current state of the VFIO device for their own purposes. A new per VFIO device capability, "migration-events", is added so events can be enabled only for

[PATCH v3 3/4] vfio/migration: Don't emit STOP_COPY VFIO migration QAPI event twice

2024-05-15 Thread Avihai Horon
When migrating a VFIO device that supports pre-copy, it is transitioned to STOP_COPY twice: once in vfio_vmstate_change() and second time in vfio_save_complete_precopy(). The second transition is harmless, as it's a STOP_COPY->STOP_COPY no-op transition. However, with the newly added VFIO migratio

Re: [RFC PATCH v3 08/18] hw/arm/smmu-common: Add support for nested TLB

2024-05-15 Thread Eric Auger
Hi Mostafa, On 4/29/24 05:23, Mostafa Saleh wrote: > This patch adds support for nested(combined) TLB entries. space between nested and (. > The main function combine_tlb() is not used here but in the next > patches, but to simplify the patches it is introduced first. > > Main changes: > 1) New en

Re: [PATCH 01/17] ppc64: Fix include order

2024-05-15 Thread Richard Henderson
On 5/15/24 15:11, Philippe Mathieu-Daudé wrote: Hi Richard, On 11/5/24 13:53, Richard Henderson wrote: Signed-off-by: Richard Henderson ---   risu_ppc64.c | 3 +--   1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/risu_ppc64.c b/risu_ppc64.c index 9df8d58..62cf6aa 100644 --- a/risu

Re: [RFC PATCH v3 09/18] hw/arm/smmu-common: Rework TLB lookup for nesting

2024-05-15 Thread Eric Auger
On 4/29/24 05:23, Mostafa Saleh wrote: > In the previous patch, comine_tlb() was added which combines 2 TLB combine > entries into one, which chooses the granule and level from the > smallest entry. > > This means that a nested translation, an entry can be cached with the that with nested transl

[PATCH v3 0/5] Fix "virtio-gpu: fix scanout migration post-load"

2024-05-15 Thread marcandre . lureau
From: Marc-André Lureau Hi, The aforementioned patch breaks virtio-gpu device migrations for versions pre-9.0/9.0, both forwards and backwards. Versioning of `VMS_STRUCT` is more complex than it may initially appear, as evidenced in the problematic commit dfcf74fa68c ("virtio-gpu: fix scanout mi

[PATCH v3 1/5] migration: add "exists" info to load-state-field trace

2024-05-15 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Peter Xu --- migration/vmstate.c| 5 +++-- migration/trace-events | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/migration/vmstate.c b/migration/vmstate.c index ef26f26ccd..b51212a75b 100644 --- a

[PATCH v3 2/5] migration: fix a typo

2024-05-15 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Peter Xu Reviewed-by: Fabiano Rosas --- migration/vmstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/vmstate.c b/migration/vmstate.c index b51212a75b..ff5d589a6d 100644 --- a/migration/v

[PATCH v3 4/5] Set major/minor for PC and arm machines

2024-05-15 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- include/hw/i386/pc.h | 4 ++- hw/arm/virt.c| 2 ++ hw/i386/pc_piix.c| 74 ++-- hw/i386/pc_q35.c | 62 ++--- 4 files changed, 73 insertions(+), 6

[PATCH v3 3/5] hw/boards: add machine_check_version()

2024-05-15 Thread marcandre . lureau
From: Marc-André Lureau Add optional major/minor version fields to the MachineClass, and a helper to check if the current machine version is >= (major, minor). This function can be used to check for extra migration fields, instead of relying on structure version which are typically associated to

[PATCH v3 5/5] virtio-gpu: fix v2 migration

2024-05-15 Thread marcandre . lureau
From: Marc-André Lureau Commit dfcf74fa ("virtio-gpu: fix scanout migration post-load") broke forward/backward version migration. Versioning of nested VMSD structures is not straightforward, as the wire format doesn't have nested structures versions. Use the previously introduced check_machine_v

Re: [PATCH 04/20] qapi/parser: preserve indentation in QAPIDoc sections

2024-05-15 Thread Markus Armbruster
John Snow writes: > On Wed, May 15, 2024, 7:50 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > Prior to this patch, a section like this: >> > >> > @name: lorem ipsum >> >dolor sit amet >> > consectetur adipiscing elit >> > >> > would be parsed as: >> > >> > "lorem ipsum\ndol

Re: [PATCH v2 02/15] hw/riscv: add riscv-iommu-bits.h

2024-05-15 Thread Daniel Henrique Barboza
On 5/15/24 07:02, Eric Cheng wrote: On 3/8/2024 12:03 AM, Daniel Henrique Barboza wrote: From: Tomasz Jeznach This header will be used by the RISC-V IOMMU emulation to be added in the next patch. Due to its size it's being sent in separate for an easier review. One thing to notice is that

Re: [PATCH v11 00/21] i386: Introduce smp.modules and clean up cache topology

2024-05-15 Thread Zhao Liu
Hi Paolo, I have a question before I do a new v12 rebase: Since patch 5,6,7 fixed CPUID encoding way, should I add the compat options for older machines to be compatible with past encoding behavior? Thanks, Zhao On Wed, Apr 24, 2024 at 11:49:08PM +0800, Zhao Liu wrote: > Date: Wed, 24 Apr 2024

Re: [PATCH v2 1/1] target/riscv/kvm.c: Fix the hart bit setting of AIA

2024-05-15 Thread Andrew Jones
On Wed, May 15, 2024 at 05:11:28PM GMT, Yong-Xuan Wang wrote: > In AIA spec, each hart (or each hart within a group) has a unique hart > number to locate the memory pages of interrupt files in the address > space. The number of bits required to represent any hart number is equal > to ceil(log2(hmax

[PATCH 4/5] tcg/arm: Support TCG_TARGET_HAS_tst_vec

2024-05-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.h | 2 +- tcg/arm/tcg-target.c.inc | 23 --- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 434a892e07..fb7261499b 100644 --- a/tcg/arm/tcg-target.h

[PATCH 3/5] tcg/aarch64: Support TCG_TARGET_HAS_tst_vec

2024-05-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 2 +- tcg/aarch64/tcg-target.c.inc | 26 -- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 138bafb9da..8bd9e6a5eb 100644 --- a/tc

[PATCH 0/5] tcg: Support TCG_COND_TST* for vectors

2024-05-15 Thread Richard Henderson
It would be weird if some TCG_COND_* codes are supported in only restricted cases. Let's go ahead and fill this out. Based-on: 20240506010403.6204-1-richard.hender...@linaro.org ("[PATCH 00/57] target/arm: Convert a64 advsimd to decodetree (part 1)") I will inject the target/arm patch as 45.5 in

[PATCH 1/5] tcg: Introduce TCG_TARGET_HAS_tst_vec

2024-05-15 Thread Richard Henderson
Prelude to supporting TCG_COND_TST* in vector comparisons. Signed-off-by: Richard Henderson --- include/tcg/tcg.h| 1 + tcg/aarch64/tcg-target.h | 1 + tcg/arm/tcg-target.h | 1 + tcg/i386/tcg-target.h| 1 + tcg/loongarch64/tcg-target.h | 1 + tcg/ppc/tcg-target.h

[PATCH 5/5] target/arm: Use TCG_COND_TSTNE in gen_cmtst_vec

2024-05-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/gengvec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c index 1d6bc6021d..1895c3b19f 100644 --- a/target/arm/tcg/gengvec.c +++ b/target/arm/tcg/gengvec.c @@ -943,9 +943

[PATCH 2/5] tcg: Expand TCG_COND_TST* if not TCG_TARGET_HAS_tst_vec

2024-05-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/tcg-op-vec.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index 094298bb27..84af210bc0 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -508,9 +508,11 @@ void tcg_gen_cmp_vec(TCGCond con

[PATCH v3 06/28] target/i386: Convert do_fsave, do_frstor to X86Access

2024-05-15 Thread Richard Henderson
Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 60 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 01e9a1fbbf..df12eac71e 100644

[PATCH v3 03/28] target/i386: Convert helper_{fbld, fbst}_ST0 to X86Access

2024-05-15 Thread Richard Henderson
Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 1662643a8f..6237cd8383 100644 --- a/targe

[PATCH v3 13/28] target/i386: Add rbfm argument to cpu_x86_{xsave, xrstor}

2024-05-15 Thread Richard Henderson
For now, continue to pass all 1's from signal.c. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/cpu.h| 4 ++-- linux-user/i386/signal.c | 4 ++-- target/i386/tcg/fpu_helper.c | 8 3 files changed, 8 insertions(+), 8 deletions(-) diff --git

[PATCH v3 22/28] linux-user/i386: Fix allocation and alignment of fp state

2024-05-15 Thread Richard Henderson
For modern cpus, the kernel uses xsave to store all extra cpu state across the signal handler. For xsave/xrstor to work, the pointer must be 64 byte aligned. Moreover, the regular part of the signal frame must be 16 byte aligned. Attempt to mirror the kernel code as much as possible. Use enum FP

[PATCH v3 15/28] linux-user/i386: Drop xfeatures_size from sigcontext arithmetic

2024-05-15 Thread Richard Henderson
This is subtracting sizeof(target_fpstate_fxsave) in TARGET_FXSAVE_SIZE, then adding it again via &fxsave->xfeatures. Perform the same computation using xstate_size alone. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 7 +++ 1 file changed, 3 ins

[PATCH v3 00/28] linux-user/i386: Properly align signal frame

2024-05-15 Thread Richard Henderson
v2: https://lore.kernel.org/qemu-devel/20240409050302.1523277-1-richard.hender...@linaro.org/ Disconnect fpstate from sigframe, just like the kernel does. Return the separate portions of the frame from get_sigframe. Alter all of the target fpu routines to access memory that has already been trans

[PATCH v3 20/28] linux-user/i386: Return boolean success from restore_sigcontext

2024-05-15 Thread Richard Henderson
Invert the sense of the return value and use bool. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 51 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/linux-user/i386/signal.c b/linux-user/i386/s

[PATCH v3 12/28] target/i386: Split out do_xsave_chk

2024-05-15 Thread Richard Henderson
This path is not required by user-only, and can in fact be shared between xsave and xrstor. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 51 +++- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/tar

[PATCH v3 10/28] target/i386: Convert do_xsave_* to X86Access

2024-05-15 Thread Richard Henderson
The body of do_xsave is now fully converted. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 47 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu

[PATCH v3 08/28] target/i386: Convert do_xrstor_{fpu, mxcr, sse} to X86Access

2024-05-15 Thread Richard Henderson
Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 46 ++-- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 8fbe6e00ce..f21cdb45ea 100644

[PATCH v3 18/28] linux-user/i386: Split out struct target_fregs_state

2024-05-15 Thread Richard Henderson
Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 43 +++- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index 5b1c570bff..3271ebd333 100644 --- a/li

[PATCH v3 23/28] target/i386: Honor xfeatures in xrstor_sigcontext

2024-05-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index 95dd01820d..c2826a707d 100644 --- a/linux-user/i386/signal.c +++ b/linux-user/i386/signal

[PATCH v3 19/28] linux-user/i386: Fix -mregparm=3 for signal delivery

2024-05-15 Thread Richard Henderson
Since v2.6.19, the kernel has supported -mregparm=3. Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index 3271ebd333..6763b4bda8 10064

[PATCH v3 02/28] target/i386: Convert do_fldt, do_fstt to X86Access

2024-05-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 44 +--- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index ece22a3553..1662643a8f 100644 --- a/target/i386/tcg/fpu_he

[PATCH v3 16/28] linux-user/i386: Remove xfeatures from target_fpstate_fxsave

2024-05-15 Thread Richard Henderson
This is easily computed by advancing past the structure. At the same time, replace the magic number "64". Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/linux-user/i386/signal.c b/lin

[PATCH v3 17/28] linux-user/i386: Replace target_fpstate_fxsave with X86LegacyXSaveArea

2024-05-15 Thread Richard Henderson
Use the structure definition from target/i386/cpu.h. The only minor quirk is re-casting the sw_reserved area to the OS specific struct target_fpx_sw_bytes. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 71 +++- 1 f

[PATCH v3 07/28] target/i386: Convert do_xsave_{fpu, mxcr, sse} to X86Access

2024-05-15 Thread Richard Henderson
Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 52 +--- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index df12eac71e..8fbe6e00ce 100644

[PATCH v3 27/28] target/i386: Pass host pointer and size to cpu_x86_{fxsave, fxrstor}

2024-05-15 Thread Richard Henderson
We have already validated the memory region in the course of validating the signal frame. No need to do it again within the helper function. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/cpu.h| 4 ++-- linux-user/i386/signal.c | 13 +

[PATCH v3 09/28] tagret/i386: Convert do_fxsave, do_fxrstor to X86Access

2024-05-15 Thread Richard Henderson
Move the alignment fault from do_* to helper_*, as it need not apply to usage from within user-only signal handling. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 84 1 file changed, 48 insertions(+), 36 delet

[PATCH v3 05/28] target/i386: Convert do_fstenv to X86Access

2024-05-15 Thread Richard Henderson
Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 45 +++- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 5ad6e04639..01e9a1fbbf 100644

[PATCH v3 25/28] target/i386: Convert do_xrstor to X86Access

2024-05-15 Thread Richard Henderson
Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 106 +-- 1 file changed, 64 insertions(+), 42 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index f5748b72b8..1ac61c5d7d 100644

[PATCH v3 21/28] linux-user/i386: Return boolean success from xrstor_sigcontext

2024-05-15 Thread Richard Henderson
Invert the sense of the return value and use bool. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index 9e6d883ea1..

[PATCH v3 28/28] target/i386: Pass host pointer and size to cpu_x86_{xsave, xrstor}

2024-05-15 Thread Richard Henderson
We have already validated the memory region in the course of validating the signal frame. No need to do it again within the helper function. In addition, return failure when the header contains invalid xstate_bv. The kernel handles this via exception handling within XSTATE_OP within xrstor_from_

[PATCH v3 24/28] target/i386: Convert do_xsave to X86Access

2024-05-15 Thread Richard Henderson
Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 2 +- target/i386/tcg/fpu_helper.c | 72 +--- 2 files changed, 43 insertions(+), 31 deletions(-) diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index

[PATCH v3 01/28] target/i386: Add tcg/access.[ch]

2024-05-15 Thread Richard Henderson
Provide a method to amortize page lookup across large blocks. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/access.h| 40 + target/i386/tcg/access.c| 169 target/i386/tcg/meson.build | 1 + 3 files changed

[PATCH v3 26/28] target/i386: Pass host pointer and size to cpu_x86_{fsave, frstor}

2024-05-15 Thread Richard Henderson
We have already validated the memory region in the course of validating the signal frame. No need to do it again within the helper function. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/cpu.h| 10 ++ linux-user/i386/signal.c | 4 ++-- tar

[PATCH v3 04/28] target/i386: Convert do_fldenv to X86Access

2024-05-15 Thread Richard Henderson
Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 6237cd8383..5ad6e04639 100644 --- a/

[PATCH v3 14/28] target/i386: Add {hw, sw}_reserved to X86LegacyXSaveArea

2024-05-15 Thread Richard Henderson
This completes the 512 byte structure, allowing the union to be removed. Assert that the structure layout is as expected. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/cpu.h | 39 +-- 1 file changed, 25 insertions(+), 14 deletio

[PATCH v3 11/28] target/i386: Convert do_xrstor_* to X86Access

2024-05-15 Thread Richard Henderson
The body of do_xrstor is now fully converted. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 51 ++-- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fp

Re: [PATCH 00/41] target/sparc: Implement VIS4

2024-05-15 Thread Richard Henderson
On 4/29/24 23:02, Richard Henderson wrote: On 4/29/24 13:52, Mark Cave-Ayland wrote: No objections here about the remainder of the series, other than that I don't have an easy/obvious way to test the new instructions... I was thinking about adding support to RISU, but the gcc compile farm spar

Re: [PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-15 Thread Raphael Norwitz
On Wed, May 15, 2024 at 1:47 AM Li Feng wrote: > > > > > 2024年5月14日 21:58,Raphael Norwitz 写道: > > > > The code for these two patches looks fine. Just some questions on the > > failure case you're trying to fix. > > > > > > On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: > >> > >> This reverts com

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Raphael Norwitz
The case your describing makes sense but now I have some concerns on the vhost_dev_cleanup bit. On Wed, May 15, 2024 at 1:47 AM Li Feng wrote: > > > > > 2024年5月14日 21:58,Raphael Norwitz 写道: > > > > Code looks good. Just a question on the error case you're trying to fix. > > > > On Tue, May 14, 2

Re: [PATCH v3 5/5] virtio-gpu: fix v2 migration

2024-05-15 Thread Michael S. Tsirkin
On Wed, May 15, 2024 at 06:15:56PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Commit dfcf74fa ("virtio-gpu: fix scanout migration post-load") broke > forward/backward version migration. Versioning of nested VMSD structures > is not straightforward, as the wire format

Re: [PATCH v3 5/5] virtio-gpu: fix v2 migration

2024-05-15 Thread Daniel P . Berrangé
On Wed, May 15, 2024 at 06:15:56PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Commit dfcf74fa ("virtio-gpu: fix scanout migration post-load") broke > forward/backward version migration. Versioning of nested VMSD structures > is not straightforward, as the wire format

Re: [PATCH v3 4/5] Set major/minor for PC and arm machines

2024-05-15 Thread Michael S. Tsirkin
On Wed, May 15, 2024 at 06:15:55PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Signed-off-by: Marc-André Lureau I would much rather compat machinery was in one place as opposed to being spread all over the codebase as this new API would encourage. > --- > include/

Re: [PATCH v3 0/5] Fix "virtio-gpu: fix scanout migration post-load"

2024-05-15 Thread Peter Xu
On Wed, May 15, 2024 at 06:15:51PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Hi, > > The aforementioned patch breaks virtio-gpu device migrations for versions > pre-9.0/9.0, both forwards and backwards. Versioning of `VMS_STRUCT` is more > complex than it may initia

Re: [PATCH 03/20] docs/qapidoc: delint a tiny portion of the module

2024-05-15 Thread John Snow
On Wed, May 15, 2024 at 5:17 AM Markus Armbruster wrote: > John Snow writes: > > > In the coming patches, it's helpful to have a linting baseline. However, > > there's no need to shuffle around the deck chairs too much, because most > > of this code will be removed once the new qapidoc generator

Re: [PATCH v3 4/4] vfio/migration: Enhance VFIO migration state tracing

2024-05-15 Thread Cédric Le Goater
On 5/15/24 15:21, Avihai Horon wrote: Move trace_vfio_migration_set_state() to the top of the function, add recover_state to it, and add a new trace event to vfio_migration_set_device_state(). This improves tracing of device state changes as state changes are now also logged when vfio_migration_

Re: [PATCH v11 01/10] virtio-gpu: Unrealize GL device

2024-05-15 Thread Dmitry Osipenko
On 5/13/24 11:44, Akihiko Odaki wrote: > On 2024/05/12 3:22, Dmitry Osipenko wrote: >> Even though GL GPU doesn't support hotplugging today, free virgl >> resources when GL device is unrealized. For consistency. >> >> Signed-off-by: Dmitry Osipenko >> --- >>   hw/display/virtio-gpu-gl.c | 11 +

Re: [PATCH v3 2/4] vfio/migration: Emit VFIO migration QAPI event

2024-05-15 Thread Cédric Le Goater
On 5/15/24 15:21, Avihai Horon wrote: Emit VFIO migration QAPI event when a VFIO device changes its migration state. This can be used by management applications to get updates on the current state of the VFIO device for their own purposes. A new per VFIO device capability, "migration-events", is

Re: [PATCH v3 0/5] Fix "virtio-gpu: fix scanout migration post-load"

2024-05-15 Thread Daniel P . Berrangé
On Wed, May 15, 2024 at 10:07:31AM -0600, Peter Xu wrote: > On Wed, May 15, 2024 at 06:15:51PM +0400, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Hi, > > > > The aforementioned patch breaks virtio-gpu device migrations for versions > > pre-9.0/9.0, both forwards and ba

Re: [PATCH v11 09/10] virtio-gpu: Register capsets dynamically

2024-05-15 Thread Dmitry Osipenko
On 5/13/24 12:20, Akihiko Odaki wrote: ... >>   -int virtio_gpu_virgl_get_num_capsets(VirtIOGPU *g) >> +static void virtio_gpu_virgl_add_capset(GArray *capset_ids, uint32_t >> capset_id) >> +{ >> +    g_array_append_val(capset_ids, capset_id); >> +} > > Is it worthwhile to have a function for this

Re: [PATCH v11 01/10] virtio-gpu: Unrealize GL device

2024-05-15 Thread Akihiko Odaki
On 2024/05/16 1:18, Dmitry Osipenko wrote: On 5/13/24 11:44, Akihiko Odaki wrote: On 2024/05/12 3:22, Dmitry Osipenko wrote: Even though GL GPU doesn't support hotplugging today, free virgl resources when GL device is unrealized. For consistency. Signed-off-by: Dmitry Osipenko ---   hw/displ

Re: [PATCH v2 03/11] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

2024-05-15 Thread Cédric Le Goater
On 5/7/24 09:34, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Subject: Re: [PATCH v2 03/11] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool On 5/7/24 08:42, Zhenzhong Duan wrote: Make VFIOIOMMUClass::attach_device() and its wrapper function

Re: [PATCH v3 5/5] virtio-gpu: fix v2 migration

2024-05-15 Thread Peter Xu
On Wed, May 15, 2024 at 12:02:49PM -0400, Michael S. Tsirkin wrote: > On Wed, May 15, 2024 at 06:15:56PM +0400, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Commit dfcf74fa ("virtio-gpu: fix scanout migration post-load") broke > > forward/backward version migration. Vers

Re: [PATCH v11 08/10] virtio-gpu: Handle resource blob commands

2024-05-15 Thread Dmitry Osipenko
On 5/13/24 12:18, Akihiko Odaki wrote: >>     static void virgl_cmd_resource_unref(VirtIOGPU *g, >> - struct virtio_gpu_ctrl_command >> *cmd) >> + struct virtio_gpu_ctrl_command >> *cmd, >> +

Re: [PATCH v11 08/10] virtio-gpu: Handle resource blob commands

2024-05-15 Thread Akihiko Odaki
On 2024/05/16 1:39, Dmitry Osipenko wrote: On 5/13/24 12:18, Akihiko Odaki wrote:     static void virgl_cmd_resource_unref(VirtIOGPU *g, - struct virtio_gpu_ctrl_command *cmd) + struct virtio_gpu_ctrl_command *cmd, +   

Re: [PATCH v9] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-05-15 Thread Daniel P . Berrangé
On Mon, May 13, 2024 at 02:52:14PM +0800, Zhao Liu wrote: > Hi Daniel, > > > Please describe it in terms of a QAPI definition, as that's what we're > > striving for with all QEMU public interfaces. Once the QAPI design is > > agreed, then the -object mapping is trivial, as -object's JSON format >

Re: [PATCH v11 01/10] virtio-gpu: Unrealize GL device

2024-05-15 Thread Dmitry Osipenko
On 5/15/24 19:22, Akihiko Odaki wrote: > On 2024/05/16 1:18, Dmitry Osipenko wrote: >> On 5/13/24 11:44, Akihiko Odaki wrote: >>> On 2024/05/12 3:22, Dmitry Osipenko wrote: Even though GL GPU doesn't support hotplugging today, free virgl resources when GL device is unrealized. For consist

Re: [PATCH 01/17] ppc64: Fix include order

2024-05-15 Thread Philippe Mathieu-Daudé
On 15/5/24 15:53, Richard Henderson wrote: On 5/15/24 15:11, Philippe Mathieu-Daudé wrote: Hi Richard, On 11/5/24 13:53, Richard Henderson wrote: Signed-off-by: Richard Henderson ---   risu_ppc64.c | 3 +--   1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/risu_ppc64.c b/risu_ppc6

Re: [PATCH v6 1/9] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-15 Thread Cédric Le Goater
On 5/15/24 08:40, Eric Auger wrote: Hi Cédric, On 5/14/24 17:31, Cédric Le Goater wrote: We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Avihai Horon Signed-off-by:

Re: [PATCH v11 08/10] virtio-gpu: Handle resource blob commands

2024-05-15 Thread Dmitry Osipenko
On 5/15/24 19:42, Akihiko Odaki wrote: >>> It may be better to actually implement unmapping instead of returning an >>> error for consistency with the iov operation. Apparently crosvm also >>> unmaps blobs with VIRTIO_GPU_CMD_RESOURCE_UNREF. >> >> Then I'll add back `async_unmap_in_progress` becaus

Re: [PATCH 1/5] tcg: Introduce TCG_TARGET_HAS_tst_vec

2024-05-15 Thread Philippe Mathieu-Daudé
On 15/5/24 16:58, Richard Henderson wrote: Prelude to supporting TCG_COND_TST* in vector comparisons. Signed-off-by: Richard Henderson --- include/tcg/tcg.h| 1 + tcg/aarch64/tcg-target.h | 1 + tcg/arm/tcg-target.h | 1 + tcg/i386/tcg-target.h| 1 + tcg/lo

Re: [PATCH v3 5/5] virtio-gpu: fix v2 migration

2024-05-15 Thread Peter Xu
On Wed, May 15, 2024 at 05:03:44PM +0100, Daniel P. Berrangé wrote: > Above all, I'm failing to see why there's a compelling reason > for virtio_gpu to diverge from our long standing practice of > adding a named property flag "virtio_scanout_vmstate_fix" > on the machine class, and then setting it

Re: [PATCH v11 08/10] virtio-gpu: Handle resource blob commands

2024-05-15 Thread Akihiko Odaki
On 2024/05/16 2:01, Dmitry Osipenko wrote: On 5/15/24 19:42, Akihiko Odaki wrote: It may be better to actually implement unmapping instead of returning an error for consistency with the iov operation. Apparently crosvm also unmaps blobs with VIRTIO_GPU_CMD_RESOURCE_UNREF. Then I'll add back `a

<    1   2   3   4   >