Re: [PATCH 9.0 00/13] Consolidate common vdpa members in VhostVDPAShared

2023-11-30 Thread Jason Wang
On Sat, Nov 25, 2023 at 1:14 AM Eugenio Pérez wrote: > > Current memory operations like pinning may take a lot of time at the > destination. Currently they are done after the source of the migration is > stopped, and before the workload is resumed at the destination. This is a > period where

[PATCH v5] accel/kvm: Turn DPRINTF macro use into tracepoints

2023-11-30 Thread Jai Arora
Patch removes DRPINTF macro and adds multiple tracepoints to capture different kvm events. We also drop the DPRINTFs that don't add any additional information than trace_kvm_run_exit already does. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1827 Signed-off-by: Jai Arora

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

2023-11-30 Thread Gavin Shan
Hi Shaoqin, On 11/29/23 14:08, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provide the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `pmu-filter` as -accel sub-option to set the PMU Event Filtering. Without the filter, the KVM will expose all

Re: [PATCH v4] migration: Plug memory leak with migration URIs

2023-11-30 Thread Markus Armbruster
Peter Xu writes: > On Thu, Nov 30, 2023 at 07:35:43PM +0100, Markus Armbruster wrote: >> Peter Xu writes: >> >> > On Wed, Nov 29, 2023 at 08:43:01PM +, Het Gala wrote: >> >> migrate_uri_parse() allocates memory to 'channel' if the user >> >> opts for old syntax - uri, which is leaked

Re: [PATCH 9.0 01/13] vdpa: add VhostVDPAShared

2023-11-30 Thread Eugenio Perez Martin
On Fri, Dec 1, 2023 at 6:35 AM Jason Wang wrote: > > On Sat, Nov 25, 2023 at 1:14 AM Eugenio Pérez wrote: > > > > It will hold properties shared among all vhost_vdpa instances associated > > with of the same device. For example, we just need one iova_tree or one > > memory listener for the

Re: [PATCH v8 1/9] machine: Use error handling when CPU type is checked

2023-11-30 Thread Gavin Shan
Hi Markus, On 11/29/23 19:20, Markus Armbruster wrote: Gavin Shan writes: QEMU will be terminated if the specified CPU type isn't supported in machine_run_board_init(). The list of supported CPU type names is tracked by mc->valid_cpu_types. Suggest to drop the second sentence. Indeed,

Re: [PATCH 2/6] qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to QEMU_BQL_LOCK_GUARD

2023-11-30 Thread Harsh Prateek Bora
On 12/1/23 01:57, Stefan Hajnoczi wrote: On Thu, Nov 30, 2023 at 10:14:47AM +0100, Ilya Leoshkevich wrote: On Wed, 2023-11-29 at 16:26 -0500, Stefan Hajnoczi wrote: The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous.

[PATCH 2/2] linux-user: Fix openat() emulation to not modify atime

2023-11-30 Thread Shu-Chun Weng
Commit b8002058 strengthened openat()'s /proc detection by calling realpath(3) on the given path, which allows various paths and symlinks that points to the /proc file system to be intercepted correctly. Using realpath(3), though, has a side effect that it reads the symlinks along the way, and

[PATCH 0/2] linux-user: openat() fixes

2023-11-30 Thread Shu-Chun Weng
Shu-Chun Weng (2): linux-user: Define TARGET_O_LARGEFILE for aarch64 linux-user: Fix openat() emulation to not modify atime linux-user/aarch64/target_fcntl.h | 1 + linux-user/syscall.c | 42 --- 2 files changed, 34 insertions(+), 9 deletions(-)

[PATCH 1/2] linux-user: Define TARGET_O_LARGEFILE for aarch64

2023-11-30 Thread Shu-Chun Weng
In 050a1ba, when moving the macros from preprocessor-guarding to file-based definition, TARGET_O_LARGEFILE appeared to have been accidentally left off. This may have correctness implication, but so far I was only confused by strace's output. Signed-off-by: Shu-Chun Weng ---

Re: [PATCH v2 04/14] spapr: nested: Introduce cap-nested-papr for Nested PAPR API

2023-11-30 Thread Harsh Prateek Bora
On 11/30/23 16:41, Nicholas Piggin wrote: On Thu Nov 30, 2023 at 4:19 PM AEST, Harsh Prateek Bora wrote: On 11/29/23 09:31, Nicholas Piggin wrote: On Thu Oct 12, 2023 at 8:49 PM AEST, Harsh Prateek Bora wrote: Introduce a SPAPR capability cap-nested-papr which provides a nested HV

Re: [PATCH 1/6] system/cpus: rename qemu_mutex_lock_iothread() to qemu_bql_lock()

2023-11-30 Thread Harsh Prateek Bora
Hi Stefan, On 11/30/23 02:56, Stefan Hajnoczi wrote: The Big QEMU Lock (BQL) has many names and they are confusing. The actual QemuMutex variable is called qemu_global_mutex but it's commonly referred to as the BQL in discussions and some code comments. The locking APIs, however, are called

Re: [PATCH 9.0 01/13] vdpa: add VhostVDPAShared

