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

2024-04-08 Thread Thomas Huth
On 09/04/2024 04.49, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provides the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `kvm-pmu-filter` as -cpu sub-option to set the PMU Event Filtering. Without the filter, all PMU events are exposed from

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

2024-04-08 Thread Shaoqin Huang
Hi Kevin, On 4/2/24 21:01, Kevin Wolf wrote: Maybe I'm wrong. So I want to double check with if the -cpu option support json format nowadays? As far as I can see, -cpu doesn't support JSON yet. But even if it did, your command line would be invalid because the 'host,' part isn't JSON.

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

2024-04-08 Thread Richard Henderson
Invert the sense of the return value and use bool. 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/signal.c index

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

2024-04-08 Thread Richard Henderson
Invert the sense of the return value and use bool. 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 1571ff8553..d600a4355b 100644 ---

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

2024-04-08 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. Signed-off-by: Richard Henderson --- target/i386/cpu.h| 4 ++-- linux-user/i386/signal.c | 13 +

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

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

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

2024-04-08 Thread Richard Henderson
This is easily computed by advancing past the structure. At the same time, replace the magic number "64". 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/linux-user/i386/signal.c index

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

2024-04-08 Thread Richard Henderson
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 ed98b4d073..559b63c25b 100644 --- a/linux-user/i386/signal.c +++

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

2024-04-08 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. Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 71 +++- 1 file changed, 26

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

2024-04-08 Thread Richard Henderson
Provide a method to amortize page lookup across large blocks. Signed-off-by: Richard Henderson --- target/i386/tcg/access.h| 40 + target/i386/tcg/access.c| 160 target/i386/tcg/meson.build | 1 + 3 files changed, 201 insertions(+) create

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

2024-04-08 Thread Richard Henderson
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 d4dd09dc95..909da05f91 100644 ---

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

2024-04-08 Thread Richard Henderson
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 643e017bef..59f73ad075 100644 ---

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

2024-04-08 Thread Richard Henderson
For now, continue to pass all 1's from signal.c. 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 a/target/i386/cpu.h

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

2024-04-08 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 d015fe520a..fd09c973d4 100644 --- a/linux-user/i386/signal.c +++

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

2024-04-08 Thread Richard Henderson
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 878fad9795..ad8b536cb5 100644 --- a/target/i386/tcg/fpu_helper.c +++

Re: [PATCH v2] vhost: don't set vring call if guest notifiers is not enabled

2024-04-08 Thread Jason Wang
On Mon, Apr 8, 2024 at 3:33 PM lyx634449800 wrote: > > When conducting performance testing using testpmd in the guest os, > it was observed that the performance was lower compared to the > scenario of direct vfio-pci usage. > > In the commit 96a3d98d2cdbd897ff5ab33427aa4cfb94077665, the author >

[PATCH] hw/intc/riscv_aplic: APLICs should add child earlier than realize

2024-04-08 Thread yang.zhang
From: "yang.zhang" Since only root APLICs can have hw IRQ lines, aplic->parent should be initialized first. Fixes: e8f79343cf ("hw/intc: Add RISC-V AIA APLIC device emulation") Reviewed-by: Daniel Henrique Barboza Signed-off-by: yang.zhang --- hw/intc/riscv_aplic.c | 8 1 file

Re:Re: [PATCH] hw/intc/riscv_aplic: APLICs should add child earlier than realize

2024-04-08 Thread yang.zhang
At 2024-04-09 06:33:55, "Daniel Henrique Barboza" wrote: > > >On 4/7/24 00:46, yang.zhang wrote: >> From: "yang.zhang" >> >> Since only root APLICs can have hw IRQ lines, aplic->parent should >> be initialized first. > >I think it's worth mentioning that, if we don't do that, there won't be

Re: [PATCH] Revert "hw/virtio: Add support for VDPA network simulation devices"

2024-04-08 Thread Jason Wang
On Mon, Apr 8, 2024 at 5:47 PM Michael S. Tsirkin wrote: > > This reverts commit cd341fd1ffded978b2aa0b5309b00be7c42e347c. > > The patch adds non-upstream code in > include/standard-headers/linux/virtio_pci.h > which would make maintainance harder. > > Revert for now. > > Suggested-by: Jason Wang

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

