Re: [PATCH v2 01/22] qapi: Inline and remove QERR_BUS_NO_HOTPLUG definition

2023-10-19 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Address the comment added in commit 4629ed1e98 > ("qerror: Finally unused, clean up"), from 2015: > > /* >* These macros will go away, please don't use >* in new code, and do not add new ones! >*/ > > Mechanical transformation using sed, manually >

Re: [PATCH 07/13] RFC migration: icp/server is a mess

2023-10-19 Thread Thomas Huth
On 19/10/2023 23.15, Cédric Le Goater wrote: On 10/19/23 22:49, Greg Kurz wrote: Hi Juan, On Thu, 19 Oct 2023 21:08:25 +0200 Juan Quintela wrote: Current code does: - register pre_2_10_vmstate_dummy_icp with "icp/server" and instance    dependinfg on cpu number - for newer machines, it

Re: [PATCH v5 5/6] hw/virtio: add vhost-user-snd and virtio-snd-pci devices

2023-10-19 Thread Viresh Kumar
On 19-10-23, 10:56, Alex Bennée wrote: > From: Manos Pitsidianakis > > Tested with rust-vmm vhost-user-sound daemon: > > RUST_LOG=trace cargo run --bin vhost-user-sound -- --socket /tmp/snd.sock > --backend null > > Invocation: > > qemu-system-x86_64 \ > -qmp

[PATCH] hw/ufs: Modify lu.c to share codes with SCSI subsystem

2023-10-19 Thread Jeuk Kim
This patch removes the code that ufs-lu was duplicating from scsi-hd and allows them to share code. It makes ufs-lu have a virtual scsi-bus and scsi-hd internally. This allows scsi related commands to be passed thorugh to the scsi-hd. The query request and nop command work the same as the

Re: [PATCH 0/2] ide: implement simple legacy/native mode switching for PCI IDE controllers

2023-10-19 Thread BALATON Zoltan
On Thu, 19 Oct 2023, Mark Cave-Ayland wrote: This series adds a simple implementation of legacy/native mode switching for PCI IDE controllers and updates the via-ide device to use it. The approach I take here is to add a new pci_ide_update_mode() function which handles management of the PCI

Re: [PATCH 2/2] hw/ide/via: implement legacy/native mode switching

2023-10-19 Thread BALATON Zoltan
On Thu, 19 Oct 2023, Mark Cave-Ayland wrote: Allow the VIA IDE controller to switch between both legacy and native modes by calling pci_ide_update_mode() to reconfigure the device whenever PCI_CLASS_PROG is updated. This patch also moves the setting of PCI_CLASS_PROG from via_ide_realize() to

Re: [PATCH 0/7] hw: Few more QOM/QDev cleanups

2023-10-19 Thread Philippe Mathieu-Daudé
On 17/10/23 16:01, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (7): hw/virtio/virtio-pmem: Replace impossible check by assertion hw/block/vhost-user-blk: Use DEVICE() / VIRTIO_DEVICE() macros hw/display/virtio-gpu: Use VIRTIO_DEVICE() macro hw/scsi/virtio-scsi: Use

Re: [PATCH 07/13] RFC migration: icp/server is a mess

2023-10-19 Thread Greg Kurz
On Thu, 19 Oct 2023 21:08:25 +0200 Juan Quintela wrote: > Current code does: > - register pre_2_10_vmstate_dummy_icp with "icp/server" and instance > dependinfg on cpu number > - for newer machines, it register vmstate_icp with "icp/server" name > and instance 0 > - now it unregisters

[PULL 07/46] buildsys: Only display Objective-C information when Objective-C is used

2023-10-19 Thread Philippe Mathieu-Daudé
When configuring with '--disable-cocoa --disable-coreaudio' on Darwin, we get: meson.build:4081:58: ERROR: Tried to access compiler for language "objc", not specified for host machine. meson.build:4097:47: ERROR: Tried to access unknown option 'objc_args'. Instead of unconditionally display

[PULL 05/46] MAINTAINERS: Add include/hw/openrisc/ to the OpenRISC section

2023-10-19 Thread Philippe Mathieu-Daudé
From: Thomas Huth hw/openrisc/ is already listed here, so we should mention the folder for the headers here, too. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231017154242.234133-1-th...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 +

[PULL 13/46] hw/misc/mips_itu: Declare itc_reconfigure() in 'hw/misc/mips_itu.h'