2023-11-30 Thread Jason Wang
On Sat, Nov 25, 2023 at 1:14 AM Eugenio Pérez wrote: > > It will hold properties shared among all vhost_vdpa instances associated > with of the same device. For example, we just need one iova_tree or one > memory listener for the entire device. > > Next patches will register the vhost_vdpa

Re: [PATCH 9.0 00/13] Consolidate common vdpa members in VhostVDPAShared

2023-11-30 Thread Lei Yang
On Thu, Nov 30, 2023 at 3:38 PM Eugenio Perez Martin wrote: > > On Thu, Nov 30, 2023 at 4:22 AM Lei Yang wrote: > > > > Hi Eugenio > > > > QE performed regression testing after applying this patch. This series > > patch introduced a qemu core dump bug, for the core dump information > > please

Re: [PATCH 1/6] system/cpus: rename qemu_mutex_lock_iothread() to qemu_bql_lock()

2023-11-30 Thread Paul Durrant
On 29/11/2023 21:26, Stefan Hajnoczi wrote: The Big QEMU Lock (BQL) has many names and they are confusing. The actual QemuMutex variable is called qemu_global_mutex but it's commonly referred to as the BQL in discussions and some code comments. The locking APIs, however, are called

Re: [PATCH 2/6] qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to QEMU_BQL_LOCK_GUARD

2023-11-30 Thread Paul Durrant
On 29/11/2023 21:26, Stefan Hajnoczi wrote: The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous. Signed-off-by: Stefan Hajnoczi --- include/qemu/main-loop.h | 20 ++-- hw/i386/kvm/xen_evtchn.c | 14

Re: [PATCH v3 03/70] RAMBlock/guest_memfd: Enable KVM_GUEST_MEMFD_ALLOW_HUGEPAGE

2023-11-30 Thread Xiaoyao Li
On 11/20/2023 5:26 PM, David Hildenbrand wrote: ... did you shamelessly copy that from hw/virtio/virtio-mem.c ? ;) Get caught. This should be factored out into a common helper. Sure, will do it in next version. Factor it out in a separate patch. Then, this patch is get small that you

[PATCH-for-9.0] accel: Do not set CPUState::tcg_cflags in non-TCG accels

2023-11-30 Thread Philippe Mathieu-Daudé
'tcg_cflags' is specific to TCG. Signed-off-by: Philippe Mathieu-Daudé --- Other targets already use it restricted to TCG, or are TCG-only. --- target/arm/cpu.c | 2 +- target/i386/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c

Re: [PATCH v6 2/4] qcow2: add configurations for zoned format extension

2023-11-30 Thread Markus Armbruster
Sam Li writes: > To configure the zoned format feature on the qcow2 driver, it > requires settings as: the device size, zone model, zone size, > zone capacity, number of conventional zones, limits on zone > resources (max append bytes, max open zones, and max_active_zones). > > To create a qcow2

Re: [PATCH 05/12] block: remove AioContext locking

2023-11-30 Thread Paul Durrant
On 29/11/2023 19:55, Stefan Hajnoczi wrote: This is the big patch that removes aio_context_acquire()/aio_context_release() from the block layer and affected block layer users. There isn't a clean way to split this patch and the reviewers are likely the same group of people, so I decided to do

Re: [PATCH 2/6] qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to QEMU_BQL_LOCK_GUARD

2023-11-30 Thread Ilya Leoshkevich
On Wed, 2023-11-29 at 16:26 -0500, Stefan Hajnoczi wrote: > The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) > instead, it is already widely used and unambiguous. > > Signed-off-by: Stefan Hajnoczi > --- >  include/qemu/main-loop.h  | 20 ++-- >  

Re: [PATCH] pcie_sriov: Remove g_new assertion

2023-11-30 Thread YangHang Liu
After applying this patch, the VM with a igbvf will not crash during reboot. Tested-by: Yanghang Liu On Mon, Nov 27, 2023 at 5:12 PM Cédric Le Goater wrote: > On 11/23/23 08:56, Akihiko Odaki wrote: > > g_new() aborts if the allocation fails so it returns NULL only if the > > requested

Re: [PATCH v6 0/4] Add full zoned storage emulation to qcow2 driver

2023-11-30 Thread Markus Armbruster
Clang reports ../block/qcow2.c:4066:5: error: mutex 'graph_lock' is not held on every path through here [-Werror,-Wthread-safety-analysis] blk_co_unref(blk); ^ ../block/qcow2.c:3928:5: note: mutex acquired here bdrv_graph_co_rdlock(); ^ ../block/qcow2.c:4066:5: error: mutex

Re: [PATCH v3 02/70] RAMBlock: Add support of KVM private guest memfd

2023-11-30 Thread Xiaoyao Li
On 11/18/2023 4:35 AM, Isaku Yamahata wrote: On Wed, Nov 15, 2023 at 02:14:11AM -0500, Xiaoyao Li wrote: diff --git a/system/physmem.c b/system/physmem.c index fc2b0fee0188..0af2213cbd9c 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -1841,6 +1841,20 @@ static void

