Misc HW/UI patches for 2023-10-19
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 to fetch changes up to b1be65f6436f53618408d9c6fc6959054f5afed6:
ui/input: Constify QemuInputHandler structure (2023-10-19 23:13:28 +0200)
----------------------------------------------------------------
Misc hardware patch queue
- MAINTAINERS updates (Zoltan, Thomas)
- Fix cutils::get_relocated_path on Windows host (Akihiko)
- Housekeeping in Memory APIs (Marc-André)
- SDHCI fix for SDMA transfer (Lu, Jianxian)
- Various QOM/QDev/SysBus cleanups (Philippe)
- Constify QemuInputHandler structure (Philippe)
----------------------------------------------------------------
Akihiko Odaki (1):
cutils: Fix get_relocated_path on Windows
BALATON Zoltan (1):
MAINTAINERS: Split vt82c686 out of fuloong2e
Lu Gao (1):
hw/sd/sdhci: Block Size Register bits [14:12] is lost
Luc Michel (1):
mailmap: update email addresses for Luc Michel
Marc-André Lureau (2):
memory: drop needless argument
memory: follow Error API guidelines
Philippe Mathieu-Daudé (37):
buildsys: Only display Objective-C information when Objective-C is
used
hw/mips/malta: Use sdram_type enum from 'hw/i2c/smbus_eeprom.h' hw/mips: Merge 'hw/mips/cpudevs.h' with 'target/mips/cpu.h' hw/misc/mips_itu: Declare itc_reconfigure() in 'hw/misc/mips_itu.h' hw/misc/mips_itu: Make MIPSITUState target agnostic hw/pci-host/sh_pcic: Declare CPU QOM types using DEFINE_TYPES() macro hw/pci-host/sh_pcic: Correct PCI host / devfn#0 function names hw/pci-host/sh_pcic: Replace magic value by proper definition hw/sparc64/ebus: Access memory regions via pci_address_space_io() hw/acpi/pcihp: Clean up global variable shadowing in acpi_pcihp_init() hw/pci: Clean up global variable shadowing of address_space_io
variable
hw/s390x: Clean up global variable shadowing in
quiesce_powerdown_req()
hw/intc/apic: Use ERRP_GUARD() in apic_common_realize() hw/ppc/spapr_vio: Realize SPAPR_VIO_BRIDGE device before accessing it hw/ppc/pnv_xscom: Rename pnv_xscom_realize(Error **) ->
pnv_xscom_init()
hw/ppc/pnv_xscom: Move sysbus_mmio_map() call within pnv_xscom_init() hw/ppc/pnv_xscom: Do not use SysBus API to map local MMIO region hw/ppc/pnv: Do not use SysBus API to map local MMIO region hw/intc/spapr_xive: Move sysbus_init_mmio() calls around hw/intc/spapr_xive: Do not use SysBus API to map local MMIO region hw/audio/pcspk: Inline pcspk_init()
hw/i386/amd_iommu: Do not use SysBus API to map local MMIO region hw/i386/intel_iommu: Do not use SysBus API to map local MMIO region hw/misc/allwinner-dramc: Move sysbus_mmio_map call from init ->
realize
hw/misc/allwinner-dramc: Do not use SysBus API to map local MMIO
region
hw/pci-host/bonito: Do not use SysBus API to map local MMIO region hw/acpi: Realize ACPI_GED sysbus device before accessing it hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it hw/isa: Realize ISA bridge device before accessing it hw/s390x/css-bridge: Realize sysbus device before accessing it 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 VIRTIO_SCSI_COMMON() macro hw/dma: Declare link using static DEFINE_PROP_LINK() macro hw/net: Declare link using static DEFINE_PROP_LINK() macro ui/input: Constify QemuInputHandler structure
Thomas Huth (3):
MAINTAINERS: Add hw/input/lasips2.c to the HPPA machine section
MAINTAINERS: Add include/hw/intc/loongson_liointc.h to the Loongson-3
virt section
MAINTAINERS: Add include/hw/openrisc/ to the OpenRISC section
MAINTAINERS | 16 ++++++-- meson.build | 6 ++- include/hw/acpi/pcihp.h | 2 +- include/hw/audio/pcspk.h | 10 ----- include/hw/core/cpu.h | 4 +- include/hw/core/sysemu-cpu-ops.h | 2 +- include/hw/mips/cpudevs.h | 14 ------- include/hw/misc/mips_itu.h | 4 +- include/hw/pci/pci.h | 9 ++--- include/hw/ppc/pnv_xscom.h | 2 +- include/hw/virtio/virtio-input.h | 2 +- include/sysemu/memory_mapping.h | 2 +- include/ui/input.h | 2 +- target/i386/cpu.h | 2 +- target/mips/cpu.h | 7 ++-- chardev/msmouse.c | 2 +- chardev/wctablet.c | 2 +- hw/acpi/pcihp.c | 5 +-- hw/arm/virt.c | 5 +-- hw/block/vhost-user-blk.c | 4 +- hw/char/escc.c | 2 +- hw/core/cpu-sysemu.c | 6 +-- hw/display/virtio-gpu.c | 2 +- hw/display/xenfb.c | 6 +-- hw/dma/xilinx_axidma.c | 6 +-- hw/dma/xlnx-zdma.c | 7 +--- hw/dma/xlnx_csu_dma.c | 13 ++----- hw/i386/amd_iommu.c | 5 +-- hw/i386/intel_iommu.c | 5 +-- hw/i386/microvm.c | 2 +- hw/i386/pc.c | 4 +- hw/input/adb-kbd.c | 2 +- hw/input/hid.c | 6 +-- hw/input/ps2.c | 4 +- hw/input/virtio-input-hid.c | 8 ++-- hw/intc/apic_common.c | 4 ++ hw/intc/spapr_xive.c | 12 +++--- hw/isa/i82378.c | 5 ++- hw/isa/isa-bus.c | 11 +++++- hw/loongarch/virt.c | 2 +- hw/mips/cps.c | 1 - hw/mips/fuloong2e.c | 1 - hw/mips/jazz.c | 6 ++- hw/mips/loongson3_virt.c | 1 - hw/mips/malta.c | 3 +- hw/mips/mips_int.c | 1 - hw/mips/mipssim.c | 1 - hw/misc/allwinner-r40-dramc.c | 20 +++++----- hw/misc/mips_itu.c | 4 +- hw/net/cadence_gem.c | 7 +--- hw/pci-host/bonito.c | 30 +++++++-------- hw/pci-host/sh_pci.c | 57 +++++++++++++---------------- hw/pci/pci.c | 25 +++++-------- hw/ppc/pnv.c | 26 +++---------- hw/ppc/pnv_xscom.c | 5 +-- hw/ppc/spapr_vio.c | 3 +- hw/s390x/css-bridge.c | 7 ++-- hw/s390x/sclpquiesce.c | 8 ++-- hw/scsi/virtio-scsi.c | 2 +- hw/sd/sdhci.c | 15 ++++++-- hw/sparc64/sun4u.c | 8 ++-- hw/virtio/virtio-pmem.c | 5 +-- system/memory_mapping.c | 17 ++++----- target/i386/arch_memory_mapping.c | 6 ++- target/mips/sysemu/cp0_timer.c | 1 - target/mips/tcg/sysemu/cp0_helper.c | 1 + target/mips/tcg/sysemu/tlb_helper.c | 1 - ui/input-legacy.c | 2 +- ui/input.c | 4 +- ui/vdagent.c | 2 +- util/cutils.c | 18 +++++---- .mailmap | 3 ++ 72 files changed, 232 insertions(+), 273 deletions(-) delete mode 100644 include/hw/mips/cpudevs.h
Signature · 1 line
2.41.0
[PULL 01/46] mailmap: update email addresses for Luc Michel
From: Luc Michel <[email protected]>
Map my old and now invalid work email addresses to my personal one.
Message-ID: <[email protected]>
--- .mailmap | 3 +++ 1 file changed, 3 insertions(+)
.mailmap +3 -0
@@ -81,6 +81,9 @@ Huacai Chen <[email protected]> <[email protected]> James Hogan <[email protected]> <[email protected]> Leif Lindholm <[email protected]> <[email protected]> Leif Lindholm <[email protected]> <[email protected]> +Luc Michel <[email protected]> <[email protected]> +Luc Michel <[email protected]> <[email protected]> +Luc Michel <[email protected]> <[email protected]> Radoslaw Biernacki <[email protected]> <[email protected]> Paul Brook <[email protected]> <[email protected]> Paul Burton <[email protected]> <[email protected]>
Signature · 1 line
2.41.0
[PULL 04/46] MAINTAINERS: Add include/hw/intc/loongson_liointc.h to the Loongson-3 virt section
In reply to Philippe Mathieu-DaudéFrom: Thomas Huth <[email protected]>
The corresponding .c file is already listed here, so we should mention the header here, too.
Message-ID: <[email protected]>
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -1336,6 +1336,7 @@ F: hw/intc/loongson_liointc.c F: hw/mips/loongson3_bootp.c F: hw/mips/loongson3_bootp.h F: hw/mips/loongson3_virt.c +F: include/hw/intc/loongson_liointc.h F: tests/avocado/machine_mips_loongson3v.py Boston
Signature · 1 line
2.41.0
[PULL 07/46] buildsys: Only display Objective-C information when Objective-C is used
In reply to 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 Objective-C informations on Darwin, display them when Objective-C is discovered.
Message-Id: <[email protected]>
--- meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
meson.build +4 -2
@@ -4087,8 +4087,10 @@ if 'cpp' in all_languages else summary_info += {'C++ compiler': false} endif -if targetos == 'darwin' +if 'objc' in all_languages summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())} +else + summary_info += {'Objective-C compiler': false} endif option_cflags = (get_option('debug') ? ['-g'] : []) if get_option('optimization') != 'plain'
@@ -4098,7 +4100,7 @@ summary_info += {'CFLAGS': ' '.join(get_option('c_args') + option_cfl if 'cpp' in all_languages summary_info += {'CXXFLAGS': ' '.join(get_option('cpp_args') + option_cflags)} endif -if targetos == 'darwin' +if 'objc' in all_languages summary_info += {'OBJCFLAGS': ' '.join(get_option('objc_args') + option_cflags)} endif link_args = get_option('c_link_args')
Signature · 1 line
2.41.0
[PULL 10/46] hw/sd/sdhci: Block Size Register bits [14:12] is lost
In reply to Philippe Mathieu-DaudéFrom: Lu Gao <[email protected]>
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 Buffer Boundary settings.
Message-ID: <[email protected]>
--- hw/sd/sdhci.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
hw/sd/sdhci.c +11 -4
@@ -321,6 +321,8 @@ static void sdhci_poweron_reset(DeviceState *dev)static void sdhci_data_transfer (void *opaque); +#define BLOCK_SIZE_MASK (4 * KiB - 1) +static void sdhci_send_command (SDHCIState *s) {SDRequest request;
@@ -371,7 +373,8 @@ static void sdhci_send_command(SDHCIState *s)sdhci_update_irq (s); -if (!timeout && s->blksize && (s->cmdreg &SDHC_CMD_DATA_PRESENT )) { +if (!timeout && (s->blksize &BLOCK_SIZE_MASK ) && + (s->cmdreg &SDHC_CMD_DATA_PRESENT )) { s->data_count =0 ;sdhci_data_transfer (s); }
@@ -406,7 +409,6 @@ static void sdhci_end_transfer(SDHCIState *s)/* * Programmed i/o data transfer */ -#define BLOCK_SIZE_MASK (4 * KiB - 1)/* Fill host controller's read buffer with BLKSIZE bytes of data from card */ static void sdhci_read_block_from_card (SDHCIState *s)
@@ -1154,7 +1156,8 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) s->sdmasysad = (s->sdmasysad & mask) | value;MASKED_WRITE (s->sdmasysad, mask, value);/* Writing to last byte of sdmasysad might trigger transfer */ -if (!(mask &0xFF000000 ) && s->blkcnt && s->blksize && +if (!(mask &0xFF000000 ) && s->blkcnt && + (s->blksize &BLOCK_SIZE_MASK ) &&SDHC_DMA_TYPE (s->hostctl1) ==SDHC_CTRL_SDMA ) {if (s->trnmod &SDHC_TRNS_MULTI ) {sdhci_sdma_transfer_multi_blocks (s);
@@ -1168,7 +1171,11 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)if (!TRANSFERRING_DATA (s->prnsts)) {uint16_t blksize = s->blksize; -MASKED_WRITE (s->blksize, mask,extract32 (value,0 ,12 )); +/* +* [14:12] SDMA Buffer Boundary +* [11:00] Transfer Block Size +*/ +MASKED_WRITE (s->blksize, mask,extract32 (value,0 ,15 ));MASKED_WRITE (s->blkcnt, mask >>16 , value >>16 );/* Limit block size to the maximum buffer size */
Signature · 1 line
2.41.0
[PULL 05/46] MAINTAINERS: Add include/hw/openrisc/ to the OpenRISC section
In reply to Philippe Mathieu-DaudéFrom: Thomas Huth <[email protected]>
hw/openrisc/ is already listed here, so we should mention the folder for the headers here, too.
Message-ID: <[email protected]>
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -295,6 +295,7 @@ S: Odd Fixes F: docs/system/openrisc/cpu-features.rst F: target/openrisc/ F: hw/openrisc/ +F: include/hw/openrisc/ F: tests/tcg/openrisc/ PowerPC TCG CPUs
Signature · 1 line
2.41.0
[PULL 16/46] hw/pci-host/sh_pcic: Correct PCI host / devfn#0 function names
In reply to Philippe Mathieu-DaudéHost bridge device and PCI function #0 are inverted.
Message-Id: <[email protected]>
--- hw/pci-host/sh_pci.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
hw/pci-host/sh_pci.c +8 -8
@@ -116,7 +116,7 @@ static void sh_pci_set_irq(void *opaque, int irq_num, int level)qemu_set_irq (pic[irq_num], level); } -static void sh_pci_device_realize (DeviceState *dev,Error **errp) +static void sh_pcic_host_realize (DeviceState *dev,Error **errp) {SysBusDevice *sbd =SYS_BUS_DEVICE (dev);SHPCIState *s =SH_PCI_HOST_BRIDGE (dev);
@@ -145,19 +145,19 @@ static void sh_pci_device_realize(DeviceState *dev, Error **errp) s->dev =pci_create_simple (phb->bus,PCI_DEVFN (0 ,0 ),"sh_pci_host" ); } -static void sh_pci_host_realize (PCIDevice *d,Error **errp) +static void sh_pcic_pci_realize (PCIDevice *d,Error **errp) {pci_set_word (d->config +PCI_COMMAND ,PCI_COMMAND_WAIT );pci_set_word (d->config +PCI_STATUS ,PCI_STATUS_CAP_LIST |PCI_STATUS_FAST_BACK |PCI_STATUS_DEVSEL_MEDIUM ); } -static void sh_pci_host_class_init (ObjectClass *klass,void *data) +static void sh_pcic_pci_class_init (ObjectClass *klass,void *data) {PCIDeviceClass *k =PCI_DEVICE_CLASS (klass);DeviceClass *dc =DEVICE_CLASS (klass); - k->realize = sh_pci_host_realize; + k->realize = sh_pcic_pci_realize; k->vendor_id =PCI_VENDOR_ID_HITACHI ; k->device_id =PCI_DEVICE_ID_HITACHI_SH7751R ;/*
@@ -167,11 +167,11 @@ static void sh_pci_host_class_init(ObjectClass *klass, void *data) dc->user_creatable = false; } -static void sh_pci_device_class_init (ObjectClass *klass,void *data) +static void sh_pcic_host_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->realize = sh_pci_device_realize; + dc->realize = sh_pcic_host_realize; }static const TypeInfo sh_pcic_types[] = {
@@ -179,12 +179,12 @@ static const TypeInfo sh_pcic_types[] = { .name = TYPE_SH_PCI_HOST_BRIDGE, .parent = TYPE_PCI_HOST_BRIDGE, .instance_size = sizeof(SHPCIState), - .class_init = sh_pci_device_class_init, + .class_init = sh_pcic_host_class_init, }, { .name = "sh_pci_host", .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), - .class_init = sh_pci_host_class_init, + .class_init = sh_pcic_pci_class_init, .interfaces = (InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
Signature · 1 line
2.41.0
[PULL 12/46] hw/mips: Merge 'hw/mips/cpudevs.h' with 'target/mips/cpu.h'
In reply to 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".
Message-Id: <[email protected]>
--- include/hw/mips/cpudevs.h | 14 -------------- target/mips/cpu.h | 4 +++- hw/mips/cps.c | 1 - hw/mips/fuloong2e.c | 1 - hw/mips/jazz.c | 1 - hw/mips/loongson3_virt.c | 1 - hw/mips/malta.c | 1 - hw/mips/mips_int.c | 1 - hw/mips/mipssim.c | 1 - target/mips/sysemu/cp0_timer.c | 1 - target/mips/tcg/sysemu/tlb_helper.c | 1 - 11 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 include/hw/mips/cpudevs.h
include/hw/mips/cpudevs.h deleted +0 -14
@@ -1,14 +0,0 @@ -#ifndef HW_MIPS_CPUDEVS_H -#define HW_MIPS_CPUDEVS_H - -#include "target/mips/cpu-qom.h" - -/* Definitions for MIPS CPU internal devices. */ - -/* mips_int.c */ -void cpu_mips_irq_init_cpu (MIPSCPU *cpu); - -/* mips_timer.c */ -void cpu_mips_clock_init (MIPSCPU *cpu); - -#endif
target/mips/cpu.h +3 -1
@@ -1345,8 +1345,10 @@ uint64_t cpu_mips_phys_to_kseg1(void *opaque, uint64_t addr);#if !defined(CONFIG_USER_ONLY ) -/* mips_int.c */ +/* HW declaration specific to the MIPS target */ void cpu_mips_soft_irq (CPUMIPSState *env,int irq,int level); +void cpu_mips_irq_init_cpu (MIPSCPU *cpu); +void cpu_mips_clock_init (MIPSCPU *cpu);/* mips_itu.c */ void itc_reconfigure (struct MIPSITUState *tag);
hw/mips/cps.c +0 -1
@@ -24,7 +24,6 @@#include "hw/mips/mips.h" #include "hw/qdev-clock.h" #include "hw/qdev-properties.h" -#include "hw/mips/cpudevs.h" #include "sysemu/kvm.h" #include "sysemu/reset.h"
hw/mips/fuloong2e.c +0 -1
@@ -30,7 +30,6 @@#include "hw/block/flash.h" #include "hw/mips/mips.h" #include "hw/mips/bootloader.h" -#include "hw/mips/cpudevs.h" #include "hw/pci/pci.h" #include "hw/loader.h" #include "hw/ide/pci.h"
hw/mips/jazz.c +0 -1
@@ -26,7 +26,6 @@#include "qemu/datadir.h" #include "hw/clock.h" #include "hw/mips/mips.h" -#include "hw/mips/cpudevs.h" #include "hw/intc/i8259.h" #include "hw/dma/i8257.h" #include "hw/char/serial.h"
hw/mips/loongson3_virt.c +0 -1
@@ -32,7 +32,6 @@#include "hw/char/serial.h" #include "hw/intc/loongson_liointc.h" #include "hw/mips/mips.h" -#include "hw/mips/cpudevs.h" #include "hw/mips/fw_cfg.h" #include "hw/mips/loongson3_bootp.h" #include "hw/misc/unimp.h"
hw/mips/malta.c +0 -1
@@ -37,7 +37,6 @@#include "hw/block/flash.h" #include "hw/mips/mips.h" #include "hw/mips/bootloader.h" -#include "hw/mips/cpudevs.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "qemu/log.h"
hw/mips/mips_int.c +0 -1
@@ -23,7 +23,6 @@#include "qemu/osdep.h" #include "qemu/main-loop.h" #include "hw/irq.h" -#include "hw/mips/cpudevs.h" #include "sysemu/kvm.h" #include "kvm_mips.h"
hw/mips/mipssim.c +0 -1
@@ -30,7 +30,6 @@#include "qemu/datadir.h" #include "hw/clock.h" #include "hw/mips/mips.h" -#include "hw/mips/cpudevs.h" #include "hw/char/serial.h" #include "hw/isa/isa.h" #include "net/net.h"
target/mips/sysemu/cp0_timer.c +0 -1
@@ -22,7 +22,6 @@#include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/mips/cpudevs.h" #include "qemu/timer.h" #include "sysemu/kvm.h" #include "internal.h"
target/mips/tcg/sysemu/tlb_helper.c +0 -1
@@ -24,7 +24,6 @@#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/log.h" -#include "hw/mips/cpudevs.h" #include "exec/helper-proto.h" /* TLB management */
Signature · 1 line
2.41.0
[PULL 24/46] hw/ppc/pnv_xscom: Rename pnv_xscom_realize(Error **) -> pnv_xscom_init()
In reply to 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.
Message-Id: <[email protected]>
--- include/hw/ppc/pnv_xscom.h | 2 +- hw/ppc/pnv.c | 18 +++--------------- hw/ppc/pnv_xscom.c | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-)
include/hw/ppc/pnv_xscom.h +1 -1
@@ -170,7 +170,7 @@ struct PnvXScomInterfaceClass {#define PNV10_XSCOM_PEC_PCI_BASE 0x8010800/* index goes upwards ... */ #define PNV10_XSCOM_PEC_PCI_SIZE 0x200 -void pnv_xscom_realize (PnvChip *chip,uint64_t size,Error **errp); +void pnv_xscom_init (PnvChip *chip,uint64_t size);int pnv_dt_xscom (PnvChip *chip,void *fdt,int root_offset,uint64_t xscom_base,uint64_t xscom_size,const char *compat,int compat_size);
hw/ppc/pnv.c +3 -15
@@ -1249,11 +1249,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)assert (chip8->xics);/* XSCOM bridge is first */ -pnv_xscom_realize (chip,PNV_XSCOM_SIZE , &local_err); -if (local_err) { -error_propagate (errp, local_err); -return ; - } +pnv_xscom_init (chip,PNV_XSCOM_SIZE );sysbus_mmio_map (SYS_BUS_DEVICE (chip),0 ,PNV_XSCOM_BASE (chip)); pcc->parent_realize (dev, &local_err);
@@ -1512,11 +1508,7 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)Error *local_err =NULL ;/* XSCOM bridge is first */ -pnv_xscom_realize (chip,PNV9_XSCOM_SIZE , &local_err); -if (local_err) { -error_propagate (errp, local_err); -return ; - } +pnv_xscom_init (chip,PNV9_XSCOM_SIZE );sysbus_mmio_map (SYS_BUS_DEVICE (chip),0 ,PNV9_XSCOM_BASE (chip)); pcc->parent_realize (dev, &local_err);
@@ -1727,11 +1719,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)Error *local_err =NULL ;/* XSCOM bridge is first */ -pnv_xscom_realize (chip,PNV10_XSCOM_SIZE , &local_err); -if (local_err) { -error_propagate (errp, local_err); -return ; - } +pnv_xscom_init (chip,PNV10_XSCOM_SIZE );sysbus_mmio_map (SYS_BUS_DEVICE (chip),0 ,PNV10_XSCOM_BASE (chip)); pcc->parent_realize (dev, &local_err);
hw/ppc/pnv_xscom.c +1 -1
@@ -221,7 +221,7 @@ const MemoryRegionOps pnv_xscom_ops = { .endianness = DEVICE_BIG_ENDIAN, }; -void pnv_xscom_realize (PnvChip *chip,uint64_t size,Error **errp) +void pnv_xscom_init (PnvChip *chip,uint64_t size) {SysBusDevice *sbd =SYS_BUS_DEVICE (chip);char *name;
Signature · 1 line
2.41.0
[PULL 13/46] hw/misc/mips_itu: Declare itc_reconfigure() in 'hw/misc/mips_itu.h'
In reply to Philippe Mathieu-DaudéWe already provide "hw/misc/mips_itu.h" to declare prototype related to MIPSITUState. Move itc_reconfigure() declaration there.
Message-Id: <[email protected]>
--- include/hw/misc/mips_itu.h | 2 ++ target/mips/cpu.h | 3 --- target/mips/tcg/sysemu/cp0_helper.c | 1 + 3 files changed, 3 insertions(+), 3 deletions(-)
include/hw/misc/mips_itu.h +2 -0
@@ -79,4 +79,6 @@ struct MIPSITUState {/* Get ITC Configuration Tag memory region. */ MemoryRegion *mips_itu_get_tag_region (MIPSITUState *itu); +void itc_reconfigure (struct MIPSITUState *tag); +#endif /* MIPS_ITU_H */
target/mips/cpu.h +0 -3
@@ -1350,9 +1350,6 @@ void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level);void cpu_mips_irq_init_cpu (MIPSCPU *cpu);void cpu_mips_clock_init (MIPSCPU *cpu); -/* mips_itu.c */ -void itc_reconfigure (struct MIPSITUState *tag); -#endif /* !CONFIG_USER_ONLY */ /* helper.c */
target/mips/tcg/sysemu/cp0_helper.c +1 -0
@@ -28,6 +28,7 @@#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" +#include "hw/misc/mips_itu.h" /* SMP helpers. */
Signature · 1 line
2.41.0
[PULL 08/46] memory: drop needless argument
In reply to Philippe Mathieu-DaudéFrom: Marc-André Lureau <[email protected]>
The argument is unused since commit bdc44640c ("cpu: Use QTAILQ for CPU list").
Message-ID: <[email protected]>
--- system/memory_mapping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
system/memory_mapping.c +2 -2
@@ -291,7 +291,7 @@ void guest_phys_blocks_append(GuestPhysBlockList *list)memory_listener_unregister (&g.listener); } -static CPUState *find_paging_enabled_cpu (CPUState *start_cpu) +static CPUState *find_paging_enabled_cpu (void ) {CPUState *cpu;
@@ -312,7 +312,7 @@ void qemu_get_guest_memory_mapping(MemoryMappingList *list,GuestPhysBlock *block;ram_addr_t offset, length; - first_paging_enabled_cpu =find_paging_enabled_cpu (first_cpu); + first_paging_enabled_cpu =find_paging_enabled_cpu ();if (first_paging_enabled_cpu) {for (cpu = first_paging_enabled_cpu; cpu !=NULL ; cpu =CPU_NEXT (cpu)) {
Signature · 1 line
2.41.0
[PULL 11/46] hw/mips/malta: Use sdram_type enum from 'hw/i2c/smbus_eeprom.h'
In reply to 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 { SDR = 0x4, DDR2 = 0x8 } type;
^
include/hw/i2c/smbus_eeprom.h:33:19: note: previous declaration is here
enum sdram_type { SDR = 0x4, DDR = 0x7, DDR2 = 0x8 };
^Message-Id: <[email protected]>
--- hw/mips/malta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/malta.c +1 -1
@@ -206,7 +206,7 @@ static eeprom24c0x_t spd_eeprom = {static void generate_eeprom_spd (uint8_t *eeprom,ram_addr_t ram_size) { -enum {SDR =0x4 ,DDR2 =0x8 } type; +enum sdram_type type;uint8_t *spd = spd_eeprom.contents;uint8_t nbanks =0 ;uint16_t density =0 ;
Signature · 1 line
2.41.0
[PULL 28/46] hw/intc/spapr_xive: Move sysbus_init_mmio() calls around
In reply to Philippe Mathieu-DaudéIn order to make the next commit trivial, move sysbus_init_mmio() calls just before the corresponding sysbus_mmio_map() calls.
Message-Id: <[email protected]>
--- hw/intc/spapr_xive.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
hw/intc/spapr_xive.c +3 -3
@@ -316,7 +316,6 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp)if (!qdev_realize (DEVICE (xsrc),NULL , errp)) {return ; } -sysbus_init_mmio (SYS_BUS_DEVICE (xive), &xsrc->esb_mmio);/* * Initialize the END ESB source
@@ -328,7 +327,6 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp)if (!qdev_realize (DEVICE (end_xsrc),NULL , errp)) {return ; } -sysbus_init_mmio (SYS_BUS_DEVICE (xive), &end_xsrc->esb_mmio);/* Set the mapping address of the END ESB pages after the source ESBs */ xive->end_base = xive->vc_base +xive_source_esb_len (xsrc);
@@ -347,14 +345,16 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp)/* TIMA initialization */ memory_region_init_io (&xive->tm_mmio,OBJECT (xive), &spapr_xive_tm_ops, xive,"xive.tima" ,4ull <<TM_SHIFT ); -sysbus_init_mmio (SYS_BUS_DEVICE (xive), &xive->tm_mmio);/* * Map all regions. These will be enabled or disabled at reset and * can also be overridden by KVM memory regions if active */ +sysbus_init_mmio (SYS_BUS_DEVICE (xive), &xsrc->esb_mmio);sysbus_mmio_map (SYS_BUS_DEVICE (xive),0 , xive->vc_base); +sysbus_init_mmio (SYS_BUS_DEVICE (xive), &end_xsrc->esb_mmio);sysbus_mmio_map (SYS_BUS_DEVICE (xive),1 , xive->end_base); +sysbus_init_mmio (SYS_BUS_DEVICE (xive), &xive->tm_mmio);sysbus_mmio_map (SYS_BUS_DEVICE (xive),2 , xive->tm_base); }
Signature · 1 line
2.41.0
[PULL 09/46] memory: follow Error API guidelines
In reply to Philippe Mathieu-DaudéFrom: Marc-André Lureau <[email protected]>
Return true/false on success/failure.
Message-ID: <[email protected]>
--- include/hw/core/cpu.h | 4 +++- include/hw/core/sysemu-cpu-ops.h | 2 +- include/sysemu/memory_mapping.h | 2 +- target/i386/cpu.h | 2 +- hw/core/cpu-sysemu.c | 6 +++--- system/memory_mapping.c | 13 ++++++------- target/i386/arch_memory_mapping.c | 6 ++++-- 7 files changed, 19 insertions(+), 16 deletions(-)
include/hw/core/cpu.h +3 -1
@@ -618,8 +618,10 @@ bool cpu_paging_enabled(const CPUState *cpu);* @cpu: The CPU whose memory mappings are to be obtained. * @list: Where to write the memory mappings to. * @errp: Pointer for reporting an #Error. +* +* Returns: %true on success, %false otherwise. */ -void cpu_get_memory_mapping (CPUState *cpu,MemoryMappingList *list, +bool cpu_get_memory_mapping (CPUState *cpu,MemoryMappingList *list,Error **errp);#if !defined(CONFIG_USER_ONLY )
include/hw/core/sysemu-cpu-ops.h +1 -1
@@ -19,7 +19,7 @@ typedef struct SysemuCPUOps {/** * @get_memory_mapping: Callback for obtaining the memory mappings. */ -void (*get_memory_mapping)(CPUState *cpu,MemoryMappingList *list, +bool (*get_memory_mapping)(CPUState *cpu,MemoryMappingList *list,Error **errp);/** * @get_paging_enabled: Callback for inquiring whether paging is enabled.
include/sysemu/memory_mapping.h +1 -1
@@ -71,7 +71,7 @@ void guest_phys_blocks_free(GuestPhysBlockList *list);void guest_phys_blocks_init (GuestPhysBlockList *list);void guest_phys_blocks_append (GuestPhysBlockList *list); -void qemu_get_guest_memory_mapping (MemoryMappingList *list, +bool qemu_get_guest_memory_mapping (MemoryMappingList *list,const GuestPhysBlockList *guest_phys_blocks,Error **errp);
target/i386/cpu.h +1 -1
@@ -2055,7 +2055,7 @@ int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu,int x86_cpu_write_elf32_qemunote (WriteCoreDumpFunction f,CPUState *cpu,DumpState *s); -void x86_cpu_get_memory_mapping (CPUState *cpu,MemoryMappingList *list, +bool x86_cpu_get_memory_mapping (CPUState *cpu,MemoryMappingList *list,Error **errp);void x86_cpu_dump_state (CPUState *cs,FILE *f,int flags);
hw/core/cpu-sysemu.c +3 -3
@@ -34,17 +34,17 @@ bool cpu_paging_enabled(const CPUState *cpu)return false; } -void cpu_get_memory_mapping (CPUState *cpu,MemoryMappingList *list, +bool cpu_get_memory_mapping (CPUState *cpu,MemoryMappingList *list,Error **errp) {CPUClass *cc =CPU_GET_CLASS (cpu);if (cc->sysemu_ops->get_memory_mapping) { - cc->sysemu_ops->get_memory_mapping (cpu, list, errp); -return ; +return cc->sysemu_ops->get_memory_mapping (cpu, list, errp); }error_setg (errp,"Obtaining memory mappings is unsupported on this CPU." ); +return false; } hwaddr cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr,
system/memory_mapping.c +6 -7
@@ -304,10 +304,11 @@ static CPUState *find_paging_enabled_cpu(void)return NULL ; } -void qemu_get_guest_memory_mapping (MemoryMappingList *list, +bool qemu_get_guest_memory_mapping (MemoryMappingList *list,const GuestPhysBlockList *guest_phys_blocks,Error **errp) { +ERRP_GUARD ();CPUState *cpu, *first_paging_enabled_cpu;GuestPhysBlock *block;ram_addr_t offset, length;
@@ -316,14 +317,11 @@ void qemu_get_guest_memory_mapping(MemoryMappingList *list,if (first_paging_enabled_cpu) {for (cpu = first_paging_enabled_cpu; cpu !=NULL ; cpu =CPU_NEXT (cpu)) { -Error *err =NULL ; -cpu_get_memory_mapping (cpu, list, &err); -if (err) { -error_propagate (errp, err); -return ; +if (!cpu_get_memory_mapping (cpu, list, errp)) { +return false; } } -return ; +return true; }/*
@@ -335,6 +333,7 @@ void qemu_get_guest_memory_mapping(MemoryMappingList *list, length = block->target_end - block->target_start;create_new_memory_mapping (list, offset, offset, length); } +return true; } void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list,
target/i386/arch_memory_mapping.c +4 -2
@@ -266,7 +266,7 @@ static void walk_pml5e(MemoryMappingList *list, AddressSpace *as, }#endif -void x86_cpu_get_memory_mapping (CPUState *cs,MemoryMappingList *list, +bool x86_cpu_get_memory_mapping (CPUState *cs,MemoryMappingList *list,Error **errp) {X86CPU *cpu =X86_CPU (cs);
@@ -275,7 +275,7 @@ void x86_cpu_get_memory_mapping(CPUState *cs, MemoryMappingList *list,if (!cpu_paging_enabled (cs)) {/* paging is disabled */ -return ; +return true; } a20_mask =x86_get_a20_mask (env);
@@ -310,5 +310,7 @@ void x86_cpu_get_memory_mapping(CPUState *cs, MemoryMappingList *list, pse = !!(env->cr[4 ] &CR4_PSE_MASK );walk_pde2 (list, cs->as, pde_addr, a20_mask, pse); } + +return true; }
Signature · 1 line
2.41.0
[PULL 03/46] MAINTAINERS: Add hw/input/lasips2.c to the HPPA machine section
In reply to Philippe Mathieu-DaudéFrom: Thomas Huth <[email protected]>
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.
Message-ID: <[email protected]>
--- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
@@ -1179,9 +1179,11 @@ R: Helge Deller <[email protected]> S: Odd Fixes F: configs/devices/hppa-softmmu/default.mak F: hw/hppa/ +F: hw/input/lasips2.c F: hw/net/*i82596* F: hw/misc/lasi.c F: hw/pci-host/dino.c +F: include/hw/input/lasips2.h F: include/hw/misc/lasi.h F: include/hw/net/lasi_82596.h F: include/hw/pci-host/dino.h
Signature · 1 line
2.41.0
[PULL 31/46] hw/i386/amd_iommu: Do not use SysBus API to map local MMIO region
In reply to 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 subregion;
@@
- sysbus_init_mmio(sbdev, subregion);
... when != sbdev - sysbus_mmio_map(sbdev, index, addr);
+ memory_region_add_subregion(get_system_memory(), addr, subregion);
Message-Id: <[email protected]>
--- hw/i386/amd_iommu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
hw/i386/amd_iommu.c +2 -3
@@ -1579,9 +1579,8 @@ static void amdvi_sysbus_realize(DeviceState *dev, Error **errp)/* set up MMIO */ memory_region_init_io (&s->mmio,OBJECT (s), &mmio_mem_ops, s,"amdvi-mmio" ,AMDVI_MMIO_SIZE ); - -sysbus_init_mmio (SYS_BUS_DEVICE (s), &s->mmio); -sysbus_mmio_map (SYS_BUS_DEVICE (s),0 ,AMDVI_BASE_ADDR ); +memory_region_add_subregion (get_system_memory (),AMDVI_BASE_ADDR , + &s->mmio);pci_setup_iommu (bus, amdvi_host_dma_iommu, s);amdvi_init (s); }
Signature · 1 line
2.41.0
[PULL 22/46] hw/intc/apic: Use ERRP_GUARD() in apic_common_realize()
In reply to Philippe Mathieu-DaudéAPICCommonClass::realize() is a DeviceRealize() handler which take an Error** parameter and can fail. Do not proceed further on failure.
Message-Id: <[email protected]>
--- hw/intc/apic_common.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/intc/apic_common.c +4 -0
@@ -257,6 +257,7 @@ static const VMStateDescription vmstate_apic_common;static void apic_common_realize (DeviceState *dev,Error **errp) { +ERRP_GUARD ();APICCommonState *s =APIC_COMMON (dev);APICCommonClass *info;static DeviceState *vapic;
@@ -267,6 +268,9 @@ static void apic_common_realize(DeviceState *dev, Error **errp) info =APIC_COMMON_GET_CLASS (s); info->realize (dev, errp); +if (*errp) { +return ; + }/* Note: We need at least 1M to map the VAPIC option ROM */ if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK &&
Signature · 1 line
2.41.0
[PULL 25/46] hw/ppc/pnv_xscom: Move sysbus_mmio_map() call within pnv_xscom_init()
In reply to Philippe Mathieu-DaudéIn order to make the next commit trivial, move sysbus_init_mmio() calls just before the corresponding sysbus_mmio_map() calls.
Message-Id: <[email protected]>
--- include/hw/ppc/pnv_xscom.h | 2 +- hw/ppc/pnv.c | 9 +++------ hw/ppc/pnv_xscom.c | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-)
include/hw/ppc/pnv_xscom.h +1 -1
@@ -170,7 +170,7 @@ struct PnvXScomInterfaceClass {#define PNV10_XSCOM_PEC_PCI_BASE 0x8010800/* index goes upwards ... */ #define PNV10_XSCOM_PEC_PCI_SIZE 0x200 -void pnv_xscom_init (PnvChip *chip,uint64_t size); +void pnv_xscom_init (PnvChip *chip,uint64_t size,hwaddr addr);int pnv_dt_xscom (PnvChip *chip,void *fdt,int root_offset,uint64_t xscom_base,uint64_t xscom_size,const char *compat,int compat_size);
hw/ppc/pnv.c +3 -6
@@ -1249,8 +1249,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)assert (chip8->xics);/* XSCOM bridge is first */ -pnv_xscom_init (chip,PNV_XSCOM_SIZE ); -sysbus_mmio_map (SYS_BUS_DEVICE (chip),0 ,PNV_XSCOM_BASE (chip)); +pnv_xscom_init (chip,PNV_XSCOM_SIZE ,PNV_XSCOM_BASE (chip)); pcc->parent_realize (dev, &local_err);if (local_err) {
@@ -1508,8 +1507,7 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)Error *local_err =NULL ;/* XSCOM bridge is first */ -pnv_xscom_init (chip,PNV9_XSCOM_SIZE ); -sysbus_mmio_map (SYS_BUS_DEVICE (chip),0 ,PNV9_XSCOM_BASE (chip)); +pnv_xscom_init (chip,PNV9_XSCOM_SIZE ,PNV9_XSCOM_BASE (chip)); pcc->parent_realize (dev, &local_err);if (local_err) {
@@ -1719,8 +1717,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)Error *local_err =NULL ;/* XSCOM bridge is first */ -pnv_xscom_init (chip,PNV10_XSCOM_SIZE ); -sysbus_mmio_map (SYS_BUS_DEVICE (chip),0 ,PNV10_XSCOM_BASE (chip)); +pnv_xscom_init (chip,PNV10_XSCOM_SIZE ,PNV10_XSCOM_BASE (chip)); pcc->parent_realize (dev, &local_err);if (local_err) {
hw/ppc/pnv_xscom.c +2 -1
@@ -221,7 +221,7 @@ const MemoryRegionOps pnv_xscom_ops = { .endianness = DEVICE_BIG_ENDIAN, }; -void pnv_xscom_init (PnvChip *chip,uint64_t size) +void pnv_xscom_init (PnvChip *chip,uint64_t size,hwaddr addr) {SysBusDevice *sbd =SYS_BUS_DEVICE (chip);char *name;
@@ -230,6 +230,7 @@ void pnv_xscom_init(PnvChip *chip, uint64_t size)memory_region_init_io (&chip->xscom_mmio,OBJECT (chip), &pnv_xscom_ops, chip, name, size);sysbus_init_mmio (sbd, &chip->xscom_mmio); +sysbus_mmio_map (sbd,0 , addr);memory_region_init (&chip->xscom,OBJECT (chip), name, size);address_space_init (&chip->xscom_as, &chip->xscom, name);
Signature · 1 line
2.41.0
[PULL 27/46] hw/ppc/pnv: Do not use SysBus API to map local MMIO region
In reply to 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 subregion;
@@
- sysbus_init_mmio(sbdev, subregion);
... when != sbdev - sysbus_mmio_map(sbdev, index, addr);
+ memory_region_add_subregion(get_system_memory(), addr, subregion);
Message-Id: <[email protected]>
--- hw/ppc/pnv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
hw/ppc/pnv.c +2 -3
@@ -1217,10 +1217,9 @@ static void pnv_chip_icp_realize(Pnv8Chip *chip8, Error **errp) name =g_strdup_printf ("icp-%x" , chip->chip_id);memory_region_init (&chip8->icp_mmio,OBJECT (chip), name,PNV_ICP_SIZE ); -sysbus_init_mmio (SYS_BUS_DEVICE (chip), &chip8->icp_mmio);g_free (name); - -sysbus_mmio_map (SYS_BUS_DEVICE (chip),1 ,PNV_ICP_BASE (chip)); +memory_region_add_subregion (get_system_memory (),PNV_ICP_BASE (chip), + &chip8->icp_mmio);/* Map the ICP registers for each thread */ for (i =0 ; i < chip->nr_cores; i++) {
Signature · 1 line
2.41.0
[PULL 19/46] hw/acpi/pcihp: Clean up global variable shadowing in acpi_pcihp_init()
In reply to 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 AddressSpace address_space_io;
^Message-Id: <[email protected]>
--- include/hw/acpi/pcihp.h | 2 +- hw/acpi/pcihp.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)
include/hw/acpi/pcihp.h +1 -1
@@ -56,7 +56,7 @@ typedef struct AcpiPciHpState { } AcpiPciHpState;void acpi_pcihp_init (Object *owner,AcpiPciHpState *,PCIBus *root, -MemoryRegion *address_space_io,uint16_t io_base); +MemoryRegion *io,uint16_t io_base);bool acpi_pcihp_is_hotpluggbale_bus (AcpiPciHpState *s,BusState *bus); void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev,
hw/acpi/pcihp.c +2 -3
@@ -496,8 +496,7 @@ static const MemoryRegionOps acpi_pcihp_io_ops = { };void acpi_pcihp_init (Object *owner,AcpiPciHpState *s,PCIBus *root_bus, -MemoryRegion *address_space_io, -uint16_t io_base) +MemoryRegion *io,uint16_t io_base) { s->io_len =ACPI_PCIHP_SIZE ; s->io_base = io_base;
@@ -506,7 +505,7 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus,memory_region_init_io (&s->io, owner, &acpi_pcihp_io_ops, s,"acpi-pci-hotplug" , s->io_len); -memory_region_add_subregion (address_space_io, s->io_base, &s->io); +memory_region_add_subregion (io, s->io_base, &s->io);object_property_add_uint16_ptr (owner,ACPI_PCIHP_IO_BASE_PROP , &s->io_base,OBJ_PROP_FLAG_READ );
Signature · 1 line
2.41.0
[PULL 34/46] hw/misc/allwinner-dramc: Do not use SysBus API to map local MMIO region
In reply to 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 subregion;
@@
- sysbus_init_mmio(sbdev, subregion);
... when != sbdev - sysbus_mmio_map(sbdev, index, addr);
+ memory_region_add_subregion(get_system_memory(),
+ addr, subregion);
@@
expression priority;
@@
- sysbus_init_mmio(sbdev, subregion);
... when != sbdev - sysbus_mmio_map_overlap(sbdev, index, addr, priority);
+ memory_region_add_subregion_overlap(get_system_memory(),
+ addr,
+ subregion, priority);
Message-Id: <[email protected]>
--- hw/misc/allwinner-r40-dramc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
hw/misc/allwinner-r40-dramc.c +6 -7
@@ -414,7 +414,6 @@ static void allwinner_r40_dramc_reset(DeviceState *dev)static void allwinner_r40_dramc_realize (DeviceState *dev,Error **errp) {AwR40DramCtlState *s =AW_R40_DRAMC (dev); -SysBusDevice *sbd =SYS_BUS_DEVICE (dev);if (!get_match_ddr (s->ram_size)) { error_report("%s: ram-size %u MiB is not supported",
@@ -422,23 +421,23 @@ static void allwinner_r40_dramc_realize(DeviceState *dev, Error **errp)exit (1 ); } -/* R40 support max 2G memory but we only support up to 1G now. index 3 */ +/* R40 support max 2G memory but we only support up to 1G now. */ memory_region_init_io (&s->detect_cells,OBJECT (s), &allwinner_r40_detect_ops, s,"DRAMCELLS" ,1 * GiB); -sysbus_init_mmio (sbd, &s->detect_cells); -sysbus_mmio_map_overlap (sbd,3 , s->ram_addr,10 ); +memory_region_add_subregion_overlap (get_system_memory (), s->ram_addr, + &s->detect_cells,10 );memory_region_set_enabled (&s->detect_cells, false);/* * We only support DRAM size up to 1G now, so prepare a high memory page -* after 1G for dualrank detect. index = 4 +* after 1G for dualrank detect. */ memory_region_init_io (&s->dram_high,OBJECT (s), &allwinner_r40_dualrank_detect_ops, s,"DRAMHIGH" , KiB); -sysbus_init_mmio (SYS_BUS_DEVICE (s), &s->dram_high); -sysbus_mmio_map (SYS_BUS_DEVICE (s),4 , s->ram_addr + GiB); +memory_region_add_subregion (get_system_memory (), s->ram_addr + GiB, + &s->dram_high); }static void allwinner_r40_dramc_init (Object *obj)
Signature · 1 line
2.41.0
[PULL 33/46] hw/misc/allwinner-dramc: Move sysbus_mmio_map call from init -> realize
In reply to 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().
Message-Id: <[email protected]>
--- hw/misc/allwinner-r40-dramc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
hw/misc/allwinner-r40-dramc.c +7 -8
@@ -414,6 +414,7 @@ static void allwinner_r40_dramc_reset(DeviceState *dev)static void allwinner_r40_dramc_realize (DeviceState *dev,Error **errp) {AwR40DramCtlState *s =AW_R40_DRAMC (dev); +SysBusDevice *sbd =SYS_BUS_DEVICE (dev);if (!get_match_ddr (s->ram_size)) { error_report("%s: ram-size %u MiB is not supported",
@@ -421,8 +422,12 @@ static void allwinner_r40_dramc_realize(DeviceState *dev, Error **errp)exit (1 ); } -/* detect_cells */ -sysbus_mmio_map_overlap (SYS_BUS_DEVICE (s),3 , s->ram_addr,10 ); +/* R40 support max 2G memory but we only support up to 1G now. index 3 */ +memory_region_init_io (&s->detect_cells,OBJECT (s), + &allwinner_r40_detect_ops, s, +"DRAMCELLS" ,1 * GiB); +sysbus_init_mmio (sbd, &s->detect_cells); +sysbus_mmio_map_overlap (sbd,3 , s->ram_addr,10 );memory_region_set_enabled (&s->detect_cells, false);/*
@@ -458,12 +463,6 @@ static void allwinner_r40_dramc_init(Object *obj) &allwinner_r40_dramphy_ops, s, "DRAMPHY", 4 * KiB);sysbus_init_mmio (sbd, &s->dramphy_iomem); - -/* R40 support max 2G memory but we only support up to 1G now. index 3 */ -memory_region_init_io (&s->detect_cells,OBJECT (s), - &allwinner_r40_detect_ops, s, -"DRAMCELLS" ,1 * GiB); -sysbus_init_mmio (sbd, &s->detect_cells); }static Property allwinner_r40_dramc_properties[] = {
Signature · 1 line
2.41.0
[PULL 29/46] hw/intc/spapr_xive: Do not use SysBus API to map local MMIO region
In reply to 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 subregion;
@@
- sysbus_init_mmio(sbdev, subregion);
... when != sbdev - sysbus_mmio_map(sbdev, index, addr);
+ memory_region_add_subregion(get_system_memory(), addr, subregion);
Message-Id: <[email protected]>
--- hw/intc/spapr_xive.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
hw/intc/spapr_xive.c +6 -6
@@ -350,12 +350,12 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp)* Map all regions. These will be enabled or disabled at reset and * can also be overridden by KVM memory regions if active */ -sysbus_init_mmio (SYS_BUS_DEVICE (xive), &xsrc->esb_mmio); -sysbus_mmio_map (SYS_BUS_DEVICE (xive),0 , xive->vc_base); -sysbus_init_mmio (SYS_BUS_DEVICE (xive), &end_xsrc->esb_mmio); -sysbus_mmio_map (SYS_BUS_DEVICE (xive),1 , xive->end_base); -sysbus_init_mmio (SYS_BUS_DEVICE (xive), &xive->tm_mmio); -sysbus_mmio_map (SYS_BUS_DEVICE (xive),2 , xive->tm_base); +memory_region_add_subregion (get_system_memory (), xive->vc_base, + &xsrc->esb_mmio); +memory_region_add_subregion (get_system_memory (), xive->end_base, + &end_xsrc->esb_mmio); +memory_region_add_subregion (get_system_memory (), xive->tm_base, + &xive->tm_mmio); } static int spapr_xive_get_eas(XiveRouter *xrtr, uint8_t eas_blk,
Signature · 1 line
2.41.0
[PULL 38/46] hw/isa: Realize ISA bridge device before accessing it
In reply to Philippe Mathieu-Daudéqbus_new() should not be called on unrealized device.
Message-Id: <[email protected]>
--- hw/isa/isa-bus.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
hw/isa/isa-bus.c +9 -2
@@ -52,18 +52,25 @@ static const TypeInfo isa_bus_info = {ISABus *isa_bus_new (DeviceState *dev,MemoryRegion * address_space,MemoryRegion *address_space_io,Error **errp) { +DeviceState *bridge =NULL ; +if (isabus) {error_setg (errp,"Can't create a second ISA bus" );return NULL ; }if (!dev) { - dev =qdev_new ("isabus-bridge" ); -sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal); + bridge =qdev_new ("isabus-bridge" ); + dev = bridge; } isabus =ISA_BUS (qbus_new (TYPE_ISA_BUS , dev,NULL )); isabus->address_space = address_space; isabus->address_space_io = address_space_io; + +if (bridge) { +sysbus_realize_and_unref (SYS_BUS_DEVICE (bridge), &error_fatal); + } +return isabus; }
Signature · 1 line
2.41.0
[PULL 15/46] hw/pci-host/sh_pcic: Declare CPU QOM types using DEFINE_TYPES() macro
In reply to 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.
Message-Id: <[email protected]>
--- hw/pci-host/sh_pci.c | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-)
hw/pci-host/sh_pci.c +17 -23
@@ -167,17 +167,6 @@ static void sh_pci_host_class_init(ObjectClass *klass, void *data) dc->user_creatable = false; } -static const TypeInfo sh_pci_host_info = { - .name ="sh_pci_host" , - .parent =TYPE_PCI_DEVICE , - .instance_size =sizeof (PCIDevice), - .class_init = sh_pci_host_class_init, - .interfaces = (InterfaceInfo []) { - {INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; -static void sh_pci_device_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);
@@ -185,17 +174,22 @@ static void sh_pci_device_class_init(ObjectClass *klass, void *data) dc->realize = sh_pci_device_realize; } -static const TypeInfo sh_pci_device_info = { - .name =TYPE_SH_PCI_HOST_BRIDGE , - .parent =TYPE_PCI_HOST_BRIDGE , - .instance_size =sizeof (SHPCIState), - .class_init = sh_pci_device_class_init, +static const TypeInfo sh_pcic_types[] = { + { + .name =TYPE_SH_PCI_HOST_BRIDGE , + .parent =TYPE_PCI_HOST_BRIDGE , + .instance_size =sizeof (SHPCIState), + .class_init = sh_pci_device_class_init, + }, { + .name ="sh_pci_host" , + .parent =TYPE_PCI_DEVICE , + .instance_size =sizeof (PCIDevice), + .class_init = sh_pci_host_class_init, + .interfaces = (InterfaceInfo []) { + {INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, + }, }; -static void sh_pci_register_types (void ) -{ -type_register_static (&sh_pci_device_info); -type_register_static (&sh_pci_host_info); -} - -type_init (sh_pci_register_types) +DEFINE_TYPES (sh_pcic_types)
Signature · 1 line
2.41.0
[PULL 23/46] hw/ppc/spapr_vio: Realize SPAPR_VIO_BRIDGE device before accessing it
In reply to Philippe Mathieu-Daudéqbus_new() should not be called on unrealized device.
Message-Id: <[email protected]>
--- hw/ppc/spapr_vio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/spapr_vio.c +2 -1
@@ -574,13 +574,14 @@ SpaprVioBus *spapr_vio_bus_init(void)/* Create bridge device */ dev =qdev_new (TYPE_SPAPR_VIO_BRIDGE ); -sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal);/* Create bus on bridge device */ qbus =qbus_new (TYPE_SPAPR_VIO_BUS , dev,"spapr-vio" ); bus =SPAPR_VIO_BUS (qbus); bus->next_reg =SPAPR_VIO_REG_BASE ; +sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal); +/* hcall-vio */ spapr_register_hypercall (H_VIO_SIGNAL , h_vio_signal);
Signature · 1 line
2.41.0
[PULL 46/46] ui/input: Constify QemuInputHandler structure
In reply to Philippe Mathieu-DaudéAccess to QemuInputHandlerState::handler are read-only.
Message-Id: <[email protected]>
--- include/hw/virtio/virtio-input.h | 2 +- include/ui/input.h | 2 +- chardev/msmouse.c | 2 +- chardev/wctablet.c | 2 +- hw/char/escc.c | 2 +- hw/display/xenfb.c | 6 +++--- hw/input/adb-kbd.c | 2 +- hw/input/hid.c | 6 +++--- hw/input/ps2.c | 4 ++-- hw/input/virtio-input-hid.c | 8 ++++---- ui/input-legacy.c | 2 +- ui/input.c | 4 ++-- ui/vdagent.c | 2 +- 13 files changed, 22 insertions(+), 22 deletions(-)
include/hw/virtio/virtio-input.h +1 -1
@@ -84,7 +84,7 @@ struct VirtIOInputHID {VirtIOInput parent_obj;char *display;uint32_t head; -QemuInputHandler *handler; +const QemuInputHandler *handler;QemuInputHandlerState *hs;int ledstate;bool wheel_axis;
include/ui/input.h +1 -1
@@ -30,7 +30,7 @@ struct QemuInputHandler { };QemuInputHandlerState *qemu_input_handler_register (DeviceState *dev, -QemuInputHandler *handler); +const QemuInputHandler *handler);void qemu_input_handler_activate (QemuInputHandlerState *s);void qemu_input_handler_deactivate (QemuInputHandlerState *s);void qemu_input_handler_unregister (QemuInputHandlerState *s);
chardev/msmouse.c +1 -1
@@ -171,7 +171,7 @@ static int msmouse_chr_write(struct Chardev *s, const uint8_t *buf, int len)return len; } -static QemuInputHandler msmouse_handler = { +static const QemuInputHandler msmouse_handler = { .name ="QEMU Microsoft Mouse" , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_REL , .event = msmouse_input_event,
chardev/wctablet.c +1 -1
@@ -178,7 +178,7 @@ static void wctablet_input_sync(DeviceState *dev) } } -static QemuInputHandler wctablet_handler = { +static const QemuInputHandler wctablet_handler = { .name ="QEMU Wacom Pen Tablet" , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_ABS , .event = wctablet_input_event,
hw/char/escc.c +1 -1
@@ -845,7 +845,7 @@ static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src,put_queue (s, keycode); } -static QemuInputHandler sunkbd_handler = { +static const QemuInputHandler sunkbd_handler = { .name ="sun keyboard" , .mask =INPUT_EVENT_MASK_KEY , .event = sunkbd_handle_event,
hw/display/xenfb.c +3 -3
@@ -321,20 +321,20 @@ static void xenfb_mouse_sync(DeviceState *dev) xenfb->wheel =0 ; } -static QemuInputHandler xenfb_keyboard = { +static const QemuInputHandler xenfb_keyboard = { .name ="Xen PV Keyboard" , .mask =INPUT_EVENT_MASK_KEY , .event = xenfb_key_event, }; -static QemuInputHandler xenfb_abs_mouse = { +static const QemuInputHandler xenfb_abs_mouse = { .name ="Xen PV Mouse" , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_ABS , .event = xenfb_mouse_event, .sync = xenfb_mouse_sync, }; -static QemuInputHandler xenfb_rel_mouse = { +static const QemuInputHandler xenfb_rel_mouse = { .name ="Xen PV Mouse" , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_REL , .event = xenfb_mouse_event,
hw/input/adb-kbd.c +1 -1
@@ -355,7 +355,7 @@ static void adb_kbd_reset(DeviceState *dev) s->count =0 ; } -static QemuInputHandler adb_keyboard_handler = { +static const QemuInputHandler adb_keyboard_handler = { .name ="QEMU ADB Keyboard" , .mask =INPUT_EVENT_MASK_KEY , .event = adb_keyboard_event,
hw/input/hid.c +3 -3
@@ -510,20 +510,20 @@ void hid_free(HIDState *hs)hid_del_idle_timer (hs); } -static QemuInputHandler hid_keyboard_handler = { +static const QemuInputHandler hid_keyboard_handler = { .name ="QEMU HID Keyboard" , .mask =INPUT_EVENT_MASK_KEY , .event = hid_keyboard_event, }; -static QemuInputHandler hid_mouse_handler = { +static const QemuInputHandler hid_mouse_handler = { .name ="QEMU HID Mouse" , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_REL , .event = hid_pointer_event, .sync = hid_pointer_sync, }; -static QemuInputHandler hid_tablet_handler = { +static const QemuInputHandler hid_tablet_handler = { .name ="QEMU HID Tablet" , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_ABS , .event = hid_pointer_event,
hw/input/ps2.c +2 -2
@@ -1231,7 +1231,7 @@ static const VMStateDescription vmstate_ps2_mouse = { } }; -static QemuInputHandler ps2_keyboard_handler = { +static const QemuInputHandler ps2_keyboard_handler = { .name ="QEMU PS/2 Keyboard" , .mask =INPUT_EVENT_MASK_KEY , .event = ps2_keyboard_event,
@@ -1242,7 +1242,7 @@ static void ps2_kbd_realize(DeviceState *dev, Error **errp)qemu_input_handler_register (dev, &ps2_keyboard_handler); } -static QemuInputHandler ps2_mouse_handler = { +static const QemuInputHandler ps2_mouse_handler = { .name ="QEMU PS/2 Mouse" , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_REL , .event = ps2_mouse_event,
hw/input/virtio-input-hid.c +4 -4
@@ -265,7 +265,7 @@ static const TypeInfo virtio_input_hid_info = {/* ----------------------------------------------------------------- */ -static QemuInputHandler virtio_keyboard_handler = { +static const QemuInputHandler virtio_keyboard_handler = { .name =VIRTIO_ID_NAME_KEYBOARD , .mask =INPUT_EVENT_MASK_KEY , .event = virtio_input_handle_event,
@@ -322,7 +322,7 @@ static const TypeInfo virtio_keyboard_info = {/* ----------------------------------------------------------------- */ -static QemuInputHandler virtio_mouse_handler = { +static const QemuInputHandler virtio_mouse_handler = { .name =VIRTIO_ID_NAME_MOUSE , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_REL , .event = virtio_input_handle_event,
@@ -416,7 +416,7 @@ static const TypeInfo virtio_mouse_info = {/* ----------------------------------------------------------------- */ -static QemuInputHandler virtio_tablet_handler = { +static const QemuInputHandler virtio_tablet_handler = { .name =VIRTIO_ID_NAME_TABLET , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_ABS , .event = virtio_input_handle_event,
@@ -541,7 +541,7 @@ static const TypeInfo virtio_tablet_info = {/* ----------------------------------------------------------------- */ -static QemuInputHandler virtio_multitouch_handler = { +static const QemuInputHandler virtio_multitouch_handler = { .name =VIRTIO_ID_NAME_MULTITOUCH , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_MTT , .event = virtio_input_handle_event,
ui/input-legacy.c +1 -1
@@ -127,7 +127,7 @@ static void legacy_kbd_event(DeviceState *dev, QemuConsole *src, } } -static QemuInputHandler legacy_kbd_handler = { +static const QemuInputHandler legacy_kbd_handler = { .name ="legacy-kbd" , .mask =INPUT_EVENT_MASK_KEY , .event = legacy_kbd_event,
ui/input.c +2 -2
@@ -10,7 +10,7 @@struct QemuInputHandlerState {DeviceState *dev; -QemuInputHandler *handler; +const QemuInputHandler *handler;int id;int events;QemuConsole *con;
@@ -46,7 +46,7 @@ static uint32_t queue_count;static uint32_t queue_limit =1024 ;QemuInputHandlerState *qemu_input_handler_register (DeviceState *dev, -QemuInputHandler *handler) +const QemuInputHandler *handler) {QemuInputHandlerState *s =g_new0 (QemuInputHandlerState,1 );static int id =1 ;
ui/vdagent.c +1 -1
@@ -297,7 +297,7 @@ static void vdagent_pointer_sync(DeviceState *dev) } } -static QemuInputHandler vdagent_mouse_handler = { +static const QemuInputHandler vdagent_mouse_handler = { .name ="vdagent mouse" , .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_ABS , .event = vdagent_pointer_event,
Signature · 1 line
2.41.0
[PULL 02/46] MAINTAINERS: Split vt82c686 out of fuloong2e
In reply to Philippe Mathieu-DaudéFrom: BALATON Zoltan <[email protected]>
The VIA south bridges are now mostly used by other machines not just fuloong2e so split off into a separate section and take maintainership.
Message-ID: <[email protected]>
--- MAINTAINERS | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
MAINTAINERS +9 -3
@@ -1322,10 +1322,7 @@ M: Philippe Mathieu-Daudé <[email protected]> R: Jiaxun Yang <[email protected]> S: Odd Fixes F: hw/mips/fuloong2e.c -F: hw/isa/vt82c686.c F: hw/pci-host/bonito.c -F: hw/usb/vt82c686-uhci-pci.c -F: include/hw/isa/vt82c686.h F: include/hw/pci-host/bonito.h F: tests/avocado/machine_mips_fuloong2e.py
@@ -2481,6 +2478,15 @@ S: Maintained F: hw/isa/piix4.c F: include/hw/southbridge/piix.h +VIA South Bridges (VT82C686B, VT8231) +M: BALATON Zoltan <[email protected]> +M: Philippe Mathieu-Daudé <[email protected]> +R: Jiaxun Yang <[email protected]> +S: Maintained +F: hw/isa/vt82c686.c +F: hw/usb/vt82c686-uhci-pci.c +F: include/hw/isa/vt82c686.h + Firmware configuration (fw_cfg) M: Philippe Mathieu-Daudé <[email protected]> R: Gerd Hoffmann <[email protected]>
Signature · 1 line
2.41.0
[PULL 17/46] hw/pci-host/sh_pcic: Replace magic value by proper definition
In reply to Philippe Mathieu-DaudéMessage-Id: <[email protected]>
--- hw/pci-host/sh_pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/pci-host/sh_pci.c +3 -2
@@ -40,7 +40,7 @@ struct SHPCIState {PCIHostState parent_obj;PCIDevice *dev; -qemu_irq irq[4 ]; +qemu_irq irq[PCI_NUM_PINS ];MemoryRegion memconfig_p4;MemoryRegion memconfig_a7;MemoryRegion isa;
@@ -131,7 +131,8 @@ static void sh_pcic_host_realize(DeviceState *dev, Error **errp) s->irq,get_system_memory (),get_system_io (), - PCI_DEVFN(0, 0), 4, TYPE_PCI_BUS); +PCI_DEVFN (0 ,0 ),PCI_NUM_PINS , + TYPE_PCI_BUS);memory_region_init_io (&s->memconfig_p4,OBJECT (s), &sh_pci_reg_ops, s,"sh_pci" ,0x224 ); memory_region_init_alias(&s->memconfig_a7, OBJECT(s), "sh_pci.2",
Signature · 1 line
2.41.0
[PULL 20/46] hw/pci: Clean up global variable shadowing of address_space_io variable
In reply to 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 in the global scope [-Werror,-Wshadow]
MemoryRegion *address_space_io,
^
hw/pci/pci.c:543:40: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
MemoryRegion *address_space_io,
^
hw/pci/pci.c:590:45: 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 AddressSpace address_space_io;
^Message-Id: <[email protected]>
--- include/hw/pci/pci.h | 9 +++------ hw/pci/pci.c | 25 +++++++++---------------- 2 files changed, 12 insertions(+), 22 deletions(-)
include/hw/pci/pci.h +3 -6
@@ -279,12 +279,10 @@ bool pci_bus_is_express(const PCIBus *bus);void pci_root_bus_init (PCIBus *bus,size_t bus_size,DeviceState *parent,const char *name, -MemoryRegion *address_space_mem, -MemoryRegion *address_space_io, +MemoryRegion *mem,MemoryRegion *io,uint8_t devfn_min,const char *typename);PCIBus *pci_root_bus_new (DeviceState *parent,const char *name, -MemoryRegion *address_space_mem, -MemoryRegion *address_space_io, +MemoryRegion *mem,MemoryRegion *io,uint8_t devfn_min,const char *typename);void pci_root_bus_cleanup (PCIBus *bus); void pci_bus_irqs(PCIBus *bus, pci_set_irq_fn set_irq,
@@ -304,8 +302,7 @@ int pci_swizzle_map_irq_fn(PCIDevice *pci_dev, int pin);PCIBus *pci_register_root_bus (DeviceState *parent,const char *name,pci_set_irq_fn set_irq,pci_map_irq_fn map_irq,void *irq_opaque, -MemoryRegion *address_space_mem, -MemoryRegion *address_space_io, +MemoryRegion *mem,MemoryRegion *io,uint8_t devfn_min,int nirq,const char *typename);void pci_unregister_root_bus (PCIBus *bus);
hw/pci/pci.c +9 -16
@@ -500,15 +500,14 @@ bool pci_bus_bypass_iommu(PCIBus *bus) }static void pci_root_bus_internal_init (PCIBus *bus,DeviceState *parent, -MemoryRegion *address_space_mem, -MemoryRegion *address_space_io, +MemoryRegion *mem,MemoryRegion *io,uint8_t devfn_min) {assert (PCI_FUNC (devfn_min) ==0 ); bus->devfn_min = devfn_min; bus->slot_reserved_mask =0x0 ; - bus->address_space_mem = address_space_mem; - bus->address_space_io = address_space_io; + bus->address_space_mem = mem; + bus->address_space_io = io; bus->flags |=PCI_BUS_IS_ROOT ;/* host bridge */
@@ -529,25 +528,21 @@ bool pci_bus_is_express(const PCIBus *bus)void pci_root_bus_init (PCIBus *bus,size_t bus_size,DeviceState *parent,const char *name, -MemoryRegion *address_space_mem, -MemoryRegion *address_space_io, +MemoryRegion *mem,MemoryRegion *io,uint8_t devfn_min,const char *typename) {qbus_init (bus, bus_size, typename, parent, name); -pci_root_bus_internal_init (bus, parent, address_space_mem, - address_space_io, devfn_min); +pci_root_bus_internal_init (bus, parent, mem, io, devfn_min); }PCIBus *pci_root_bus_new (DeviceState *parent,const char *name, -MemoryRegion *address_space_mem, -MemoryRegion *address_space_io, +MemoryRegion *mem,MemoryRegion *io,uint8_t devfn_min,const char *typename) {PCIBus *bus; bus =PCI_BUS (qbus_new (typename, parent, name)); -pci_root_bus_internal_init (bus, parent, address_space_mem, - address_space_io, devfn_min); +pci_root_bus_internal_init (bus, parent, mem, io, devfn_min);return bus; }
@@ -586,15 +581,13 @@ void pci_bus_irqs_cleanup(PCIBus *bus)PCIBus *pci_register_root_bus (DeviceState *parent,const char *name,pci_set_irq_fn set_irq,pci_map_irq_fn map_irq,void *irq_opaque, -MemoryRegion *address_space_mem, -MemoryRegion *address_space_io, +MemoryRegion *mem,MemoryRegion *io,uint8_t devfn_min,int nirq,const char *typename) {PCIBus *bus; - bus =pci_root_bus_new (parent, name, address_space_mem, - address_space_io, devfn_min, typename); + bus =pci_root_bus_new (parent, name, mem, io, devfn_min, typename);pci_bus_irqs (bus, set_irq, irq_opaque, nirq);pci_bus_map_irqs (bus, map_irq);return bus;
Signature · 1 line
2.41.0
[PULL 37/46] hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it
In reply to Philippe Mathieu-Daudésysbus_mmio_map() should not be called on unrealized device.
Message-Id: <[email protected]>
--- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/virt.c +1 -1
@@ -690,10 +690,10 @@ static void create_v2m(VirtMachineState *vms)DeviceState *dev; dev =qdev_new ("arm-gicv2m" ); -sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 , vms->memmap[VIRT_GIC_V2M ].base);qdev_prop_set_uint32 (dev,"base-spi" , irq);qdev_prop_set_uint32 (dev,"num-spi" ,NUM_GICV2M_SPIS );sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal); +sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 , vms->memmap[VIRT_GIC_V2M ].base);for (i =0 ; i <NUM_GICV2M_SPIS ; i++) { sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
Signature · 1 line
2.41.0
[PULL 44/46] hw/dma: Declare link using static DEFINE_PROP_LINK() macro
In reply to Philippe Mathieu-DaudéDeclare link statically using DEFINE_PROP_LINK().
Message-Id: <[email protected]>
--- hw/dma/xilinx_axidma.c | 6 ++---- hw/dma/xlnx-zdma.c | 7 ++----- hw/dma/xlnx_csu_dma.c | 13 ++++--------- 3 files changed, 8 insertions(+), 18 deletions(-)
hw/dma/xilinx_axidma.c +2 -4
@@ -577,10 +577,6 @@ static void xilinx_axidma_init(Object *obj)object_initialize_child (OBJECT (s),"axistream-control-connected-target" , &s->rx_control_dev,TYPE_XILINX_AXI_DMA_CONTROL_STREAM ); -object_property_add_link (obj,"dma" ,TYPE_MEMORY_REGION , - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, -OBJ_PROP_LINK_STRONG );sysbus_init_irq (sbd, &s->streams[0 ].irq);sysbus_init_irq (sbd, &s->streams[1 ].irq);
@@ -596,6 +592,8 @@ static Property axidma_properties[] = { tx_data_dev, TYPE_STREAM_SINK, StreamSink *),DEFINE_PROP_LINK ("axistream-control-connected" , XilinxAXIDMA, tx_control_dev, TYPE_STREAM_SINK, StreamSink *), +DEFINE_PROP_LINK ("dma" , XilinxAXIDMA, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), };
hw/dma/xlnx-zdma.c +2 -5
@@ -795,11 +795,6 @@ static void zdma_init(Object *obj) TYPE_XLNX_ZDMA, ZDMA_R_MAX * 4);sysbus_init_mmio (sbd, &s->iomem);sysbus_init_irq (sbd, &s->irq_zdma_ch_imr); - -object_property_add_link (obj,"dma" ,TYPE_MEMORY_REGION , - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, -OBJ_PROP_LINK_STRONG ); }static const VMStateDescription vmstate_zdma = {
@@ -817,6 +812,8 @@ static const VMStateDescription vmstate_zdma = {static Property zdma_props[] = {DEFINE_PROP_UINT32 ("bus-width" , XlnxZDMA, cfg.bus_width,64 ), +DEFINE_PROP_LINK ("dma" , XlnxZDMA, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *),DEFINE_PROP_END_OF_LIST (), };
hw/dma/xlnx_csu_dma.c +4 -9
@@ -702,6 +702,10 @@ static Property xlnx_csu_dma_properties[] = {* which channel the device is connected to. */ DEFINE_PROP_BOOL ("is-dst" , XlnxCSUDMA, is_dst, true), +DEFINE_PROP_LINK ("stream-connected-dma" , XlnxCSUDMA, tx_dev, + TYPE_STREAM_SINK, StreamSink *), +DEFINE_PROP_LINK ("dma" , XlnxCSUDMA, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), };
@@ -728,15 +732,6 @@ static void xlnx_csu_dma_init(Object *obj)memory_region_init (&s->iomem, obj,TYPE_XLNX_CSU_DMA ,XLNX_CSU_DMA_R_MAX *4 ); - -object_property_add_link (obj,"stream-connected-dma" ,TYPE_STREAM_SINK , - (Object **)&s->tx_dev, - qdev_prop_allow_set_link_before_realize, -OBJ_PROP_LINK_STRONG ); -object_property_add_link (obj,"dma" ,TYPE_MEMORY_REGION , - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, -OBJ_PROP_LINK_STRONG ); }static const TypeInfo xlnx_csu_dma_info = {
Signature · 1 line
2.41.0
[PULL 41/46] hw/block/vhost-user-blk: Use DEVICE() / VIRTIO_DEVICE() macros
In reply to Philippe Mathieu-DaudéAccess QOM parent with the proper QOM [VIRTIO_]DEVICE() macros.
Message-Id: <[email protected]>
--- hw/block/vhost-user-blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/block/vhost-user-blk.c +2 -2
@@ -405,7 +405,7 @@ static void vhost_user_blk_event(void *opaque, QEMUChrEvent event)static int vhost_user_blk_realize_connect (VHostUserBlk *s,Error **errp) { -DeviceState *dev = &s->parent_obj.parent_obj; +DeviceState *dev =DEVICE (s);int ret; s->connected = false;
@@ -423,7 +423,7 @@ static int vhost_user_blk_realize_connect(VHostUserBlk *s, Error **errp)assert (s->connected); ret =vhost_dev_get_config (&s->dev, (uint8_t *)&s->blkcfg, - s->parent_obj.config_len, errp); +VIRTIO_DEVICE (s)->config_len, errp);if (ret <0 ) {qemu_chr_fe_disconnect (&s->chardev);vhost_dev_cleanup (&s->dev);
Signature · 1 line
2.41.0
[PULL 06/46] cutils: Fix get_relocated_path on Windows
In reply to Philippe Mathieu-DaudéFrom: Akihiko Odaki <[email protected]>
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 to get_relocated_path() are defined by macros generated by Meson. Meson in turn uses a prefix given by the configure script to generate them. For Windows, the script passes /qemu as a prefix to Meson by default.
As documented in docs/about/build-platforms.rst, typically MSYS2 is used for the build system, but it is also possible to use Linux as well. When MSYS2 is used, its Bash variant recognizes /qemu as a MSYS2 path, and converts it to a Windows path, adding the MSYS2 prefix including a drive letter or UNC server/share path elements. Such a conversion does not happen on a shell on Linux however, and /qemu will be passed as is in the case.
Implement a proper error handling of PathCchSkipRoot() in get_relocated_path() so that it can handle a path without a drive letter or UNC server/share path elements.
Message-ID: <[email protected]>
--- util/cutils.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
util/cutils.c +11 -7
@@ -1163,17 +1163,21 @@ char *get_relocated_path(const char *dir)g_string_append (result,"/qemu-bundle" );if (access (result->str,R_OK ) ==0 ) {#ifdef G_OS_WIN32 -size_t size =mbsrtowcs (NULL , &dir,0 , &(mbstate_t ){0 }) +1 ; +const char *src = dir; +size_t size =mbsrtowcs (NULL , &src,0 , &(mbstate_t ){0 }) +1 ;PWSTR wdir =g_new (WCHAR , size); -mbsrtowcs (wdir, &dir, size, &(mbstate_t ){0 }); +mbsrtowcs (wdir, &src, size, &(mbstate_t ){0 });PCWSTR wdir_skipped_root; -PathCchSkipRoot (wdir, &wdir_skipped_root); +if (PathCchSkipRoot (wdir, &wdir_skipped_root) ==S_OK ) { + size =wcsrtombs (NULL , &wdir_skipped_root,0 , &(mbstate_t ){0 }); +char *cursor = result->str + result->len; +g_string_set_size (result, result->len + size); +wcsrtombs (cursor, &wdir_skipped_root, size +1 , &(mbstate_t ){0 }); + }else { +g_string_append (result, dir); + } - size =wcsrtombs (NULL , &wdir_skipped_root,0 , &(mbstate_t ){0 }); -char *cursor = result->str + result->len; -g_string_set_size (result, result->len + size); -wcsrtombs (cursor, &wdir_skipped_root, size +1 , &(mbstate_t ){0 });g_free (wdir);#else g_string_append (result, dir);
Signature · 1 line
2.41.0
[PULL 36/46] hw/acpi: Realize ACPI_GED sysbus device before accessing it
In reply to Philippe Mathieu-Daudésysbus_mmio_map() should not be called on unrealized device.
Message-Id: <[email protected]>
--- hw/arm/virt.c | 3 +-- hw/i386/microvm.c | 2 +- hw/loongarch/virt.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-)
hw/arm/virt.c +1 -2
@@ -647,13 +647,12 @@ static inline DeviceState *create_acpi_ged(VirtMachineState *vms) dev =qdev_new (TYPE_ACPI_GED );qdev_prop_set_uint32 (dev,"ged-event" , event); +sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal);sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 , vms->memmap[VIRT_ACPI_GED ].base);sysbus_mmio_map (SYS_BUS_DEVICE (dev),1 , vms->memmap[VIRT_PCDIMM_ACPI ].base);sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 ,qdev_get_gpio_in (vms->gic, irq)); -sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal); -return dev; }
hw/i386/microvm.c +1 -1
@@ -206,12 +206,12 @@ static void microvm_devices_init(MicrovmMachineState *mms)if (x86_machine_is_acpi_enabled (x86ms)) {DeviceState *dev =qdev_new (TYPE_ACPI_GED );qdev_prop_set_uint32 (dev,"ged-event" ,ACPI_GED_PWR_DOWN_EVT ); +sysbus_realize (SYS_BUS_DEVICE (dev), &error_fatal);sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,GED_MMIO_BASE );/* sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, GED_MMIO_BASE_MEMHP); */ sysbus_mmio_map (SYS_BUS_DEVICE (dev),2 ,GED_MMIO_BASE_REGS );sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , x86ms->gsi[GED_MMIO_IRQ ]); -sysbus_realize (SYS_BUS_DEVICE (dev), &error_fatal); x86ms->acpi_dev =HOTPLUG_HANDLER (dev); }
hw/loongarch/virt.c +1 -1
@@ -412,6 +412,7 @@ static DeviceState *create_acpi_ged(DeviceState *pch_pic, LoongArchMachineState } dev =qdev_new (TYPE_ACPI_GED );qdev_prop_set_uint32 (dev,"ged-event" , event); +sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal);/* ged event */ sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,VIRT_GED_EVT_ADDR );
@@ -422,7 +423,6 @@ static DeviceState *create_acpi_ged(DeviceState *pch_pic, LoongArchMachineStatesysbus_connect_irq (SYS_BUS_DEVICE (dev),0 ,qdev_get_gpio_in (pch_pic,VIRT_SCI_IRQ -VIRT_GSI_BASE )); -sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal);return dev; }
Signature · 1 line
2.41.0
[PULL 39/46] hw/s390x/css-bridge: Realize sysbus device before accessing it
In reply to Philippe Mathieu-Daudéqbus_new() should not be called on unrealized device.
Message-Id: <[email protected]>
--- hw/s390x/css-bridge.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
hw/s390x/css-bridge.c +3 -4
@@ -95,7 +95,6 @@ static const TypeInfo virtual_css_bus_info = {VirtualCssBus *virtual_css_bus_init (void ) { -VirtualCssBus *cbus;BusState *bus;DeviceState *dev;
@@ -103,19 +102,19 @@ VirtualCssBus *virtual_css_bus_init(void) dev =qdev_new (TYPE_VIRTUAL_CSS_BRIDGE );object_property_add_child (qdev_get_machine (),TYPE_VIRTUAL_CSS_BRIDGE ,OBJECT (dev)); -sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal);/* Create bus on bridge device */ bus =qbus_new (TYPE_VIRTUAL_CSS_BUS , dev,"virtual-css" ); - cbus =VIRTUAL_CSS_BUS (bus);/* Enable hotplugging */ qbus_set_hotplug_handler (bus,OBJECT (dev)); +sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal); +css_register_io_adapters (CSS_IO_ADAPTER_VIRTIO , true, false,0 , &error_abort); -return cbus; +return VIRTUAL_CSS_BUS (bus); }/***************** Virtual-css Bus Bridge Device ********************/
Signature · 1 line
2.41.0
[PULL 18/46] hw/sparc64/ebus: Access memory regions via pci_address_space_io()
In reply to Philippe Mathieu-DaudéPCI functions are plugged on a PCI bus. They can only access external memory regions via the bus.
Message-Id: <[email protected]>
--- hw/sparc64/sun4u.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/sparc64/sun4u.c +4 -4
@@ -360,11 +360,11 @@ static void ebus_realize(PCIDevice *pci_dev, Error **errp) pci_dev->config[0x09 ] =0x00 ;// programming i/f pci_dev->config[0x0D ] =0x0a ;// latency_timer -memory_region_init_alias (&s->bar0,OBJECT (s),"bar0" ,get_system_io (), -0 ,0x1000000 ); +memory_region_init_alias (&s->bar0,OBJECT (s),"bar0" , +pci_address_space_io (pci_dev),0 ,0x1000000 );pci_register_bar (pci_dev,0 ,PCI_BASE_ADDRESS_SPACE_MEMORY , &s->bar0); -memory_region_init_alias (&s->bar1,OBJECT (s),"bar1" ,get_system_io (), -0 ,0x8000 ); +memory_region_init_alias (&s->bar1,OBJECT (s),"bar1" , +pci_address_space_io (pci_dev),0 ,0x8000 );pci_register_bar (pci_dev,1 ,PCI_BASE_ADDRESS_SPACE_IO , &s->bar1); }
Signature · 1 line
2.41.0
[PULL 40/46] hw/virtio/virtio-pmem: Replace impossible check by assertion
In reply to 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.
Message-Id: <[email protected]>
--- hw/virtio/virtio-pmem.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
hw/virtio/virtio-pmem.c +1 -4
@@ -147,10 +147,7 @@ static void virtio_pmem_fill_device_info(const VirtIOPMEM *pmem,static MemoryRegion *virtio_pmem_get_memory_region (VirtIOPMEM *pmem,Error **errp) { -if (!pmem->memdev) { -error_setg (errp,"'%s' property must be set" ,VIRTIO_PMEM_MEMDEV_PROP ); -return NULL ; - } +assert (pmem->memdev);return &pmem->memdev->mr; }
Signature · 1 line
2.41.0
[PULL 45/46] hw/net: Declare link using static DEFINE_PROP_LINK() macro
In reply to Philippe Mathieu-DaudéDeclare link statically using DEFINE_PROP_LINK().
Message-Id: <[email protected]>
--- hw/net/cadence_gem.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
hw/net/cadence_gem.c +2 -5
@@ -1654,11 +1654,6 @@ static void gem_init(Object *obj) "enet", sizeof(s->regs));sysbus_init_mmio (SYS_BUS_DEVICE (dev), &s->iomem); - -object_property_add_link (obj,"dma" ,TYPE_MEMORY_REGION , - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, -OBJ_PROP_LINK_STRONG ); }static const VMStateDescription vmstate_cadence_gem = {
@@ -1691,6 +1686,8 @@ static Property gem_properties[] = { num_type2_screeners, 4),DEFINE_PROP_UINT16 ("jumbo-max-len" , CadenceGEMState, jumbo_max_len,10240 ), +DEFINE_PROP_LINK ("dma" , CadenceGEMState, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), };
Signature · 1 line
2.41.0
[PULL 42/46] hw/display/virtio-gpu: Use VIRTIO_DEVICE() macro
In reply to Philippe Mathieu-DaudéAccess QOM parent with the proper QOM VIRTIO_DEVICE() macro.
Message-Id: <[email protected]>
--- hw/display/virtio-gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/virtio-gpu.c +1 -1
@@ -1128,7 +1128,7 @@ static void virtio_gpu_ctrl_bh(void *opaque)VirtIOGPU *g = opaque;VirtIOGPUClass *vgc =VIRTIO_GPU_GET_CLASS (g); - vgc->handle_ctrl (&g->parent_obj.parent_obj, g->ctrl_vq); + vgc->handle_ctrl (VIRTIO_DEVICE (g), g->ctrl_vq); }static void virtio_gpu_handle_cursor (VirtIODevice *vdev,VirtQueue *vq)
Signature · 1 line
2.41.0
[PULL 21/46] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req()
In reply to 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;
^Message-Id: <[email protected]>
--- hw/s390x/sclpquiesce.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/s390x/sclpquiesce.c +4 -4
@@ -78,12 +78,10 @@ static const VMStateDescription vmstate_sclpquiesce = { } }; -typedef struct QuiesceNotifier QuiesceNotifier ; - -static struct QuiesceNotifier { +typedef struct QuiesceNotifier {Notifier notifier;SCLPEvent *event; -} qn; +}QuiesceNotifier ;static void quiesce_powerdown_req (Notifier *n,void *opaque) {
@@ -97,6 +95,8 @@ static void quiesce_powerdown_req(Notifier *n, void *opaque)static int quiesce_init (SCLPEvent *event) { +static QuiesceNotifier qn; + qn.notifier.notify = quiesce_powerdown_req; qn.event = event;
Signature · 1 line
2.41.0
[PULL 43/46] hw/scsi/virtio-scsi: Use VIRTIO_SCSI_COMMON() macro
In reply to Philippe Mathieu-DaudéAccess QOM parent with the proper QOM VIRTIO_SCSI_COMMON() macro.
Message-Id: <[email protected]>
--- hw/scsi/virtio-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/scsi/virtio-scsi.c +1 -1
@@ -761,7 +761,7 @@ static void virtio_scsi_fail_cmd_req(VirtIOSCSIReq *req)static int virtio_scsi_handle_cmd_req_prepare (VirtIOSCSI *s,VirtIOSCSIReq *req) { -VirtIOSCSICommon *vs = &s->parent_obj; +VirtIOSCSICommon *vs =VIRTIO_SCSI_COMMON (s);SCSIDevice *d;int rc;
Signature · 1 line
2.41.0
[PULL 26/46] hw/ppc/pnv_xscom: Do not use SysBus API to map local MMIO region
In reply to 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 subregion;
@@
- sysbus_init_mmio(sbdev, subregion);
... when != sbdev - sysbus_mmio_map(sbdev, index, addr);
+ memory_region_add_subregion(get_system_memory(), addr, subregion);
Message-Id: <[email protected]>
--- hw/ppc/pnv_xscom.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
hw/ppc/pnv_xscom.c +1 -3
@@ -223,14 +223,12 @@ const MemoryRegionOps pnv_xscom_ops = {void pnv_xscom_init (PnvChip *chip,uint64_t size,hwaddr addr) { -SysBusDevice *sbd =SYS_BUS_DEVICE (chip);char *name; name =g_strdup_printf ("xscom-%x" , chip->chip_id);memory_region_init_io (&chip->xscom_mmio,OBJECT (chip), &pnv_xscom_ops, chip, name, size); -sysbus_init_mmio (sbd, &chip->xscom_mmio); -sysbus_mmio_map (sbd,0 , addr); +memory_region_add_subregion (get_system_memory (), addr, &chip->xscom_mmio);memory_region_init (&chip->xscom,OBJECT (chip), name, size);address_space_init (&chip->xscom_as, &chip->xscom, name);
Signature · 1 line
2.41.0
[PULL 35/46] hw/pci-host/bonito: Do not use SysBus API to map local MMIO region
In reply to 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 subregion;
@@
- sysbus_init_mmio(sbdev, subregion);
... when != sbdev - sysbus_mmio_map(sbdev, index, addr);
+ memory_region_add_subregion(get_system_memory(), addr, subregion);
and manually adding the local 'host_mem' variable to avoid multiple calls to get_system_memory().
Message-Id: <[email protected]>
--- hw/pci-host/bonito.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-)
hw/pci-host/bonito.c +13 -17
@@ -654,7 +654,7 @@ static void bonito_host_realize(DeviceState *dev, Error **errp)static void bonito_pci_realize (PCIDevice *dev,Error **errp) {PCIBonitoState *s =PCI_BONITO (dev); -SysBusDevice *sysbus =SYS_BUS_DEVICE (s->pcihost); +MemoryRegion *host_mem =get_system_memory ();PCIHostState *phb =PCI_HOST_BRIDGE (s->pcihost);BonitoState *bs = s->pcihost;MemoryRegion *pcimem_alias =g_new (MemoryRegion,1 );
@@ -668,48 +668,45 @@ static void bonito_pci_realize(PCIDevice *dev, Error **errp)/* set the north bridge register mapping */ memory_region_init_io (&s->iomem,OBJECT (s), &bonito_ops, s,"north-bridge-register" ,BONITO_INTERNAL_REG_SIZE ); -sysbus_init_mmio (sysbus, &s->iomem); -sysbus_mmio_map (sysbus,0 ,BONITO_INTERNAL_REG_BASE ); +memory_region_add_subregion (host_mem,BONITO_INTERNAL_REG_BASE , &s->iomem);/* set the north bridge pci configure mapping */ memory_region_init_io (&phb->conf_mem,OBJECT (s), &bonito_pciconf_ops, s,"north-bridge-pci-config" ,BONITO_PCICONFIG_SIZE ); -sysbus_init_mmio (sysbus, &phb->conf_mem); -sysbus_mmio_map (sysbus,1 ,BONITO_PCICONFIG_BASE ); +memory_region_add_subregion (host_mem,BONITO_PCICONFIG_BASE , + &phb->conf_mem);/* set the south bridge pci configure mapping */ memory_region_init_io (&phb->data_mem,OBJECT (s), &bonito_spciconf_ops, s,"south-bridge-pci-config" ,BONITO_SPCICONFIG_SIZE ); -sysbus_init_mmio (sysbus, &phb->data_mem); -sysbus_mmio_map (sysbus,2 ,BONITO_SPCICONFIG_BASE ); +memory_region_add_subregion (host_mem,BONITO_SPCICONFIG_BASE , + &phb->data_mem);create_unimplemented_device ("bonito" ,BONITO_REG_BASE ,BONITO_REG_SIZE );memory_region_init_io (&s->iomem_ldma,OBJECT (s), &bonito_ldma_ops, s,"ldma" ,0x100 ); -sysbus_init_mmio (sysbus, &s->iomem_ldma); -sysbus_mmio_map (sysbus,3 ,0x1fe00200 ); +memory_region_add_subregion (host_mem,0x1fe00200 , &s->iomem_ldma);/* PCI copier */ memory_region_init_io (&s->iomem_cop,OBJECT (s), &bonito_cop_ops, s,"cop" ,0x100 ); -sysbus_init_mmio (sysbus, &s->iomem_cop); -sysbus_mmio_map (sysbus,4 ,0x1fe00300 ); +memory_region_add_subregion (host_mem,0x1fe00300 , &s->iomem_cop);create_unimplemented_device ("ROMCS" ,BONITO_FLASH_BASE ,60 * MiB);/* Map PCI IO Space 0x1fd0 0000 - 0x1fd1 0000 */ memory_region_init_alias (&s->bonito_pciio,OBJECT (s),"isa_mmio" ,get_system_io (),0 ,BONITO_PCIIO_SIZE ); -sysbus_init_mmio (sysbus, &s->bonito_pciio); -sysbus_mmio_map (sysbus,5 ,BONITO_PCIIO_BASE ); +memory_region_add_subregion (host_mem,BONITO_PCIIO_BASE , + &s->bonito_pciio);/* add pci local io mapping */ memory_region_init_alias (&s->bonito_localio,OBJECT (s),"IOCS[0]" ,get_system_io (),0 ,256 * KiB); -sysbus_init_mmio (sysbus, &s->bonito_localio); -sysbus_mmio_map (sysbus,6 ,BONITO_DEV_BASE ); +memory_region_add_subregion (host_mem,BONITO_DEV_BASE , + &s->bonito_localio);create_unimplemented_device ("IOCS[1]" ,BONITO_DEV_BASE +1 *256 * KiB,256 * KiB); create_unimplemented_device("IOCS[2]", BONITO_DEV_BASE + 2 * 256 * KiB,
@@ -719,8 +716,7 @@ static void bonito_pci_realize(PCIDevice *dev, Error **errp)memory_region_init_alias (pcimem_alias,NULL ,"pci.mem.alias" , &bs->pci_mem,0 ,BONITO_PCIHI_SIZE ); -memory_region_add_subregion (get_system_memory (), -BONITO_PCIHI_BASE , pcimem_alias); +memory_region_add_subregion (host_mem,BONITO_PCIHI_BASE , pcimem_alias);create_unimplemented_device ("PCI_2" , (hwaddr )BONITO_PCIHI_BASE +BONITO_PCIHI_SIZE ,2 * GiB);
Signature · 1 line
2.41.0
[PULL 30/46] hw/audio/pcspk: Inline pcspk_init()
In reply to Philippe Mathieu-Daudépcspk_init() is a legacy init function, inline and remove it.
Since the device is realized using &error_fatal, use the same error for setting the "pit" link.
Message-Id: <[email protected]>
--- include/hw/audio/pcspk.h | 10 ---------- hw/i386/pc.c | 4 +++- hw/isa/i82378.c | 5 ++++- hw/mips/jazz.c | 5 ++++- 4 files changed, 11 insertions(+), 13 deletions(-)
include/hw/audio/pcspk.h +0 -10
@@ -25,16 +25,6 @@#ifndef HW_PCSPK_H #define HW_PCSPK_H -#include "hw/isa/isa.h" -#include "hw/qdev-properties.h" -#include "qapi/error.h" -#define TYPE_PC_SPEAKER "isa-pcspk" -static inline void pcspk_init (ISADevice *isadev,ISABus *bus,ISADevice *pit) -{ -object_property_set_link (OBJECT (isadev),"pit" ,OBJECT (pit),NULL ); -isa_realize_and_unref (isadev, bus, &error_fatal); -} -#endif /* HW_PCSPK_H */
hw/i386/pc.c +3 -1
@@ -1283,7 +1283,9 @@ void pc_basic_device_init(struct PCMachineState *pcms,/* connect PIT to output control line of the HPET */ qdev_connect_gpio_out (hpet,0 ,qdev_get_gpio_in (DEVICE (pit),0 )); } -pcspk_init (pcms->pcspk, isa_bus, pit); +object_property_set_link (OBJECT (pcms->pcspk),"pit" , +OBJECT (pit), &error_fatal); +isa_realize_and_unref (pcms->pcspk, isa_bus, &error_fatal); }/* Super I/O */
hw/isa/i82378.c +4 -1
@@ -67,6 +67,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp)uint8_t *pci_conf;ISABus *isabus;ISADevice *pit; +ISADevice *pcspk; pci_conf = pci->config; pci_set_word(pci_conf + PCI_COMMAND,
@@ -102,7 +103,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp) pit =i8254_pit_init (isabus,0x40 ,0 ,NULL );/* speaker */ -pcspk_init (isa_new (TYPE_PC_SPEAKER ), isabus, pit); + pcspk =isa_new (TYPE_PC_SPEAKER ); +object_property_set_link (OBJECT (pcspk),"pit" ,OBJECT (pit), &error_fatal); +isa_realize_and_unref (pcspk, isabus, &error_fatal);/* 2 82C37 (dma) */ isa_create_simple (isabus,"i82374" );
hw/mips/jazz.c +4 -1
@@ -176,6 +176,7 @@ static void mips_jazz_init(MachineState *machine,SysBusDevice *sysbus;ISABus *isa_bus;ISADevice *pit; +ISADevice *pcspk;DriveInfo *fds[MAX_FD ];MemoryRegion *bios =g_new (MemoryRegion,1 );MemoryRegion *bios2 =g_new (MemoryRegion,1 );
@@ -278,7 +279,9 @@ static void mips_jazz_init(MachineState *machine,isa_bus_register_input_irqs (isa_bus, i8259);i8257_dma_init (isa_bus,0 ); pit =i8254_pit_init (isa_bus,0x40 ,0 ,NULL ); -pcspk_init (isa_new (TYPE_PC_SPEAKER ), isa_bus, pit); + pcspk =isa_new (TYPE_PC_SPEAKER ); +object_property_set_link (OBJECT (pcspk),"pit" ,OBJECT (pit), &error_fatal); +isa_realize_and_unref (pcspk, isa_bus, &error_fatal);/* Video card */ switch (jazz_model) {
Signature · 1 line
2.41.0
[PULL 32/46] hw/i386/intel_iommu: Do not use SysBus API to map local MMIO region
In reply to 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 subregion;
@@
- sysbus_init_mmio(sbdev, subregion);
... when != sbdev - sysbus_mmio_map(sbdev, index, addr);
+ memory_region_add_subregion(get_system_memory(), addr, subregion);
Message-Id: <[email protected]>
--- hw/i386/intel_iommu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
hw/i386/intel_iommu.c +2 -3
@@ -4134,6 +4134,8 @@ static void vtd_realize(DeviceState *dev, Error **errp)qemu_mutex_init (&s->iommu_lock);memory_region_init_io (&s->csrmem,OBJECT (s), &vtd_mem_ops, s,"intel_iommu" ,DMAR_REG_SIZE ); +memory_region_add_subregion (get_system_memory (), +Q35_HOST_BRIDGE_IOMMU_ADDR , &s->csrmem);/* Create the shared memory regions by all devices */ memory_region_init(&s->mr_nodmar, OBJECT(s), "vtd-nodmar",
@@ -4148,15 +4150,12 @@ static void vtd_realize(DeviceState *dev, Error **errp)memory_region_add_subregion_overlap (&s->mr_nodmar,VTD_INTERRUPT_ADDR_FIRST , &s->mr_ir,1 ); - -sysbus_init_mmio (SYS_BUS_DEVICE (s), &s->csrmem);/* No corresponding destroy */ s->iotlb =g_hash_table_new_full (vtd_iotlb_hash, vtd_iotlb_equal, g_free, g_free); s->vtd_address_spaces =g_hash_table_new_full (vtd_as_hash, vtd_as_equal, g_free, g_free);vtd_init (s); -sysbus_mmio_map (SYS_BUS_DEVICE (s),0 ,Q35_HOST_BRIDGE_IOMMU_ADDR );pci_setup_iommu (bus, vtd_host_dma_iommu, dev);/* Pseudo address space under root PCI bus. */ x86ms->ioapic_as =vtd_host_dma_iommu (bus, s,Q35_PSEUDO_DEVFN_IOAPIC );
Signature · 1 line
2.41.0
[PULL 14/46] hw/misc/mips_itu: Make MIPSITUState target agnostic
In reply to 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 its inclusion taints all files including "mips_itu.h", which become target specific too. We can however use the 'ArchCPU *' type in the public header. By keeping the TYPE_MIPS_CPU QOM type check in the link property declaration, QOM core code will still check the property is a correct MIPS CPU.
TYPE_MIPS_ITU is still built per-(MIPS)target, but its header can now be included by other targets.
Message-Id: <[email protected]>
--- include/hw/misc/mips_itu.h | 2 +- hw/misc/mips_itu.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
include/hw/misc/mips_itu.h +1 -1
@@ -73,7 +73,7 @@ struct MIPSITUState {/* SAAR */ uint64_t *saar; -MIPSCPU *cpu0; +ArchCPU *cpu0; };/* Get ITC Configuration Tag memory region. */
hw/misc/mips_itu.c +2 -2
@@ -532,7 +532,7 @@ static void mips_itu_realize(DeviceState *dev, Error **errp)return ; } - env = &s->cpu0->env; + env = &MIPS_CPU (s->cpu0)->env;if (env->saarp) { s->saar = env->CP0_SAAR; }
@@ -563,7 +563,7 @@ static Property mips_itu_properties[] = { ITC_FIFO_NUM_MAX),DEFINE_PROP_UINT32 ("num-semaphores" , MIPSITUState, num_semaphores,ITC_SEMAPH_NUM_MAX ), - DEFINE_PROP_LINK("cpu[0]", MIPSITUState, cpu0, TYPE_MIPS_CPU, MIPSCPU *), + DEFINE_PROP_LINK("cpu[0]", MIPSITUState, cpu0, TYPE_MIPS_CPU, ArchCPU *), DEFINE_PROP_END_OF_LIST(), };
Signature · 1 line
2.41.0
Quoted 5 lines · Philippe Mathieu-Daudé
The following changes since commit
0d239e513e0117e66fa739fb71a43b9383a108ff:----------------------------------------------------------------
Misc hardware patch queue
Quoted 8 lines
-
MAINTAINERSupdates (Zoltan, Thomas)
- Fixcutils::get_relocated_pathon Windows host (Akihiko)
- Housekeeping in Memory APIs (Marc-André)
- SDHCI fix for SDMA transfer (Lu, Jianxian)
- Various QOM/QDev/SysBus cleanups (Philippe)
- Constify QemuInputHandler structure (Philippe)----------------------------------------------------------------
Stefan, a change has been requested for #30 "hw/audio/pcspk: Inline pcspk_init()", so please drop this pull request.
Regards,
Phil.
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.