2023-10-19 Thread Philippe Mathieu-Daudé
We already provide "hw/misc/mips_itu.h" to declare prototype related to MIPSITUState. Move itc_reconfigure() declaration there. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20231009171443.12145-3-phi...@linaro.org> --- include/hw/misc/mips_itu.h |

[PULL 32/46] hw/i386/intel_iommu: Do not use SysBus API to map local MMIO region

2023-10-19 Thread Philippe Mathieu-Daudé
There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression

[PULL 43/46] hw/scsi/virtio-scsi: Use VIRTIO_SCSI_COMMON() macro

2023-10-19 Thread Philippe Mathieu-Daudé
Access QOM parent with the proper QOM VIRTIO_SCSI_COMMON() macro. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Reviewed-by: Manos Pitsidianakis Reviewed-by: Mark Cave-Ayland Message-Id: <20231017140150.44995-5-phi...@linaro.org> --- hw/scsi/virtio-scsi.c | 2 +- 1

[PULL 35/46] hw/pci-host/bonito: Do not use SysBus API to map local MMIO region

2023-10-19 Thread Philippe Mathieu-Daudé
There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression

[PULL 45/46] hw/net: Declare link using static DEFINE_PROP_LINK() macro

2023-10-19 Thread Philippe Mathieu-Daudé
Declare link statically using DEFINE_PROP_LINK(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20231017140150.44995-7-phi...@linaro.org> --- hw/net/cadence_gem.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/net/cadence_gem.c

[PULL 11/46] hw/mips/malta: Use sdram_type enum from 'hw/i2c/smbus_eeprom.h'

2023-10-19 Thread Philippe Mathieu-Daudé
Since commit 93198b6cad ("i2c: Split smbus into parts") the SDRAM types are enumerated as sdram_type in "hw/i2c/smbus_eeprom.h". Using the enum removes this global shadow warning: hw/mips/malta.c:209:12: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] enum {

[PULL 40/46] hw/virtio/virtio-pmem: Replace impossible check by assertion

2023-10-19 Thread Philippe Mathieu-Daudé
The get_memory_region() handler is used when (un)plugging the device, which can only occur *after* it is realized. virtio_pmem_realize() ensure the instance can not be realized without 'memdev'. Remove the superfluous check, replacing it by an assertion. Signed-off-by: Philippe Mathieu-Daudé

[PULL 17/46] hw/pci-host/sh_pcic: Replace magic value by proper definition

2023-10-19 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Message-Id: <20231012041237.22281-4-phi...@linaro.org> --- hw/pci-host/sh_pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index 580e273d96..4edebced5e

[PULL 20/46] hw/pci: Clean up global variable shadowing of address_space_io variable

2023-10-19 Thread Philippe Mathieu-Daudé
Fix: hw/pci/pci.c:504:54: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, ^ hw/pci/pci.c:533:38: error: declaration shadows a variable

[PULL 34/46] hw/misc/allwinner-dramc: Do not use SysBus API to map local MMIO region

2023-10-19 Thread Philippe Mathieu-Daudé
There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression

[PULL 27/46] hw/ppc/pnv: Do not use SysBus API to map local MMIO region

2023-10-19 Thread Philippe Mathieu-Daudé
There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression

[PULL 38/46] hw/isa: Realize ISA bridge device before accessing it

2023-10-19 Thread Philippe Mathieu-Daudé
qbus_new() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Message-Id: <20231019071611.98885-9-phi...@linaro.org> --- hw/isa/isa-bus.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git

[PULL 30/46] hw/audio/pcspk: Inline pcspk_init()

2023-10-19 Thread Philippe Mathieu-Daudé
pcspk_init() is a legacy init function, inline and remove it. Since the device is realized using _fatal, use the same error for setting the "pit" link. Reviewed-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20231019073307.99608-1-phi...@linaro.org> ---

[PULL 09/46] memory: follow Error API guidelines

2023-10-19 Thread Philippe Mathieu-Daudé
From: Marc-André Lureau Return true/false on success/failure. Signed-off-by: Marc-André Lureau Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231009075310.153617-1-marcandre.lur...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé ---

[PULL 22/46] hw/intc/apic: Use ERRP_GUARD() in apic_common_realize()

2023-10-19 Thread Philippe Mathieu-Daudé
APICCommonClass::realize() is a DeviceRealize() handler which take an Error** parameter and can fail. Do not proceed further on failure. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Message-Id: <20231003082728.83496-2-phi...@linaro.org> --- hw/intc/apic_common.c | 4 1 file

[PULL 23/46] hw/ppc/spapr_vio: Realize SPAPR_VIO_BRIDGE device before accessing it

2023-10-19 Thread Philippe Mathieu-Daudé
qbus_new() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Thomas Huth Message-Id: <20231019131647.19690-2-phi...@linaro.org> --- hw/ppc/spapr_vio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PULL 21/46] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req()