Re: [PULL 2/2] ppc/amigaone: Allow running AmigaOS without firmware image

2023-11-30 Thread BALATON Zoltan
On Thu, 30 Nov 2023, BALATON Zoltan wrote: On Thu, 30 Nov 2023, Nicholas Piggin wrote: From: BALATON Zoltan The machine uses a modified U-Boot under GPL license but the sources of it are lost with only a binary available so it cannot be included in QEMU. Allow running without the firmware

Re: [PATCH] accel: Do not set CPUState::can_do_io in non-TCG accels

2023-11-30 Thread Claudio Fontana
On 11/30/23 14:31, Philippe Mathieu-Daudé wrote: > Hi Claudio, > > On 30/11/23 13:48, Claudio Fontana wrote: >> Hi Philippe, >> >> took a quick look with >> >> grep -R can_do_io >> >> and this seems to be in include/hw/core/cpu.h as well as cpu-common.c, >> >> maybe there is more meat to address

Re: [PATCH 6/6] Rename "QEMU global mutex" to "BQL" in comments and docs

2023-11-30 Thread Philippe Mathieu-Daudé
On 29/11/23 22:26, Stefan Hajnoczi wrote: The term "QEMU global mutex" is identical to the more widely used Big QEMU Lock ("BQL"). Update the code comments and documentation to use "BQL" instead of "QEMU global mutex". Signed-off-by: Stefan Hajnoczi --- docs/devel/multi-thread-tcg.rst | 7

Re: [PATCH-for-9.0] accel: Do not set CPUState::tcg_cflags in non-TCG accels

2023-11-30 Thread Richard Henderson
On 11/30/23 01:59, Philippe Mathieu-Daudé wrote: 'tcg_cflags' is specific to TCG. Signed-off-by: Philippe Mathieu-Daudé --- Other targets already use it restricted to TCG, or are TCG-only. Reviewed-by: Richard Henderson r~

Re: [PATCH v4 2/2] hw/acpi: Implement the SRAT GI affinity structure

2023-11-30 Thread Markus Armbruster
writes: > From: Ankit Agrawal > > ACPI spec provides a scheme to associate "Generic Initiators" [1] > (e.g. heterogeneous processors and accelerators, GPUs, and I/O devices with > integrated compute or DMA engines GPUs) with Proximity Domains. This is > achieved using Generic Initiator Affinity

[PATCH-for-9.0 1/3] target/arm: Restrict TCG specific helpers

2023-11-30 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/arm/helper.c| 55 -- target/arm/tcg/op_helper.c | 55 ++ 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c

[PATCH-for-9.0 3/3] target/arm/tcg: Including missing 'exec/exec-all.h' header

2023-11-30 Thread Philippe Mathieu-Daudé
translate_insn() ends up calling probe_access_full(), itself declared in "exec/exec-all.h": TranslatorOps::translate_insn -> aarch64_tr_translate_insn() -> is_guarded_page() -> probe_access_full() Signed-off-by: Philippe Mathieu-Daudé --- target/arm/tcg/translate-a64.c | 1

[PATCH-for-9.0 0/3] target/arm/tcg: Few non-TCG cleanups

2023-11-30 Thread Philippe Mathieu-Daudé
Few non-TCG cleanups extracted from a bigger rework. Philippe Mathieu-Daudé (3): target/arm: Restrict TCG specific helpers target/arm: Restrict DC CVAP & DC CVADP instructions to TCG accel target/arm/tcg: Including missing 'exec/exec-all.h' header target/arm/helper.c| 60

[PATCH-for-9.0 2/3] target/arm: Restrict DC CVAP & DC CVADP instructions to TCG accel

2023-11-30 Thread Philippe Mathieu-Daudé
Hardware accelerators handle that in *hardware*. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/helper.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 4844cf1d78..20e13215bb 100644 --- a/target/arm/helper.c +++

[RFC 14/41] PPC/ppc-core: Offload core-id to PPC specific core abstarction

2023-11-30 Thread Zhao Liu
From: Zhao Liu PPC (spapr) supports hotplugs at the core granularity (spapr core) and treats core-id as the global id for all cores. But other architectures that support hotplugging at CPU granularity, use core-id as the local id to indicate the core within the parent topology container instand

[RFC 16/41] PPC/ppc-core: Limit plugged-threads and nr-threads to be equal

2023-11-30 Thread Zhao Liu
From: Zhao Liu PPC supports CPU hotplug at core granularity, thus ppc-core only accepts all CPUs in a core are plugged. Check if plugged_threads and nr_threads are equal when ppc-core realizes. Signed-off-by: Zhao Liu --- hw/ppc/ppc_core.c | 18 ++

[RFC 02/41] qdev: Allow qdev_device_add() to add specific category device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Topology devices need to be created and realized before board initialization. Allow qdev_device_add() to specify category to help create topology devices early. Signed-off-by: Zhao Liu --- hw/net/virtio-net.c| 2 +- hw/usb/xen-usb.c | 3 ++- include/monitor/qdev.h

[RFC 18/41] hw/cpu/cluster: Rename CPUClusterState to CPUCluster