2024-04-08 Thread Shaoqin Huang
The KVM_ARM_VCPU_PMU_V3_FILTER provides the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `kvm-pmu-filter` as -cpu sub-option to set the PMU Event Filtering. Without the filter, all PMU events are exposed from host to guest by default. The usage of the

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

2024-04-08 Thread Richard Henderson
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 28ae8100f6..25074af0ce 100644 ---

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

2024-04-08 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

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

2024-04-08 Thread Richard Henderson
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 fd09c973d4..ba17d27219

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

2024-04-08 Thread Richard Henderson
The body of do_xsave is now fully converted. 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_helper.c index

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

2024-04-08 Thread Richard Henderson
The body of do_xrstor is now fully converted. 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/fpu_helper.c index

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

2024-04-08 Thread Richard Henderson
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 25074af0ce..e6fa161aa0 100644 ---

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

2024-04-08 Thread Richard Henderson
This is subtracting sizeof(target_fpstate_fxsave) in TARGET_FXSAVE_SIZE, then adding it again via >xfeatures. Perform the same computation using xstate_size alone. Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff

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

2024-04-08 Thread Richard Henderson
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 e6fa161aa0..643e017bef 100644 ---

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

2024-04-08 Thread Richard Henderson
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 ad8b536cb5..28ae8100f6 100644 ---

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

2024-04-08 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. Signed-off-by: Richard Henderson --- target/i386/cpu.h| 10 ++ linux-user/i386/signal.c | 4 ++-- target/i386/tcg/fpu_helper.c |

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

2024-04-08 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 4b965a5d6c..878fad9795 100644 ---

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

2024-04-08 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

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

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

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

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

[PATCH for-9.1 v2 00/28] linux-user/i386: Properly align signal frame

2024-04-08 Thread Richard Henderson
v1: https://lore.kernel.org/qemu-devel/20230524054647.1093758-1-richard.hender...@linaro.org/ But v1 isn't particularly complet or korrect. 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

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

2024-04-08 Thread Richard Henderson
Since v2.6.19, the kernel has supported -mregparm=3. Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index 559b63c25b..f8cc0cff07 100644

Re: [PATCH v4] hw/virtio: Fix packed virtqueue flush used_idx

2024-04-08 Thread Wafer
On 4/9/24 1:32 Eugenio Perez Martin wrote: > > External Mail: This email originated from OUTSIDE of the organization! > Do not click links, open attachments or provide ANY information unless you > recognize the sender and know the content is safe. > > > On Sun, Apr 7, 2024 at 3:56 AM Wafer

Re: [PATCH-for-9.0?] backends/cryptodev: Do not abort for invalid session ID

2024-04-08 Thread zhenwei pi
Hi, VIRTIO_CRYPTO_INVSESS has a quite clear meaning: invalid session ID when executing crypto operations. Uplayer would get an explicit code once failing to close session, so I suggest no error log printing in this function. On 4/8/24 23:45, Philippe Mathieu-Daudé wrote: Instead of

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

