Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Thu, Jan 12, 2023 at 08:51:32AM -0500, Michael S. Tsirkin wrote: >> On Thu, Jan 12, 2023 at 12:50:05PM +0100, Markus Armbruster wrote: >> > docs/devel/style.rst mandates: >> > >> > The "qemu/osdep.h" header contains preprocessor macros that affect >> > t

[PATCH v2 0/5] parallels: Add duplication check, repair at open, fix bugs

2023-01-12 Thread Alexander Ivanov
Fix incorrect data end calculation in parallels_open(). Split image leak handling to separate check and fix helpers. Add checking and repairing duplicate offsets in BAT Replace fprintf() by qemu_log(). Image repairing in parallels_open(). v2: 2: Moved outsude parallels_check_leak() 2 helpers:

[PATCH v2 3/5] parallels: Add checking and repairing duplicate offsets in BAT

2023-01-12 Thread Alexander Ivanov
Cluster offsets must be unique among all the BAT entries. Find duplicate offsets in the BAT and fix it by copying the content of the relevant cluster to a newly allocated cluster and set the new cluster offset to the duplicated entry. Add host_cluster_index() and highest_offset() helpers to dedupl

Re: [RFC v4 2/3] memory: add depth assert in address_space_to_flatview

2023-01-12 Thread Peter Xu
On Thu, Jan 12, 2023 at 03:59:55PM +0800, Chuang Xu wrote: > Hi, Peter, Paolo, Chuang, > > On 2023/1/10 下午10:45, Peter Xu wrote: > > On Tue, Jan 10, 2023 at 12:09:41AM -0800, Chuang Xu wrote: > > > Hi, Peter and Paolo, > > Hi, Chuang, Paolo, > > > > > I'm sorry I didn't reply to your email in t

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Daniel P . Berrangé
On Thu, Jan 12, 2023 at 08:51:26AM -0500, Michael S. Tsirkin wrote: > On Thu, Jan 12, 2023 at 12:50:05PM +0100, Markus Armbruster wrote: > > docs/devel/style.rst mandates: > > > > The "qemu/osdep.h" header contains preprocessor macros that affect > > the behavior of core system headers lik

[PATCH v2 1/5] parallels: Incorrect data end calculation in parallels_open()

2023-01-12 Thread Alexander Ivanov
The BDRVParallelsState structure contains data_end field that is measured in sectors. In parallels_open() initially this field is set by data_off field from parallels image header. According to the parallels format documentation, data_off field contains an offset, in sectors, from the start of the

[PATCH v2 2/5] parallels: Split image leak handling to separate check and fix helpers

2023-01-12 Thread Alexander Ivanov
We need to fix leak after deduplication in the next patch. Move leak fixing to a separate helper parallels_fix_leak() and add parallels_get_leak_size() helper wich used in parallels_fix_leak() and parallels_check_leak(). Signed-off-by: Alexander Ivanov --- block/parallels.c | 88

[PATCH 21/40] pcihp: compose PCNT callchain right before its user _GPE._E01

2023-01-12 Thread Igor Mammedov
it's a stepping stone to making build_append_pci_bus_devices() suitable for AcpiDevAmlIfClass:build_dev_aml callback and lets further simplify it by separating PCNT generation from slots descriptions. It also makes PCNT callchain ASL much more readable since callchain not longer cluttered by slots

[PATCH v2 5/5] parallels: Image repairing in parallels_open()

2023-01-12 Thread Alexander Ivanov
Repair an image at opening if the image is unclean or out-of-image corruption was detected. Signed-off-by: Alexander Ivanov --- block/parallels.c | 67 +-- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/block/parallels.c b/block/parall

Re: [PATCH 02/26] gitlab: add FF_SCRIPT_SECTIONS for timings

2023-01-12 Thread Thomas Huth
On 10/01/2023 18.38, Alex Bennée wrote: From: Mark Cave-Ayland Suggested-by: Mark Cave-Ayland Signed-off-by: Alex Bennée --- .gitlab-ci.d/base.yml | 5 + 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml index 69b36c148a..50fb59e147 100644 ---

[PATCH v4 1/3] linux-user: Clean up when exiting due to a signal

2023-01-12 Thread Ilya Leoshkevich
When exiting due to an exit() syscall, qemu-user calls preexit_cleanup(), but this is currently not the case when exiting due to a signal. This leads to various buffers not being flushed (e.g., for gprof, for gcov, and for the upcoming perf support). Add the missing call. Signed-off-by: Ilya Leos

[PATCH v5 2/4] python/qmp: increase read buffer size

2023-01-12 Thread Maksim Davydov
Current 256KB is not enough for some real cases. As a possible solution limit can be chosen to be the same as libvirt (10MB) Signed-off-by: Maksim Davydov Reviewed-by: John Snow --- python/qemu/qmp/qmp_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/qemu