2023-11-30 Thread Zhao Liu
From: Zhao Liu To keep the same naming style as cpu-core, rename CPUClusterState to CPUCluster. Signed-off-by: Zhao Liu --- gdbstub/system.c | 2 +- hw/cpu/cluster.c | 8 include/hw/arm/armsse.h| 2 +- include/hw/arm/xlnx-versal.h

[RFC 35/41] hw/i386: Make x86_cpu_new() private in x86.c

2023-11-30 Thread Zhao Liu
From: Zhao Liu x86_cpu_new() is only invoked in x86.c. Declear it as static in x86.c. Signed-off-by: Zhao Liu --- hw/i386/x86.c | 3 ++- include/hw/i386/x86.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index

[RFC 32/41] hw/machine: Build smp topology tree from -smp

2023-11-30 Thread Zhao Liu
From: Zhao Liu For the architecture supports QOM topology (the field MachineClass.possible_cpus_qom_granu is set), implement smp QOM topology tree from MachineState.smp. Signed-off-by: Zhao Liu --- hw/core/cpu-slot.c | 217 + hw/core/machine-smp.c

[RFC 23/41] hw/cpu/die: Abstract cpu-die level as topology device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Abstract die level as a topology device "cpu-die" to allow user to create die level topology from cli and later the cpu-dies could be added into topology tree. In addition, mark the cpu-die as DEVICE_CATEGORY_CPU_DEF category to indicate it belongs to the basic CPU definition and

[RFC 01/41] qdev: Introduce new device category to cover basic topology device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Topology devices are used to define CPUs and need to be created and realized before the board initialization. Use this new catogory to identify such special devices. Signed-off-by: Zhao Liu --- include/hw/qdev-core.h | 1 + system/qdev-monitor.c | 1 + 2 files changed, 2

[RFC 13/41] hw/core/cpu: Convert CPU from general device to topology device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Convert CPU to topology device then its parent topology devices could count the number of CPUs when new CPUs are added into topology tree. Note since CPUs are created from *_init_cpus() in MachineClass.init() or added from hotplug way, it depends on board initialization. Thus CPU

[RFC 26/41] hw/cpu/drawer: Abstract cpu-drawer level as topology device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Abstract drawer level as a topology device "cpu-drawer" to allow user to create drawer level topology from cli and later the cpu-drawers could be added into topology tree. In addition, mark the cpu-drawer as DEVICE_CATEGORY_CPU_DEF category to indicate it belongs to the basic CPU

[RFC 33/41] hw/machine: Validate smp topology tree without -smp

2023-11-30 Thread Zhao Liu
From: Zhao Liu QOM topology allows user to create topology tree from cli without -smp, in this case, validate the topology tree to meet the smp requirement. Currently, for compatibility with MachineState.smp, initialize MachineState.smp from topology tree in this case. Signed-off-by: Zhao Liu

[RFC 30/41] hw/core/slot: Check topology child to be added under CPU slot

2023-11-30 Thread Zhao Liu
From: Zhao Liu Implement CPUTopoClass.check_topo_child() in cpu-slot to be compatible with the limitations of the current smp topology. Signed-off-by: Zhao Liu --- hw/core/cpu-slot.c | 37 + hw/core/cpu-topo.c | 2 +-

[RFC 41/41] hw/i386: Cleanup non-QOM topology support

2023-11-30 Thread Zhao Liu
From: Zhao Liu After i386 supports QOM topology, drop original topology logic. Signed-off-by: Zhao Liu --- hw/i386/x86.c | 52 +++ 1 file changed, 11 insertions(+), 41 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index

[RFC 17/41] hw/cpu/core: Convert cpu-core from general device to topology device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Convert cpu-core to topology device then user could create core level topology from cli and later the cpu-cores could be added into topology tree. In addition, mark the common cpu-core as DEVICE_CATEGORY_CPU_DEF category to indicate it belongs to the basic CPU definition and

[RFC 40/41] hw/i386: Support QOM topology

2023-11-30 Thread Zhao Liu
From: Zhao Liu Set MachineClass.smp_props.possible_cpus_qom_granu and TopoClass.search_parent_pre_plug for i386. So far, the i386 topology is based on the QOM topology. Signed-off-by: Zhao Liu --- hw/i386/x86.c | 1 + target/i386/cpu.c | 4 2 files changed, 5 insertions(+) diff

[RFC 36/41] hw/i386: Allow x86_cpu_new() to specify parent for new CPU

2023-11-30 Thread Zhao Liu
From: Zhao Liu For QOM topology, CPU should be inserted under its parent core. Extend x86_cpu_new() to allow caller to specify topology parent. Signed-off-by: Zhao Liu --- hw/i386/x86.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/i386/x86.c

[RFC 20/41] hw/cpu/cluster: Descript cluster is not only used for TCG in comment

2023-11-30 Thread Zhao Liu
From: Zhao Liu Update the comment to make the cpu-cluster description more general for both TCG and accel cases. Signed-off-by: Zhao Liu --- hw/cpu/cluster.c | 2 +- include/hw/cpu/cluster.h | 20 +++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git

