[PULL 04/20] hw/mem/nvdimm: Use Kconfig 'imply' instead of 'depends on'

2021-05-17 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Per the kconfig.rst: A device should be listed [...] ``imply`` if (depending on the QEMU command line) the board may or may not be started without it. This is the case with the NVDIMM device, so use the 'imply' weak reverse dependency to select the symbol.

[PULL 10/20] KVM: do not allow setting properties at runtime

2021-05-17 Thread Paolo Bonzini
Only allow accelerator properties to be set when the accelerator is being created. Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 4e0168e88b..54c0860979 100644

[PATCH v7 22/23] cpu: Move CPUClass::get_paging_enabled to SysemuCPUOps

2021-05-17 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h| 2 -- include/hw/core/sysemu-cpu-ops.h | 4 hw/core/cpu-sysemu.c | 4 ++-- target/i386/cpu.c| 4 +++- 4 files changed, 9 insertions(+), 5 deletions(-)

Re: [PATCH v3 1/9] qapi: replace List[str] by QAPISchemaIfCond

2021-05-17 Thread Marc-André Lureau
Hi On Thu, May 13, 2021 at 12:53 AM John Snow wrote: > On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Wrap the 'if' condition in a higher-level object. Not only this allows > > more type safety but also further refactoring without too much churn. > >

[PULL 00/20] Misc patches for 2020-05-17

2021-05-17 Thread Paolo Bonzini
The following changes since commit 6005ee07c380cbde44292f5f6c96e7daa70f4f7d: Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2021-05-16 17:22:46 +0100) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fetch

Re: [PATCH v3 4/9] qapi: introduce IfPredicateList and IfAny

2021-05-17 Thread Marc-André Lureau
Hi On Thu, May 13, 2021 at 3:26 AM John Snow wrote: > On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Refactor IfAll class, to introduce a base class IfPredicateList and add > > IfAny for the 'any' conditions. > > > > Signed-off-by: Marc-André Lureau

[PATCH v7 19/23] cpu: Move CPUClass::asidx_from_attrs to SysemuCPUOps

2021-05-17 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h| 3 --- include/hw/core/sysemu-cpu-ops.h | 5 + hw/core/cpu-sysemu.c | 4 ++-- target/arm/cpu.c | 2 +- target/i386/cpu.c| 2 +- 5 files

[PATCH 08/11] exec: Restrict ioport.h to sysemu/

2021-05-17 Thread Philippe Mathieu-Daudé
To make it clearer the ioport.h header is sysemu specific, move it to the sysemu/ directory. Patch created mechanically using: $ sed -i s,exec/ioport.h,sysemu/ioport.h, $(git grep -l exec/ioport.h) Then the #ifdef'ry conditional on CONFIG_USER_ONLY has been replaced by an #error.

Re: [PATCH v3 2/9] qapi: move gen_if/gen_endif to QAPISchemaIfCond

2021-05-17 Thread Marc-André Lureau
Hi On Wed, May 12, 2021 at 10:53 PM John Snow wrote: > On 5/11/21 12:39 PM, Stefan Hajnoczi wrote: > > On Thu, Apr 29, 2021 at 05:40:25PM +0400, marcandre.lur...@redhat.com > wrote: > >> From: Marc-André Lureau > >> > >> Move the generating function to the QAPISchemaIfCond class. > > > > I'm

[PATCH v7 17/23] cpu: Move CPUClass::get_crash_info to SysemuCPUOps

2021-05-17 Thread Philippe Mathieu-Daudé
cpu_get_crash_info() is called on GUEST_PANICKED events, which only occur in system emulation. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h| 1 - include/hw/core/sysemu-cpu-ops.h | 5 + hw/core/cpu-sysemu.c | 4 ++--

[PATCH 06/11] exec: Restrict address-spaces.h to sysemu/

2021-05-17 Thread Philippe Mathieu-Daudé
To make it clearer the address-spaces.h header is sysemu specific, move it to the sysemu/ directory. Patch created mechanically using: $ sed -i s,exec/address-spaces.h,exec/sysemu/address-spaces.h, $(git grep -l exec/address-spaces.h) Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH 05/11] exec: Restrict memory-internal.h to sysemu/

2021-05-17 Thread Philippe Mathieu-Daudé
To make it clearer the memory-internal.h header is sysemu specific, move it to the sysemu/ directory. Patch created mechanically using: $ sed -i s,exec/memory-internal.h,exec/sysemu/memory-internal.h, $(git grep -l exec/memory-internal.h) Then the #ifdef'ry conditional on CONFIG_USER_ONLY

[PATCH 11/11] exec: Restrict confidential-guest-support.h to sysemu/

2021-05-17 Thread Philippe Mathieu-Daudé
To make it clearer the confidential-guest-support.h header is sysemu specific, move it to the sysemu/ directory. Patch created mechanically using: $ sed -i s,exec/confidential-guest-support.h,sysemu/confidential-guest-support.h, \ $(git grep -l exec/confidential-guest-support.h) Then the