building qemu on windows 11

2023-01-12 Thread Neal Elliott
Hello,              is it possible, or has anyone built qemu from the master branch using visual studio? I attempted to build the code using mingw64, but it failed to build. is there a current build document for windows? 

Re: [RFC PATCH v2 13/19] tests: do not run test-hmp on all machines for ARM KVM-only

2023-01-12 Thread Fabiano Rosas
Richard Henderson writes: > On 1/11/23 04:36, Fabiano Rosas wrote: >> Nowadays for KVM is the 'virt' machine the only one we use? > > Also sbsa-ref. It seems not, sbsa_ref_init has this: if (kvm_enabled()) { error_report("sbsa-ref: KVM is not supported for this machine"); exit(1); }

Re: [RFC] Reducing NEED_CPU_H usage

2023-01-12 Thread Alessandro Di Federico via
On Tue, 10 Jan 2023 11:56:50 -0800 Richard Henderson wrote: > However, at some point we do want to keep some target addresses in > the proper size. For instance within the softmmu tlb, where > CPUTLBEntry is either 16 or 32 bytes, depending. So that would be an optimization if `HOST_LONG_BITS =

Re: [PATCH v3 0/5] hw/i2c/bitbang_i2c: Housekeeping

2023-01-12 Thread Corey Minyard
On Wed, Jan 11, 2023 at 09:50:11AM +0100, Philippe Mathieu-Daudé wrote: > Series fully reviewed. These all look good to me Acked-by: Corey Minyard You mentioned the ARM tree, is this going in through there? -corey > > Since v2: > - Use array of const pointers to const (Richard) > > Since v1

[PATCH v5 0/4] compare machine type compat_props

2023-01-12 Thread Maksim Davydov
This script is necessary to choose the best machine type in the appropriate cases. Also we have to check compat_props of the old MT after changes to be sure that they haven't broken old the MT. For example, pc_compat_3_1 of pc-q35-3.1 has Icelake-Client which was removed in March. v5 -> v4: * mino

[PATCH v4 3/3] tcg: add perfmap and jitdump

2023-01-12 Thread Ilya Leoshkevich
Add ability to dump /tmp/perf-.map and jit-.dump. The first one allows the perf tool to map samples to each individual translation block. The second one adds the ability to resolve symbol names, line numbers and inspect JITed code. Example of use: perf record qemu-x86_64 -perfmap ./a.out

Re: [RFC PATCH v2 13/19] tests: do not run test-hmp on all machines for ARM KVM-only

2023-01-12 Thread Peter Maydell
On Wed, 11 Jan 2023 at 12:36, Fabiano Rosas wrote: > What remains is changing the Kconfig to not bring all the > machines. Nowadays for KVM is the 'virt' machine the only one we use? I think perhaps also xlnx-versal-virt -- at any rate, the source files include some KVM related headers... Alista

Re: [PATCH v6 05/13] migration/qemu-file: Add qemu_file_get_to_fd()

2023-01-12 Thread Cédric Le Goater
On 1/12/23 09:50, Avihai Horon wrote: Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Céd

[PATCH v4 0/3] tcg: add perfmap and jitdump

2023-01-12 Thread Ilya Leoshkevich
v3: https://lists.gnu.org/archive/html/qemu-devel/2023-01/msg02072.html v3 -> v4: * s/unsigned long long/uint64_t/g (Richard). * Fix address resolution with TARGET_TB_PCREL again. * Open question: do we need something like get_pc_from_opc()? See FIXME in patch 3. v2: https://lists.gnu.org/a

[PATCH v5 4/4] scripts: add script to compare compatible properties

2023-01-12 Thread Maksim Davydov
This script run QEMU to obtain compat_props of machines and default values of different types and produce appropriate table. This table can be used to compare machine types to choose the most suitable machine. Also this table in json or csv format should be used to check that new machine doesn't af

[PATCH v5 1/4] qom: add default value

2023-01-12 Thread Maksim Davydov
qmp_qom_list_properties can print default values if they are available as qmp_device_list_properties does, because both of them use the ObjectPropertyInfo structure with default_value field. This can be useful when working with "not device" types. Signed-off-by: Maksim Davydov Reviewed-by: Vladim

Re: [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c

2023-01-12 Thread Philippe Mathieu-Daudé
On 9/1/23 18:23, Bernhard Beschow wrote: Now that the PIIX3 and PIIX4 device models are sufficiently consolidated, their implementations can be merged into one file for further consolidation. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Message-Id: <20221022150508.26830-37-s

[PATCH 38/40] tests: acpi: whitelist DSDT before moving non-hotpluggble slots description from hotplug path

2023-01-12 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..0adf61bac3 100644 --- a/tests/qtest/bios-table

[PATCH v4 2/3] accel/tcg: Add debuginfo support

2023-01-12 Thread Ilya Leoshkevich
Add libdw-based functions for loading and querying debuginfo. Load debuginfo from the system and the linux-user loaders. This is useful for the upcoming perf support, which can then put human-readable guest symbols instead of raw guest PCs into perfmap and jitdump files. Signed-off-by: Ilya Leosh

Re: [PULL v2 00/29] Misc patches for 2023-01-10

2023-01-12 Thread Peter Maydell
On Thu, 12 Jan 2023 at 13:45, Paolo Bonzini wrote: > > The following changes since commit aa96ab7c9df59c615ca82b49c9062819e0a1c287: > > Merge tag 'pull-request-2023-01-09' of https://gitlab.com/thuth/qemu into > staging (2023-01-09 15:54:31 +) > > are available in the Git repository at: > >

Re: [PATCH v2 8/8] hw/cxl/events: Add in inject general media event

2023-01-12 Thread Jonathan Cameron via
On Wed, 21 Dec 2022 20:24:38 -0800 Ira Weiny wrote: > To facilitate testing provide a QMP command to inject a general media > event. The event can be added to the log specified. > > Signed-off-by: Ira Weiny Hi Ira, One thing inline that kind of came out of Philippe's review of the earlier cle

[PATCH v5 3/4] qmp: add dump machine type compatible properties

2023-01-12 Thread Maksim Davydov
To control that creating new machine type doesn't affect the previous types (their compat_props) and to check complex compat_props inheritance we need qmp command to print machine type compatible properties. This patch adds the ability to get list of all the compat_props of the corresponding suppor

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-12 Thread Gregory Price
On Wed, Jan 11, 2023 at 02:24:32PM +, Jonathan Cameron via wrote: > Gregory's patches were posted as part of his work on adding volatile support. > https://lore.kernel.org/linux-cxl/20221006233702.18532-1-gregory.pr...@memverge.com/ > https://lore.kernel.org/linux-cxl/20221128150157.97724-2-gre

[PATCH] tests/docker: Install flex in debian-tricore-cross

2023-01-12 Thread Philippe Mathieu-Daudé
When flex is not available, binutils sources default to the 'missing' script, but the current script available is not in the format expected by the 'configure' script: $ ./configure ... /usr/src/binutils/missing: Unknown `--run' option Try `/usr/src/binutils/missing --help' for more inform

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Peter Maydell
On Thu, 12 Jan 2023 at 15:14, Daniel P. Berrangé wrote: > > On Thu, Jan 12, 2023 at 08:51:26AM -0500, Michael S. Tsirkin wrote: > > On Thu, Jan 12, 2023 at 12:50:05PM +0100, Markus Armbruster wrote: > > > docs/devel/style.rst mandates: > > > > > > The "qemu/osdep.h" header contains preprocesso

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Daniel P . Berrangé
On Thu, Jan 12, 2023 at 03:58:56PM +, Peter Maydell wrote: > On Thu, 12 Jan 2023 at 15:14, Daniel P. Berrangé wrote: > > > > On Thu, Jan 12, 2023 at 08:51:26AM -0500, Michael S. Tsirkin wrote: > > > On Thu, Jan 12, 2023 at 12:50:05PM +0100, Markus Armbruster wrote: > > > > docs/devel/style.rst