[RFC 34/41] hw/core/topo: Implement user-child to collect topology device from cli

2023-11-30 Thread Zhao Liu
From: Zhao Liu Support user-child for topology devices. This will affect these 2 aspects: 1. For the basic topology device (with DEVICE_CATEGORY_CPU_DEF category), user could specify "parent" to build the topology relationship from cli. And cpu-slot will collect all topology devices.

[RFC 39/41] hw/i386: Add the interface to search parent for QOM topology

2023-11-30 Thread Zhao Liu
From: Zhao Liu QOM topology needs to search parent cpu-core for hotplugged CPU to create topology child<> property in qdev_set_id(). This process is before x86_cpu_pre_plug(), thus place 2 helpers x86_cpu_assign_apic_id() and x86_cpu_assign_topo_id() in x86_cpu_search_parent_pre_plug() to help

Re: [PATCH for-8.2 2/2] string-output-visitor: Support lists for non-integer types

2023-11-30 Thread Markus Armbruster
I understand Stefan already took this patch. I'm looking at it anyway, because experience has taught me to be very afraid of the string visitors. Kevin Wolf writes: > With the introduction of list-based array properties in qdev, the string > output visitor has to deal with lists of non-integer

Re: [PULL 2/2] ppc/amigaone: Allow running AmigaOS without firmware image

2023-11-30 Thread BALATON Zoltan
On Thu, 30 Nov 2023, Nicholas Piggin wrote: From: BALATON Zoltan The machine uses a modified U-Boot under GPL license but the sources of it are lost with only a binary available so it cannot be included in QEMU. Allow running without the firmware image which can be used when calling a boot

Re: [PATCH for-8.2 2/2] string-output-visitor: Support lists for non-integer types

2023-11-30 Thread Stefan Hajnoczi
On Thu, 30 Nov 2023 at 08:12, Markus Armbruster wrote: > > I understand Stefan already took this patch. I'm looking at it anyway, > because experience has taught me to be very afraid of the string > visitors. Hi Markus, I should have waited for your review. Sorry! Stefan

Re: [PATCH 4/6] system/cpus: rename qemu_global_mutex to qemu_bql

2023-11-30 Thread Cédric Le Goater
On 11/29/23 22:26, Stefan Hajnoczi wrote: The APIs using qemu_global_mutex now follow the Big QEMU Lock (BQL) nomenclature. It's a little strange that the actual QemuMutex variable that embodies the BQL is called qemu_global_mutex instead of qemu_bql. Rename it for consistency. Signed-off-by:

Re: [PATCH 3/6] qemu/main-loop: rename qemu_cond_wait_iothread() to qemu_cond_wait_bql()

2023-11-30 Thread Cédric Le Goater
On 11/29/23 22:26, Stefan Hajnoczi wrote: The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous. Signed-off-by: Stefan Hajnoczi Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH] accel: Do not set CPUState::can_do_io in non-TCG accels

2023-11-30 Thread Philippe Mathieu-Daudé
Hi Claudio, On 30/11/23 13:48, Claudio Fontana wrote: Hi Philippe, took a quick look with grep -R can_do_io and this seems to be in include/hw/core/cpu.h as well as cpu-common.c, maybe there is more meat to address to fully solve this? Before we had stuff for reset in cpu-common.c under a

Re: [PATCH 3/6] qemu/main-loop: rename qemu_cond_wait_iothread() to qemu_cond_wait_bql()

2023-11-30 Thread Philippe Mathieu-Daudé
On 29/11/23 22:26, Stefan Hajnoczi wrote: The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous. Signed-off-by: Stefan Hajnoczi --- include/qemu/main-loop.h | 8 accel/tcg/tcg-accel-ops-rr.c | 4 ++--

Re: [PATCH] accel: Do not set CPUState::can_do_io in non-TCG accels

2023-11-30 Thread Richard Henderson
On 11/29/23 14:50, Philippe Mathieu-Daudé wrote: 'can_do_io' is specific to TCG. Having it set in non-TCG code is confusing, so remove it from QTest / HVF / KVM. Signed-off-by: Philippe Mathieu-Daudé --- accel/dummy-cpus.c| 1 - accel/hvf/hvf-accel-ops.c | 1 -

Re: [PATCH v4 1/2] qom: new object to associate device to numa node

2023-11-30 Thread Markus Armbruster
writes: > From: Ankit Agrawal > > NVIDIA GPU's support MIG (Mult-Instance GPUs) feature [1], which allows > partitioning of the GPU device resources (including device memory) into > several (upto 8) isolated instances. Each of the partitioned memory needs > a dedicated NUMA node to operate. The

Re: [PATCH v12 04/10] hvf: Add Apple Silicon support

2023-11-30 Thread Philippe Mathieu-Daudé
Hi, On 16/9/21 17:53, Alexander Graf wrote: With Apple Silicon available to the masses, it's a good time to add support for driving its virtualization extensions from QEMU. This patch adds all necessary architecture specific code to get basic VMs working, including save/restore. Known

[RFC 11/41] hw/core/topo: Add virtual method to check topology child