2024-04-08 Thread Shaoqin Huang
Hi Eric, On 3/19/24 23:23, Eric Auger wrote: +if (kvm_supports_pmu_filter) { +assert_set_feature_str(qts, "host", "kvm-pmu-filter", ""); +assert_set_feature_str(qts, "host", "kvm-pmu-filter", + "A:0x11-0x11"); +

RE: [PATCH v2 03/10] backends/iommufd: Introduce abstract HIODIOMMUFD device

2024-04-08 Thread Duan, Zhenzhong
Hi All, >-Original Message- >From: Duan, Zhenzhong >Subject: [PATCH v2 03/10] backends/iommufd: Introduce abstract >HIODIOMMUFD device > >HIODIOMMUFD represents a host IOMMU device under iommufd backend. > >Currently it includes only public iommufd handle and device id. >which could be

Re: [PATCH 1/2] virtio-net: Fix vhost virtqueue notifiers for RSS

2024-04-08 Thread Jason Wang
On Mon, Apr 8, 2024 at 6:13 PM Michael S. Tsirkin wrote: > > On Tue, Mar 26, 2024 at 07:06:29PM +0900, Akihiko Odaki wrote: > > virtio_net_guest_notifier_pending() and virtio_net_guest_notifier_mask() > > checked VIRTIO_NET_F_MQ to know there are multiple queues, but > > VIRTIO_NET_F_RSS also

Re: [PATCH] xen-hvm: Avoid livelock while handling buffered ioreqs

2024-04-08 Thread Ross Lagerwall
On Sat, Apr 6, 2024 at 11:58 AM Durrant, Paul wrote: > > On 04/04/2024 15:08, Ross Lagerwall wrote: > > A malicious or buggy guest may generated buffered ioreqs faster than > > QEMU can process them in handle_buffered_iopage(). The result is a > > livelock - QEMU continuously processes ioreqs on

Re: [PATCH] xen-hvm: Avoid livelock while handling buffered ioreqs

2024-04-08 Thread Paul Durrant
On 08/04/2024 14:00, Ross Lagerwall wrote: On Sat, Apr 6, 2024 at 11:58 AM Durrant, Paul wrote: On 04/04/2024 15:08, Ross Lagerwall wrote: A malicious or buggy guest may generated buffered ioreqs faster than QEMU can process them in handle_buffered_iopage(). The result is a livelock - QEMU

Re: [PATCH] xen-hvm: Avoid livelock while handling buffered ioreqs

2024-04-08 Thread Paul Durrant
On 04/04/2024 15:08, Ross Lagerwall wrote: A malicious or buggy guest may generated buffered ioreqs faster than QEMU can process them in handle_buffered_iopage(). The result is a livelock - QEMU continuously processes ioreqs on the main thread without iterating through the main loop which

Re: [PATCH 9/9] accel/tcg: Improve can_do_io management

2024-04-08 Thread Jørgen Hansen
On 4/7/24 00:32, Richard Henderson wrote: > We already attempted to set and clear can_do_io before the first > and last insns, but only used the initial value of max_insns and > the call to translator_io_start to find those insns. > > Now that we track insn_start in DisasContextBase, and now that

Re: [PATCH for-9.0] nanomips: fix warnings with GCC 14

2024-04-08 Thread Richard Henderson
On 4/8/24 04:25, Paolo Bonzini wrote: GCC 14 shows -Wshadow=local warnings if an enum conflicts with a local variable (including a parameter). To avoid this, move the problematic enum and all of its dependencies after the hundreds of functions that have a parameter named "instruction".

Re: [PATCH-for-9.0? 2/3] hw/block/nand: Have blk_load() return boolean indicating success

2024-04-08 Thread Richard Henderson
On 4/7/24 22:36, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nand.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH-for-9.0? 3/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-08 Thread Richard Henderson
On 4/7/24 22:36, Philippe Mathieu-Daudé wrote: nand_command() and nand_getio() don't check @offset points into the block, nor the available data length (s->iolen) is not negative. In order to fix: - check the offset is in range in nand_blk_load_NAND_PAGE_SIZE(), - do not set @iolen if

Re: [PATCH v2 10/18] hw/usb: move stubs out of stubs/

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: Since the USB stubs are needed exactly when the Kconfig symbols are not enabled, they can be placed in hw/usb/ and conditionalized on CONFIG_USB. Signed-off-by: Paolo Bonzini --- stubs/usb-dev-stub.c => hw/usb/bus-stub.c | 0 hw/usb/meson.build

Re: [PATCH v2 09/18] stubs: remove obsolete stubs

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: These file define functions are are not called from common code anymore. Delete those functions and, if applicable, the entire files. Signed-off-by: Paolo Bonzini --- include/sysemu/sysemu.h | 2 -- stubs/isa-bus.c | 7 ---

Re: [PATCH v2 13/18] ramfb: move stubs out of stubs/

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: Since the ramfb stubs are needed exactly when the Kconfig symbols are not needed, move them to hw/display/ and compile them when ramfb.c is absent. Signed-off-by: Paolo Bonzini --- stubs/ramfb.c => hw/display/ramfb-stubs.c | 0 hw/display/meson.build

Re: [PATCH v2 16/18] stubs: split record/replay stubs further

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: replay.c symbols are only needed by user mode emulation, with the exception of replay_mode that is needed by both user mode emulation (by way of qemu_guest_getrandom) and block layer tools (by way of util/qemu-timer.c). Since it is needed by libqemuutil

[PULL 08/35] linux-user: replace calloc() with g_new0()

2024-04-08 Thread Richard Henderson
From: Nguyen Dinh Phi Use glib allocation as recommended by the coding convention Signed-off-by: Nguyen Dinh Phi Message-Id: <20240317171747.1642207-1-phind@gmail.com> Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/main.c | 6 +- 1 file changed, 1

[PULL 21/35] target/arm: Use insn_start from DisasContextBase

2024-04-08 Thread Richard Henderson
To keep the multiple update check, replace insn_start with insn_start_updated. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate.h | 12 ++-- target/arm/tcg/translate-a64.c | 2 +- target/arm/tcg/translate.c | 2 +- 3 files

[PULL 04/35] linux-user: do_setsockopt: make ip_mreq local to the place it is used and inline target_to_host_ip_mreq()

2024-04-08 Thread Richard Henderson
From: Michael Tokarev ip_mreq is declared at the beginning of do_setsockopt(), while it is used in only one place. Move its declaration to that very place and replace pointer to alloca()-allocated memory with the structure itself. target_to_host_ip_mreq() is used only once, inline it. This

[PULL 15/35] target/m68k: Map FPU exceptions to FPSR register

2024-04-08 Thread Richard Henderson
From: Keith Packard Add helpers for reading/writing the 68881 FPSR register so that changes in floating point exception state can be seen by the application. Call these helpers in pre_load/post_load hooks to synchronize exception state. Signed-off-by: Keith Packard Reviewed-by: Richard

[PULL 01/35] tcg/optimize: Do not attempt to constant fold neg_vec

2024-04-08 Thread Richard Henderson
Split out the tail of fold_neg to fold_neg_no_const so that we can avoid attempting to constant fold vector negate. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2150 Signed-off-by: Richard Henderson --- tcg/optimize.c| 17 -

[PULL 31/35] util/bufferiszero: Remove useless prefetches

2024-04-08 Thread Richard Henderson
From: Alexander Monakov Use of prefetching in bufferiszero.c is quite questionable: - prefetches are issued just a few CPU cycles before the corresponding line would be hit by demand loads; - they are done for simple access patterns, i.e. where hardware prefetchers can perform better; -

[PULL 23/35] target/i386: Preserve DisasContextBase.insn_start across rewind

2024-04-08 Thread Richard Henderson
When aborting translation of the current insn, restore the previous value of insn_start. Acked-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c

[PULL 29/35] util/bufferiszero: Remove AVX512 variant

2024-04-08 Thread Richard Henderson
From: Alexander Monakov Thanks to early checks in the inline buffer_is_zero wrapper, the SIMD routines are invoked much more rarely in normal use when most buffers are non-zero. This makes use of AVX512 unprofitable, as it incurs extra frequency and voltage transition periods during which the

[PULL 17/35] target/m68k: Perform the semihosting test during translate

2024-04-08 Thread Richard Henderson
Replace EXCP_HALT_INSN by EXCP_SEMIHOSTING. Perform the pre- and post-insn tests during translate, leaving only the actual semihosting operation for the exception. Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 +- target/m68k/op_helper.c | 14 ++---

[PULL 07/35] linux-user: Add FITRIM ioctl

2024-04-08 Thread Richard Henderson
From: Michael Vogt Tiny patch to add the missing FITRIM ioctl. Signed-off-by: Michael Vogt Message-Id: <20240403092048.16023-2-michael.v...@gmail.com> Signed-off-by: Richard Henderson --- linux-user/ioctls.h| 3 +++ linux-user/syscall_defs.h | 1 + linux-user/syscall_types.h | 5

Re: [PATCH 1/2] Fix typo to allow migrate_qmp_fail command with 'channels' argument

2024-04-08 Thread Het Gala
On 08/04/24 9:05 pm, Peter Xu wrote: !---| CAUTION: External Email |---! Hey, Het, On Sun, Apr 07, 2024 at 01:21:24PM +, Het Gala wrote: Fixes:

Re: [PATCH-for-9.0? 1/3] hw/block/nand: Factor nand_load_iolen() method out

2024-04-08 Thread Richard Henderson
On 4/7/24 22:36, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nand.c | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 07/18] hw/core: Move system emulation files to system_ss

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: hotplug.c, qdev-hotplug.c and reset.c are not used by user emulation and need not be included in hwcore_ss. Move them to system_ss, where they belong, by letting the linker pull in the stubs when needed. Signed-off-by: Paolo Bonzini --- {hw/core =>

Re: [PATCH v2 11/18] hw/virtio: move stubs out of stubs/

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: Since the virtio memory device stubs are needed exactly when the Kconfig symbol is not enabled, they can be placed in hw/virtio/ and conditionalized on CONFIG_VIRTIO_MD. Signed-off-by: Paolo Bonzini --- stubs/virtio-md-pci.c => hw/virtio/virtio-md-stubs.c

[PULL 27/35] accel/tcg: Improve can_do_io management

2024-04-08 Thread Richard Henderson
We already attempted to set and clear can_do_io before the first and last insns, but only used the initial value of max_insns and the call to translator_io_start to find those insns. Now that we track insn_start in DisasContextBase, and now that we have emit_before_op, we can wait until we have

[PULL 11/35] target/sh4: Merge mach and macl into a union

2024-04-08 Thread Richard Henderson
Allow host access to the entire 64-bit accumulator. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/sh4/cpu.h | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 9211da6bde..d928bcf006

[PULL 06/35] linux-user: do_setsockopt: eliminate goto in switch for SO_SNDTIMEO

2024-04-08 Thread Richard Henderson
From: Michael Tokarev There's identical code for SO_SNDTIMEO and SO_RCVTIMEO, currently implemented using an ugly goto into another switch case. Eliminate that using arithmetic if, making code flow more natural. Signed-off-by: Michael Tokarev Message-Id:

[PULL 19/35] tcg: Add TCGContext.emit_before_op

2024-04-08 Thread Richard Henderson
Allow operations to be emitted via normal expanders into the middle of the opcode stream. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 6 ++ tcg/tcg.c | 14 -- 2 files changed, 18

[PULL 05/35] linux-user: do_setsockopt: make ip_mreq_source local to the place where it is used

2024-04-08 Thread Richard Henderson
From: Michael Tokarev Signed-off-by: Michael Tokarev Message-Id: <20240331100737.2724186-4-...@tls.msk.ru> Signed-off-by: Richard Henderson --- linux-user/syscall.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index

[PULL 24/35] target/microblaze: Use insn_start from DisasContextBase

2024-04-08 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 4e52ef32db..fc451befae 100644 ---

[PULL 25/35] target/riscv: Use insn_start from DisasContextBase

2024-04-08 Thread Richard Henderson
To keep the multiple update check, replace insn_start with insn_start_updated. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/riscv/translate.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target/riscv/translate.c

[PULL 35/35] util/bufferiszero: Simplify test_buffer_is_zero_next_accel

2024-04-08 Thread Richard Henderson
Because the three alternatives are monotonic, we don't need to keep a couple of bitmasks, just identify the strongest alternative at startup. Signed-off-by: Richard Henderson --- util/bufferiszero.c | 56 ++--- 1 file changed, 22 insertions(+), 34

[PULL 10/35] target/sh4: mac.w: memory accesses are 16-bit words

2024-04-08 Thread Richard Henderson
From: Zack Buhman Before this change, executing a code sequence such as: mova tblm,r0 movr0,r1 mova tbln,r0 clrs clrmac mac.w @r0+,@r1+ mac.w @r0+,@r1+ .align 4 tblm:.word 0x1234

[PULL 13/35] target/sh4: Fix mac.w with saturation enabled

2024-04-08 Thread Richard Henderson
From: Zack Buhman The saturation arithmetic logic in helper_macw is not correct. I tested and verified this behavior on a SH7091. Reviewd-by: Yoshinori Sato Signed-off-by: Zack Buhman Message-Id: <20240405233802.29128-3-z...@buhman.org> [rth: Reformat helper_macw, add a test case.]

[PULL 03/35] linux-user: do_setsockopt: fix SOL_ALG.ALG_SET_KEY

2024-04-08 Thread Richard Henderson
From: Michael Tokarev This setsockopt accepts zero-lengh optlen (current qemu implementation does not allow this). Also, there's no need to make a copy of the key, it is enough to use lock_user() (which accepts zero length already). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2197

Re: [PATCH-for-9.0 3/4] hw/char/virtio-serial-bus: Protect from DMA re-entrancy bugs

2024-04-08 Thread Philippe Mathieu-Daudé
On 8/4/24 17:20, Michael S. Tsirkin wrote: On Mon, Apr 08, 2024 at 01:04:11PM +0200, Philippe Mathieu-Daudé wrote: On 8/4/24 12:08, Michael S. Tsirkin wrote: On Mon, Apr 08, 2024 at 09:14:39AM +0200, Philippe Mathieu-Daudé wrote: On 4/4/24 21:13, Philippe Mathieu-Daudé wrote: Replace

Re: [PATCH v2 14/18] memory-device: move stubs out of stubs/

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: Since the memory-device stubs are needed exactly when the Kconfig symbols are not needed, move them to hw/mem/. Signed-off-by: Paolo Bonzini --- stubs/memory_device.c => hw/mem/memory-device-stubs.c | 0 hw/mem/meson.build

Re: [PATCH v2 13/18] ramfb: move stubs out of stubs/

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: Since the ramfb stubs are needed exactly when the Kconfig symbols are not needed, move them to hw/display/ and compile them when ramfb.c is absent. Signed-off-by: Paolo Bonzini --- stubs/ramfb.c => hw/display/ramfb-stubs.c | 0 hw/display/meson.build

[PULL 26/35] target/s390x: Use insn_start from DisasContextBase

2024-04-08 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 57b7db1ee9..90a74ee795 100644 ---

[PULL 34/35] util/bufferiszero: Introduce biz_accel_fn typedef

2024-04-08 Thread Richard Henderson
Signed-off-by: Richard Henderson --- util/bufferiszero.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/bufferiszero.c b/util/bufferiszero.c index c9a7ded016..eb8030a3f0 100644 --- a/util/bufferiszero.c +++ b/util/bufferiszero.c @@ -26,7 +26,8 @@ #include

[PULL 18/35] target/m68k: Support semihosting on non-ColdFire targets

2024-04-08 Thread Richard Henderson
From: Keith Packard According to the m68k semihosting spec: "The instruction used to trigger a semihosting request depends on the m68k processor variant. On ColdFire, "halt" is used; on other processors (which don't implement "halt"), "bkpt #0" may be used." Add support for non-CodeFire

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-04-08 Thread Peter Xu
On Mon, Apr 08, 2024 at 04:07:20PM +0200, Jinpu Wang wrote: > Hi Peter, Jinpu, Thanks for joining the discussion. > > On Tue, Apr 2, 2024 at 11:24 PM Peter Xu wrote: > > > > On Mon, Apr 01, 2024 at 11:26:25PM +0200, Yu Zhang wrote: > > > Hello Peter und Zhjian, > > > > > > Thank you so much

Re: [PATCH-for-9.0] hw/sd/sdhci: Discard excess of data written to Buffer Data Port register

2024-04-08 Thread Peter Maydell
On Mon, 8 Apr 2024 at 13:34, Peter Maydell wrote: > > On Thu, 4 Apr 2024 at 09:56, Philippe Mathieu-Daudé wrote: > > diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c > > index c5e0bc018b..2dd88fa139 100644 > > --- a/hw/sd/sdhci.c > > +++ b/hw/sd/sdhci.c > > @@ -552,7 +552,7 @@ static void

Re: [PATCH v2 04/18] tests/unit: match some unit tests to corresponding feature switches

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: Try not to test code that is not used by user mode emulation, or by the block layer, unless they are being compiled; and fix test-timed-average which was not compiled with --disable-system --enable-tools. This is by no means complete, it only touches the

Re: [PATCH v2 01/18] meson: do not link pixman automatically into all targets

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: The dependency on pixman is listed manually in all sourcesets that need it. There is no need to bring into libqemuutil, since there is nothing in util/ that needs pixman either. Reported-by: Michael Tokarev Signed-off-by: Paolo Bonzini --- meson.build | 2

Re: [PATCH v2 05/18] yank: only build if needed

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: The yank feature is not used in user emulation. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- util/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 18/18] stubs: move monitor_fdsets_cleanup with other fdset stubs

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: Even though monitor_get_fd() has to remain separate because it is mocked by tests/unit/test-util-sockets, monitor_fdsets_cleanup() is logically part of the stubs for monitor/fds.c, so move it there. Signed-off-by: Paolo Bonzini --- stubs/fdset.c

