[PATCH v2 04/11] gdbstub: Introduce GDBFeature structure

2023-09-11 Thread Akihiko Odaki
Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to understand and to extend with more fields. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Revi

Re: [PATCH v2 1/2] ui: fix crash when there are no active_console

2023-09-11 Thread Albert Esteve
On Tue, Sep 12, 2023 at 8:28 AM wrote: > From: Marc-André Lureau > > Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. > 0x55888630 in dpy_ui_info_supported (con=0x0) at > ../ui/console.c:812 > 812 return con->hw_ops->ui_info != NULL; > (gdb) bt > #0 0x

[PATCH v2 03/11] contrib/plugins: Use GRWLock in execlog

2023-09-11 Thread Akihiko Odaki
execlog had the following comment: > As we could have multiple threads trying to do this we need to > serialise the expansion under a lock. Threads accessing already > created entries can continue without issue even if the ptr array > gets reallocated during resize. However, when the ptr array get

[PATCH v2 07/11] gdbstub: Use g_markup_printf_escaped()

2023-09-11 Thread Akihiko Odaki
g_markup_printf_escaped() is a safer alternative to simple printf() as it automatically escapes values. Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstu

[PATCH v2 00/11] gdbstub and TCG plugin improvements

2023-09-11 Thread Akihiko Odaki
This series extracts fixes and refactorings that can be applied independently from "[PATCH RESEND v5 00/26] plugins: Allow to read registers" as suggested by Nicholas Piggin. Patch "target/ppc: Remove references to gdb_has_xml" is also updated to remove some dead code I missed earlier and thus the

[PATCH v2 01/11] gdbstub: Fix target_xml initialization

2023-09-11 Thread Akihiko Odaki
target_xml is no longer a fixed-length array but a pointer to a variable-length memory. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki --- gdbstub/softmmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub/softmmu.c b/gdbstub/softm

[PATCH v2 02/11] gdbstub: Fix target.xml response

2023-09-11 Thread Akihiko Odaki
It was failing to return target.xml after the first request. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 349d348c7b..3841

Re: [PATCH v1 1/2] target/s390x: introduce "host-recommended" option for model expansion

2023-09-11 Thread David Hildenbrand
On 11.09.23 22:52, Collin Walling wrote: Patch subject is wrong (should contain "static-recommended") Newer S390 machines may drop support for features completely, rendering guests operating with older CPU models incapable of running on said machines. A manual effort to disable certain CPU feat

Re: [PATCH] vdpa: fix gcc cvq_isolated uninitialized variable warning

2023-09-11 Thread Eugenio Perez Martin
On Mon, Sep 11, 2023 at 11:54 PM Stefan Hajnoczi wrote: > > gcc 13.2.1 emits the following warning: > > net/vhost-vdpa.c: In function ‘net_vhost_vdpa_init.constprop’: > net/vhost-vdpa.c:1394:25: error: ‘cvq_isolated’ may be used uninitialized > [-Werror=maybe-uninitialized] >1394 |

Re: [PATCH qemu 2/2] dump: Only use the makedumpfile flattened format when necessary

2023-09-11 Thread Marc-André Lureau
Hi On Wed, Aug 23, 2023 at 2:03 PM Marc-André Lureau wrote: > > Hi > > On Wed, Aug 23, 2023 at 4:31 AM Stephen Brennan > wrote: > > > > Stephen Brennan writes: > > > Marc-André Lureau writes: > > >> I am a bit reluctant to change the dump format by default. But since the > > >> flatten format

[PATCH v2 2/2] ui: add precondition for dpy_get_ui_info()

2023-09-11 Thread marcandre . lureau
From: Marc-André Lureau Ensure that it only get called when dpy_ui_info_supported(). The function should always return a result. There should be a non-null console or active_console. Modify the argument to be const as well. Signed-off-by: Marc-André Lureau --- include/ui/console.h | 2 +- ui/

[PATCH v2 1/2] ui: fix crash when there are no active_console

2023-09-11 Thread marcandre . lureau
From: Marc-André Lureau Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. 0x55888630 in dpy_ui_info_supported (con=0x0) at ../ui/console.c:812 812 return con->hw_ops->ui_info != NULL; (gdb) bt #0 0x55888630 in dpy_ui_info_supported (con=0x0) at ../ui

Re: [PATCH] ui: fix crash when there are no active_console

2023-09-11 Thread Marc-André Lureau
Hi On Mon, Sep 11, 2023 at 6:44 PM Albert Esteve wrote: > > > > On Mon, Sep 11, 2023 at 4:08 PM wrote: >> >> From: Marc-André Lureau >> >> Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. >> 0x55888630 in dpy_ui_info_supported (con=0x0) at ../ui/console.c:812 >> 8

Re: [PATCH] vdpa: fix gcc cvq_isolated uninitialized variable warning

2023-09-11 Thread Philippe Mathieu-Daudé
On 11/9/23 23:54, Stefan Hajnoczi wrote: gcc 13.2.1 emits the following warning: net/vhost-vdpa.c: In function ‘net_vhost_vdpa_init.constprop’: net/vhost-vdpa.c:1394:25: error: ‘cvq_isolated’ may be used uninitialized [-Werror=maybe-uninitialized] 1394 | s->cvq_isolated = cvq_