[PATCH 02/11] exec: Restrict hwaddr.h to sysemu/

2021-05-17 Thread Philippe Mathieu-Daudé
Guard declarations within hwaddr.h against inclusion from user-mode emulation. To make it clearer this header is sysemu specific, move it to the sysemu/ directory. Patch created mechanically using: $ sed -i s,exec/hwaddr.h,exec/sysemu/hwaddr.h, $(git grep -l exec/hwaddr.h) Signed-off-by:

[PATCH 01/11] NOTFORMERGE target/arm: Restrict KVM files to softmmu

2021-05-17 Thread Philippe Mathieu-Daudé
The following patches require the "arm cleanup experiment for kvm-only build" [*] series with split various user/sysemu and tcg/kvm code from the target/arm/ directory. To be able to build the following patches waiting the series get merged, simply restrict the KVM files to the softmmu source

[PATCH v7 14/23] cpu: Introduce SysemuCPUOps structure

2021-05-17 Thread Philippe Mathieu-Daudé
Introduce a structure to hold handler specific to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h| 5 + include/hw/core/sysemu-cpu-ops.h | 21 + target/alpha/cpu.c | 6 ++

[PATCH 09/11] exec: Restrict ram_addr.h to sysemu/

2021-05-17 Thread Philippe Mathieu-Daudé
To make it clearer the ram_addr.h header is sysemu specific, move it to the sysemu/ directory. Patch created mechanically using: $ sed -i s,exec/ram_addr.h,sysemu/ram_addr.h, $(git grep -l exec/ram_addr.h) Then the #ifdef'ry conditional on CONFIG_USER_ONLY has been replaced by an #error.

[PATCH v7 23/23] cpu: Restrict "hw/core/sysemu-cpu-ops.h" to target/cpu.c

2021-05-17 Thread Philippe Mathieu-Daudé
Somehow similar to commit 78271684719 ("cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass"): We cannot in principle make the SysEmu Operations field definitions conditional on CONFIG_SOFTMMU in code that is included by both common_ss and specific_ss modules. Therefore, what we can

[PATCH 00/11] exec: Restrict various system emulation specific headers (to sysemu)

2021-05-17 Thread Philippe Mathieu-Daudé
Hi, This series restricts various system emulation specific headers by moving them under sysemu/ and adding #error if included from user emulation. We could avoid the sysemu/ rename if too much churn, but enforcing error of headers that must not be included in user emulation allows further

[PATCH v7 11/23] cpu: Assert DeviceClass::vmsd is NULL on user emulation

2021-05-17 Thread Philippe Mathieu-Daudé
Migration is specific to system emulation. Restrict current DeviceClass::vmsd to sysemu using #ifdef'ry, and assert in cpu_exec_realizefn() that dc->vmsd not set under user emulation. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- v7: Check vmsd->unmigratable (David)

[PATCH v7 21/23] cpu: Move CPUClass::get_memory_mapping to SysemuCPUOps

2021-05-17 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h| 3 --- include/hw/core/sysemu-cpu-ops.h | 5 + hw/core/cpu-sysemu.c | 4 ++-- target/i386/cpu.c| 2 +- 4 files changed, 8 insertions(+), 6 deletions(-)

[PATCH v7 20/23] cpu: Move CPUClass::get_phys_page_debug to SysemuCPUOps

2021-05-17 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h| 8 include/hw/core/sysemu-cpu-ops.h | 13 + target/alpha/cpu.h | 2 +- target/arm/cpu.h | 6 +++--- target/cris/cpu.h

[PATCH v7 10/23] cpu: Directly use get_memory_mapping() fallback handlers in place

2021-05-17 Thread Philippe Mathieu-Daudé
No code uses CPUClass::get_memory_mapping() outside of hw/core/cpu.c: $ git grep -F -- '->get_memory_mapping' hw/core/cpu.c:87:cc->get_memory_mapping(cpu, list, errp); hw/core/cpu.c:439:k->get_memory_mapping = cpu_common_get_memory_mapping; target/i386/cpu.c:7422:

[PATCH v7 18/23] cpu: Move CPUClass::write_elf* to SysemuCPUOps

2021-05-17 Thread Philippe Mathieu-Daudé
The write_elf*() handlers are used to dump vmcore images. This feature is only meaningful for system emulation. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h| 17 - include/hw/core/sysemu-cpu-ops.h | 24

[PATCH v7 15/23] cpu: Move CPUClass::vmsd to SysemuCPUOps

2021-05-17 Thread Philippe Mathieu-Daudé
Migration is specific to system emulation. - Move the CPUClass::vmsd field to SysemuCPUOps, - restrict VMSTATE_CPU() macro to sysemu, - vmstate_dummy is now unused, remove it. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h| 8

[PATCH v7 04/23] cpu: Remove duplicated 'sysemu/hw_accel.h' header