2023-10-19 Thread Philippe Mathieu-Daudé
Fix: hw/s390x/sclpquiesce.c:90:22: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] QuiesceNotifier *qn = container_of(n, QuiesceNotifier, notifier); ^ hw/s390x/sclpquiesce.c:86:3: note: previous declaration is here } qn; ^

[PULL 14/46] hw/misc/mips_itu: Make MIPSITUState target agnostic

2023-10-19 Thread Philippe Mathieu-Daudé
When prototyping a heterogenous machine including the ITU, we get: include/hw/misc/mips_itu.h:76:5: error: unknown type name 'MIPSCPU' MIPSCPU *cpu0; ^ MIPSCPU is declared in the target specific "cpu.h" header, but we don't want to include it, because "cpu.h" is target specific and

[PULL 37/46] hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it

2023-10-19 Thread Philippe Mathieu-Daudé
sysbus_mmio_map() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20231018141151.87466-8-phi...@linaro.org> --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c

[PULL 33/46] hw/misc/allwinner-dramc: Move sysbus_mmio_map call from init -> realize

2023-10-19 Thread Philippe Mathieu-Daudé
In order to make the next commit trivial, move the sysbus_init_mmio() call in allwinner_r40_dramc_init() just before the corresponding sysbus_mmio_map_overlap() call in allwinner_r40_dramc_realize(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id:

[PULL 06/46] cutils: Fix get_relocated_path on Windows

2023-10-19 Thread Philippe Mathieu-Daudé
From: Akihiko Odaki get_relocated_path() did not have error handling for PathCchSkipRoot() because a path given to get_relocated_path() was expected to be a valid path containing a drive letter or UNC server/share path elements on Windows, but sometimes it turned out otherwise. The paths passed

[PULL 46/46] ui/input: Constify QemuInputHandler structure

2023-10-19 Thread Philippe Mathieu-Daudé
Access to QemuInputHandlerState::handler are read-only. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Reviewed-by: Mark Cave-Ayland Message-Id: <20231017131251.43708-1-phi...@linaro.org> --- include/hw/virtio/virtio-input.h | 2 +- include/ui/input.h | 2

[PULL 39/46] hw/s390x/css-bridge: Realize sysbus device before accessing it

2023-10-19 Thread Philippe Mathieu-Daudé
qbus_new() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20231019071611.98885-10-phi...@linaro.org> --- hw/s390x/css-bridge.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PULL 44/46] hw/dma: Declare link using static DEFINE_PROP_LINK() macro

