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

2023-01-12 Thread Eugenio Perez Martin
On Fri, Jan 13, 2023 at 5:25 AM Jason Wang wrote: > > > 在 2023/1/13 01:24, 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

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

2023-01-12 Thread Eugenio Perez Martin
On Fri, Jan 13, 2023 at 5:10 AM Jason Wang wrote: > > On Fri, Jan 13, 2023 at 1:24 AM Eugenio Pérez wrote: > > > > 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

regression in booting with -kernel in 7.2.0

2023-01-12 Thread Christoph Hellwig
Hi all, qemu 7.2.0 fails to boot my usual test setup using -kernel (see the actual script below). I've bisected this down to: commit ffe2d2382e5f1aae1abc4081af407905ef380311 Author: Jason A. Donenfeld Date: Wed Sep 21 11:31:34 2022 +0200 x86: re-enable rng seeding via SetupData with

Re: [PATCH 3/4] qemu-img bitmap: Report errors while closing the image

2023-01-12 Thread Philippe Mathieu-Daudé
On 12/1/23 20:14, Kevin Wolf wrote: 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 bitmap' won't see any error return value

Re: [PATCH 0/4] qemu-img: Fix exit code for errors closing the image

2023-01-12 Thread Markus Armbruster
Drive-by comment... Kevin Wolf writes: > This series addresses the problem described in these bug reports: > https://gitlab.com/qemu-project/qemu/-/issues/1330 > https://bugzilla.redhat.com/show_bug.cgi?id=2147617 > > qcow2 can fail when writing back dirty bitmaps in qcow2_inactivate(). >

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

2023-01-12 Thread Philippe Mathieu-Daudé
On 12/1/23 20:14, Kevin Wolf wrote: 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,

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

2023-01-12 Thread Eugenio Perez Martin
On Fri, Jan 13, 2023 at 4:53 AM Jason Wang wrote: > > On Fri, Jan 13, 2023 at 1:24 AM Eugenio Pérez wrote: > > > > 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. > > > >

Re: [PATCH v7 6/7] mac_newworld: Deprecate mac99 "via" option

2023-01-12 Thread Howard Spoelstra
On Fri, Jan 13, 2023 at 12:53 AM BALATON Zoltan wrote: > On Thu, 12 Jan 2023, Howard Spoelstra wrote: > > On Wed, Jan 11, 2023 at 1:15 AM BALATON Zoltan > wrote: > > > >> On Tue, 10 Jan 2023, Mark Cave-Ayland wrote: > >>> On 04/01/2023 21:59, BALATON Zoltan wrote: > >>> > Setting emulated

Re: [PATCH v3 0/6] qemu/bswap: Use compiler __builtin_bswap()

2023-01-12 Thread Thomas Huth
On 13/01/2023 08.05, Philippe Mathieu-Daudé wrote: On 13/1/23 02:05, Richard Henderson wrote: On 1/11/23 08:31, Philippe Mathieu-Daudé wrote: Implement Richard's suggestion to use __builtin_bswap(). Convert to __builtin_bswap() one patch per OS to simplify maintainers review. Since v2: -

Re: [PATCH v5 10/11] hw/riscv/boot.c: consolidate all kernel init in riscv_load_kernel()

2023-01-12 Thread Philippe Mathieu-Daudé
On 12/1/23 01:34, Alistair Francis wrote: On Mon, Jan 2, 2023 at 9:55 PM Daniel Henrique Barboza wrote: The microchip_icicle_kit, sifive_u, spike and virt boards are now doing the same steps when '-kernel' is used: - execute load_kernel() - load init_rd() - write kernel_cmdline Let's fold

Re: [PATCH v6 1/2] hw/riscv/boot.c: consolidate all kernel init in riscv_load_kernel()

2023-01-12 Thread Philippe Mathieu-Daudé
On 13/1/23 03:47, Bin Meng wrote: On Fri, Jan 13, 2023 at 6:37 AM Daniel Henrique Barboza wrote: The microchip_icicle_kit, sifive_u, spike and virt boards are now doing the same steps when '-kernel' is used: - execute load_kernel() - load init_rd() - write kernel_cmdline Let's fold

Re: [PATCH] hw/mips/boston.c: rename MachineState 'mc' pointer to 'ms'

2023-01-12 Thread Philippe Mathieu-Daudé
On 11/1/23 18:21, Daniel Henrique Barboza wrote: Follow the QEMU convention of naming MachineState pointers as 'ms' by renaming the instance in create_fdt() where we're calling it 'mc'. Cc: Paul Burton Cc: Aleksandar Rikalo Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Daniel Henrique