2021-05-17 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/core/cpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 00330ba07de..919dc3435a3 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -34,7 +34,6 @@ #include "hw/qdev-properties.h" #include "trace/trace-root.h"

[PATCH v7 16/23] cpu: Move CPUClass::virtio_is_big_endian to SysemuCPUOps

2021-05-17 Thread Philippe Mathieu-Daudé
VirtIO devices are only meaningful with system emulation. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h| 5 - include/hw/core/sysemu-cpu-ops.h | 9 + hw/core/cpu-sysemu.c | 5 +++-- target/arm/cpu.c

[PATCH v7 13/23] cpu: Move AVR target vmsd field from CPUClass to DeviceClass

2021-05-17 Thread Philippe Mathieu-Daudé
See rationale in previous commit. Targets should use the vmsd field of DeviceClass, not CPUClass. As migration is not important on the AVR target, break the migration compatibility and set the DeviceClass vmsd field. To feel safer, increment the vmstate version. Signed-off-by: Philippe

[PATCH v7 03/23] cpu: Restrict target cpu_do_unaligned_access() handlers to sysemu

2021-05-17 Thread Philippe Mathieu-Daudé
Commit 8535dd702dd ("cpu: move do_unaligned_access to tcg_ops") restricted the do_unaligned_access() handler to the sysemu part of TCGCPUOps, but only restricted the HPPA declaration. Restrict the other targets. Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.h | 7

[PATCH v7 07/23] cpu: Introduce cpu_virtio_is_big_endian()

2021-05-17 Thread Philippe Mathieu-Daudé
Introduce the cpu_virtio_is_big_endian() generic helper to avoid calling CPUClass internal virtio_is_big_endian() one. Similarly to commit bf7663c4bd8 ("cpu: introduce CPUClass::virtio_is_big_endian()"), we keep 'virtio' in the method name to hint this handler shouldn't be called anywhere but

[PATCH v7 12/23] cpu: Rename CPUClass vmsd -> legacy_vmsd

2021-05-17 Thread Philippe Mathieu-Daudé
Quoting Peter Maydell [*]: There are two ways to handle migration for a CPU object: (1) like any other device, so it has a dc->vmsd that covers migration for the whole object. As usual for objects that are a subclass of a parent that has state, the first entry in the

[PATCH v7 09/23] cpu: Directly use get_paging_enabled() fallback handlers in place

2021-05-17 Thread Philippe Mathieu-Daudé
No code uses CPUClass::get_paging_enabled() outside of hw/core/cpu.c: $ git grep -F -- '->get_paging_enabled' hw/core/cpu.c:74:return cc->get_paging_enabled(cpu); hw/core/cpu.c:438:k->get_paging_enabled = cpu_common_get_paging_enabled; target/i386/cpu.c:7418:

[PATCH v7 02/23] cpu: Restrict target cpu_do_transaction_failed() handlers to sysemu

2021-05-17 Thread Philippe Mathieu-Daudé
In commit cbc183d2d9f ("cpu: move cc->transaction_failed to tcg_ops") we restricted the do_transaction_failed() handler to the sysemu part of TCGCPUOps, but forgot to restrict the target specific declarations. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/internals.h | 2 ++

[PATCH v7 05/23] cpu: Split as cpu-common / cpu-sysemu

2021-05-17 Thread Philippe Mathieu-Daudé
The current cpu.c contains sysemu-specific methods. To avoid building them in user-mode builds, split the current cpu.c as cpu-common.c / cpu-sysemu.c. Start by moving cpu_get_crash_info(). Signed-off-by: Philippe Mathieu-Daudé --- hw/core/{cpu.c => cpu-common.c} | 17 -

[PATCH v7 08/23] cpu: Directly use cpu_write_elf*() fallback handlers in place