2023-10-19 Thread Philippe Mathieu-Daudé
Declare link statically using DEFINE_PROP_LINK(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20231017140150.44995-6-phi...@linaro.org> --- hw/dma/xilinx_axidma.c | 6 ++ hw/dma/xlnx-zdma.c | 7 ++- hw/dma/xlnx_csu_dma.c | 13 - 3

[PULL 41/46] hw/block/vhost-user-blk: Use DEVICE() / VIRTIO_DEVICE() macros

2023-10-19 Thread Philippe Mathieu-Daudé
Access QOM parent with the proper QOM [VIRTIO_]DEVICE() macros. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Mark Cave-Ayland Message-Id: <20231017140150.44995-3-phi...@linaro.org> --- hw/block/vhost-user-blk.c | 4 ++-- 1 file changed, 2 insertions(+),

[PULL 01/46] mailmap: update email addresses for Luc Michel

2023-10-19 Thread Philippe Mathieu-Daudé
From: Luc Michel Map my old and now invalid work email addresses to my personal one. Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230929140326.2056658-2-...@lmichel.fr> Signed-off-by: Philippe Mathieu-Daudé --- .mailmap | 3 +++ 1 file changed, 3

[PULL 25/46] hw/ppc/pnv_xscom: Move sysbus_mmio_map() call within pnv_xscom_init()

2023-10-19 Thread Philippe Mathieu-Daudé
In order to make the next commit trivial, move sysbus_init_mmio() calls just before the corresponding sysbus_mmio_map() calls. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: Cédric Le Goater Message-Id:

[PULL 02/46] MAINTAINERS: Split vt82c686 out of fuloong2e

2023-10-19 Thread Philippe Mathieu-Daudé
From: BALATON Zoltan The VIA south bridges are now mostly used by other machines not just fuloong2e so split off into a separate section and take maintainership. Signed-off-by: BALATON Zoltan Message-ID: <20231015141517.21931745...@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé ---

[PULL 36/46] hw/acpi: Realize ACPI_GED sysbus device before accessing it

2023-10-19 Thread Philippe Mathieu-Daudé
sysbus_mmio_map() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Michael S. Tsirkin Message-Id: <20231018141151.87466-7-phi...@linaro.org> --- hw/arm/virt.c | 3 +-- hw/i386/microvm.c | 2 +- hw/loongarch/virt.c |

[PULL 03/46] MAINTAINERS: Add hw/input/lasips2.c to the HPPA machine section

2023-10-19 Thread Philippe Mathieu-Daudé
From: Thomas Huth hw/input/lasips2.c and the corresponding header include/hw/input/lasips2.h are only used by the HPPA machine, so add them to the corresponding section in the MAINTAINERS file. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland

[PULL 18/46] hw/sparc64/ebus: Access memory regions via pci_address_space_io()

2023-10-19 Thread Philippe Mathieu-Daudé
PCI functions are plugged on a PCI bus. They can only access external memory regions via the bus. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20231011185954.10337-5-phi...@linaro.org> --- hw/sparc64/sun4u.c | 8 1 file changed, 4 insertions(+), 4

[PULL 19/46] hw/acpi/pcihp: Clean up global variable shadowing in acpi_pcihp_init()

2023-10-19 Thread Philippe Mathieu-Daudé
Fix: hw/acpi/pcihp.c:499:36: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, ^ include/exec/address-spaces.h:35:21: note: previous declaration is here extern

[PULL 12/46] hw/mips: Merge 'hw/mips/cpudevs.h' with 'target/mips/cpu.h'

2023-10-19 Thread Philippe Mathieu-Daudé
"hw/mips/cpudevs.h" contains declarations which are specific to the MIPS architecture; it doesn't make sense for these to be called from a non-MIPS architecture. Move the declarations to "target/mips/cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id:

[PULL 42/46] hw/display/virtio-gpu: Use VIRTIO_DEVICE() macro

2023-10-19 Thread Philippe Mathieu-Daudé
Access QOM parent with the proper QOM VIRTIO_DEVICE() macro. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Reviewed-by: Manos Pitsidianakis Reviewed-by: Mark Cave-Ayland Message-Id: <20231017140150.44995-4-phi...@linaro.org> --- hw/display/virtio-gpu.c | 2 +- 1 file

[PULL 26/46] hw/ppc/pnv_xscom: Do not use SysBus API to map local MMIO region

2023-10-19 Thread Philippe Mathieu-Daudé
There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression

[PULL 04/46] MAINTAINERS: Add include/hw/intc/loongson_liointc.h to the Loongson-3 virt section

2023-10-19 Thread Philippe Mathieu-Daudé
From: Thomas Huth The corresponding .c file is already listed here, so we should mention the header here, too. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Acked-by: Song Gao Message-ID: <20231017153345.233807-1-th...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé ---

[PULL 31/46] hw/i386/amd_iommu: Do not use SysBus API to map local MMIO region

2023-10-19 Thread Philippe Mathieu-Daudé
There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression

[PULL 24/46] hw/ppc/pnv_xscom: Rename pnv_xscom_realize(Error **) -> pnv_xscom_init()

2023-10-19 Thread Philippe Mathieu-Daudé
pnv_xscom_realize() is not used to *realize* QDev object, rename it as pnv_xscom_init(). The Error** argument is unused: remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: Cédric Le Goater Message-Id:

[PULL 28/46] hw/intc/spapr_xive: Move sysbus_init_mmio() calls around

2023-10-19 Thread Philippe Mathieu-Daudé
In order to make the next commit trivial, move sysbus_init_mmio() calls just before the corresponding sysbus_mmio_map() calls. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: Cédric Le Goater Message-Id:

[PULL 10/46] hw/sd/sdhci: Block Size Register bits [14:12] is lost

2023-10-19 Thread Philippe Mathieu-Daudé
From: Lu Gao Block Size Register bits [14:12] is SDMA Buffer Boundary, it is missed in register write, but it is needed in SDMA transfer. e.g. it will be used in sdhci_sdma_transfer_multi_blocks to calculate boundary_ variables. Missing this field will cause wrong operation for different SDMA

[PULL 29/46] hw/intc/spapr_xive: Do not use SysBus API to map local MMIO region

2023-10-19 Thread Philippe Mathieu-Daudé
There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression

[PULL 16/46] hw/pci-host/sh_pcic: Correct PCI host / devfn#0 function names

2023-10-19 Thread Philippe Mathieu-Daudé
Host bridge device and PCI function #0 are inverted. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Message-Id: <20231012041237.22281-3-phi...@linaro.org> --- hw/pci-host/sh_pci.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git

[PULL 08/46] memory: drop needless argument

2023-10-19 Thread Philippe Mathieu-Daudé
From: Marc-André Lureau The argument is unused since commit bdc44640c ("cpu: Use QTAILQ for CPU list"). Signed-off-by: Marc-André Lureau Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231009075231.150568-1-marcandre.lur...@redhat.com> Signed-off-by:

[PULL 15/46] hw/pci-host/sh_pcic: Declare CPU QOM types using DEFINE_TYPES() macro

2023-10-19 Thread Philippe Mathieu-Daudé
When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Message-Id:

[PULL 00/46] Misc HW/UI patches for 2023-10-19

2023-10-19 Thread Philippe Mathieu-Daudé
The following changes since commit 0d239e513e0117e66fa739fb71a43b9383a108ff: Merge tag 'pull-lu-20231018' of https://gitlab.com/rth7680/qemu into staging (2023-10-19 10:20:57 -0700) are available in the Git repository at: https://github.com/philmd/qemu.git tags/hw-misc-20231019 for you

Re: [PATCH 07/13] RFC migration: icp/server is a mess

2023-10-19 Thread Cédric Le Goater
On 10/19/23 22:49, Greg Kurz wrote: Hi Juan, On Thu, 19 Oct 2023 21:08:25 +0200 Juan Quintela wrote: Current code does: - register pre_2_10_vmstate_dummy_icp with "icp/server" and instance dependinfg on cpu number - for newer machines, it register vmstate_icp with "icp/server" name and

Re: [PATCH 10/13] migration: Improve example and documentation of vmstate_register()

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: Signed-off-by: Juan Quintela --- docs/devel/migration.rst | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst index c3e1400c0c..a9fde75862 100644 ---

Re: [PATCH 07/13] RFC migration: icp/server is a mess

2023-10-19 Thread Greg Kurz
Hi Juan, On Thu, 19 Oct 2023 21:08:25 +0200 Juan Quintela wrote: > Current code does: > - register pre_2_10_vmstate_dummy_icp with "icp/server" and instance > dependinfg on cpu number > - for newer machines, it register vmstate_icp with "icp/server" name > and instance 0 > - now it

Re: [PATCH 13/13] migration: Use vmstate_register_any() for vmware_vga

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: I have no idea if we can have more than one vmware_vga device, so play it safe. Signed-off-by: Juan Quintela Reviewed-by: Stefan Berger --- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 12/13] migration: Use vmstate_register_any() for eeprom93xx

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: We can have more than one eeprom93xx. For instance: e100_nic_realize() -> eeprom93xx_new() Signed-off-by: Juan Quintela Reviewed-by: Stefan Berger --- hw/nvram/eeprom93xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 11/13] migration: Use vmstate_register_any() for audio

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: We can have more than one audio card. void audio_init_audiodevs(void) { AudiodevListEntry *e; QSIMPLEQ_FOREACH(e, , next) { audio_init(e->dev, _fatal); } } Signed-off-by: Juan Quintela Reviewed-by: Stefan Berger ---