Re: [PATCH v2 02/18] tests: only build plugins if TCG is enabled

2024-04-08 Thread Richard Henderson
On 4/8/24 05:53, Paolo Bonzini wrote: There is no way to use them for testing, if all the available accelerators use hardware virtualization. Signed-off-by: Paolo Bonzini --- tests/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 16/18] stubs: split record/replay stubs further

2024-04-08 Thread Paolo Bonzini
On Mon, Apr 8, 2024 at 6:59 PM Richard Henderson wrote: > > On 4/8/24 05:53, Paolo Bonzini wrote: > > replay.c symbols are only needed by user mode emulation, with the > > exception of replay_mode that is needed by both user mode emulation > > (by way of qemu_guest_getrandom) and block layer

Re: [PATCH v4] hw/virtio: Fix packed virtqueue flush used_idx

2024-04-08 Thread Eugenio Perez Martin
On Sun, Apr 7, 2024 at 3:56 AM Wafer wrote: > Let me suggest a more generic description for the patch: In the event of writing many chains of descriptors, the device must write just the id of the last buffer in the descriptor chain, skip forward the number of descriptors in the chain, and then

[PULL 14/35] target/sh4: add missing CHECK_NOT_DELAY_SLOT

2024-04-08 Thread Richard Henderson
From: Zack Buhman CHECK_NOT_DELAY_SLOT is correctly applied to the branch-related instructions, but not to the PC-relative mov* instructions. I verified the existence of an illegal slot exception on a SH7091 when any of these instructions are attempted inside a delay slot. This also matches