2021-05-17 Thread Philippe Mathieu-Daudé
No code directly accesses CPUClass::write_elf*() handlers out of hw/core/cpu.c (the rest are assignation in target/ code): $ git grep -F -- '->write_elf' hw/core/cpu.c:157:return (*cc->write_elf32_qemunote)(f, cpu, opaque); hw/core/cpu.c:171:return (*cc->write_elf32_note)(f, cpu,

[PATCH v7 01/23] NOTFORMERGE target/arm: Restrict MTE code to softmmu

2021-05-17 Thread Philippe Mathieu-Daudé
The following patches require the "arm cleanup experiment for kvm-only build" [*] series with split various user/sysemu and tcg/kvm code from the target/arm/ directory. To be able to build the following patches waiting the series get merged, simply restrict the MTE code to the softmmu source set.

[PATCH v7 06/23] cpu: Un-inline cpu_get_phys_page_debug and cpu_asidx_from_attrs

2021-05-17 Thread Philippe Mathieu-Daudé
To be able to later extract the cpu_get_phys_page_debug() and cpu_asidx_from_attrs() handlers from CPUClass, un-inline them from "hw/core/cpu.h". Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 33 -

[PATCH v7 00/23] cpu: Introduce SysemuCPUOps structure

2021-05-17 Thread Philippe Mathieu-Daudé
Missing review: 2-5 (new) and 13 Hi, This series is inspired on Claudio TCG work. Instead of separate TCG from other accelerators, here we separate sysemu operations (system VS user). Since v6: - Rebased (3 targets removed, Claudio's target/i386 series merged) - Addressed Richard & David

Re: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality

2021-05-17 Thread Alex Bennée
Daniel P. Berrangé writes: > On Wed, May 05, 2021 at 11:41:46AM +0100, Alex Bennée wrote: >> >> Alex Bennée writes: >> >> > Daniel P. Berrangé writes: >> > >> >> On Wed, May 05, 2021 at 10:22:57AM +0100, Alex Bennée wrote: >> >> >>> +TCG introspection features >> >>>

Re: [PULL 00/14] Block layer patches

2021-05-17 Thread Peter Maydell
On Sun, 16 May 2021 at 22:09, Philippe Mathieu-Daudé wrote: > > On 5/14/21 6:31 PM, Kevin Wolf wrote: > > The following changes since commit 96662996eda78c48aa4e76d8615c7eb72d80: > > > > Merge remote-tracking branch > > 'remotes/dgilbert/tags/pull-migration-20210513a' into staging

[PATCH 2/3] hw/nvme/ctrl: fix endian conversion for nsid in ctrl list

2021-05-17 Thread Gollu Appalanaidu
In Identify Ctrl List of the CNS 0x12 and 0x13 no endian conversion for the nsid field. Signed-off-by: Gollu Appalanaidu --- hw/nvme/ctrl.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index d08a3350e2..813a72c655 100644 ---

[PATCH 0/3] adding ctrl list (cns 0x13) support and random fixes

2021-05-17 Thread Gollu Appalanaidu
This series will add the Identify Controller List (CNS 0x13) support and NSID endian conversion fixes for CNS 0x12 and CNS 0x13. Documentation fix for the '-detached' parameter. Gollu Appalanaidu (3): hw/nvme/ctrl: add controller list cns 0x13 hw/nvme/ctrl: fix endian conversion for nsid in

[PATCH] target/hppa: Remove unused 'memory.h' header

2021-05-17 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/hppa/cpu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 61178fa6a2a..748270bfa31 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -22,7 +22,6 @@ #include "cpu-qom.h" #include

[PATCH 3/3] hw/nvme/ctrl: documentation fix

2021-05-17 Thread Gollu Appalanaidu
In the documentation of the '-detached' param "be" and "not" has been used side by side, fix that. Signed-off-by: Gollu Appalanaidu --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 813a72c655..a3df26d0ce 100644 ---

[PATCH v2 6/6] coroutine-sleep: introduce qemu_co_sleep

2021-05-17 Thread Paolo Bonzini
Allow using QemuCoSleep to sleep forever until woken by qemu_co_sleep_wake. This makes the logic of qemu_co_sleep_ns_wakeable easy to understand. In the future we will introduce an API that can work even if the sleep and wake happen from different threads. For now, initializing w->to_wake after

Re: [PATCH v2 07/25] linux-user/sparc: Merge sparc64 target_syscall.h

2021-05-17 Thread Laurent Vivier
On 26/04/2021 04:53, Richard Henderson wrote: > There are only a few differences in sparc32 vs sparc64. > This fixes target_shmlba for sparc32plus, which is v9. > > Signed-off-by: Richard Henderson > --- > linux-user/sparc/target_syscall.h | 42 + >

Re: latest GOOD state of series i386 cleanup, arm cleanup, s390 cleanup

2021-05-17 Thread Al Cho via
Hi Claudio, > https://gitlab.com/hw-claudio/qemu/-/pipelines/293603379 > > https://github.com/qemu/qemu.git branch "s390_cleanup_v1" > > Al, can you take this one to the finish line? Yes, I will take it. Cheers, AL From: Claudio Fontana Sent:

[PATCH v2 3/6] coroutine-sleep: allow qemu_co_sleep_wake that wakes nothing

2021-05-17 Thread Paolo Bonzini
All callers of qemu_co_sleep_wake are checking whether they are passing a NULL argument inside the pointer-to-pointer: do the check in qemu_co_sleep_wake itself. As a side effect, qemu_co_sleep_wake can be called more than once and it will only wake the coroutine once; after the first time, the

[PATCH 1/3] hw/nvme/ctrl: add controller list cns 0x13

2021-05-17 Thread Gollu Appalanaidu
Add the controller identifiers list available in NVM Subsystem that may or may not be attached to namespaces. Signed-off-by: Gollu Appalanaidu --- hw/nvme/ctrl.c | 25 +++-- hw/nvme/trace-events | 2 +- include/block/nvme.h | 1 + 3 files changed, 17 insertions(+),

Re: [PATCH] migration/rdma: Fix cm_event used before being initialized

2021-05-17 Thread Dr. David Alan Gilbert
* lizhij...@fujitsu.com (lizhij...@fujitsu.com) wrote: > > > On 14/05/2021 01.15, Dr. David Alan Gilbert wrote: > > * Li Zhijian (lizhij...@cn.fujitsu.com) wrote: > >> A segmentation fault was triggered when i try to abort a postcopy + rdma > >> migration. > >> > >> since rdma_ack_cm_event

[PATCH v2 4/6] coroutine-sleep: move timer out of QemuCoSleepState

2021-05-17 Thread Paolo Bonzini
This simplification is enabled by the previous patch. Now aio_co_wake will only be called once, therefore we do not care about a spurious firing of the timer after a qemu_co_sleep_wake. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-sleep.c | 8

[PATCH v2 1/6] coroutine-sleep: use a stack-allocated timer

2021-05-17 Thread Paolo Bonzini
The lifetime of the timer is well-known (it cannot outlive qemu_co_sleep_ns_wakeable, because it's deleted by the time the coroutine resumes), so it is not necessary to place it on the heap. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-sleep.c

[PATCH v2 0/6] coroutine: new sleep/wake API

2021-05-17 Thread Paolo Bonzini
This is a revamp of the qemu_co_sleep* API that makes it easier to extend the API: the state that is needed to wake up a coroutine is now part of the public API instead of hidden behind a pointer-to-pointer; the API is made more extensible by pushing the rest of QemuCoSleepState into local

[PULL 17/20] hw/block/nvme: remove num_namespaces member

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen The NvmeCtrl num_namespaces member is just an indirection for the NVME_MAX_NAMESPACES constant. Remove the indirection. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.h | 1 - hw/block/nvme.c | 30 +++--- 2 files changed,

Re: making a qdev bus available from a (non-qtree?) device

2021-05-17 Thread Stefan Hajnoczi
On Mon, May 17, 2021 at 08:55:50AM +0200, Klaus Jensen wrote: > On May 13 15:02, Stefan Hajnoczi wrote: > > On Wed, May 12, 2021 at 02:02:50PM +0200, Markus Armbruster wrote: > > > Klaus Jensen writes: > > > > I can then call `qdev_set_parent_bus()` and set the parent bus to the > > > > bus

[PATCH v2 5/6] coroutine-sleep: replace QemuCoSleepState pointer with struct in the API

2021-05-17 Thread Paolo Bonzini
Right now, users of qemu_co_sleep_ns_wakeable are simply passing a pointer to QemuCoSleepState by reference to the function. But QemuCoSleepState really is just a Coroutine*; making the content of the struct public is just as efficient and lets us skip the user_state_pointer indirection. Since

[PATCH v2 2/6] coroutine-sleep: disallow NULL QemuCoSleepState** argument

2021-05-17 Thread Paolo Bonzini
Simplify the code by removing conditionals. qemu_co_sleep_ns can simply point the argument to an on-stack temporary. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h| 5 +++-- util/qemu-coroutine-sleep.c | 18 +- 2 files

[PULL 20/20] hw/nvme: move nvme emulation out of hw/block

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen With the introduction of the nvme-subsystem device we are really cluttering up the hw/block directory. As suggested by Philippe previously, move the nvme emulation to hw/nvme. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch ---

[PULL 14/20] hw/block/nvme: cache lba and ms sizes

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen There is no need to look up the lba size and metadata size in the LBA Format structure everytime we want to use it. And we use it a lot. Cache the values in the NvmeNamespace and update them if the namespace is formatted. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch

[PULL 19/20] hw/block/nvme: move zoned constraints checks

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen Validation of the max_active and max_open zoned parameters are independent of any other state, so move them to the early nvme_ns_check_constraints parameter checks. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme-ns.c | 52

Re: [PATCH v2] disas/libvixl: Protect C system header for C++ compiler

2021-05-17 Thread Thomas Huth
On 16/05/2021 19.10, Philippe Mathieu-Daudé wrote: When selecting an ARM target on Debian unstable, we get: Compiling C++ object libcommon.fa.p/disas_libvixl_vixl_utils.cc.o FAILED: libcommon.fa.p/disas_libvixl_vixl_utils.cc.o c++ -Ilibcommon.fa.p -I. -I.. [...] -o

Re: latest GOOD state of series i386 cleanup, arm cleanup, s390 cleanup

2021-05-17 Thread Claudio Fontana
On 5/17/21 11:53 AM, Claudio Fontana wrote: > Hello all, > > due to my inactivity for a few weeks coupled likely with the upstream > processes around qemu-6.0 now the series: > > 1) i386 cleanup > 2) arm cleanup and experimental kvm-only build > 3) s390 cleanup > > have become stale and hard