Re: [PATCH 06/13] migration: Use VMSTATE_INSTANCE_ID_ANY for s390 devices

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: Just with make check I can see that we can have more than one of this devices, so use ANY. ok 5 /s390x/device/introspect/abstract-interfaces ... Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate

Re: [PATCH 05/13] migration: Use VMSTATE_INSTANCE_ID_ANY for slirp

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: Each user network conection create a new slirp instance. We register more than one slirp instance for number 0. qemu-system-x86_64: -netdev user,id=hs1: savevm_state_handler_insert: Detected duplicate SaveStateEntry: id=slirp, instance_id=0x0 Broken

Re: [PATCH 04/13] migration: Use vmstate_register_any() for ipmi-bt*

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: Otherwise device-introspection-test fails. $ ./tests/qtest/device-introspect-test ... Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)

Re: [PATCH 03/13] migration: Use vmstate_register_any() for isa-ide

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: Otherwise qom-test fails. ok 4 /i386/qom/x-remote qemu-system-i386: savevm_state_handler_insert: Detected duplicate SaveStateEntry: id=isa-ide, instance_id=0x0 Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried

Re: [PATCH 02/13] migration: Use vmstate_register_any()

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: This are the easiest cases, where we were already using VMSTATE_INSTANCE_ID_ANY. Signed-off-by: Juan Quintela Reviewed-by: Stefan Berger --- backends/dbus-vmstate.c | 3 +-- backends/tpm/tpm_emulator.c | 3 +-- hw/i2c/core.c