Re: [PULL v2 38/45] hw/riscv/virt.c: fix non-KVM --enable-debug build

2023-09-11 Thread Michael Tokarev
12.09.2023 00:43, Daniel Henrique Barboza: On 9/11/23 16:54, Michael Tokarev wrote: ...   /* KVM AIA only has one APLIC instance */ -    if (virt_use_kvm_aia(s)) { +    if (kvm_enabled() && virt_use_kvm_aia(s)) {   create_fdt_socket_aplic(s, memmap, 0, ... As has been discovered e

Re: [External] Re: [PATCH v2,1/1] memory: avoid updating ioeventfds for some address_space

2023-09-11 Thread hongmainquan
在 2023/9/12 1:55 上午, David Hildenbrand 写道: On 11.09.23 18:28, Peter Xu wrote: On Mon, Sep 04, 2023 at 08:51:43PM +0800, hongmainquan wrote: Friendly ping... Hello, this patch has already received a R-b from PeterXu. Could you please help me review it as well and see if there are any issues

[PATCH v2 06/10] Optimize loongarch_irq_init function implementation

2023-09-11 Thread xianglai li
Optimize loongarch_irq_init function implementation and abstract the function loongarch_cpu_irq_init from it. Cc: "Salil Mehta" Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Ap

[PATCH v2 09/10] Add generic event device for Loongarch

2023-09-11 Thread xianglai li
Create a new GED device type for Loongarch, mount cpu_madt function to update the ACPI table. Cc: "Salil Mehta" Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Ph

[PATCH v2 08/10] Add support of *unrealize* for Loongarch cpu

2023-09-11 Thread xianglai li
Add the unrealize function to the Loongarch CPU for cpu hot-(un)plug Cc: "Salil Mehta" Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Philippe Mathieu-Daudé" Cc

[PATCH v2 02/10] Update CPUs AML with cpu-(ctrl)dev change

2023-09-11 Thread xianglai li
CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is based on PCI and is IO port based and hence existing cpus AML code assumes _CRS objects would evaluate to a system resource which describes IO Port address. But on Loongarch arch CPUs control device(\\_SB.PRES) register interfac

[PATCH v2 05/10] Added CPU topology support for Loongarch

2023-09-11 Thread xianglai li
1.Add topological relationships for Loongarch VCPU and initialize topology member variables. 2.Add a description of the calculation method of the arch_id and the topological relationship of the CPU. Cc: "Salil Mehta" Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc

[PATCH v2 04/10] Introduce the CPU address space destruction function

2023-09-11 Thread xianglai li
Introduce new function to destroy CPU address space resources for cpu hot-(un)plug. Co-authored-by: "Salil Mehta" Cc: "Salil Mehta" Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marc

[PATCH v2 10/10] Update the ACPI table for the Loongarch CPU

2023-09-11 Thread xianglai li
Add new types of GED devices for Loongarch machines, add CPU hot-(un)plug event response and address spaces, and update the ACPI table. Cc: "Salil Mehta" Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Edua

[PATCH v2 00/10] Adds CPU hot-plug support to Loongarch

2023-09-11 Thread xianglai li
Hello everyone, We refer to the implementation of ARM CPU Hot-Plug to add GED-based CPU Hot-Plug support to Loongarch. The first 4 patches are changes to the QEMU common code, including adding GED support for CPU Hot-Plug, updating the ACPI table creation process, and adding qdev_disconnect_gpio_o

[PATCH v2 03/10] make qdev_disconnect_gpio_out_named() public

2023-09-11 Thread xianglai li
It will be reused in loongarch/virt.c for unwiring the vcpu<->exioi interrupts for the vcpu hot-(un)plug cases. Co-authored-by: "Salil Mehta" Cc: "Salil Mehta" Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson C

[PATCH v2 07/10] Add basic CPU hot-(un)plug support for Loongarch

2023-09-11 Thread xianglai li
Add CPU hot-(un)plug related hook functions and turn on the CPU hot-(un)plug custom switch. Cc: "Salil Mehta" Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Phil

[PATCH v2 01/10] Update ACPI GED framework to support vcpu hot-(un)plug

2023-09-11 Thread xianglai li
ACPI GED shall be used to convey to the guest kernel about any cpu hot-(un)plug events. Therefore, existing ACPI GED framework inside QEMU needs to be enhanced to support CPU hot-(un)plug state and events. Co-authored-by: "Salil Mehta" Cc: "Salil Mehta" Cc: Xiaojuan Yang Cc: Song Gao Cc: "Mich

Re: [PATCH 0/7] target/arm: hwcaps updates, FEAT_HBC

2023-09-11 Thread Richard Henderson
On 9/11/23 06:53, Peter Maydell wrote: Peter Maydell (6): linux-user/elfload.c: Correct SME feature names reported in cpuinfo linux-user/elfload.c: Add missing arm and arm64 hwcap values linux-user/elfload.c: Report previously missing arm32 hwcaps target/arm: Update AArch64 ID registe

Re: [PATCH 7/9] migration: Remember num of ramblocks to sync during recovery

2023-09-11 Thread Fabiano Rosas
Peter Xu writes: > Instead of only relying on the count of rp_sem, make the counter be part of > RAMState so it can be used in both threads to synchronize on the process. > > rp_sem will be further reused as a way to kick the main thread, e.g., on > recovery failures. > > Signed-off-by: Peter Xu

Re: [PATCH 8/9] migration: Add migration_rp_wait|kick()

2023-09-11 Thread Fabiano Rosas
Peter Xu writes: > It's just a simple wrapper for rp_sem on either wait() or kick(), make it > even clearer on how it is used. Prepared to be used even for other things. > > Signed-off-by: Peter Xu > --- > migration/migration.h | 15 +++ > migration/migration.c | 4 ++-- > migrati

Re: [PATCH 9/9] migration/postcopy: Allow network to fail even during recovery

2023-09-11 Thread Fabiano Rosas
Peter Xu writes: Hi, sorry it took me so long to get to this. > Normally the postcopy recover phase should only exist for a super short > period, that's the duration when QEMU is trying to recover from an > interrupted postcopy migration, during which handshake will be carried out > for continui

Re: [PATCH v3 23/23] bsd-user: Add stubs for vadvise(), sbrk() and sstk()

2023-09-11 Thread Richard Henderson
On 9/9/23 12:37, Karim Taha wrote: From: Warner Losh The above system calls are not supported by qemu. Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/bsd-mem.h| 18 ++ bsd-user/freebsd/os-syscall.c | 12 2 files changed, 30 inserti

Re: [PATCH v2] tpm: fix crash when FD >= 1024

2023-09-11 Thread Stefan Berger
On 9/11/23 09:25, marcandre.lur...@redhat.com wrote: From: Marc-Andr޸ Lureau Replace select() with poll() to fix a crash when QEMU has a large number of FDs. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2020133 For backporting I think we should also add this tag here: Fixes:  ca64b0

Re: [PATCH v3 22/23] bsd-user: Implement shmat(2) and shmdt(2)

2023-09-11 Thread Richard Henderson
On 9/9/23 12:37, Karim Taha wrote: +static inline abi_long do_bsd_shmdt(abi_ulong shmaddr) +{ +int i; + +for (i = 0; i < N_BSD_SHM_REGIONS; ++i) { +if (bsd_shm_regions[i].start == shmaddr) { +bsd_shm_regions[i].start = 0; +page_set_flags(shmaddr, +

Re: [PATCH v3 19/23] bsd-user: Implement shm_open(2)

2023-09-11 Thread Richard Henderson
On 9/9/23 12:37, Karim Taha wrote: From: Stacey Son Co-authored-by: Kyle Evans Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Karim Taha --- bsd-user/bsd-mem.h| 25 + bsd-user/freebsd/os-syscall.c | 4 2 files changed, 29 inserti

Re: [PATCH v3 18/23] bsd-user: Implement do_obreak function

2023-09-11 Thread Richard Henderson
On 9/9/23 12:36, Karim Taha wrote: From: Stacey Son Match linux-user, by manually applying the following commits, in order: d28b3c90cfad1a7e211ae2bce36ecb9071086129 linux-user: Make sure initial brk(0) is page-aligned 15ad98536ad9410fb32ddf1ff09389b677643faa linux-user: Fix qemu brk() to n

Re: [PATCH v3 17/23] bsd-user: Implement mincore(2)

2023-09-11 Thread Richard Henderson
On 9/9/23 12:36, Karim Taha wrote: From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/bsd-mem.h| 22 ++ bsd-user/freebsd/os-syscall.c | 4 2 files changed, 26 insertions(+) diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd

Re: [PATCH v3 16/23] bsd-user: Implment madvise(2) to match the linux-user implementation.

2023-09-11 Thread Richard Henderson
On 9/9/23 12:36, Karim Taha wrote: Signed-off-by: Signed-off-by: Karim Taha --- bsd-user/bsd-mem.h| 53 +++ bsd-user/freebsd/os-syscall.c | 4 +++ bsd-user/syscall_defs.h | 2 ++ 3 files changed, 59 insertions(+) Reviewed-by: Richard Hend

Re: [PATCH v3 10/23] bsd-user: Implement shmid_ds conversion between host and target.

2023-09-11 Thread Richard Henderson
On 9/9/23 12:36, Karim Taha wrote: From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/bsd-mem.c | 43 +++ 1 file changed, 43 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH v3 05/23] bsd-user: Implement shm_open2(2) system call

2023-09-11 Thread Richard Henderson
On 9/9/23 12:36, Karim Taha wrote: From: Kyle Evans Signed-off-by: Kyle Evans Signed-off-by: Karim Taha --- bsd-user/freebsd/os-misc.h| 42 +++ bsd-user/freebsd/os-syscall.c | 13 +++ 2 files changed, 55 insertions(+) Reviewed-by: Richard Henders

Re: [PATCH RESEND v5 56/57] target/loongarch: Move simply DO_XX marcos togther

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: Signed-off-by: Song Gao --- target/loongarch/vec.h| 42 ++ target/loongarch/vec_helper.c | 48 --- 2 files changed, 42 insertions(+), 48 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH RESEND v5 55/57] target/loongarch: Implement xvld xvst

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: This patch includes: - XVLD[X], XVST[X]; - XVLDREPL.{B/H/W/D}; - XVSTELM.{B/H/W/D}. Signed-off-by: Song Gao --- target/loongarch/insns.decode | 18 +++ target/loongarch/disas.c| 24 target/loongarch/insn_trans/trans_ve

Re: [PATCH RESEND v5 54/57] target/loongarch: Implement xvshuf xvperm{i} xvshuf4i

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: void HELPER(vshuf_b)(void *vd, void *vj, void *vk, void *va, uint32_t desc) { int i, m; -VReg temp; +VReg temp = {}; VReg *Vd = (VReg *)vd; VReg *Vj = (VReg *)vj; VReg *Vk = (VReg *)vk; VReg *Va = (VReg *)va; +int oprs

Re: [PATCH RESEND v5 52/57] target/loongarch: Implement xvreplve xvinsve0 xvpickve

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: +static bool gen_vreplve_vl(DisasContext *ctx, arg_vvr *a, + uint32_t oprsz, int vece, int bit, + void (*func)(TCGv_i64, TCGv_ptr, tcg_target_long)) { TCGv_i64 t0 = tcg_temp_new_i64(); TCGv_ptr t1 =

Re: [PATCH 06/32] bsd-user: Add bsd-proc.c to meson.build

2023-09-11 Thread Karim Taha
Richard Henderson wrote: >> +elf = cc.find_library('elf', required: true) >> +procstat = cc.find_library('procstat', required: true) >> +kvm = cc.find_library('kvm', required: true) >> +bsd_user_ss.add(elf, procstat, kvm) > > What are these for? Particularly kvm? > > > r~ It's need to link with

Re: [PATCH 3/4] hw/cpu: Introduce CPUClass::cpu_resolving_type field

2023-09-11 Thread Gavin Shan
On 9/11/23 19:43, Philippe Mathieu-Daudé wrote: On 11/9/23 01:28, Gavin Shan wrote: On 9/8/23 21:22, Philippe Mathieu-Daudé wrote: Add a field to return the QOM type name of a CPU class. Signed-off-by: Philippe Mathieu-Daudé ---   include/hw/core/cpu.h   | 2 ++   hw/core/cpu-common.c    | 2

Re: [PATCH RESEND v5 51/57] target/loongarch: Implement xvinsgr2vr xvpickve2gr

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: +static bool trans_xvinsgr2vr_w(DisasContext *ctx, arg_vr_i *a) +{ +if (!avail_LASX(ctx)) { +return false; +} +return trans_vinsgr2vr_w(ctx, a); +} Using the other translator doesn't help. static bool trans_vinsgr2vr_w(DisasContext *ctx, ar

[PATCH 1/4] target/ppc: Add new hflags to support BHRB

2023-09-11 Thread Glenn Miles
This commit is preparatory to the addition of Branch History Rolling Buffer (BHRB) functionality, which is being provided today starting with the P8 processor. BHRB uses several SPR register fields to control whether or not a branch instruction's address (and sometimes target address) should be re

Re: [PATCH RESEND v5 41/57] target/loongarch: Implement xvssrlrn xvssrarn

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: This patch includes: - XVSSRLRN.{B.H/H.W/W.D}; - XVSSRARN.{B.H/H.W/W.D}; - XVSSRLRN.{BU.H/HU.W/WU.D}; - XVSSRARN.{BU.H/HU.W/WU.D}; - XVSSRLRNI.{B.H/H.W/W.D/D.Q}; - XVSSRARNI.{B.H/H.W/W.D/D.Q}; - XVSSRLRNI.{BU.H/HU.W/WU.D/DU.Q}; - XVSSRARNI.{BU.H/HU.W/WU.D/DU.Q}.

Re: [PATCH RESEND v5 40/57] target/loongarch: Implement xvssrln xvssran

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: This patch includes: - XVSSRLN.{B.H/H.W/W.D}; - XVSSRAN.{B.H/H.W/W.D}; - XVSSRLN.{BU.H/HU.W/WU.D}; - XVSSRAN.{BU.H/HU.W/WU.D}; - XVSSRLNI.{B.H/H.W/W.D/D.Q}; - XVSSRANI.{B.H/H.W/W.D/D.Q}; - XVSSRLNI.{BU.H/HU.W/WU.D/DU.Q}; - XVSSRANI.{BU.H/HU.W/WU.D/DU.Q}. Signed-o

[PATCH] vdpa: fix gcc cvq_isolated uninitialized variable warning

2023-09-11 Thread Stefan Hajnoczi
gcc 13.2.1 emits the following warning: net/vhost-vdpa.c: In function ‘net_vhost_vdpa_init.constprop’: net/vhost-vdpa.c:1394:25: error: ‘cvq_isolated’ may be used uninitialized [-Werror=maybe-uninitialized] 1394 | s->cvq_isolated = cvq_isolated; | ^~

Re: [PULL v2 38/45] hw/riscv/virt.c: fix non-KVM --enable-debug build

2023-09-11 Thread Daniel Henrique Barboza
On 9/11/23 16:54, Michael Tokarev wrote: 11.09.2023 09:43, Alistair Francis: From: Daniel Henrique Barboza A build with --enable-debug and without KVM will fail as follows: /usr/bin/ld: libqemu-riscv64-softmmu.fa.p/hw_riscv_virt.c.o: in function `virt_machine_init': ./qemu/build/../hw/ris

Re: [PATCH RESEND v5 21/57] target/loongarch: Implement xavg/xvagr

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: This patch includes: - XVAVG.{B/H/W/D/}[U]; - XVAVGR.{B/H/W/D}[U]. Signed-off-by: Song Gao --- target/loongarch/insns.decode | 17 target/loongarch/disas.c| 17 target/loongarch/vec_helper.c

Re: [PATCH RESEND v5 20/57] target/loongarch: Implement xvaddw/xvsubw

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: This patch includes: - XVADDW{EV/OD}.{H.B/W.H/D.W/Q.D}[U]; - XVSUBW{EV/OD}.{H.B/W.H/D.W/Q.D}[U]; - XVADDW{EV/OD}.{H.BU.B/W.HU.H/D.WU.W/Q.DU.D}. Signed-off-by: Song Gao --- target/loongarch/insns.decode | 45 target/loongarch/disas.c

Re: [PATCH RESEND v5 19/57] target/loongarch: Implement xvhaddw/xvhsubw

2023-09-11 Thread Richard Henderson
On 9/7/23 01:31, Song Gao wrote: This patch includes: - XVHADDW.{H.B/W.H/D.W/Q.D/HU.BU/WU.HU/DU.WU/QU.DU}; - XVHSUBW.{H.B/W.H/D.W/Q.D/HU.BU/WU.HU/DU.WU/QU.DU}. Signed-off-by: Song Gao --- target/loongarch/insns.decode | 18 +++ target/loongarch/disas.c

Re: [PATCH 11/14] target/arm: Implement the SETG* instructions

2023-09-11 Thread Richard Henderson
On 9/11/23 07:17, Peter Maydell wrote: I think it would be a little better if set_tags was visible to the compiler, via inlining, so that all of the conditions can be folded away. Do you mean having a separate triplet of helper functions for setg, which then call an inline function shared with

[PATCH v4 1/3] target/i386: Check kvm_hyperv_expand_features() return value

2023-09-11 Thread Philippe Mathieu-Daudé
Move kvm_hyperv_expand_features() call earlier (this will simplify reviewing the next commit) and check its return value, since it can fail. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.c b

[PATCH v4 3/3] target/i386: Prohibit target specific KVM prototypes on user emulation

2023-09-11 Thread Philippe Mathieu-Daudé
None of these target-specific prototypes should be used by user emulation. Remove their declaration there, so we get a compile failure if ever used (instead of having to deal with linker and its possible optimizations, such dead code removal). Suggested-by: Kevin Wolf Signed-off-by: Philippe Math

[RFC PATCH v4 2/3] target/i386: Restrict system-specific features from user emulation

2023-09-11 Thread Philippe Mathieu-Daudé
Since commits 3adce820cf ("target/i386: Remove unused KVM stubs") and ef1cf6890f ("target/i386: Allow elision of kvm_hv_vpindex_settable()"), when building on a x86 host configured as: $ ./configure --cc=clang \ --target-list=x86_64-linux-user,x86_64-softmmu \ --enable-debug we get:

[PATCH v4 0/3] target/i386: Restrict system-specific features from user emulation

2023-09-11 Thread Philippe Mathieu-Daudé
Too many system-specific code (and in particular KVM related) is pulled in user-only build. This led to adding unjustified stubs as kludge to unagressive linker non-optimizations. This series restrict x86 system-specific features to sysemu, so we don't require any stub, and remove all x86 KVM decl

Re: [PATCH 04/32] bsd-user: Add freebsd_exec_common and do_freebsd_procctl to qemu.h.

2023-09-11 Thread Karim Taha
Richard Henderson wrote: > On 8/27/23 08:57, Karim Taha wrote: >> From: Stacey Son >> >> Signed-off-by: Stacey Son >> Signed-off-by: Karim Taha >> --- >> bsd-user/main.c | 2 +- >> bsd-user/qemu.h | 7 +++ >> 2 files changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/bsd-user

Re: [PATCH 01/11] qdev: Add qdev_prop_set_array()

2023-09-11 Thread Philippe Mathieu-Daudé
On 8/9/23 16:36, Kevin Wolf wrote: Instead of exposing the ugly hack of how we represent arrays in qdev (a static "foo-len" property and after it is set, dynamically created "foo[i]" properties) to boards, add an interface that allows setting the whole array at once. Once all internal users of d

[PATCH v1 2/2] target/s390x: flag te and cte as deprecated

2023-09-11 Thread Collin Walling
Add the CONSTRAINT_TRANSACTIONAL_EXE (cte) and TRANSACTIONAL_EXE (te) under the list of deprecated features. Signed-off-by: Collin Walling --- target/s390x/cpu_features.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index efafc9

[PATCH v1 1/2] target/s390x: introduce "host-recommended" option for model expansion

2023-09-11 Thread Collin Walling
Newer S390 machines may drop support for features completely, rendering guests operating with older CPU models incapable of running on said machines. A manual effort to disable certain CPU features would be required. To alleviate this issue, a list of "deprecated" features are now retained within

Re: [PATCH 09/11] hw/rx/rx62n: Use qdev_prop_set_array()

2023-09-11 Thread Philippe Mathieu-Daudé
On 8/9/23 16:37, Kevin Wolf wrote: Instead of manually setting "foo-len" and "foo[i]" properties, build a QList and use the new qdev_prop_set_array() helper to set the whole array property with a single call. Signed-off-by: Kevin Wolf --- hw/rx/rx62n.c | 19 ++- 1 file change

Re: [PATCH v6 08/10] migration/yank: Use channel features

2023-09-11 Thread Philippe Mathieu-Daudé
On 11/9/23 19:13, Fabiano Rosas wrote: Stop using outside knowledge about the io channels when registering yank functions. Query for features instead. The yank method for all channels used with migration code currently is to call the qio_channel_shutdown() function, so query for QIO_CHANNEL_FEAT

Re: [PULL v2 42/45] target/riscv: Allocate itrigger timers only once

2023-09-11 Thread Michael Tokarev
11.09.2023 09:43, Alistair Francis пишет: From: Akihiko Odaki riscv_trigger_init() had been called on reset events that can happen several times for a CPU and it allocated timers for itrigger. If old timers were present, they were simply overwritten by the new timers, resulting in a memory leak

Re: [PULL v2 38/45] hw/riscv/virt.c: fix non-KVM --enable-debug build

2023-09-11 Thread Michael Tokarev
11.09.2023 09:43, Alistair Francis: From: Daniel Henrique Barboza A build with --enable-debug and without KVM will fail as follows: /usr/bin/ld: libqemu-riscv64-softmmu.fa.p/hw_riscv_virt.c.o: in function `virt_machine_init': ./qemu/build/../hw/riscv/virt.c:1465: undefined reference to `kvm_

Re: [PATCH 1/1] migration: skip poisoned memory pages on "ram saving" phase

2023-09-11 Thread Peter Xu
On Sat, Sep 09, 2023 at 03:57:44PM +0100, Joao Martins wrote: > > Should I continue to treat them as zero pages written with > > save_zero_page_to_file ? > > MCE had already been forward to the guest, so guest is supposed to not be > using > the page (nor rely on its contents). Hence destination

Re: [PATCH v1] vfio/common: Separate vfio-pci ranges

2023-09-11 Thread Joao Martins
On 11/09/2023 19:35, Alex Williamson wrote: > On Mon, 11 Sep 2023 11:12:55 +0100 > Joao Martins wrote: > >> On 11/09/2023 10:48, Duan, Zhenzhong wrote: -Original Message- From: Joao Martins Sent: Monday, September 11, 2023 5:07 PM Subject: Re: [PATCH v1] vfio/common:

Re: [PATCH 02/13] memory: Introduce memory_region_iommu_set_iova_ranges

2023-09-11 Thread Peter Xu
On Mon, Sep 04, 2023 at 10:03:45AM +0200, Eric Auger wrote: > This helper will allow to convey information about valid > IOVA ranges to virtual IOMMUS. > > Signed-off-by: Eric Auger Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH 01/13] memory: Let ReservedRegion use Range

2023-09-11 Thread Peter Xu
On Mon, Sep 04, 2023 at 10:03:44AM +0200, Eric Auger wrote: > A reserved region is a range tagged with a type. Let's directly use > the Range type in the prospect to reuse some of the library helpers > shipped with the Range type. > > Signed-off-by: Eric Auger Reviewed-by: Peter Xu -- Peter X

Re: [PATCH v1] vfio/common: Separate vfio-pci ranges

2023-09-11 Thread Alex Williamson
On Mon, 11 Sep 2023 11:12:55 +0100 Joao Martins wrote: > On 11/09/2023 10:48, Duan, Zhenzhong wrote: > >> -Original Message- > >> From: Joao Martins > >> Sent: Monday, September 11, 2023 5:07 PM > >> Subject: Re: [PATCH v1] vfio/common: Separate vfio-pci ranges > >> > >> On 11/09/2023 09

Re: [PATCH v2,1/1] memory: avoid updating ioeventfds for some address_space

2023-09-11 Thread David Hildenbrand
On 11.09.23 18:28, Peter Xu wrote: On Mon, Sep 04, 2023 at 08:51:43PM +0800, hongmainquan wrote: Friendly ping... Hello, this patch has already received a R-b from PeterXu. Could you please help me review it as well and see if there are any issues? If everything is fine, could you please consid

[PATCH v6 10/10] migration: Add a wrapper to cleanup migration files

2023-09-11 Thread Fabiano Rosas
We currently have a pattern for cleaning up a migration QEMUFile: qemu_mutex_lock(&s->qemu_file_lock); file = s->file_name; s->file_name = NULL; qemu_mutex_unlock(&s->qemu_file_lock); migration_ioc_unregister_yank_from_file(file); qemu_file_shutdown(file); qemu_fclose(file); This s

[PATCH v6 00/10] Fix segfault on migration return path

2023-09-11 Thread Fabiano Rosas
This version adds migration-specific tracking for the yank functions. We've estabilished that using the ioc refcount is a layer violation and that relaxing the abort() on yank.c is undesirable, so we're left with making the migration code keep track of how many QEMUFiles are still using the QIOCha

[PATCH v6 04/10] migration: Remove redundant cleanup of postcopy_qemufile_src

2023-09-11 Thread Fabiano Rosas
This file is owned by the return path thread which is already doing cleanup. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 5e6a766235..195726eb4a 100644 --

[PATCH v6 05/10] migration: Consolidate return path closing code

2023-09-11 Thread Fabiano Rosas
We'll start calling the await_return_path_close_on_source() function from other parts of the code, so move all of the related checks and tracepoints into it. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 29 ++--- 1 file changed, 14 inser

[PATCH v6 06/10] migration: Replace the return path retry logic

2023-09-11 Thread Fabiano Rosas
Replace the return path retry logic with finishing and restarting the thread. This fixes a race when resuming the migration that leads to a segfault. Currently when doing postcopy we consider that an IO error on the return path file could be due to a network intermittency. We then keep the thread

[PATCH v6 03/10] migration: Fix possible race when shutting down to_dst_file

2023-09-11 Thread Fabiano Rosas
It's not safe to call qemu_file_shutdown() on the to_dst_file without first checking for the file's presence under the lock. The cleanup of this file happens at postcopy_pause() and migrate_fd_cleanup() which are not necessarily running in the same thread as migrate_fd_cancel(). Reviewed-by: Peter

[PATCH v6 09/10] migration/yank: Keep track of registered yank instances

2023-09-11 Thread Fabiano Rosas
The core yank code is strict about balanced registering and unregistering of yank functions. This creates a difficulty because the migration code registers one yank function per QIOChannel, but each QIOChannel can be referenced by more than one QEMUFile. The yank function should not be removed unt

[PATCH v6 01/10] migration: Fix possible race when setting rp_state.error

2023-09-11 Thread Fabiano Rosas
We don't need to set the rp_state.error right after a shutdown because qemu_file_shutdown() always sets the QEMUFile error, so the return path thread would have seen it and set the rp error itself. Setting the error outside of the thread is also racy because the thread could clear it after we set

[PATCH v6 02/10] migration: Fix possible races when shutting down the return path

2023-09-11 Thread Fabiano Rosas
We cannot call qemu_file_shutdown() on the return path file without taking the file lock. The return path thread could be running it's cleanup code and have just cleared the from_dst_file pointer. Checking ms->to_dst_file for errors could also race with migrate_fd_cleanup() which clears the to_dst

[PATCH v6 08/10] migration/yank: Use channel features

2023-09-11 Thread Fabiano Rosas
Stop using outside knowledge about the io channels when registering yank functions. Query for features instead. The yank method for all channels used with migration code currently is to call the qio_channel_shutdown() function, so query for QIO_CHANNEL_FEATURE_SHUTDOWN. We could add a separate fea

[PATCH v6 07/10] migration: Move return path cleanup to main migration thread

2023-09-11 Thread Fabiano Rosas
Now that the return path thread is allowed to finish during a paused migration, we can move the cleanup of the QEMUFiles to the main migration thread. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-)

Re: [virtio-dev] [RESEND VIRTIO GPU PATCH v3 1/1] virtio-gpu: Add new feature flag VIRTIO_GPU_F_FREEZE_S3

2023-09-11 Thread Mikhail Golubev-Ciuchea via
Hi Jiqian, Thanks for the proposal. Some time ago I was working on the same issue with suspending the gpu device (on arm). Additionally, I had troubles with virtio-video device as well, see https://lore.kernel.org/lkml/20211215172739.ga77...@opensynergy.com/T/ for details. In your case, the VIR

Re: [PATCH 02/11] hw/i386/pc: Use qdev_prop_set_array()

2023-09-11 Thread Kevin Wolf
Am 11.09.2023 um 17:42 hat Peter Maydell geschrieben: > On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: > > > > Instead of manually setting "foo-len" and "foo[i]" properties, build a > > QList and use the new qdev_prop_set_array() helper to set the whole > > array property with a single call. > >

Re: [PATCH v3] target/i386: Restrict system-specific features from user emulation

2023-09-11 Thread Kevin Wolf
Am 11.09.2023 um 16:27 hat Philippe Mathieu-Daudé geschrieben: > Since commits 3adce820cf ("target/i386: Remove unused KVM > stubs") and ef1cf6890f ("target/i386: Allow elision of > kvm_hv_vpindex_settable()"), when building on a x86 host > configured as: > > $ ./configure --cc=clang \ > --t

Re: [PATCH v2,1/1] memory: avoid updating ioeventfds for some address_space

2023-09-11 Thread Peter Xu
On Mon, Sep 04, 2023 at 08:51:43PM +0800, hongmainquan wrote: > > Friendly ping... > Hello, this patch has already received a R-b from PeterXu. Could you please > help me review it as well and see if there are any issues? If everything is > fine, could you please consider merging it? Thank you! P

Re: [PATCH 1/7] bsd-user: spelling fixes

2023-09-11 Thread Warner Losh
On Mon, Sep 11, 2023, 10:12 AM Kyle Evans wrote: > On 9/11/23 03:39, Michael Tokarev wrote: > > Warner, Kyle, can you take a look please? > > > > > https://patchew.org/QEMU/20230909131258.354675-1-...@tls.msk.ru/20230909131258.354675-2-...@tls.msk.ru/ > > > > Hmm, the original for this doesn't se

Re: [PATCH 1/7] bsd-user: spelling fixes

2023-09-11 Thread Kyle Evans
On 9/11/23 03:39, Michael Tokarev wrote: Warner, Kyle, can you take a look please? https://patchew.org/QEMU/20230909131258.354675-1-...@tls.msk.ru/20230909131258.354675-2-...@tls.msk.ru/ Hmm, the original for this doesn't seem to have landed in my inbox, but these all look OK to me. 09.0

Re: [PATCH 10/11] qom: Add object_property_set_default_list()

2023-09-11 Thread Peter Maydell
On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: > > This function provides a default for properties that are accessed using > the list visitor interface. The default is always an empty list. > > Signed-off-by: Kevin Wolf Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH 09/11] hw/rx/rx62n: Use qdev_prop_set_array()

2023-09-11 Thread Peter Maydell
On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: > > Instead of manually setting "foo-len" and "foo[i]" properties, build a > QList and use the new qdev_prop_set_array() helper to set the whole > array property with a single call. > > Signed-off-by: Kevin Wolf > --- > hw/rx/rx62n.c | 19 +

Re: [PATCH 08/11] hw/arm/xlnx-versal: Use qdev_prop_set_array()

2023-09-11 Thread Peter Maydell
On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: > > Instead of manually setting "foo-len" and "foo[i]" properties, build a > QList and use the new qdev_prop_set_array() helper to set the whole > array property with a single call. > > Signed-off-by: Kevin Wolf > --- Reviewed-by: Peter Maydell t

Re: [PATCH 07/11] hw/arm/virt: Use qdev_prop_set_array()

2023-09-11 Thread Peter Maydell
On Fri, 8 Sept 2023 at 15:39, Kevin Wolf wrote: > > Instead of manually setting "foo-len" and "foo[i]" properties, build a > QList and use the new qdev_prop_set_array() helper to set the whole > array property with a single call. > > Signed-off-by: Kevin Wolf > --- Reviewed-by: Peter Maydell t

Re: [PATCH 06/11] hw/arm/vexpress: Use qdev_prop_set_array()

2023-09-11 Thread Peter Maydell
On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: > > Instead of manually setting "foo-len" and "foo[i]" properties, build a > QList and use the new qdev_prop_set_array() helper to set the whole > array property with a single call. > > Signed-off-by: Kevin Wolf Reviewed-by: Peter Maydell thanks

Re: [PATCH 05/11] hw/arm/sbsa-ref: Use qdev_prop_set_array()

2023-09-11 Thread Peter Maydell
On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: > > Instead of manually setting "foo-len" and "foo[i]" properties, build a > QList and use the new qdev_prop_set_array() helper to set the whole > array property with a single call. > > Signed-off-by: Kevin Wolf > --- Reviewed-by: Peter Maydell t

Re: [PATCH 04/11] hw/arm/mps2: Use qdev_prop_set_array()

2023-09-11 Thread Peter Maydell
On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: > > Instead of manually setting "foo-len" and "foo[i]" properties, build a > QList and use the new qdev_prop_set_array() helper to set the whole > array property with a single call. > > Signed-off-by: Kevin Wolf > --- > hw/arm/mps2.c | 12 -

Re: [PATCH 03/11] hw/arm/mps2-tz: Use qdev_prop_set_array()

2023-09-11 Thread Peter Maydell
On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: > > Instead of manually setting "foo-len" and "foo[i]" properties, build a > QList and use the new qdev_prop_set_array() helper to set the whole > array property with a single call. > > Signed-off-by: Kevin Wolf > --- Reviewed-by: Peter Maydell t

Re: [PATCH 02/11] hw/i386/pc: Use qdev_prop_set_array()

2023-09-11 Thread Peter Maydell
On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: > > Instead of manually setting "foo-len" and "foo[i]" properties, build a > QList and use the new qdev_prop_set_array() helper to set the whole > array property with a single call. > > Signed-off-by: Kevin Wolf > --- > hw/i386/pc.c | 8 +--- >

  1   2   3   >