2023-11-30 Thread Zhao Liu
From: Zhao Liu When a new topology child is to be inserted into the topology tree, its parents (including non-direct parents) need to check if this child is supported. Add the virtual method to allow topology device to check the support for their topology children. Signed-off-by: Zhao Liu ---

[RFC 03/41] system: Create base category devices from cli before board initialization

2023-11-30 Thread Zhao Liu
From: Zhao Liu Topology devices are required to complete CPU topology building before *_init_cpus() in MachineClass.init(). Add a qemu_create_cli_base_devices() before board initialization to help create and realize topology devices from cli early. Signed-off-by: Zhao Liu --- system/vl.c |

[RFC 05/41] qdev: Set device parent and id after setting properties

2023-11-30 Thread Zhao Liu
From: Zhao Liu The properties setting does not conflict with the creation of child<> property. Pre-setting the device's properties can help the device's parent selection. Some topology devices (e.g., CPUs that support hotplug) usually define topology sub indexes as properties, and the selection

[RFC 08/41] hw/core/topo: Introduce CPU topology device abstraction

2023-11-30 Thread Zhao Liu
From: Zhao Liu To create more flexible CPU topologies (both symmetric and heterogeneous) via the "-device" interface, it is necessary to convert the current CPU topology hierarchies into the special CPU topology devices. The CPU topology will be built as a tree, and the device with the

[RFC 06/41] qdev: Introduce user-child interface to collect devices from -device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Topology relationship is based on child<> property, therefore introduce a new user-child interface to help bus-less devices create child<> property from cli. User-child interface works in qdev_set_id(), where the child<> property is created for cli devices. With several methods,

[RFC 31/41] hw/machine: Plug cpu-slot into machine to maintain topology tree

2023-11-30 Thread Zhao Liu
From: Zhao Liu Add a cpu-slot in machine as the root of topology tree to maintain the QOM topology. Signed-off-by: Zhao Liu --- hw/core/cpu-slot.c | 31 +++ include/hw/boards.h| 2 ++ include/hw/core/cpu-slot.h | 7 +++ system/vl.c

[RFC 37/41] hw/i386: Allow i386 to create new CPUs from QOM topology

2023-11-30 Thread Zhao Liu
From: Zhao Liu For QOM topology, maximum number of CPUs and the number of plugged CPUs are configured in core level. Iterate through all the cpu-cores to determine how many CPUs should be created in each cpu-core. Signed-off-by: Zhao Liu --- hw/i386/x86.c | 32

[RFC 24/41] hw/cpu/socket: Abstract cpu-socket level as topology device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Abstract socket level as a topology device "cpu-socket" to allow user to create socket level topology from cli and later the cpu-sockets could be added into topology tree. In addition, mark the cpu-socket as DEVICE_CATEGORY_CPU_DEF category to indicate it belongs to the basic CPU

[RFC 19/41] hw/cpu/cluster: Wrap TCG related ops and props into CONFIG_TCG

2023-11-30 Thread Zhao Liu
From: Zhao Liu Currenltly cpu-cluster is used in TCG case to organize CPUs with the same type. Wrap 2 things into TCG specific areas: 1. cluster-id: The cluster-id in TCG case is global, since no higher topology container above cluster. To simplify the logic of cluster topology in

[RFC 10/41] hw/core/topo: Add virtual method to update topology info for parent

2023-11-30 Thread Zhao Liu
From: Zhao Liu When a new topology device is inserted into the topology tree, its'parents (including non-direct parent) need to update topology information. Add the virtual method to help parents on topology tree update topology information statistics. Signed-off-by: Zhao Liu ---

[RFC 27/41] hw/core/slot: Introduce CPU slot as the root of CPU topology

2023-11-30 Thread Zhao Liu
From: Zhao Liu Abstract the root of topology tree as a special topology device "cpu-slot". Signed-off-by: Zhao Liu --- MAINTAINERS| 2 ++ hw/core/cpu-slot.c | 48 ++ hw/core/meson.build| 1 + include/hw/core/cpu-slot.h | 38

Re: [RFC v2 1/7] docs/qcow2: add zd_extension_size option to the zoned format feature

2023-11-30 Thread Markus Armbruster
Sam Li writes: > Signed-off-by: Sam Li > --- > docs/interop/qcow2.txt | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt > index 0f1938f056..458d05371a 100644 > --- a/docs/interop/qcow2.txt > +++ b/docs/interop/qcow2.txt > @@ -428,6

Re: [RFC v2 0/7] Add persistence to NVMe ZNS emulation

2023-11-30 Thread Markus Armbruster
Sam Li writes: > ZNS emulation follows NVMe ZNS spec but the state of namespace > zones does not persist accross restarts of QEMU. This patch makes the > metadata of ZNS emulation persistent by using new block layer APIs and > the qcow2 img as backing file. It is the second part after the

[PATCH] blockcommit: Reopen base image as RO after abort