Re: [PATCH] target/tricore: Fix OPC1_16_SRO_LD_H translation

2023-01-12 Thread Philippe Mathieu-Daudé
On 12/1/23 15:24, Anton Kochkov wrote: Fixes: 5a7634a28c ("target-tricore: Add instructions of SLR, SSRO and SRO opcode format") Signed-off-by: Eitan Eliahu Resolves: https://gitlab.com/qemu-project/qemu/-/issues/652 --- target/tricore/translate.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH] tests/docker: Install flex in debian-tricore-cross

2023-01-12 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > When flex is not available, binutils sources default to the > 'missing' script, but the current script available is not in > the format expected by the 'configure' script: Queued to testing/next, thanks. -- Alex Bennée Virtualisation Tech Lead @ Linaro

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Peter Maydell
On Thu, 12 Jan 2023 at 16:08, Daniel P. Berrangé wrote: > I think the challenge is that osdep.h is too big as it exists > today. The stuff the needs to come before system headers is > actually little more than config-host.h and a few #defines > most of which are specific to windows. If those criti

Re: building qemu on windows 11

2023-01-12 Thread Stefan Weil via
Am 12.01.23 um 16:16 schrieb Neal Elliott: Hello,              is it possible, or has anyone built qemu from the master branch using visual studio? I attempted to build the code using mingw64, but it failed to build. is there a current build document for windows? Building with Visual Studio

[Capstone] Feedback request for new architecture updater