latest GOOD state of series i386 cleanup, arm cleanup, s390 cleanup

2021-05-17 Thread Claudio Fontana
Hello all, due to my inactivity for a few weeks coupled likely with the upstream processes around qemu-6.0 now the series: 1) i386 cleanup 2) arm cleanup and experimental kvm-only build 3) s390 cleanup have become stale and hard to rebase on latest master. This effect is compounded by the fact

[PULL 15/20] hw/block/nvme: add metadata offset helper

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen Add an nvme_moff() helper. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.h | 7 ++- hw/block/nvme-dif.c | 4 ++-- hw/block/nvme-ns.c | 2 +- hw/block/nvme.c | 12 ++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff

[PULL 12/20] hw/block/nvme: remove non-shared defines from header file

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen Remove non-shared defines from the shared header. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.h| 2 -- hw/block/nvme-ns.c | 1 + hw/block/nvme.c| 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme.h

[PULL 13/20] hw/block/nvme: replace nvme_ns_status

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen The inline nvme_ns_status() helper only has a single call site. Remove it from the header file and inline it for real. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.h | 5 - hw/block/nvme.c | 15 --- 2 files changed, 8

Re: [PATCH] include/qemu/bswap.h: using atomic memory load/store for word access

2021-05-17 Thread Peter Maydell
On Mon, 17 May 2021 at 03:54, Bibo Mao wrote: > > virtio ring buffer has lockless ring buffer scheme. When guest vcpu > reads the memory, qemu io thread may is writing the same address. > It requiires atomic operation in qemu side, __builtin_memcpy may > read byte-by-byte. > > This patch uses fix