Re: [PATCH v3 0/6] qemu/bswap: Use compiler __builtin_bswap()

2023-01-12 Thread Philippe Mathieu-Daudé
On 13/1/23 02:05, Richard Henderson wrote: On 1/11/23 08:31, Philippe Mathieu-Daudé wrote: Implement Richard's suggestion to use __builtin_bswap(). Convert to __builtin_bswap() one patch per OS to simplify maintainers review. Since v2: - Rebased adapting ./configure changes to meson Since

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

2023-01-12 Thread Eugenio Perez Martin
On Fri, Jan 13, 2023 at 4:12 AM Jason Wang wrote: > > On Fri, Jan 13, 2023 at 1:24 AM Eugenio Pérez wrote: > > > > 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

Re: [PATCH v5 10/11] hw/riscv/boot.c: consolidate all kernel init in riscv_load_kernel()

2023-01-12 Thread Bin Meng
Hi Alistair, On Thu, Jan 12, 2023 at 8:36 AM Alistair Francis wrote: > > On Mon, Jan 2, 2023 at 9:55 PM Daniel Henrique Barboza > wrote: > > > > The microchip_icicle_kit, sifive_u, spike and virt boards are now doing > > the same steps when '-kernel' is used: > > > > - execute load_kernel() > >

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

2023-01-12 Thread Jason Wang
On Fri, Jan 13, 2023 at 1:25 AM Eugenio Pérez wrote: > > 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:

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

2023-01-12 Thread Jason Wang
On Fri, Jan 13, 2023 at 1:25 AM Eugenio Pérez wrote: > > 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

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

2023-01-12 Thread Jason Wang
On Fri, Jan 13, 2023 at 1:25 AM Eugenio Pérez wrote: > > 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 Acked-by: Jason Wang We probably need to add

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

2023-01-12 Thread Jason Wang
On Fri, Jan 13, 2023 at 1:25 AM Eugenio Pérez wrote: > > 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. This probably requires the support from the parent

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

2023-01-12 Thread Jason Wang
在 2023/1/13 01:24, 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

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-12 Thread Chuck Zmudzinski
On 1/12/23 6:03 PM, Michael S. Tsirkin wrote: > On Thu, Jan 12, 2023 at 10:55:25PM +, Bernhard Beschow wrote: >> I think the change Michael suggests is very minimalistic: Move the if >> condition around xen_igd_reserve_slot() into the function itself and >> always call it there unconditionally

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

2023-01-12 Thread Jason Wang
On Fri, Jan 13, 2023 at 1:24 AM Eugenio Pérez wrote: > > 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

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

2023-01-12 Thread Jason Wang
On Fri, Jan 13, 2023 at 1:24 AM Eugenio Pérez wrote: > > 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

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

2023-01-12 Thread Jason Wang
On Fri, Jan 13, 2023 at 11:25 AM Zhu, Lingshan wrote: > > > > On 1/13/2023 10:31 AM, Jason Wang wrote: > > On Fri, Jan 13, 2023 at 1:27 AM Eugenio Pérez wrote: > >> Spuriously kick the destination device's queue so it knows in case there > >> are new descriptors. > >> > >> RFC: This is somehow a

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

2023-01-12 Thread Jason Wang
On Fri, Jan 13, 2023 at 1:24 AM Eugenio Pérez wrote: > > 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

Re: [PATCH v6 1/2] hw/riscv/boot.c: consolidate all kernel init in riscv_load_kernel()

2023-01-12 Thread Bin Meng
On Fri, Jan 13, 2023 at 6:37 AM Daniel Henrique Barboza wrote: > > The microchip_icicle_kit, sifive_u, spike and virt boards are now doing > the same steps when '-kernel' is used: > > - execute load_kernel() > - load init_rd() > - write kernel_cmdline > > Let's fold everything inside

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

2023-01-12 Thread Jason Wang
On Fri, Jan 13, 2023 at 1:27 AM Eugenio Pérez wrote: > > 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

[RFC] cxl-host: Fix committed check for passthrough decoder

2023-01-12 Thread Fan Ni
For passthrough decoder (a decoder hosted by a cxl component with only one downstream port), its cache_mem_registers field COMMITTED (see spec 2.0 8.2.5.12 - CXL HDM Decoder Capability Structure) will not be set by the current Linux CXL driver. Without the fix, for a cxl topology setup with a

Re: [PATCH 0/2] target/riscv/cpu: fix sifive_u 32/64bits boot in riscv-to-apply.next