2023-01-12 Thread Rot127
I currently work on a new updater for architecture modules in Capstone. The current update process has the problem that it is a lot of manual work. Syncing the information from LLVM to Capstone requires a one to translate a lot of C++ to C code and fix a ton of build errors. This lead to archite

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Daniel P . Berrangé
On Thu, Jan 12, 2023 at 04:20:36PM +, Peter Maydell wrote: > On Thu, 12 Jan 2023 at 16:08, Daniel P. Berrangé wrote: > > I think the challenge is that osdep.h is too big as it exists > > today. The stuff the needs to come before system headers is > > actually little more than config-host.h and

Re: [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c

2023-01-12 Thread Philippe Mathieu-Daudé
On 12/1/23 16:04, Philippe Mathieu-Daudé wrote: On 9/1/23 18:23, Bernhard Beschow wrote: Now that the PIIX3 and PIIX4 device models are sufficiently consolidated, their implementations can be merged into one file for further consolidation. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-12 Thread Keith Busch
On Thu, Jan 12, 2023 at 02:10:51PM +0100, Klaus Jensen wrote: > > The pin-based interrupt logic in hw/nvme seems sound enough to me, so I > am wondering if there is something going on with the kernel driver (but > I certainly do not rule out that hw/nvme is at fault here, since > pin-based interru

Re: [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c

2023-01-12 Thread Philippe Mathieu-Daudé
On 9/1/23 18:23, Bernhard Beschow wrote: Now that the PIIX3 and PIIX4 device models are sufficiently consolidated, their implementations can be merged into one file for further consolidation. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Message-Id: <20221022150508.26830-37-s

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Peter Maydell
On Thu, 12 Jan 2023 at 16:30, Daniel P. Berrangé wrote: > > On Thu, Jan 12, 2023 at 04:20:36PM +, Peter Maydell wrote: > > On Thu, 12 Jan 2023 at 16:08, Daniel P. Berrangé > > wrote: > > > I think the challenge is that osdep.h is too big as it exists > > > today. The stuff the needs to come

[PATCH v3 6/8] virtio-mem: Fail if a memory backend with "prealloc=on" is specified

2023-01-12 Thread David Hildenbrand
"prealloc=on" for the memory backend does not work as expected, as virtio-mem will simply discard all preallocated memory immediately again. In the best case, it's an expensive NOP. In the worst case, it's an unexpected allocation error. Instead, "prealloc=on" should be specified for the virtio-me

[PATCH v3 2/8] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup()

2023-01-12 Thread David Hildenbrand
... and store it in the migration state. This is a preparation for storing selected vmds's already in qemu_savevm_state_setup(). Signed-off-by: David Hildenbrand --- migration/migration.c | 4 migration/migration.h | 4 migration/savevm.c| 18 -- 3 files changed,

[PATCH v3 4/8] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST()

2023-01-12 Thread David Hildenbrand
We'll make use of both next in the context of virtio-mem. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: David Hildenbrand --- include/migration/vmstate.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstat

[PATCH v3 8/8] virtio-mem: Proper support for preallocation with migration

2023-01-12 Thread David Hildenbrand
Ordinary memory preallocation runs when QEMU starts up and creates the memory backends, before processing the incoming migration stream. With virtio-mem, we don't know which memory blocks to preallocate before migration started. Now that we migrate the virtio-mem bitmap early, before migrating any

[PATCH v3 0/8] virtio-mem: Handle preallocation with migration

2023-01-12 Thread David Hildenbrand
While playing with migration of virtio-mem with an ordinary file backing, I realized that migration and prealloc doesn't currently work as expected for virtio-mem. Further, Jing Qi reported that setup issues (insufficient huge pages on the destination) result in QEMU getting killed with SIGBUS inst

Re: [PATCH v3 0/8] virtio-mem: Handle preallocation with migration

2023-01-12 Thread David Hildenbrand
Subject for this series should be "v4" ... -- Thanks, David / dhildenb

[PATCH v3 5/8] migration/ram: Factor out check for advised postcopy

2023-01-12 Thread David Hildenbrand
Let's factor out this check, to be used in virtio-mem context next. While at it, fix a spelling error in a related comment. Signed-off-by: David Hildenbrand --- include/migration/misc.h | 4 +++- migration/migration.c| 7 +++ migration/ram.c | 8 +--- 3 files changed, 11 in

[PATCH v3 7/8] virtio-mem: Migrate immutable properties early

2023-01-12 Thread David Hildenbrand
The bitmap and the size are immutable while migration is active: see virtio_mem_is_busy(). We can migrate this information early, before migrating any actual RAM content. Further, all information we need for sanity checks is immutable as well. Having this information in place early will, for examp

Re: [RFC PATCH] docs: add a proper feature overview in "About QEMU"

2023-01-12 Thread Peter Maydell
On Mon, 9 Jan 2023 at 17:04, Alex Bennée wrote: > > I decide to do this because I was looking for the best place to add a > reference to a document on semihosting and there didn't seem to be > an obvious place to do this. To do this I took the original pre-amble > to the about index and moved it t

[PATCH v3 1/8] migration/savevm: Move more savevm handling into vmstate_save()

2023-01-12 Thread David Hildenbrand
Let's move more code into vmstate_save(), reducing code duplication and preparing for reuse of vmstate_save() in qemu_savevm_state_setup(). We have to move vmstate_save() to make the compiler happy. We'll now also trace from qemu_save_device_state(). Signed-off-by: David Hildenbrand --- migrati

[PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM)

2023-01-12 Thread David Hildenbrand
For virtio-mem, we want to have the plugged/unplugged state of memory blocks available before migrating any actual RAM content, and perform sanity checks before touching anything on the destination. This information is immutable on the migration source while migration is active, We want to use thi

Re: [PATCH v4 1/3] block/rbd: encryption nit fixes

2023-01-12 Thread Daniel P . Berrangé
On Thu, Jan 12, 2023 at 06:07:58PM +0100, Ilya Dryomov wrote: > On Thu, Jan 12, 2023 at 3:46 PM Daniel P. Berrangé > wrote: > > > > On Thu, Jan 12, 2023 at 03:26:56PM +0100, Ilya Dryomov wrote: > > > On Thu, Jan 12, 2023 at 1:35 PM Daniel P. Berrangé > > > wrote: > > > > > > > > On Sun, Nov 20,

Re: [PATCH v4 1/3] block/rbd: encryption nit fixes

2023-01-12 Thread Ilya Dryomov
On Thu, Jan 12, 2023 at 3:46 PM Daniel P. Berrangé wrote: > > On Thu, Jan 12, 2023 at 03:26:56PM +0100, Ilya Dryomov wrote: > > On Thu, Jan 12, 2023 at 1:35 PM Daniel P. Berrangé > > wrote: > > > > > > On Sun, Nov 20, 2022 at 04:28:34AM -0600, Or Ozeri wrote: > > > > Add const modifier to passph

Re: [PATCH 00/14] hw/arm: QOM OBJECT_DECLARE_SIMPLE_TYPE cleanups

2023-01-12 Thread Peter Maydell
On Mon, 9 Jan 2023 at 14:03, Philippe Mathieu-Daudé wrote: > > These patches certainly look as churn, but they are required to > be able to update the OBJECT_DECLARE_SIMPLE_TYPE() macro... > > Except the OMAP related files, the rest seems to have been > merged shortly after automatic script conver

Re: [PATCH 00/13] hw/arm: Cleanups before pflash refactor

2023-01-12 Thread Peter Maydell
On Mon, 9 Jan 2023 at 11:53, Philippe Mathieu-Daudé wrote: > > Various trivial cleanups: > - Remove unnecessary sysmem argument from pxa2xx_init() > - Use IEC binary prefix definitions > - Remove unreachable code calling pflash_cfi01_register() > (another use in PPC sam460ex will be removed sepa

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-12 Thread Jonathan Cameron via
On Thu, 12 Jan 2023 10:39:17 -0500 Gregory Price wrote: > On Wed, Jan 11, 2023 at 02:24:32PM +, Jonathan Cameron via wrote: > > Gregory's patches were posted as part of his work on adding volatile > > support. > > https://lore.kernel.org/linux-cxl/20221006233702.18532-1-gregory.pr...@memverg

[RFC v2 03/13] vdpa: copy cvq shadow_data from data vqs, not from x-svq

2023-01-12 Thread Eugenio Pérez
This allows to passthrough or shadow the data depending on migration state in next patches. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 75cca497c8..631424d9c4 100644 --- a/ne

[RFC v2 02/13] vdpa net: move iova tree creation from init to start

2023-01-12 Thread Eugenio Pérez
Only create iova_tree if and when it is needed. The cleanup keeps being responsability of last VQ but this change allows to merge both cleanup functions. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 101 +-- 1 file changed, 71 insertions(+), 30

[RFC v2 06/13] vhost: delay set_vring_ready after DRIVER_OK

2023-01-12 Thread Eugenio Pérez
To restore the device at the destination of a live migration we send the commands through control virtqueue. For a device to read CVQ it must have received the DRIVER_OK status bit. However this opens a window where the device could start receiving packets in rx queue 0 before it receives the RSS

[RFC v2 13/13] vdpa: Conditionally expose _F_LOG in vhost_net devices

2023-01-12 Thread Eugenio Pérez
Vhost-vdpa networking devices need to meet a few conditions to be migratable. If SVQ is not enabled from the beginning, to suspend the device to retrieve the vq state is the first requirement. Expose _F_LOG only in that case. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 22 ++

[RFC v2 01/13] vdpa: fix VHOST_BACKEND_F_IOTLB_ASID flag check

2023-01-12 Thread Eugenio Pérez
VHOST_BACKEND_F_IOTLB_ASID is the feature bit, not the bitmask. Since the device under test also provided VHOST_BACKEND_F_IOTLB_MSG_V2 and VHOST_BACKEND_F_IOTLB_BATCH, this went unnoticed. Fixes: c1a1008685 ("vdpa: always start CVQ in SVQ mode if possible") Signed-off-by: Eugenio Pérez --- net/v

[RFC v2 11/13] vdpa: add vdpa net migration state notifier

2023-01-12 Thread Eugenio Pérez
This allows net to restart the device backend to configure SVQ on it. Ideally, these changes should not be net specific. However, the vdpa net backend is the one with enough knowledge to configure everything because of some reasons: * Queues might need to be shadowed or not depending on its kind (

Re: [PATCH v14 09/11] qapi/s390/cpu topology: monitor query topology information

2023-01-12 Thread Nina Schoetterl-Glausch
On Thu, 2023-01-12 at 12:10 +, Daniel P. Berrangé wrote [...] > > We already have 'query-cpus-fast' wich returns one entry for > each CPU. In fact why do we need to add query-topology at all. > Can't we just add book-id / drawer-id / polarity / dedicated > to the query-cpus-fast result ? Is

[RFC v2 09/13] vdpa: add feature_log parameter to vhost_vdpa

2023-01-12 Thread Eugenio Pérez
This way the device's vhost_vdpa can make the choice about exposing or not the _F_LOG feature. At the moment it is always false. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost-vdpa.h | 1 + hw/virtio/vhost-vdpa.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --

[RFC v2 08/13] vdpa: Negotiate _F_SUSPEND feature

2023-01-12 Thread Eugenio Pérez
This is needed for qemu to know it can suspend the device to retrieve its status and enable SVQ with it, so all the process is transparent to the guest. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-v

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Jonathan Cameron via
On Thu, 12 Jan 2023 12:50:05 +0100 Markus Armbruster wrote: > docs/devel/style.rst mandates: > > The "qemu/osdep.h" header contains preprocessor macros that affect > the behavior of core system headers like . It must be > the first include so that core system headers included by ext

Re: [PATCH v14 09/11] qapi/s390/cpu topology: monitor query topology information

2023-01-12 Thread Daniel P . Berrangé
On Thu, Jan 12, 2023 at 06:27:04PM +0100, Nina Schoetterl-Glausch wrote: > On Thu, 2023-01-12 at 12:10 +, Daniel P. Berrangé wrote > > [...] > > > > We already have 'query-cpus-fast' wich returns one entry for > > each CPU. In fact why do we need to add query-topology at all. > > Can't we jus

[RFC v2 04/13] vdpa: rewind at get_base, not set_base

2023-01-12 Thread Eugenio Pérez
At this moment it is only possible to migrate to a vdpa device running with x-svq=on. As a protective measure, the rewind of the inflight descriptors was done at the destination. That way if the source sent a virtqueue with inuse descriptors they are always discarded. Since this series allows to m

[RFC v2 05/13] vdpa net: add migration blocker if cannot migrate cvq

2023-01-12 Thread Eugenio Pérez
A vdpa net device must initialize with SVQ in order to be migratable, and initialization code verifies conditions. If the device is not initialized with the x-svq parameter, it will not expose _F_LOG so vhost sybsystem will block VM migration from its initialization. Next patches change this. Net

[RFC v2 07/13] vdpa: delay set_vring_ready after DRIVER_OK

2023-01-12 Thread Eugenio Pérez
To restore the device at the destination of a live migration we send the commands through control virtqueue. For a device to read CVQ it must have received the DRIVER_OK status bit. However this opens a window where the device could start receiving packets in rx queue 0 before it receives the RSS

[RFC v2 10/13] vdpa net: allow VHOST_F_LOG_ALL

2023-01-12 Thread Eugenio Pérez
Since some actions move to the start function instead of init, the device features may not be the parent vdpa device's, but the one returned by vhost backend. If transition to SVQ is supported, the vhost backend will return _F_LOG_ALL to signal the device is migratable. Add VHOST_F_LOG_ALL. HW d

[RFC v2 12/13] vdpa: preemptive kick at enable

2023-01-12 Thread Eugenio Pérez
Spuriously kick the destination device's queue so it knows in case there are new descriptors. RFC: This is somehow a gray area. The guest may have placed descriptors in a virtqueue but not kicked it, so it might be surprised if the device starts processing it. However, that information is not in

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Michael S. Tsirkin
On Thu, Jan 12, 2023 at 03:47:19PM +0100, Markus Armbruster wrote: > "Michael S. Tsirkin" writes: > > > On Thu, Jan 12, 2023 at 08:51:32AM -0500, Michael S. Tsirkin wrote: > >> On Thu, Jan 12, 2023 at 12:50:05PM +0100, Markus Armbruster wrote: > >> > docs/devel/style.rst mandates: > >> > > >> >

[RFC v2 00/13] Dinamycally switch to vhost shadow virtqueues at vdpa net migration

2023-01-12 Thread Eugenio Pérez
It's possible to migrate vdpa net devices if they are shadowed from the start. But to always shadow the dataplane is effectively break its host passthrough, so its not convenient in vDPA scenarios. This series enables dynamically switching to shadow mode only at migration time. This allow full d

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Michael S. Tsirkin
On Thu, Jan 12, 2023 at 12:50:05PM +0100, Markus Armbruster wrote: > docs/devel/style.rst mandates: > > The "qemu/osdep.h" header contains preprocessor macros that affect > the behavior of core system headers like . It must be > the first include so that core system headers included b

Re: [PATCH v3 1/8] migration/savevm: Move more savevm handling into vmstate_save()

2023-01-12 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > Let's move more code into vmstate_save(), reducing code duplication and > preparing for reuse of vmstate_save() in qemu_savevm_state_setup(). We > have to move vmstate_save() to make the compiler happy. > > We'll now also trace from qemu_save_device_

Re: [PATCH v3 2/8] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup()

2023-01-12 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > ... and store it in the migration state. This is a preparation for > storing selected vmds's already in qemu_savevm_state_setup(). > > Signed-off-by: David Hildenbrand > --- > migration/migration.c | 4 > migration/migration.h | 4 > mi

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-12 Thread Klaus Jensen
On Jan 12 09:34, Keith Busch wrote: > On Thu, Jan 12, 2023 at 02:10:51PM +0100, Klaus Jensen wrote: > > > > The pin-based interrupt logic in hw/nvme seems sound enough to me, so I > > am wondering if there is something going on with the kernel driver (but > > I certainly do not rule out that hw/nv

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Daniel P . Berrangé
On Thu, Jan 12, 2023 at 12:37:46PM -0500, Michael S. Tsirkin wrote: > On Thu, Jan 12, 2023 at 03:47:19PM +0100, Markus Armbruster wrote: > > "Michael S. Tsirkin" writes: > > > > > On Thu, Jan 12, 2023 at 08:51:32AM -0500, Michael S. Tsirkin wrote: > > >> On Thu, Jan 12, 2023 at 12:50:05PM +0100,

Re: [PATCH v3 2/8] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup()

2023-01-12 Thread David Hildenbrand
On 12.01.23 18:43, Dr. David Alan Gilbert wrote: * David Hildenbrand (da...@redhat.com) wrote: ... and store it in the migration state. This is a preparation for storing selected vmds's already in qemu_savevm_state_setup(). Signed-off-by: David Hildenbrand --- migration/migration.c | 4

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-12 Thread Keith Busch
On Thu, Jan 12, 2023 at 06:45:55PM +0100, Klaus Jensen wrote: > On Jan 12 09:34, Keith Busch wrote: > > On Thu, Jan 12, 2023 at 02:10:51PM +0100, Klaus Jensen wrote: > > > > > > The pin-based interrupt logic in hw/nvme seems sound enough to me, so I > > > am wondering if there is something going o

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Michael S. Tsirkin
On Thu, Jan 12, 2023 at 03:58:56PM +, Peter Maydell wrote: > On Thu, 12 Jan 2023 at 15:14, Daniel P. Berrangé wrote: > > > > On Thu, Jan 12, 2023 at 08:51:26AM -0500, Michael S. Tsirkin wrote: > > > On Thu, Jan 12, 2023 at 12:50:05PM +0100, Markus Armbruster wrote: > > > > docs/devel/style.rst

Re: [PATCH v3 1/8] migration/savevm: Move more savevm handling into vmstate_save()

2023-01-12 Thread David Hildenbrand
On 12.01.23 17:58, Dr. David Alan Gilbert wrote: * David Hildenbrand (da...@redhat.com) wrote: Let's move more code into vmstate_save(), reducing code duplication and preparing for reuse of vmstate_save() in qemu_savevm_state_setup(). We have to move vmstate_save() to make the compiler happy. W

Re: [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM)

2023-01-12 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > For virtio-mem, we want to have the plugged/unplugged state of memory > blocks available before migrating any actual RAM content, and perform > sanity checks before touching anything on the destination. This > information is immutable on the migration

Re: [PATCH v3 1/1] include: Don't include qemu/osdep.h

2023-01-12 Thread Michael S. Tsirkin
On Thu, Jan 12, 2023 at 05:44:31PM +, Daniel P. Berrangé wrote: > On Thu, Jan 12, 2023 at 12:37:46PM -0500, Michael S. Tsirkin wrote: > > On Thu, Jan 12, 2023 at 03:47:19PM +0100, Markus Armbruster wrote: > > > "Michael S. Tsirkin" writes: > > > > > > > On Thu, Jan 12, 2023 at 08:51:32AM -050

Re: [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c

2023-01-12 Thread Bernhard Beschow
Am 12. Januar 2023 16:31:23 UTC schrieb "Philippe Mathieu-Daudé" : >On 12/1/23 16:04, Philippe Mathieu-Daudé wrote: >> On 9/1/23 18:23, Bernhard Beschow wrote: >>> Now that the PIIX3 and PIIX4 device models are sufficiently consolidated, >>> their implementations can be merged into one file for

Re: [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM)

2023-01-12 Thread David Hildenbrand
On 12.01.23 18:56, Dr. David Alan Gilbert wrote: * David Hildenbrand (da...@redhat.com) wrote: For virtio-mem, we want to have the plugged/unplugged state of memory blocks available before migrating any actual RAM content, and perform sanity checks before touching anything on the destination. Th

Re: [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c

2023-01-12 Thread Bernhard Beschow
Am 12. Januar 2023 16:36:30 UTC schrieb "Philippe Mathieu-Daudé" : >On 9/1/23 18:23, Bernhard Beschow wrote: >> Now that the PIIX3 and PIIX4 device models are sufficiently consolidated, >> their implementations can be merged into one file for further >> consolidation. >> >> Signed-off-by: Bern

Re: [PATCH v3 5/8] migration/ram: Factor out check for advised postcopy

2023-01-12 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > Let's factor out this check, to be used in virtio-mem context next. > > While at it, fix a spelling error in a related comment. > > Signed-off-by: David Hildenbrand Reviewed-by: Dr. David Alan Gilbert > --- > include/migration/misc.h | 4 +++- >

Re: [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c

2023-01-12 Thread Bernhard Beschow
Am 12. Januar 2023 13:32:02 UTC schrieb "Philippe Mathieu-Daudé" : >On 12/1/23 13:50, Philippe Mathieu-Daudé wrote: >> On 9/1/23 18:23, Bernhard Beschow wrote: >>> Now that the PIIX3 and PIIX4 device models are sufficiently consolidated, >>> their implementations can be merged into one file for

Re: [PATCH v3 6/8] virtio-mem: Fail if a memory backend with "prealloc=on" is specified

2023-01-12 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > "prealloc=on" for the memory backend does not work as expected, as > virtio-mem will simply discard all preallocated memory immediately again. > In the best case, it's an expensive NOP. In the worst case, it's an > unexpected allocation error. > > In

Re: [PATCH v3 1/8] migration/savevm: Move more savevm handling into vmstate_save()

2023-01-12 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > On 12.01.23 17:58, Dr. David Alan Gilbert wrote: > > * David Hildenbrand (da...@redhat.com) wrote: > > > Let's move more code into vmstate_save(), reducing code duplication and > > > preparing for reuse of vmstate_save() in qemu_savevm_state_setup().

Re: [PATCH v3 2/8] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup()

2023-01-12 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > On 12.01.23 18:43, Dr. David Alan Gilbert wrote: > > * David Hildenbrand (da...@redhat.com) wrote: > > > ... and store it in the migration state. This is a preparation for > > > storing selected vmds's already in qemu_savevm_state_setup(). > > > > >

[PATCH 2/4] qemu-img commit: Report errors while closing the image

2023-01-12 Thread Kevin Wolf
blk_unref() can't report any errors that happen while closing the image. For example, if qcow2 hits an -ENOSPC error while writing out dirty bitmaps when it's closed, it prints error messages to stderr, but 'qemu-img commit' won't see any error return value and will therefore look successful with e

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-12 Thread Guenter Roeck
On 1/12/23 09:45, Klaus Jensen wrote: On Jan 12 09:34, Keith Busch wrote: On Thu, Jan 12, 2023 at 02:10:51PM +0100, Klaus Jensen wrote: The pin-based interrupt logic in hw/nvme seems sound enough to me, so I am wondering if there is something going on with the kernel driver (but I certainly do

[PATCH 1/4] qcow2: Fix theoretical corruption in store_bitmap() error path

2023-01-12 Thread Kevin Wolf
In order to write the bitmap table to the image file, it is converted to big endian. If the write fails, it is passed to clear_bitmap_table() to free all of the clusters it had allocated before. However, if we don't convert it back to native endianness first, we'll free things at a wrong offset. I

[PATCH 4/4] qemu-iotests: Test qemu-img bitmap/commit exit code on error

2023-01-12 Thread Kevin Wolf
This tests that when an error happens while writing back bitmaps to the image file in qcow2_inactivate(), 'qemu-img bitmap/commit' actually return an error value in their exit code instead of making the operation look successful to scripts. Signed-off-by: Kevin Wolf --- .../qemu-iotests/tests/qe

<    1   2   3   4   >