[PULL 04/20] hw/block/nvme: fix io-command set profile feature

2021-05-17 Thread Klaus Jensen
From: Gollu Appalanaidu Currently IO Command Set Profile feature is supported, but the feature support flag not set. Further, this feature is changable. Fix that. Additionally, remove filling default value of the CQE result with zero, since it will fall back to the default case anyway.

[PULL 11/20] hw/block/nvme: cleanup includes

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen Clean up includes. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme-dif.c| 7 +++ hw/block/nvme-ns.c | 11 ++- hw/block/nvme-subsys.c | 11 +-- hw/block/nvme.c| 22 +- 4 files changed, 15

[PULL 16/20] hw/block/nvme: streamline namespace array indexing

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen Streamline namespace array indexing such that both the subsystem and controller namespaces arrays are 1-indexed. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.h | 4 ++-- hw/block/nvme.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)

[PULL 18/20] hw/block/nvme: remove irrelevant zone resource checks

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen It is not an error to report more active/open zones supported than the number of zones in the namespace. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme-ns.c | 13 - 1 file changed, 13 deletions(-) diff --git a/hw/block/nvme-ns.c

[PULL 08/20] hw/block/nvme: rename __nvme_advance_zone_wp

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen Get rid of the (reserved) double underscore use. Cc: Philippe Mathieu-Daudé Cc: Thomas Huth Signed-off-by: Klaus Jensen Reviewed-by: Thomas Huth Reviewed-by: Keith Busch --- hw/block/nvme.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PULL 00/20] emulated nvme updates

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, The following changes since commit 6005ee07c380cbde44292f5f6c96e7daa70f4f7d: Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2021-05-16 17:22:46 +0100) are available in the Git repository at: git://git.infradead.org/qemu-nvme.git

[PULL 09/20] hw/block/nvme: rename __nvme_select_ns_iocs

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen Get rid of the (reserved) double underscore use. Cc: Philippe Mathieu-Daudé Cc: Thomas Huth Signed-off-by: Klaus Jensen Reviewed-by: Thomas Huth Reviewed-by: Keith Busch --- hw/block/nvme.c | 47 +++ 1 file changed, 23

[PULL 10/20] hw/block/nvme: consolidate header files

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen In preparation for moving the nvme device into its own subtree, merge the header files into one. Also add missing copyright notice and add list of authors with substantial contributions. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme-dif.h| 63

[PULL 05/20] hw/block/nvme: function formatting fix

2021-05-17 Thread Klaus Jensen
From: Gollu Appalanaidu nvme_map_addr_pmr function arguments not aligned, fix that. Signed-off-by: Gollu Appalanaidu Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index

[PULL 02/20] hw/block/nvme: rename reserved fields declarations

2021-05-17 Thread Klaus Jensen
From: Gollu Appalanaidu Align the 'rsvd1' reserved field declaration in NvmeBar with existing style. Signed-off-by: Gollu Appalanaidu [k.jensen: minor commit message fixup] Signed-off-by: Klaus Jensen --- include/block/nvme.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PULL 07/20] hw/block/nvme: rename __nvme_zrm_open

2021-05-17 Thread Klaus Jensen
From: Klaus Jensen Get rid of the (reserved) double underscore use. Rename the "generic" zone open function to nvme_zrm_open_flags() and add a generic `int flags` argument instead which allows more flags to be easily added in the future. There is at least one TP under standardization that would

[PULL 06/20] hw/block/nvme: align with existing style