2023-11-30 Thread Alexander Ivanov
If a blockcommit is aborted the base image remains in RW mode, that leads to a fail of subsequent live migration. How to reproduce: $ virsh snapshot-create-as vm snp1 --disk-only *** write something to the disk *** $ virsh blockcommit vm vda --active --shallow && virsh blockjob vm vda

Re: [PATCH v3] migration: free 'saddr' since be no longer used

2023-11-30 Thread Het Gala
On 29/11/23 8:17 pm, Peter Xu wrote: On Wed, Nov 29, 2023 at 10:09:12AM +0800, Zongmin Zhou wrote: Ping? Has this been forgotten? Juan, Would you send a pull to include this? Thanks! Peter, Juan - Could you also pull a similar patch related to memory leak together, it has been tested and

Re: [RFC v2 0/7] Add persistence to NVMe ZNS emulation

2023-11-30 Thread Sam Li
Markus Armbruster 于2023年11月30日周四 18:11写道: > > Sam Li writes: > > > ZNS emulation follows NVMe ZNS spec but the state of namespace > > zones does not persist accross restarts of QEMU. This patch makes the > > metadata of ZNS emulation persistent by using new block layer APIs and > > the qcow2 img

Re: [PATCH v3 03/70] RAMBlock/guest_memfd: Enable KVM_GUEST_MEMFD_ALLOW_HUGEPAGE

2023-11-30 Thread David Hildenbrand
On 30.11.23 08:32, Xiaoyao Li wrote: On 11/20/2023 5:26 PM, David Hildenbrand wrote: ... did you shamelessly copy that from hw/virtio/virtio-mem.c ? ;) Get caught. This should be factored out into a common helper. Sure, will do it in next version. Factor it out in a separate patch.

Re: [RFC PATCH v2 17/19] heki: x86: Update permissions counters during text patching

2023-11-30 Thread Peter Zijlstra
On Wed, Nov 29, 2023 at 03:07:15PM -0600, Madhavan T. Venkataraman wrote: > Kernel Lockdown > --- > > But, we must provide at least some security in V2. Otherwise, it is useless. > > So, we have implemented what we call a kernel lockdown. At the end of kernel > boot, Heki

Re: [PATCH 2/6] qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to QEMU_BQL_LOCK_GUARD

2023-11-30 Thread David Woodhouse
On Wed, 2023-11-29 at 16:26 -0500, Stefan Hajnoczi wrote: > The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) > instead, it is already widely used and unambiguous. > > Signed-off-by: Stefan Hajnoczi Acked-by: David Woodhouse smime.p7s Description: S/MIME cryptographic

Re: [PATCH 1/6] system/cpus: rename qemu_mutex_lock_iothread() to qemu_bql_lock()

2023-11-30 Thread David Woodhouse
On Wed, 2023-11-29 at 16:26 -0500, Stefan Hajnoczi wrote: > The Big QEMU Lock (BQL) has many names and they are confusing. The > actual QemuMutex variable is called qemu_global_mutex but it's commonly > referred to as the BQL in discussions and some code comments. The > locking APIs, however, are

[PULL 0/2] ppc-for-8.2 queue

2023-11-30 Thread Nicholas Piggin
The following changes since commit abf635ddfe3242df907f58967f3c1e6763bbca2d: Update version for v8.2.0-rc2 release (2023-11-28 16:31:16 -0500) are available in the Git repository at: https://gitlab.com/npiggin/qemu.git tags/pull-ppc-for-8.2-20231130 for you to fetch changes up

Re: [PATCH] accel: Do not set CPUState::can_do_io in non-TCG accels

2023-11-30 Thread Claudio Fontana
Hi Philippe, took a quick look with grep -R can_do_io and this seems to be in include/hw/core/cpu.h as well as cpu-common.c, maybe there is more meat to address to fully solve this? Before we had stuff for reset in cpu-common.c under a if (tcg_enabled()) { } but now we have

Re: [PATCH v3] ppc/amigaone: Allow running AmigaOS without firmware image

2023-11-30 Thread BALATON Zoltan
On Thu, 30 Nov 2023, Nicholas Piggin wrote: On Thu Nov 30, 2023 at 8:49 AM AEST, BALATON Zoltan wrote: On Tue, 28 Nov 2023, Cédric Le Goater wrote: On 11/28/23 02:32, BALATON Zoltan wrote: The machine uses a modified U-Boot under GPL license but the sources of it are lost with only a binary

Re: [PATCH for-8.2 2/2] string-output-visitor: Support lists for non-integer types

2023-11-30 Thread Markus Armbruster
Stefan Hajnoczi writes: > On Thu, 30 Nov 2023 at 08:12, Markus Armbruster wrote: >> >> I understand Stefan already took this patch. I'm looking at it anyway, >> because experience has taught me to be very afraid of the string >> visitors. > > Hi Markus, > I should have waited for your review.

Re: [PATCH 4/6] system/cpus: rename qemu_global_mutex to qemu_bql

2023-11-30 Thread Philippe Mathieu-Daudé
Hi Stefan, On 29/11/23 22:26, Stefan Hajnoczi wrote: The APIs using qemu_global_mutex now follow the Big QEMU Lock (BQL) nomenclature. It's a little strange that the actual QemuMutex variable that embodies the BQL is called qemu_global_mutex instead of qemu_bql. Rename it for consistency.