2023-01-12 Thread Bin Meng
Hi Daniel, On Wed, Jan 11, 2023 at 1:03 PM Alistair Francis wrote: > > On Wed, Jan 11, 2023 at 6:17 AM Daniel Henrique Barboza > wrote: > > > > Hi, > > > > I found this bug when testing my avocado changes in riscv-to-apply.next. > > The sifive_u board, both 32 and 64 bits, stopped booting

Re: [PATCH] hw/mips/boston.c: rename MachineState 'mc' pointer to 'ms'

2023-01-12 Thread Bin Meng
On Thu, Jan 12, 2023 at 1:27 AM Daniel Henrique Barboza wrote: > > Follow the QEMU convention of naming MachineState pointers as 'ms' by > renaming the instance in create_fdt() where we're calling it 'mc'. > > Cc: Paul Burton > Cc: Aleksandar Rikalo > Suggested-by: Philippe Mathieu-Daudé >

Re: [PATCH v3 0/6] qemu/bswap: Use compiler __builtin_bswap()

2023-01-12 Thread Richard Henderson
On 1/11/23 08:31, Philippe Mathieu-Daudé wrote: Implement Richard's suggestion to use __builtin_bswap(). Convert to __builtin_bswap() one patch per OS to simplify maintainers review. Since v2: - Rebased adapting ./configure changes to meson Since v1: - Remove the Haiku/BSD ifdef'ry (Peter) -

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

2023-01-12 Thread Guenter Roeck
On 1/12/23 11:27, Keith Busch wrote: 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

Re: [PATCH 07/31] e1000: Use more constant definitions

2023-01-12 Thread BALATON Zoltan
On Thu, 12 Jan 2023, Philippe Mathieu-Daudé wrote: On 12/1/23 10:57, Akihiko Odaki wrote: The definitions for E1000_VFTA_ENTRY_SHIFT, E1000_VFTA_ENTRY_MASK, and E1000_VFTA_ENTRY_BIT_SHIFT_MASK were copied from:

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

Re: [PATCH v7 6/7] mac_newworld: Deprecate mac99 "via" option

2023-01-12 Thread BALATON Zoltan
On Thu, 12 Jan 2023, Howard Spoelstra wrote: On Wed, Jan 11, 2023 at 1:15 AM BALATON Zoltan wrote: On Tue, 10 Jan 2023, Mark Cave-Ayland wrote: On 04/01/2023 21:59, BALATON Zoltan wrote: Setting emulated machine type with a property called "via" is confusing users so deprecate the "via"

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-12 Thread Michael S. Tsirkin
On Thu, Jan 12, 2023 at 10:55:25PM +, Bernhard Beschow wrote: > I think the change Michael suggests is very minimalistic: Move the if > condition around xen_igd_reserve_slot() into the function itself and > always call it there unconditionally -- basically turning three lines > into one. Since

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-12 Thread Bernhard Beschow
Am 12. Januar 2023 20:11:54 UTC schrieb Chuck Zmudzinski : >On 1/12/23 2:18 PM, Bernhard Beschow wrote: >> >> >> Am 11. Januar 2023 15:40:24 UTC schrieb Chuck Zmudzinski : >>>On 1/10/23 3:16 AM, Michael S. Tsirkin wrote: On Tue, Jan 10, 2023 at 02:08:34AM -0500, Chuck Zmudzinski wrote:

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

2023-01-12 Thread Gregory Price
On Thu, Jan 12, 2023 at 05:21:30PM +, Jonathan Cameron wrote: > 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. > >

Re: [RFC] Reducing NEED_CPU_H usage

2023-01-12 Thread Richard Henderson
On 1/12/23 07:28, Alessandro Di Federico wrote: 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

[PATCH v6 1/2] hw/riscv/boot.c: consolidate all kernel init in riscv_load_kernel()

2023-01-12 Thread Daniel Henrique Barboza
The microchip_icicle_kit, sifive_u, spike and virt boards are now doing the same steps when '-kernel' is used: - execute load_kernel() - load init_rd() - write kernel_cmdline Let's fold everything inside riscv_load_kernel() to avoid code repetition. To not change the behavior of boards that

[PATCH v6 2/2] hw/riscv/boot.c: make riscv_load_initrd() static

2023-01-12 Thread Daniel Henrique Barboza
The only remaining caller is riscv_load_kernel_and_initrd() which belongs to the same file. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Bin Meng --- hw/riscv/boot.c | 80 - include/hw/riscv/boot.h | 1

[PATCH v6 0/2] hw/riscv: consolidate kernel init in riscv_load_kernel()