2021-05-17 Thread Klaus Jensen
From: Gollu Appalanaidu While QEMU coding style prefers lowercase hexadecimals in constants, the NVMe subsystem uses the format from the NVMe specifications in comments, i.e. 'h' suffix instead of '0x' prefix. Fix this up across the code base. Signed-off-by: Gollu Appalanaidu [k.jensen:

[PULL 03/20] hw/block/nvme: consider metadata read aio return value in compare

2021-05-17 Thread Klaus Jensen
From: Gollu Appalanaidu Currently in compare command metadata aio read blk_aio_preadv return value ignored. Consider it and complete the block accounting. Signed-off-by: Gollu Appalanaidu Fixes: 0a384f923f51 ("hw/block/nvme: add compare command") Signed-off-by: Klaus Jensen ---

[PULL 01/20] hw/block/nvme: remove redundant invalid_lba_range trace

2021-05-17 Thread Klaus Jensen
From: Gollu Appalanaidu Currently pci_nvme_err_invalid_lba_range trace is called individually at each nvme_check_bounds() call site. Move the trace event to nvme_check_bounds() and remove the redundant events. Signed-off-by: Gollu Appalanaidu Reviewed-by: Philippe Mathieu-Daudé [k.jensen:

Re: [RFC PATCH v3 4/4] hw/arm/virt: Parse -smp cluster parameter in virt_smp_parse

2021-05-17 Thread Andrew Jones
On Sun, May 16, 2021 at 06:32:28PM +0800, Yanan Wang wrote: > There is a separate function virt_smp_parse() in hw/virt/arm.c used > to parse cpu topology for the ARM machines. So add parsing of -smp > cluster parameter in it, then total number of logical cpus will be > calculated like: max_cpus =

Re: [RFC PATCH v3 1/4] vl.c: Add -smp, clusters=* command line support for ARM cpu

2021-05-17 Thread Andrew Jones
On Sun, May 16, 2021 at 06:32:25PM +0800, Yanan Wang wrote: > In implementations of ARM architecture, at most there could be a > cpu hierarchy like "sockets/dies/clusters/cores/threads" defined. > For example, ARM64 server chip Kunpeng 920 totally has 2 sockets, > 2 NUMA nodes (also means cpu

Re: [PATCH v2 08/12] tests/vm: convert centos VM recipe to CentOS 8

2021-05-17 Thread Daniel P . Berrangé
On Fri, May 14, 2021 at 02:31:50PM -0300, Willian Rampazzo wrote: > On Fri, May 14, 2021 at 9:05 AM Daniel P. Berrangé > wrote: > > > > Signed-off-by: Daniel P. Berrangé > > --- > > tests/vm/centos | 17 - > > 1 file changed, 8 insertions(+), 9 deletions(-) > > > > diff --git

Re: [PATCH v2 0/4] virtio: Improve boot time of virtio-scsi-pci and virtio-blk-pci

2021-05-17 Thread Greg Kurz
On Wed, 12 May 2021 17:05:53 +0100 Stefan Hajnoczi wrote: > On Fri, May 07, 2021 at 06:59:01PM +0200, Greg Kurz wrote: > > Now that virtio-scsi-pci and virtio-blk-pci map 1 virtqueue per vCPU, > > a serious slow down may be observed on setups with a big enough number > > of vCPUs. > > > >

Re: [RFC PATCH v3 9/9] hw/arm/virt: Add separate -smp parsing function for ARM machines

2021-05-17 Thread Andrew Jones
On Sun, May 16, 2021 at 06:29:00PM +0800, Yanan Wang wrote: > The cpu hierarchy topology information parsed out from QEMU -smp > command line will be exposed to guest kernel through ACPI and DT > since machine type 6.1, so we will expect more detailed topology > descriptions and will be more

Re: [RFC PATCH v3] ppc/spapr: Add support for H_SCM_PERFORMANCE_STATS hcall

2021-05-17 Thread David Gibson
On Mon, May 17, 2021 at 09:55:31AM +0200, Greg Kurz wrote: > On Mon, 17 May 2021 16:23:56 +1000 > David Gibson wrote: > > > On Sat, May 15, 2021 at 01:07:59PM +0530, Vaibhav Jain wrote: > [...] > > > +rc = (result == MEMTX_OK) ? > > > +scm_perf_check_rr_buffer(perfstats, addr, size,

Re: [RFC PATCH v3 8/9] hw/arm/virt-acpi-build: Generate PPTT table

2021-05-17 Thread Andrew Jones
On Sun, May 16, 2021 at 06:28:59PM +0800, Yanan Wang wrote: > From: Andrew Jones > > Add the Processor Properties Topology Table (PPTT) to expose > CPU topology information defined by users to ACPI guests. > > Note, a DT-boot Linux guest with a non-flat CPU topology will > see socket and core

Re: [RFC PATCH v3] ppc/spapr: Add support for H_SCM_PERFORMANCE_STATS hcall

2021-05-17 Thread Greg Kurz
On Mon, 17 May 2021 16:23:56 +1000 David Gibson wrote: > On Sat, May 15, 2021 at 01:07:59PM +0530, Vaibhav Jain wrote: [...] > > +rc = (result == MEMTX_OK) ? > > +scm_perf_check_rr_buffer(perfstats, addr, size, _stats) : > > +H_PRIVILEGE; > > This is a bit cryptic. Just

Re: [RFC PATCH v3 7/9] hw/acpi/aml-build: Add Processor hierarchy node structure

2021-05-17 Thread Andrew Jones
On Sun, May 16, 2021 at 06:28:58PM +0800, Yanan Wang wrote: > Add a generic API to build Processor hierarchy node structure (Type 0), > which is strictly consistent with descriptions in ACPI 6.2: 5.2.29.1. > > This function will be used to build ACPI PPTT table for cpu topology. > >

Re: [RFC PATCH v3 6/9] hw/arm/virt-acpi-build: Use possible cpus in generation of MADT

2021-05-17 Thread Andrew Jones
On Sun, May 16, 2021 at 06:28:57PM +0800, Yanan Wang wrote: > When building ACPI tables regarding CPUs we should always build > them for the number of possible CPUs, not the number of present > CPUs. So we create gicc nodes in MADT for possible cpus and then > ensure only the present CPUs are

Re: [PATCH v2] block: Improve backing file validation

2021-05-17 Thread lizhij...@fujitsu.com
On 12/05/2021 23.10, Kevin Wolf wrote: > Am 11.05.2021 um 10:35 hat Daniel P. Berrangé geschrieben: >> On Tue, May 11, 2021 at 01:55:18PM +0800, Li Zhijian wrote: >>> void bdrv_img_create(const char *filename, const char *fmt, >>>const char *base_filename, const char

Re: [PATCH] target/ppc: Implement ISA v3.1 wait variants

2021-05-17 Thread Nicholas Piggin
Excerpts from David Gibson's message of May 17, 2021 3:39 pm: > On Mon, May 17, 2021 at 12:46:51PM +1000, Nicholas Piggin wrote: >> ISA v3.1 adds new variations of wait, specified by the WC field. These >> are not compatible with the wait 0 implementation, because they add >> additional conditions

Re: [PATCH] hw/display/qxl: Set pci rom address aligned with page size

2021-05-17 Thread Gerd Hoffmann
On Sat, May 15, 2021 at 04:06:23PM +0800, Bibo Mao wrote: > From: maobibo > > pci memory bar size should be aligned with page size, else it will > not be effective memslot when running in kvm mode. > > This patch set qxl pci rom size aligned with page size of host > machine. What is the exact

A bug of Monitor Chardev ?

2021-05-17 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
We find a race during QEMU starting, which would case the QEMU process coredump. | | [1] create MON chardev | qemu_create_early_backends | chardev_init_func |

[PATCH] target/riscv: Remove obsolete 'CPU unmigratable' comment

2021-05-17 Thread Philippe Mathieu-Daudé
The RISCV CPU is migratable since commit f7697f0e629 ("target/riscv: Add basic vmstate description of CPU"), so remove an obsolete comment which is now incorrect. Reported-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.c | 1 - 1 file changed, 1 deletion(-)

[PATCH 17/21] block/block-copy: switch to fully set bitmap by default

2021-05-17 Thread Vladimir Sementsov-Ogievskiy
block-copy has a bit inconvenient interface around dirty bitmap: user should get pointer to it and than set by hand. We do need a possibility to share the bitmap with backup job. But default of empty bitmap is strange. Switch to full-set bitmap by default. This way we will not care about setting

Re: [PATCH updated v2] spapr: Fix EEH capability issue on KVM guest for PCI passthru

2021-05-17 Thread David Gibson
On Fri, May 14, 2021 at 12:03:10PM +1000, Oliver O'Halloran wrote: > On Thu, May 13, 2021 at 2:22 PM David Gibson > wrote: > > > > On Wed, May 05, 2021 at 08:18:27PM +0530, Mahesh Salgaonkar wrote: > > > With upstream kernel, especially after commit 98ba956f6a389 > > > ("powerpc/pseries/eeh:

[PATCH 15/21] block/copy-before-write: cbw_init(): use file child after attaching

2021-05-17 Thread Vladimir Sementsov-Ogievskiy
In the next commit we'll get rid of source argument of cbw_init(). Prepare to it now, to make next commit simpler: move the code block that uses source below attaching the child and use bs->file->bs instead of source variable. Signed-off-by: Vladimir Sementsov-Ogievskiy ---

Re: making a qdev bus available from a (non-qtree?) device

2021-05-17 Thread Klaus Jensen
On May 13 15:02, Stefan Hajnoczi wrote: On Wed, May 12, 2021 at 02:02:50PM +0200, Markus Armbruster wrote: Klaus Jensen writes: > I can then call `qdev_set_parent_bus()` and set the parent bus to the > bus creates in the nvme-subsys device. This solves the problem since > the namespaces are

<    1   2   3   4   5   6   7   >