[PULL 02/35] linux-user: Fix waitid return of siginfo_t and rusage

2024-04-08 Thread Richard Henderson
The copy back to siginfo_t should be conditional only on arg3, not the specific values that might have been written. The copy back to rusage was missing entirely. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2262 Signed-off-by: Richard Henderson --- linux-user/syscall.c | 22

[PULL 20/35] accel/tcg: Add insn_start to DisasContextBase

2024-04-08 Thread Richard Henderson
This is currently target-specific for many; begin making it target independent. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/translator.h | 3 +++ accel/tcg/translator.c| 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/exec/translator.h

[PULL 09/35] target/hppa: Fix IIAOQ, IIASQ for pa2.0

2024-04-08 Thread Richard Henderson
The contents of IIAOQ depend on PSW_W. Follow the text in "Interruption Instruction Address Queues", pages 2-13 through 2-15. Tested-by: Sven Schnelle Tested-by: Helge Deller Reported-by: Sven Schnelle Fixes: b10700d826c ("target/hppa: Update IIAOQ, IIASQ for pa2.0") Signed-off-by: Richard

[PULL 12/35] target/sh4: Fix mac.l with saturation enabled

2024-04-08 Thread Richard Henderson
From: Zack Buhman The saturation arithmetic logic in helper_macl is not correct. I tested and verified this behavior on a SH7091. Signed-off-by: Zack Buhman Message-Id: <20240404162641.27528-2-z...@buhman.org> [rth: Reformat helper_macl, add a test case.] Signed-off-by: Richard Henderson