Re: [PATCH 5/6] Replace "iothread lock" with "BQL" in comments

2023-11-30 Thread Philippe Mathieu-Daudé
Hi Stefan, On 29/11/23 22:26, Stefan Hajnoczi wrote: The term "iothread lock" is obsolete. The APIs use Big QEMU Lock (BQL) in their names. Update the code comments to use "BQL" instead of "iothread lock". Signed-off-by: Stefan Hajnoczi --- docs/devel/reset.rst | 2 +-

Re: [PATCH for-8.2 2/2] string-output-visitor: Support lists for non-integer types

2023-11-30 Thread Kevin Wolf
Am 30.11.2023 um 14:11 hat Markus Armbruster geschrieben: > I understand Stefan already took this patch. I'm looking at it anyway, > because experience has taught me to be very afraid of the string > visitors. > > Kevin Wolf writes: > > > With the introduction of list-based array properties in

[RFC 15/41] hw/cpu/core: Allow to configure plugged threads for cpu-core

2023-11-30 Thread Zhao Liu
From: Zhao Liu When the core abstraction is applied for the architecture support CPU hotplug, the plugged CPUs and unplugged CPUs are distributed among the cores created in the topology tree. Add plugged_threads field to help cpu-core decide to how many CPUs to create. Signed-off-by: Zhao Liu

[RFC 04/41] qom/object: Introduce helper to resolve path from non-direct parent

2023-11-30 Thread Zhao Liu
From: Zhao Liu When we support child<> property creation from cli, the peripheral container (/machine/peripheral) may not be the direct parent of the devices created from cli. For this case, add a helper to resolve path from non-direct parent. Signed-off-by: Zhao Liu --- include/qom/object.h

[RFC 07/41] qdev: Introduce parent option in -device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Currently, the devices added by "-device" are linked via bus, and are set the parent as peripheral-anon or peripheral containers of the machine. But this is not enough for building CPU topology hierarchies as: 1. The relationship between different CPU hierarchies is child<>

[RFC 09/41] hw/core/topo: Support topology index for topology device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Topology index is used to identify the topology child under the same parent topology device. This field corresponds to the topology sub index (e.g., socket-id/ core-id/thread-id) used for addressing. Signed-off-by: Zhao Liu --- hw/core/cpu-topo.c | 77

[RFC 21/41] hw/cpu/cluster: Allow cpu-cluster to be created by -device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Since we will extend cpu-cluster to build CPU topology in virtualization case via -device, remove the original limitition. Signed-off-by: Zhao Liu --- hw/cpu/cluster.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/cpu/cluster.c b/hw/cpu/cluster.c index

[RFC 00/41] qom-topo: Abstract Everything about CPU Topology

2023-11-30 Thread Zhao Liu
From: Zhao Liu Hi list, This series is our latest attempt after the previous RFC [1] about hybrid topology support, which is based on the commit 4705fc0c8511 ("Merge tag 'pull-for-8.2-fixes-231123-1' of https://gitlab.com/ stsquad/qemu into staging") with our previous cleanup (patches link:

[RFC 12/41] hw/core/topo: Add helpers to traverse the CPU topology tree

2023-11-30 Thread Zhao Liu
From: Zhao Liu The topology devices will be organized as a topology tree. Each topology device may have many topology children with lower topology level. Add the helpers to traverse the CPU topology tree. Signed-off-by: Zhao Liu --- hw/core/cpu-topo.c | 41

Re: [PATCH for-8.2 2/2] string-output-visitor: Support lists for non-integer types

2023-11-30 Thread Markus Armbruster
Kevin Wolf writes: > Am 30.11.2023 um 14:11 hat Markus Armbruster geschrieben: >> I understand Stefan already took this patch. I'm looking at it anyway, >> because experience has taught me to be very afraid of the string >> visitors. >> >> Kevin Wolf writes: >> >> > With the introduction of

[RFC 25/41] hw/cpu/book: Abstract cpu-book level as topology device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Abstract book level as a topology device "cpu-book" to allow user to create book level topology from cli and later the cpu-books could be added into topology tree. In addition, mark the cpu-book as DEVICE_CATEGORY_CPU_DEF category to indicate it belongs to the basic CPU

[RFC 22/41] hw/cpu/cluster: Convert cpu-cluster from general device to topology device

2023-11-30 Thread Zhao Liu
From: Zhao Liu Convert cpu-cluster to topology device then user could create cluster level topology from cli and later the cpu-clusters could be added into topology tree. In addition, mark the cpu-cluster as DEVICE_CATEGORY_CPU_DEF category to indicate it belongs to the basic CPU definition and

[RFC 29/41] hw/core/slot: Statistics topology information in CPU slot

2023-11-30 Thread Zhao Liu
From: Zhao Liu The CPU slot, as the root of the topology tree, is responsible for global topology information collection and updates. When a new topology device is added to/deleted from the topology tree, update the corresponding information in the slot. Signed-off-by: Zhao Liu ---

  1   2   3   >