Re: [PATCH 01/13] migration: Create vmstate_register_any()

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: We have lots of cases where we are using an instance_id==0 when we should be using VMSTATE_INSTANCE_ID_ANY (-1). Basically everything that can have more than one needs to have a proper instance_id or -1 and the system will take one for it.

[PATCH 12/13] migration: Use vmstate_register_any() for eeprom93xx

2023-10-19 Thread Juan Quintela
We can have more than one eeprom93xx. For instance: e100_nic_realize() -> eeprom93xx_new() Signed-off-by: Juan Quintela --- hw/nvram/eeprom93xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvram/eeprom93xx.c b/hw/nvram/eeprom93xx.c index 1081e2cc0d..57d63638d7

[PATCH 13/13] migration: Use vmstate_register_any() for vmware_vga

2023-10-19 Thread Juan Quintela
I have no idea if we can have more than one vmware_vga device, so play it safe. Signed-off-by: Juan Quintela --- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 09591fbd39..7490d43881 100644 ---

[PATCH 05/13] migration: Use VMSTATE_INSTANCE_ID_ANY for slirp

2023-10-19 Thread Juan Quintela
Each user network conection create a new slirp instance. We register more than one slirp instance for number 0. qemu-system-x86_64: -netdev user,id=hs1: savevm_state_handler_insert: Detected duplicate SaveStateEntry: id=slirp, instance_id=0x0 Broken pipe

[PATCH 11/13] migration: Use vmstate_register_any() for audio

2023-10-19 Thread Juan Quintela
We can have more than one audio card. void audio_init_audiodevs(void) { AudiodevListEntry *e; QSIMPLEQ_FOREACH(e, , next) { audio_init(e->dev, _fatal); } } Signed-off-by: Juan Quintela --- audio/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 04/13] migration: Use vmstate_register_any() for ipmi-bt*

2023-10-19 Thread Juan Quintela
Otherwise device-introspection-test fails. $ ./tests/qtest/device-introspect-test ... Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0) Aborted (core dumped) Signed-off-by: Juan

[PATCH 08/13] migration: vmstate_register() check that instance_id is valid

2023-10-19 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 9ca7e9cc48..d1282a78ef 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -28,6 +28,7

[PATCH 06/13] migration: Use VMSTATE_INSTANCE_ID_ANY for s390 devices

2023-10-19 Thread Juan Quintela
Just with make check I can see that we can have more than one of this devices, so use ANY. ok 5 /s390x/device/introspect/abstract-interfaces ... Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered exit status 1

[PATCH 07/13] RFC migration: icp/server is a mess

2023-10-19 Thread Juan Quintela
Current code does: - register pre_2_10_vmstate_dummy_icp with "icp/server" and instance dependinfg on cpu number - for newer machines, it register vmstate_icp with "icp/server" name and instance 0 - now it unregisters "icp/server" for the 1st instance. This is wrong at many levels: - we

[PATCH 10/13] migration: Improve example and documentation of vmstate_register()

2023-10-19 Thread Juan Quintela
Signed-off-by: Juan Quintela --- docs/devel/migration.rst | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst index c3e1400c0c..a9fde75862 100644 --- a/docs/devel/migration.rst +++ b/docs/devel/migration.rst @@

[PATCH 09/13] migration: Check in savevm_state_handler_insert for dups