[PULL 28/35] util/bufferiszero: Remove SSE4.1 variant

2024-04-08 Thread Richard Henderson
From: Alexander Monakov The SSE4.1 variant is virtually identical to the SSE2 variant, except for using 'PTEST+JNZ' in place of 'PCMPEQB+PMOVMSKB+CMP+JNE' for testing if an SSE register is all zeroes. The PTEST instruction decodes to two uops, so it can be handled only by the complex decoder,

[PULL 30/35] util/bufferiszero: Reorganize for early test for acceleration

2024-04-08 Thread Richard Henderson
From: Alexander Monakov Test for length >= 256 inline, where is is often a constant. Before calling into the accelerated routine, sample three bytes from the buffer, which handles most non-zero buffers. Signed-off-by: Alexander Monakov Signed-off-by: Mikhail Romanov Message-Id:

[PULL 16/35] target/m68k: Pass semihosting arg to exit

2024-04-08 Thread Richard Henderson
From: Keith Packard Instead of using d0 (the semihost function number), use d1 (the provide exit status). Signed-off-by: Keith Packard Reviewed-by: Peter Maydell Message-Id: <20230802161914.395443-2-kei...@keithp.com> Signed-off-by: Richard Henderson --- target/m68k/m68k-semi.c | 4 ++-- 1

  1   2   3   >