2023-01-12 Thread Daniel Henrique Barboza
Hi, These are the 2 remaining patches, patches 10 and 11, of: "[PATCH v5 00/11] riscv: OpenSBI boot test and cleanups" The first 9 patches are already available in riscv-to-apply.next. The only change made was in patch 10 where we're now handling the case where load_elf_ram_sym is padding the

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

2023-01-12 Thread Peter Xu
On Thu, Jan 12, 2023 at 05:14:57PM -0500, Peter Xu wrote: > On Thu, Jan 12, 2023 at 07:52:41PM +, Dr. David Alan Gilbert wrote: > > * David Hildenbrand (da...@redhat.com) wrote: > > > On 12.01.23 18:56, Dr. David Alan Gilbert wrote: > > > > * David Hildenbrand (da...@redhat.com) wrote: > > > >

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

2023-01-12 Thread Peter Xu
On Thu, Jan 12, 2023 at 07:52:41PM +, Dr. David Alan Gilbert wrote: > * David Hildenbrand (da...@redhat.com) wrote: > > 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

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

2023-01-12 Thread Peter Xu
On Thu, Jan 12, 2023 at 06:40:00PM +, Dr. David Alan Gilbert wrote: > * 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

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

2023-01-12 Thread Bastian Koppelmann
On Thu, Jan 12, 2023 at 04:56:43PM +0100, Philippe Mathieu-Daudé wrote: > 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 > ... >

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

2023-01-12 Thread Bastian Koppelmann
On Thu, Jan 12, 2023 at 02:24:02PM +, Anton Kochkov wrote: > 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 deletion(-) > > diff --git a/target/tricore/translate.c

Re: [PATCH v1 1/1] virtio-block: switch to blk_get_max_hw_transfer

2023-01-12 Thread Ilya Dryomov
On Thu, Dec 9, 2021 at 10:34 AM Or Ozeri wrote: > > The blk_get_max_hw_transfer API was recently added in 6.1.0. > It allows querying an underlying block device its max transfer capability. > This commit changes virtio-blk to use this. > > Signed-off-by: Or Ozeri > --- > hw/block/virtio-blk.c |

Re: [PATCH v7 6/7] mac_newworld: Deprecate mac99 "via" option

2023-01-12 Thread Howard Spoelstra
On Wed, Jan 11, 2023 at 1:15 AM BALATON Zoltan wrote: > On Tue, 10 Jan 2023, Mark Cave-Ayland wrote: > > On 04/01/2023 21:59, BALATON Zoltan wrote: > > > >> Setting emulated machine type with a property called "via" is > >> confusing users so deprecate the "via" option in favour of newly added >

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-12 Thread Chuck Zmudzinski
On 1/12/23 2:18 PM, Bernhard Beschow wrote: > > > Am 11. Januar 2023 15:40:24 UTC schrieb Chuck Zmudzinski : >>On 1/10/23 3:16 AM, Michael S. Tsirkin wrote: >>> On Tue, Jan 10, 2023 at 02:08:34AM -0500, Chuck Zmudzinski wrote: Intel specifies that the Intel IGD must occupy slot 2 on the PCI

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: > 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

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

2023-01-12 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > 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

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

2023-01-12 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > 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.

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

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-12 Thread Bernhard Beschow
Am 11. Januar 2023 15:40:24 UTC schrieb Chuck Zmudzinski : >On 1/10/23 3:16 AM, Michael S. Tsirkin wrote: >> On Tue, Jan 10, 2023 at 02:08:34AM -0500, Chuck Zmudzinski wrote: >>> Intel specifies that the Intel IGD must occupy slot 2 on the PCI bus, >>> as noted in docs/igd-assign.txt in the

[PATCH 3/4] qemu-img bitmap: 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 bitmap' won't see any error return value and will therefore look successful with

[PATCH 0/4] qemu-img: Fix exit code for errors closing the image

2023-01-12 Thread Kevin Wolf
This series addresses the problem described in these bug reports: https://gitlab.com/qemu-project/qemu/-/issues/1330 https://bugzilla.redhat.com/show_bug.cgi?id=2147617 qcow2 can fail when writing back dirty bitmaps in qcow2_inactivate(). However, when the function is called through blk_unref(),

[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 ---

[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.

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

[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

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(). > > > > >

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 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. > >

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

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 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:

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.

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

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

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

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.

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: > > > >

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

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: [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: 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

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 >

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

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

[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

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 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

[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

[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 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.

[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

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

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

[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

[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

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 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

[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 ---

[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 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 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 ---

[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(+),

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. > >

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

  1   2   3   4   >