2023-10-19 Thread Juan Quintela
From: Peter Xu Before finally register one SaveStateEntry, we detect for duplicated entries. This could be helpful to notify us asap instead of get silent migration failures which could be hard to diagnose. For example, this patch will generate a message like this (if without previous fixes on

[PATCH 02/13] migration: Use vmstate_register_any()

2023-10-19 Thread Juan Quintela
This are the easiest cases, where we were already using VMSTATE_INSTANCE_ID_ANY. Signed-off-by: Juan Quintela --- backends/dbus-vmstate.c | 3 +-- backends/tpm/tpm_emulator.c | 3 +-- hw/i2c/core.c | 2 +- hw/input/adb.c | 2 +- hw/input/ads7846.c | 2 +-

[PATCH 01/13] migration: Create vmstate_register_any()

2023-10-19 Thread Juan Quintela
We have lots of cases where we are using an instance_id==0 when we should be using VMSTATE_INSTANCE_ID_ANY (-1). Basically everything that can have more than one needs to have a proper instance_id or -1 and the system will take one for it. vmstate_register_any(): We register with -1.

[PATCH 03/13] migration: Use vmstate_register_any() for isa-ide

2023-10-19 Thread Juan Quintela
Otherwise qom-test fails. ok 4 /i386/qom/x-remote qemu-system-i386: savevm_state_handler_insert: Detected duplicate SaveStateEntry: id=isa-ide, instance_id=0x0 Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered

[PATCH 00/13] migration: Check for duplicates on vmstate_register()

2023-10-19 Thread Juan Quintela
Hi This series are based in a patch from Peter than check if a we try to register the same device with the same instance_id more than once. It was not merged when he sent it because it broke "make check". So I fixed all devices to be able to merge it. - I create vmstate_register_any(), its the

[PULL v2 71/78] vhost-user: fix lost reconnect

2023-10-19 Thread Michael S. Tsirkin
From: Li Feng When the vhost-user is reconnecting to the backend, and if the vhost-user fails at the get_features in vhost_dev_init(), then the reconnect will fail and it will not be retriggered forever. The reason is: When the vhost-user fails at get_features, the vhost_dev_cleanup will be

[PULL v2 68/78] vhost: move and rename the conn retry times

2023-10-19 Thread Michael S. Tsirkin
From: Li Feng Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz Message-Id: <20231009044735.941655-3-fen...@smartx.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost.h | 2 ++

[PATCH v2 20/24] hw/xenpv: fix '-nic' support for xen-net-device

2023-10-19 Thread David Woodhouse
From: David Woodhouse I can't see how this has ever worked. If I start with the simple attempt "-nic user,model=xen", it creates a device with index -1 because it's assuming that it'll be attached to a hubport. So it creates a frontend at e.g. "/local/domain/84/device/vif/-1" and the guest fails

[PATCH v2 01/24] i386/xen: Don't advertise XENFEAT_supervisor_mode_kernel

2023-10-19 Thread David Woodhouse
From: David Woodhouse This confuses lscpu into thinking it's running in PVH mode. Fixes: bedcc139248 ("i386/xen: implement HYPERVISOR_xen_version") Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH v2 10/24] hw/xen: populate store frontend nodes with XenStore PFN/port

2023-10-19 Thread David Woodhouse
From: David Woodhouse This is kind of redundant since without being able to get these through some other method (HVMOP_get_param) the guest wouldn't be able to access XenStore in order to find them. But Xen populates them, and it does allow guests to *rebind* to the event channel port after a

[PATCH v2 12/24] hw/xen: add get_frontend_path() method to XenDeviceClass

2023-10-19 Thread David Woodhouse
From: David Woodhouse The primary Xen console is special. The guest's side is set up for it by the toolstack automatically and not by the standard PV init sequence. Accordingly, its *frontend* doesn't appear in …/device/console/0 either; instead it appears under …/console in the guest's

[PATCH v2 15/24] hw/xen: add support for Xen primary console in emulated mode

2023-10-19 Thread David Woodhouse
From: David Woodhouse The primary console is special because the toolstack maps a page at a fixed GFN and also allocates the guest-side event channel. Add support for that in emulated mode, so that we can have a primary console. Add a *very* rudimentary stub of foriegnmem ops for emulated mode,

[PATCH v2 03/24] hw/xen: select kernel mode for per-vCPU event channel upcall vector

2023-10-19 Thread David Woodhouse
From: David Woodhouse A guest which has configured the per-vCPU upcall vector may set the HVM_PARAM_CALLBACK_IRQ param to fairly much anything other than zero. For example, Linux v6.0+ after commit b1c3497e604 ("x86/xen: Add support for HVMOP_set_evtchn_upcall_vector") will just do this after

[PATCH v2 22/24] tests/avocado: switch to using xen-net-device for Xen guest tests

2023-10-19 Thread David Woodhouse
From: David Woodhouse Fix the filename in the MAINTAINERS file too. Signed-off-by: David Woodhouse --- MAINTAINERS| 2 +- tests/avocado/kvm_xen_guest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index

[PATCH v2 05/24] hw/xen: fix XenStore watch delivery to guest

2023-10-19 Thread David Woodhouse
From: David Woodhouse When fire_watch_cb() found the response buffer empty, it would call deliver_watch() to generate the XS_WATCH_EVENT message in the response buffer and send an event channel notification to the guest… without actually *copying* the response buffer into the ring. So there was

[PATCH v2 11/24] hw/xen: automatically assign device index to block devices

2023-10-19 Thread David Woodhouse
From: David Woodhouse There's no need to force the user to assign a vdev. We can automatically assign one, starting at xvda and searching until we find the first disk name that's unused. This means we can now allow '-drive if=xen,file=xxx' to work without an explicit separate -driver argument,

[PATCH v2 09/24] i386/xen: advertise XEN_HVM_CPUID_UPCALL_VECTOR in CPUID

2023-10-19 Thread David Woodhouse
From: David Woodhouse This will allow Linux guests (since v6.0) to use the per-vCPU upcall vector delivered as MSI through the local APIC. Signed-off-by: David Woodhouse --- target/i386/kvm/kvm.c | 4 1 file changed, 4 insertions(+) diff --git a/target/i386/kvm/kvm.c

[PATCH v2 07/24] hw/xen: Clean up event channel 'type_val' handling to use union

2023-10-19 Thread David Woodhouse
From: David Woodhouse A previous implementation of this stuff used a 64-bit field for all of the port information (vcpu/type/type_val) and did atomic exchanges on them. When I implemented that in Qemu I regretted my life choices and just kept it simple with locking instead. So there's no need

[PATCH v2 24/24] docs: update Xen-on-KVM documentation

2023-10-19 Thread David Woodhouse
From: David Woodhouse Add notes about console and network support, and how to launch PV guests. Clean up the disk configuration examples now that that's simpler, and remove the comment about IDE unplug on q35/AHCI now that it's fixed. Signed-off-by: David Woodhouse ---

[PATCH v2 02/24] i386/xen: fix per-vCPU upcall vector for Xen emulation

2023-10-19 Thread David Woodhouse
From: David Woodhouse The per-vCPU upcall vector support had two problems. Firstly it was using the wrong hypercall argument and would always return -EFAULT. And secondly it was using the wrong ioctl() to pass the vector to the kernel and thus the *kernel* would always return -EINVAL. Linux

[PATCH v2 17/24] hw/xen: only remove peers of PCI NICs on unplug

2023-10-19 Thread David Woodhouse
From: David Woodhouse When the Xen guest asks to unplug *emulated* NICs, it's kind of unhelpful also to unplug the peer of the *Xen* PV NIC. Signed-off-by: David Woodhouse --- hw/i386/xen/xen_platform.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git

[PATCH v2 23/24] xen-platform: unplug AHCI disks

2023-10-19 Thread David Woodhouse
From: David Woodhouse To support Xen guests using the Q35 chipset, the unplug protocol needs to also remove AHCI disks. Make pci_xen_ide_unplug() more generic, iterating over the children of the PCI device and destroying the "ide-hd" devices. That works the same for both AHCI and IDE, as does

[PATCH v2 16/24] hw/xen: handle soft reset for primary console

2023-10-19 Thread David Woodhouse
From: David Woodhouse On soft reset, the prinary console event channel needs to be rebound to the backend port (in the xen-console driver). We could put that into the xen-console driver itself, but it's slightly less ugly to keep it within the KVM/Xen code, by stashing the backend port# on event

[PATCH v2 13/24] hw/xen: do not repeatedly try to create a failing backend device

2023-10-19 Thread David Woodhouse
From: David Woodhouse If xen_backend_device_create() fails to instantiate a device, the XenBus code will just keep trying over and over again each time the bus is re-enumerated, as long as the backend appears online and in XenbusStateInitialising. The only thing which prevents the XenBus code

  1   2   >