From 3817261eb9e763cb2e71649201c7ec0823858f0c Mon Sep 17 00:00:00 2001 From: Denis Plotnikov Date: Mon, 23 Dec 2019 10:28:56 +0300 Subject: hw: fix using 4.2 compat in 5.0 machine types for i440fx/q35 5.0 machine type uses 4.2 compats. This seems to be incorrect, since the latests machine type by now is 5.0 and it should use its own compat or shouldn't use any relying on the defaults. Seems, like this appeared because of some problems on merge/rebase. Signed-off-by: Denis Plotnikov Reviewed-by: Cornelia Huck Reviewed-by: Igor Mammedov Message-Id: <20191223072856.5369-1-dplotnikov@virtuozzo.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc_piix.c | 1 - hw/i386/pc_q35.c | 1 - 2 files changed, 2 deletions(-) (limited to 'hw') diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 721c7aa..fa12203 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -425,7 +425,6 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m) m->alias = "pc"; m->is_default = 1; pcmc->default_cpu_version = 1; - compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len); } DEFINE_I440FX_MACHINE(v5_0, "pc-i440fx-5.0", NULL, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 52f4573..84cf925 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -354,7 +354,6 @@ static void pc_q35_5_0_machine_options(MachineClass *m) pc_q35_machine_options(m); m->alias = "q35"; pcmc->default_cpu_version = 1; - compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len); } DEFINE_Q35_MACHINE(v5_0, "pc-q35-5.0", NULL, -- cgit v1.1 From 218fc2b5c83948fe75a6de09be14fb8aef09bb10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 20 Dec 2019 16:42:25 +0100 Subject: hw/i386/x86-iommu: Add missing stubs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit 6c730e4af9 we introduced a stub to build the MicroVM machine without Intel IOMMU. This stub is incomplete for the other PC machines. Add the missing stubs. Fixes: 6c730e4af9 ("pc: stubify x86 iommu", 2019-12-17) Reported-by: Travis-CI Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191220154225.25879-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/x86-iommu-stub.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'hw') diff --git a/hw/i386/x86-iommu-stub.c b/hw/i386/x86-iommu-stub.c index 03576cd..c5ba077 100644 --- a/hw/i386/x86-iommu-stub.c +++ b/hw/i386/x86-iommu-stub.c @@ -32,3 +32,12 @@ X86IOMMUState *x86_iommu_get_default(void) return NULL; } +bool x86_iommu_ir_supported(X86IOMMUState *s) +{ + return false; +} + +IommuType x86_iommu_get_type(void) +{ + abort(); +} -- cgit v1.1 From a88c40f02ace88f09b2a85a64831b277b2ebc88c Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 21 Dec 2019 17:21:24 +0100 Subject: hw/i386/pc: fix regression in parsing vga cmdline parameter When the 'vga=' parameter is succeeded by another parameter, QEMU 4.2.0 would refuse to start with a rather cryptic message: $ qemu-system-x86_64 -kernel /boot/vmlinuz-linux -append 'vga=792 quiet' qemu: can't parse 'vga' parameter: Invalid argument It was not clear whether this applied to the '-vga std' parameter or the '-append' one. Fix the parsing regression and clarify the error. Fixes: 133ef074bd ("hw/i386/pc: replace use of strtol with qemu_strtoui in x86_load_linux()") Cc: Sergio Lopez Signed-off-by: Peter Wu Message-Id: <20191221162124.1159291-1-peter@lekensteyn.nl> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- hw/i386/x86.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hw') diff --git a/hw/i386/x86.c b/hw/i386/x86.c index d8bb5c2..9b9a4d5 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -612,6 +612,7 @@ void x86_load_linux(X86MachineState *x86ms, vmode = strstr(kernel_cmdline, "vga="); if (vmode) { unsigned int video_mode; + const char *end; int ret; /* skip "vga=" */ vmode += 4; @@ -622,10 +623,9 @@ void x86_load_linux(X86MachineState *x86ms, } else if (!strncmp(vmode, "ask", 3)) { video_mode = 0xfffd; } else { - ret = qemu_strtoui(vmode, NULL, 0, &video_mode); - if (ret != 0) { - fprintf(stderr, "qemu: can't parse 'vga' parameter: %s\n", - strerror(-ret)); + ret = qemu_strtoui(vmode, &end, 0, &video_mode); + if (ret != 0 || (*end && *end != ' ')) { + fprintf(stderr, "qemu: invalid 'vga=' kernel parameter.\n"); exit(1); } } -- cgit v1.1 From dccdaa1f756fedee2f1dac3650e19f29572f76c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Mon, 6 Jan 2020 18:19:12 +0100 Subject: hw/timer/Kconfig: Intel 8254 PIT depends of ISA bus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since i8254_common.c calls isa_register_ioport() from "hw/isa/isa.h" we can not select it when ISA_BUS is disabled. Add a 'depends on' clause. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200106171912.16523-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/timer/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'hw') diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig index a990f9f..59b3f44 100644 --- a/hw/timer/Kconfig +++ b/hw/timer/Kconfig @@ -15,6 +15,7 @@ config HPET config I8254 bool + depends on ISA_BUS config ALTERA_TIMER bool -- cgit v1.1 From be3d7ee960143959c5866daf15f2ab93f3f282b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:03 +0100 Subject: hw/usb/redirect: Do not link 'usb-redir' device when USB not enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'usb-redir' device requires the USB core code to work. Do not link it when there is no USB support. This fixes: $ qemu-system-tricore -M tricore_testboard -device usb-redir qemu-system-tricore: -device usb-redir: No 'usb-bus' bus found for device 'usb-redir' Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/usb/Makefile.objs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw') diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs index 0ab20f9..0052d49 100644 --- a/hw/usb/Makefile.objs +++ b/hw/usb/Makefile.objs @@ -39,9 +39,11 @@ common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o endif # usb redirection +ifeq ($(CONFIG_USB),y) common-obj-$(CONFIG_USB_REDIR) += redirect.o quirks.o redirect.o-cflags = $(USB_REDIR_CFLAGS) redirect.o-libs = $(USB_REDIR_LIBS) +endif # usb pass-through ifeq ($(CONFIG_USB_LIBUSB)$(CONFIG_USB),yy) -- cgit v1.1 From 48ca2c4aa174aebedfdd64369697e467e30ffd22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:04 +0100 Subject: hw/intc/i8259: Fix Kconfig dependency on ISA bus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 8259 Interrupt Controller sits on a ISA bus. Add the missing dependency to fix: LINK x86_64-softmmu/qemu-system-x86_64 /usr/bin/ld: ../hw/intc/i8259_common.o: in function `pic_common_realize': hw/intc/i8259_common.c:84: undefined reference to `isa_register_ioport' /usr/bin/ld: hw/intc/i8259_common.c:86: undefined reference to `isa_register_ioport' /usr/bin/ld: ../hw/intc/i8259_common.o: in function `i8259_init_chip': hw/intc/i8259_common.c:97: undefined reference to `isa_create' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:206: qemu-system-x86_64] Error 1 Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/intc/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'hw') diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig index 10a680b..a189d6f 100644 --- a/hw/intc/Kconfig +++ b/hw/intc/Kconfig @@ -3,6 +3,7 @@ config HEATHROW_PIC config I8259 bool + select ISA_BUS config PL190 bool -- cgit v1.1 From ff2efdcdc1674b31fcad64d668a4da01cd454b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:05 +0100 Subject: hw/i386/Kconfig: Let the MicroVM machine select the SERIAL_ISA config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When configured with --without-default-devices, the build fails: LINK x86_64-softmmu/qemu-system-x86_64 /usr/bin/ld: hw/i386/microvm.o: in function `microvm_devices_init': hw/i386/microvm.c:157: undefined reference to `serial_hds_isa_init' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:206: qemu-system-x86_64] Error 1 make: *** [Makefile:483: x86_64-softmmu/all] Error 2 While the MicroVM machine only uses the ISA serial port when the MICROVM_MACHINE_ISA_SERIAL property is set, it has to be linked with it. Replace the 'imply' Kconfig rule by a 'select'. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 91cf584..cdc8515 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -95,7 +95,7 @@ config Q35 config MICROVM bool - imply SERIAL_ISA + select SERIAL_ISA # for serial_hds_isa_init() select ISA_BUS select APIC select IOAPIC -- cgit v1.1 From a0297be4bead925d0eea4a0de9ce8c3e48c2f43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:08 +0100 Subject: hw/ppc/Kconfig: Restrict the MPC I2C controller to e500-based platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the PowerPC e500-based platforms use the MPC I2C controller. Do not build it for the other machines. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-7-philmd@redhat.com> Acked-by: David Gibson Signed-off-by: Paolo Bonzini --- hw/ppc/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'hw') diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index f927ec9..0cd8d40 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -105,6 +105,7 @@ config E500 select PLATFORM_BUS select PPCE500_PCI select SERIAL + select MPC_I2C config VIRTEX bool -- cgit v1.1 From def9119efe20cf14204753426c20527efd97eed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:09 +0100 Subject: hw/ppc/Kconfig: Let the Sam460ex board use the PowerPC 405 devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When configured with --without-default-devices, the build fails: LINK ppc-softmmu/qemu-system-ppc /usr/bin/ld: hw/ppc/sam460ex.o: in function `sam460ex_init': hw/ppc/sam460ex.c:313: undefined reference to `ppc4xx_plb_init' /usr/bin/ld: hw/ppc/sam460ex.c:353: undefined reference to `ppc405_ebc_init' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:206: qemu-system-ppc] Error 1 Fix by selecting the PPC405 config. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-8-philmd@redhat.com> Reviewed-by: BALATON Zoltan Acked-by: David Gibson Signed-off-by: Paolo Bonzini --- hw/ppc/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'hw') diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 0cd8d40..004b7d5 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -50,6 +50,7 @@ config PPC4XX config SAM460EX bool + select PPC405 select PFLASH_CFI01 select IDE_SII3112 select M41T80 -- cgit v1.1 From 45b0bd10957d40dccc6d9a98d484d548df04e02c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:10 +0100 Subject: hw/ppc/Kconfig: Let the Xilinx Virtex5 ML507 use the PPC-440 devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When configured with --without-default-devices, the build fails: LINK ppc-softmmu/qemu-system-ppc /usr/bin/ld: hw/ppc/virtex_ml507.o: in function `ppc440_init_xilinx': hw/ppc/virtex_ml507.c:112: undefined reference to `ppcuic_init' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:206: qemu-system-ppc] Error 1 make: *** [Makefile:483: ppc-softmmu/all] Error 2 Fix by selecting the PPC4XX config. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-9-philmd@redhat.com> Acked-by: David Gibson Signed-off-by: Paolo Bonzini --- hw/ppc/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'hw') diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 004b7d5..d8482a5 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -110,6 +110,7 @@ config E500 config VIRTEX bool + select PPC4XX select PFLASH_CFI01 select SERIAL select XILINX -- cgit v1.1 From 74969757226e49a7d6157f2ea03746a9ae106cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:11 +0100 Subject: hw/ppc/Makefile: Simplify the sPAPR PCI objects rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CONFIG_PSERIES already selects CONFIG_PCI. Simplify the Makefile rules. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-10-philmd@redhat.com> Acked-by: David Gibson Signed-off-by: Paolo Bonzini --- hw/ppc/Makefile.objs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'hw') diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs index 101e9fc..79adf06 100644 --- a/hw/ppc/Makefile.objs +++ b/hw/ppc/Makefile.objs @@ -7,14 +7,11 @@ obj-$(CONFIG_PSERIES) += spapr_pci.o spapr_rtc.o spapr_drc.o obj-$(CONFIG_PSERIES) += spapr_cpu_core.o spapr_ovec.o spapr_irq.o obj-$(CONFIG_PSERIES) += spapr_tpm_proxy.o obj-$(CONFIG_SPAPR_RNG) += spapr_rng.o +obj-$(call land,$(CONFIG_PSERIES),$(CONFIG_LINUX)) += spapr_pci_vfio.o spapr_pci_nvlink2.o # IBM PowerNV obj-$(CONFIG_POWERNV) += pnv.o pnv_xscom.o pnv_core.o pnv_lpc.o pnv_psi.o pnv_occ.o pnv_bmc.o obj-$(CONFIG_POWERNV) += pnv_homer.o pnv_pnor.o - -ifeq ($(CONFIG_PCI)$(CONFIG_PSERIES)$(CONFIG_LINUX), yyy) -obj-y += spapr_pci_vfio.o spapr_pci_nvlink2.o -endif obj-$(CONFIG_PSERIES) += spapr_rtas_ddw.o # PowerPC 4xx boards obj-$(CONFIG_PPC405) += ppc405_boards.o ppc405_uc.o -- cgit v1.1 From 032757adaa2fb77fcd2067c0063f32a4a8a78636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:12 +0100 Subject: hw/ppc/Kconfig: Only select fw_cfg with machines using OpenBIOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fw_cfg helpers are only used by machines using OpenBIOS. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-11-philmd@redhat.com> Acked-by: David Gibson Signed-off-by: Paolo Bonzini --- hw/ppc/Kconfig | 6 ++++++ hw/ppc/Makefile.objs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index d8482a5..e4ca920 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -72,6 +72,7 @@ config PREP select M48T59 select PC87312 select RS6000_MC + select FW_CFG_PPC config RS6000_MC bool @@ -85,6 +86,7 @@ config MAC_OLDWORLD select GRACKLE_PCI select HEATHROW_PIC select MACIO + select FW_CFG_PPC config MAC_NEWWORLD bool @@ -96,6 +98,7 @@ config MAC_NEWWORLD select MACIO_GPIO select MAC_PMU select UNIN_PCI + select FW_CFG_PPC config E500 bool @@ -130,3 +133,6 @@ config XIVE_KVM bool default y depends on XIVE_SPAPR && KVM + +config FW_CFG_PPC + bool diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs index 79adf06..5c46c68 100644 --- a/hw/ppc/Makefile.objs +++ b/hw/ppc/Makefile.objs @@ -1,5 +1,6 @@ # shared objects -obj-y += ppc.o ppc_booke.o fdt.o fw_cfg.o +obj-y += ppc.o ppc_booke.o fdt.o +obj-$(CONFIG_FW_CFG_PPC) += fw_cfg.o # IBM pSeries (sPAPR) obj-$(CONFIG_PSERIES) += spapr.o spapr_caps.o spapr_vio.o spapr_events.o obj-$(CONFIG_PSERIES) += spapr_hcall.o spapr_iommu.o spapr_rtas.o -- cgit v1.1 From b0048f760957512aecc0b1cb0f4325ed4e102acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:13 +0100 Subject: hw/ppc/Kconfig: Only select FDT helper for machines using it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not all machines use the ppc_create_page_sizes_prop() helper. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-12-philmd@redhat.com> Acked-by: David Gibson Signed-off-by: Paolo Bonzini --- hw/ppc/Kconfig | 10 ++++++++++ hw/ppc/Makefile.objs | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index e4ca920..8e62d8f 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -10,6 +10,7 @@ config PSERIES select XICS_SPAPR select XIVE_SPAPR select MSI_NONBROKEN + select FDT_PPC config SPAPR_RNG bool @@ -26,6 +27,7 @@ config POWERNV select MC146818RTC select XICS select XIVE + select FDT_PPC config PPC405 bool @@ -42,6 +44,7 @@ config PPC440 select PCI_EXPRESS select PPC4XX select SERIAL + select FDT_PPC config PPC4XX bool @@ -60,6 +63,7 @@ config SAM460EX select SMBUS_EEPROM select USB_EHCI_SYSBUS select USB_OHCI + select FDT_PPC config PREP bool @@ -110,6 +114,7 @@ config E500 select PPCE500_PCI select SERIAL select MPC_I2C + select FDT_PPC config VIRTEX bool @@ -118,6 +123,7 @@ config VIRTEX select SERIAL select XILINX select XILINX_ETHLITE + select FDT_PPC config XIVE bool @@ -134,5 +140,9 @@ config XIVE_KVM default y depends on XIVE_SPAPR && KVM +# Only used by 64-bit targets config FW_CFG_PPC bool + +config FDT_PPC + bool diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs index 5c46c68..a4bac57 100644 --- a/hw/ppc/Makefile.objs +++ b/hw/ppc/Makefile.objs @@ -1,5 +1,6 @@ # shared objects -obj-y += ppc.o ppc_booke.o fdt.o +obj-y += ppc.o ppc_booke.o +obj-$(CONFIG_FDT_PPC) += fdt.o obj-$(CONFIG_FW_CFG_PPC) += fw_cfg.o # IBM pSeries (sPAPR) obj-$(CONFIG_PSERIES) += spapr.o spapr_caps.o spapr_vio.o spapr_events.o -- cgit v1.1 From 3fd0305eaf9bb2756f4eafcf5602d1adac928e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:14 +0100 Subject: hw/nvram/Kconfig: Add an entry for the NMC93xx EEPROM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The NMC93xx EEPROM is only used by few NIC cards and the Am53C974 SCSI controller. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-13-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/net/Kconfig | 2 ++ hw/nvram/Kconfig | 4 ++++ hw/nvram/Makefile.objs | 2 +- hw/scsi/Kconfig | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/net/Kconfig b/hw/net/Kconfig index 3856417..af6a11b 100644 --- a/hw/net/Kconfig +++ b/hw/net/Kconfig @@ -14,6 +14,7 @@ config EEPRO100_PCI bool default y if PCI_DEVICES depends on PCI + select NMC93XX_EEPROM config PCNET_PCI bool @@ -28,6 +29,7 @@ config TULIP bool default y if PCI_DEVICES depends on PCI + select NMC93XX_EEPROM config E1000_PCI bool diff --git a/hw/nvram/Kconfig b/hw/nvram/Kconfig index ebaa749..24b0ce6 100644 --- a/hw/nvram/Kconfig +++ b/hw/nvram/Kconfig @@ -7,3 +7,7 @@ config AT24C config MAC_NVRAM bool + +# NMC93XX uses the NS uWire interface (similar to SPI but less configurable) +config NMC93XX_EEPROM + bool diff --git a/hw/nvram/Makefile.objs b/hw/nvram/Makefile.objs index 26f7b4c..a4bdfbf 100644 --- a/hw/nvram/Makefile.objs +++ b/hw/nvram/Makefile.objs @@ -1,5 +1,5 @@ common-obj-$(CONFIG_DS1225Y) += ds1225y.o -common-obj-y += eeprom93xx.o +common-obj-$(CONFIG_NMC93XX_EEPROM) += eeprom93xx.o common-obj-$(CONFIG_AT24C) += eeprom_at24c.o common-obj-y += fw_cfg.o common-obj-y += chrp_nvram.o diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig index b3ba540..77d397c 100644 --- a/hw/scsi/Kconfig +++ b/hw/scsi/Kconfig @@ -34,6 +34,7 @@ config ESP_PCI default y if PCI_DEVICES depends on PCI select ESP + select NMC93XX_EEPROM config SPAPR_VSCSI bool -- cgit v1.1 From 7bebc358df4781b6133c0d21da80a50a63a1d31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 31 Dec 2019 19:32:15 +0100 Subject: hw/nvram/Kconfig: Restrict CHRP NVRAM to machines using OpenBIOS or SLOF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the OpenBIOS and SLOF firmwares use the CHRP NVRAM layout. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191231183216.6781-14-philmd@redhat.com> Acked-by: David Gibson Signed-off-by: Paolo Bonzini --- hw/nvram/Kconfig | 4 ++++ hw/nvram/Makefile.objs | 2 +- hw/ppc/Kconfig | 1 + hw/sparc/Kconfig | 1 + hw/sparc64/Kconfig | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/nvram/Kconfig b/hw/nvram/Kconfig index 24b0ce6..e872fcb 100644 --- a/hw/nvram/Kconfig +++ b/hw/nvram/Kconfig @@ -7,7 +7,11 @@ config AT24C config MAC_NVRAM bool + select CHRP_NVRAM # NMC93XX uses the NS uWire interface (similar to SPI but less configurable) config NMC93XX_EEPROM bool + +config CHRP_NVRAM + bool diff --git a/hw/nvram/Makefile.objs b/hw/nvram/Makefile.objs index a4bdfbf..090df63 100644 --- a/hw/nvram/Makefile.objs +++ b/hw/nvram/Makefile.objs @@ -2,7 +2,7 @@ common-obj-$(CONFIG_DS1225Y) += ds1225y.o common-obj-$(CONFIG_NMC93XX_EEPROM) += eeprom93xx.o common-obj-$(CONFIG_AT24C) += eeprom_at24c.o common-obj-y += fw_cfg.o -common-obj-y += chrp_nvram.o +common-obj-$(CONFIG_CHRP_NVRAM) += chrp_nvram.o common-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o obj-$(CONFIG_PSERIES) += spapr_nvram.o obj-$(CONFIG_NRF51_SOC) += nrf51_nvm.o diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 8e62d8f..e27efe9 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -11,6 +11,7 @@ config PSERIES select XIVE_SPAPR select MSI_NONBROKEN select FDT_PPC + select CHRP_NVRAM config SPAPR_RNG bool diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig index 2a83a80..22aff2f 100644 --- a/hw/sparc/Kconfig +++ b/hw/sparc/Kconfig @@ -12,6 +12,7 @@ config SUN4M select LANCE select M48T59 select STP2000 + select CHRP_NVRAM config LEON3 bool diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig index f9f8b0f..980a201 100644 --- a/hw/sparc64/Kconfig +++ b/hw/sparc64/Kconfig @@ -12,6 +12,7 @@ config SUN4U select IDE_CMD646 select PCKBD select SIMBA + select CHRP_NVRAM config NIAGARA bool -- cgit v1.1 From c9c6b2e1c485670763bb8aea4c769081b9a5fe56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 24 Dec 2019 12:16:28 +0100 Subject: hw/rtc/mc146818: Add missing dependency on ISA Bus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MC146818 sits on an ISA bus. Since it can not be used without it, select ISA in the Kconfig. Fixes: 82f5181777 ("kconfig: introduce kconfig files", 2019-03-07) Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191224111628.3551-1-philmd@redhat.com> Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Bonzini --- hw/rtc/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'hw') diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig index 45daa8d..3dc2dd6 100644 --- a/hw/rtc/Kconfig +++ b/hw/rtc/Kconfig @@ -17,6 +17,7 @@ config TWL92230 depends on I2C config MC146818RTC + depends on ISA_BUS bool config SUN4V_RTC -- cgit v1.1 From ce25653dfb69a2c79c237dfa218029506284d41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 18 Dec 2019 18:19:56 +0100 Subject: hw/ipmi: Remove unnecessary declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we don't use these methods before defining them, no need to forward-declare them. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Corey Minyard Reviewed-by: Marc-André Lureau Message-Id: <20191218172009.8868-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/ipmi/ipmi_bmc_extern.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'hw') diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index 87da9ff..450926e 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -87,10 +87,6 @@ typedef struct IPMIBmcExtern { bool send_reset; } IPMIBmcExtern; -static int can_receive(void *opaque); -static void receive(void *opaque, const uint8_t *buf, int size); -static void chr_event(void *opaque, int event); - static unsigned char ipmb_checksum(const unsigned char *data, int size, unsigned char start) { -- cgit v1.1 From 1d043b1ec03406442cea52680756ba19b1581f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 18 Dec 2019 18:19:57 +0100 Subject: hw/ipmi: Explicit we ignore some QEMUChrEvent in IOEventHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit all the events ignored by this frontend, to silent the following GCC warning: hw/ipmi/ipmi_bmc_extern.c: In function ‘chr_event’: hw/ipmi/ipmi_bmc_extern.c:389:5: error: enumeration value ‘CHR_EVENT_BREAK’ not handled in switch [-Werror=switch] 389 | switch (event) { | ^~~~~~ hw/ipmi/ipmi_bmc_extern.c:389:5: error: enumeration value ‘CHR_EVENT_MUX_IN’ not handled in switch [-Werror=switch] hw/ipmi/ipmi_bmc_extern.c:389:5: error: enumeration value ‘CHR_EVENT_MUX_OUT’ not handled in switch [-Werror=switch] cc1: all warnings being treated as errors Signed-off-by: Philippe Mathieu-Daudé Acked-by: Corey Minyard Reviewed-by: Marc-André Lureau Reviewed-by: Richard Henderson Message-Id: <20191218172009.8868-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/ipmi/ipmi_bmc_extern.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hw') diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index 450926e..adf2afe 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -435,6 +435,12 @@ static void chr_event(void *opaque, int event) k->handle_rsp(s, ibe->outbuf[0], ibe->inbuf + 1, 3); } break; + + case CHR_EVENT_BREAK: + case CHR_EVENT_MUX_IN: + case CHR_EVENT_MUX_OUT: + /* Ignore */ + break; } } -- cgit v1.1 From 75c5bb0b72f1421234cb34e4361dc2f2e4601dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 18 Dec 2019 18:19:58 +0100 Subject: hw/char/terminal3270: Explicit ignored QEMUChrEvent in IOEventHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit all the events ignored by this frontend, to silent the following GCC warning: CC s390x-softmmu/hw/char/terminal3270.o hw/char/terminal3270.c: In function ‘chr_event’: hw/char/terminal3270.c:156:5: error: enumeration value ‘CHR_EVENT_BREAK’ not handled in switch [-Werror=switch] 156 | switch (event) { | ^~~~~~ hw/char/terminal3270.c:156:5: error: enumeration value ‘CHR_EVENT_MUX_IN’ not handled in switch [-Werror=switch] hw/char/terminal3270.c:156:5: error: enumeration value ‘CHR_EVENT_MUX_OUT’ not handled in switch [-Werror=switch] cc1: all warnings being treated as errors Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Reviewed-by: Marc-André Lureau Message-Id: <20191218172009.8868-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/char/terminal3270.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw') diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c index 6859c1b..2aab04f 100644 --- a/hw/char/terminal3270.c +++ b/hw/char/terminal3270.c @@ -166,6 +166,11 @@ static void chr_event(void *opaque, int event) sch->curr_status.scsw.dstat = SCSW_DSTAT_DEVICE_END; css_conditional_io_interrupt(sch); break; + case CHR_EVENT_BREAK: + case CHR_EVENT_MUX_IN: + case CHR_EVENT_MUX_OUT: + /* Ignore */ + break; } } -- cgit v1.1 From c263158ed9a0cfe62a49a7415874a7ce69c3e6b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 18 Dec 2019 18:19:59 +0100 Subject: hw/usb/dev-serial: Explicit we ignore few QEMUChrEvent in IOEventHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit all the events ignored by this frontend, to silent the following GCC warning: hw/usb/dev-serial.c: In function ‘usb_serial_event’: hw/usb/dev-serial.c:468:5: error: enumeration value ‘CHR_EVENT_MUX_IN’ not handled in switch [-Werror=switch] 468 | switch (event) { | ^~~~~~ hw/usb/dev-serial.c:468:5: error: enumeration value ‘CHR_EVENT_MUX_OUT’ not handled in switch [-Werror=switch] cc1: all warnings being treated as errors Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Message-Id: <20191218172009.8868-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/usb/dev-serial.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hw') diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 45cc741..2ba6870 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -479,6 +479,10 @@ static void usb_serial_event(void *opaque, int event) usb_device_detach(&s->dev); } break; + case CHR_EVENT_MUX_IN: + case CHR_EVENT_MUX_OUT: + /* Ignore */ + break; } } -- cgit v1.1 From acd51e41311f8a2c2dc16dfd66334d2eda4f80f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 18 Dec 2019 18:20:00 +0100 Subject: hw/usb/redirect: Explicit we ignore few QEMUChrEvent in IOEventHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit all the events ignored by this frontend, to silent the following GCC warning: CC hw/usb/redirect.o hw/usb/redirect.c: In function ‘usbredir_chardev_event’: hw/usb/redirect.c:1361:5: error: enumeration value ‘CHR_EVENT_BREAK’ not handled in switch [-Werror=switch] 1361 | switch (event) { | ^~~~~~ hw/usb/redirect.c:1361:5: error: enumeration value ‘CHR_EVENT_MUX_IN’ not handled in switch [-Werror=switch] hw/usb/redirect.c:1361:5: error: enumeration value ‘CHR_EVENT_MUX_OUT’ not handled in switch [-Werror=switch] cc1: all warnings being treated as errors Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Message-Id: <20191218172009.8868-6-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/usb/redirect.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw') diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index e0f5ca6..ddc1a59 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1370,6 +1370,11 @@ static void usbredir_chardev_event(void *opaque, int event) DPRINTF("chardev close\n"); qemu_bh_schedule(dev->chardev_close_bh); break; + case CHR_EVENT_BREAK: + case CHR_EVENT_MUX_IN: + case CHR_EVENT_MUX_OUT: + /* Ignore */ + break; } } -- cgit v1.1 From dfe8114aa4ac51bf67df81327ee50edad7d9a31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 18 Dec 2019 18:20:01 +0100 Subject: ccid-card-passthru: Explicit we ignore QEMUChrEvent in IOEventHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit all the events ignored by this frontend, to silent the following GCC warning: hw/usb/ccid-card-passthru.c: In function ‘ccid_card_vscard_event’: hw/usb/ccid-card-passthru.c:314:5: error: enumeration value ‘CHR_EVENT_MUX_IN’ not handled in switch [-Werror=switch] 314 | switch (event) { | ^~~~~~ hw/usb/ccid-card-passthru.c:314:5: error: enumeration value ‘CHR_EVENT_MUX_OUT’ not handled in switch [-Werror=switch] hw/usb/ccid-card-passthru.c:314:5: error: enumeration value ‘CHR_EVENT_CLOSED’ not handled in switch [-Werror=switch] cc1: all warnings being treated as errors Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Message-Id: <20191218172009.8868-7-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/usb/ccid-card-passthru.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw') diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 267ed9a..e53696c 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -318,6 +318,11 @@ static void ccid_card_vscard_event(void *opaque, int event) case CHR_EVENT_OPENED: DPRINTF(card, D_INFO, "%s: CHR_EVENT_OPENED\n", __func__); break; + case CHR_EVENT_MUX_IN: + case CHR_EVENT_MUX_OUT: + case CHR_EVENT_CLOSED: + /* Ignore */ + break; } } -- cgit v1.1 From 669457f352a50baaae26c5e168e628e4f46e6170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 18 Dec 2019 18:20:04 +0100 Subject: vhost-user-blk: Explicit we ignore few QEMUChrEvent in IOEventHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit all the events ignored by this frontend, to silent the following GCC warning: CC s390x-softmmu/hw/block/vhost-user-blk.o hw/block/vhost-user-blk.c: In function ‘vhost_user_blk_event’: hw/block/vhost-user-blk.c:370:5: error: enumeration value ‘CHR_EVENT_BREAK’ not handled in switch [-Werror=switch] 370 | switch (event) { | ^~~~~~ hw/block/vhost-user-blk.c:370:5: error: enumeration value ‘CHR_EVENT_MUX_IN’ not handled in switch [-Werror=switch] hw/block/vhost-user-blk.c:370:5: error: enumeration value ‘CHR_EVENT_MUX_OUT’ not handled in switch [-Werror=switch] cc1: all warnings being treated as errors Signed-off-by: Philippe Mathieu-Daudé Acked-by: Michael S. Tsirkin Reviewed-by: Marc-André Lureau Message-Id: <20191218172009.8868-10-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/block/vhost-user-blk.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw') diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 63da9bb..ccaf2ad 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -383,6 +383,11 @@ static void vhost_user_blk_event(void *opaque, int event) s->watch = 0; } break; + case CHR_EVENT_BREAK: + case CHR_EVENT_MUX_IN: + case CHR_EVENT_MUX_OUT: + /* Ignore */ + break; } } -- cgit v1.1 From 3042bd34136b718f1274c6d28c333ec1d0dd3803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 18 Dec 2019 18:20:05 +0100 Subject: virtio-console: Explicit we ignore some QEMUChrEvent in IOEventHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit all the events ignored by this frontend, to silent the following GCC warning: CC hw/char/virtio-console.o hw/char/virtio-console.c: In function ‘chr_event’: hw/char/virtio-console.c:154:5: error: enumeration value ‘CHR_EVENT_BREAK’ not handled in switch [-Werror=switch] 154 | switch (event) { | ^~~~~~ hw/char/virtio-console.c:154:5: error: enumeration value ‘CHR_EVENT_MUX_IN’ not handled in switch [-Werror=switch] hw/char/virtio-console.c:154:5: error: enumeration value ‘CHR_EVENT_MUX_OUT’ not handled in switch [-Werror=switch] cc1: all warnings being treated as errors Signed-off-by: Philippe Mathieu-Daudé Acked-by: Michael S. Tsirkin Reviewed-by: Marc-André Lureau Message-Id: <20191218172009.8868-11-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/char/virtio-console.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw') diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c index c13649f..cbb304d 100644 --- a/hw/char/virtio-console.c +++ b/hw/char/virtio-console.c @@ -162,6 +162,11 @@ static void chr_event(void *opaque, int event) } virtio_serial_close(port); break; + case CHR_EVENT_BREAK: + case CHR_EVENT_MUX_IN: + case CHR_EVENT_MUX_OUT: + /* Ignore */ + break; } } -- cgit v1.1 From 083b266f69f36195aef22cb224f86b99ca0d6feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 18 Dec 2019 18:20:09 +0100 Subject: chardev: Use QEMUChrEvent enum in IOEventHandler typedef MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chardev events are listed in the QEMUChrEvent enum. By using the enum in the IOEventHandler typedef we: - make the IOEventHandler type more explicit (this handler process out-of-band information, while the IOReadHandler is in-band), - help static code analyzers. This patch was produced with the following spatch script: @match@ expression backend, opaque, context, set_open; identifier fd_can_read, fd_read, fd_event, be_change; @@ qemu_chr_fe_set_handlers(backend, fd_can_read, fd_read, fd_event, be_change, opaque, context, set_open); @depends on match@ identifier opaque, event; identifier match.fd_event; @@ static -void fd_event(void *opaque, int event) +void fd_event(void *opaque, QEMUChrEvent event) { ... } Then the typedef was modified manually in include/chardev/char-fe.h. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Corey Minyard Acked-by: Cornelia Huck Reviewed-by: Marc-André Lureau Message-Id: <20191218172009.8868-15-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/arm/pxa2xx.c | 2 +- hw/arm/strongarm.c | 2 +- hw/block/vhost-user-blk.c | 2 +- hw/char/cadence_uart.c | 2 +- hw/char/digic-uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c | 2 +- hw/char/exynos4210_uart.c | 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/ipoctal232.c | 2 +- hw/char/lm32_juart.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/mcf_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/nrf51_uart.c | 2 +- hw/char/pl011.c | 2 +- hw/char/serial.c | 2 +- hw/char/sh_serial.c | 2 +- hw/char/terminal3270.c | 2 +- hw/char/virtio-console.c | 2 +- hw/char/xilinx_uartlite.c | 2 +- hw/ipmi/ipmi_bmc_extern.c | 2 +- hw/mips/boston.c | 2 +- hw/mips/mips_malta.c | 2 +- hw/riscv/riscv_htif.c | 2 +- hw/riscv/sifive_uart.c | 2 +- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-serial.c | 2 +- hw/usb/redirect.c | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) (limited to 'hw') diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index cdafde2..950ff42 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -1955,7 +1955,7 @@ static void pxa2xx_fir_rx(void *opaque, const uint8_t *buf, int size) pxa2xx_fir_update(s); } -static void pxa2xx_fir_event(void *opaque, int event) +static void pxa2xx_fir_event(void *opaque, QEMUChrEvent event) { } diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index 6bee034..c6776e8 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -1093,7 +1093,7 @@ static void strongarm_uart_receive(void *opaque, const uint8_t *buf, int size) strongarm_uart_update_int_status(s); } -static void strongarm_uart_event(void *opaque, int event) +static void strongarm_uart_event(void *opaque, QEMUChrEvent event) { StrongARMUARTState *s = opaque; if (event == CHR_EVENT_BREAK) { diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index ccaf2ad..98b383f 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -361,7 +361,7 @@ static gboolean vhost_user_blk_watch(GIOChannel *chan, GIOCondition cond, return true; } -static void vhost_user_blk_event(void *opaque, int event) +static void vhost_user_blk_event(void *opaque, QEMUChrEvent event) { DeviceState *dev = opaque; VirtIODevice *vdev = VIRTIO_DEVICE(dev); diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c index 0e315b2..51791bd 100644 --- a/hw/char/cadence_uart.c +++ b/hw/char/cadence_uart.c @@ -348,7 +348,7 @@ static void uart_receive(void *opaque, const uint8_t *buf, int size) } } -static void uart_event(void *opaque, int event) +static void uart_event(void *opaque, QEMUChrEvent event) { CadenceUARTState *s = opaque; uint8_t buf = '\0'; diff --git a/hw/char/digic-uart.c b/hw/char/digic-uart.c index 974a261..033eba0 100644 --- a/hw/char/digic-uart.c +++ b/hw/char/digic-uart.c @@ -131,7 +131,7 @@ static void uart_rx(void *opaque, const uint8_t *buf, int size) s->reg_rx = *buf; } -static void uart_event(void *opaque, int event) +static void uart_event(void *opaque, QEMUChrEvent event) { } diff --git a/hw/char/escc.c b/hw/char/escc.c index 8f7bf32..c40c1d2 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -634,7 +634,7 @@ static void serial_receive1(void *opaque, const uint8_t *buf, int size) serial_receive_byte(s, buf[0]); } -static void serial_event(void *opaque, int event) +static void serial_event(void *opaque, QEMUChrEvent event) { ESCCChannelState *s = opaque; if (event == CHR_EVENT_BREAK) diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c index 15ac12e..f34f767 100644 --- a/hw/char/etraxfs_ser.c +++ b/hw/char/etraxfs_ser.c @@ -202,7 +202,7 @@ static int serial_can_receive(void *opaque) return sizeof(s->rx_fifo) - s->rx_fifo_len; } -static void serial_event(void *opaque, int event) +static void serial_event(void *opaque, QEMUChrEvent event) { } diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c index d6b6b62..7e5c5ce 100644 --- a/hw/char/exynos4210_uart.c +++ b/hw/char/exynos4210_uart.c @@ -528,7 +528,7 @@ static void exynos4210_uart_receive(void *opaque, const uint8_t *buf, int size) } -static void exynos4210_uart_event(void *opaque, int event) +static void exynos4210_uart_event(void *opaque, QEMUChrEvent event) { Exynos4210UartState *s = (Exynos4210UartState *)opaque; diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c index fe3cbf4..8e59c3b 100644 --- a/hw/char/grlib_apbuart.c +++ b/hw/char/grlib_apbuart.c @@ -155,7 +155,7 @@ static void grlib_apbuart_receive(void *opaque, const uint8_t *buf, int size) } } -static void grlib_apbuart_event(void *opaque, int event) +static void grlib_apbuart_event(void *opaque, QEMUChrEvent event) { trace_grlib_apbuart_event(event); } diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index fddde9b..d09c210 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -323,7 +323,7 @@ static void imx_receive(void *opaque, const uint8_t *buf, int size) imx_put_data(opaque, *buf); } -static void imx_event(void *opaque, int event) +static void imx_event(void *opaque, QEMUChrEvent event) { if (event == CHR_EVENT_BREAK) { imx_put_data(opaque, URXD_BRK | URXD_FRMERR | URXD_ERR); diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c index 66c163b..80e9dff 100644 --- a/hw/char/ipoctal232.c +++ b/hw/char/ipoctal232.c @@ -503,7 +503,7 @@ static void hostdev_receive(void *opaque, const uint8_t *buf, int size) } } -static void hostdev_event(void *opaque, int event) +static void hostdev_event(void *opaque, QEMUChrEvent event) { SCC2698Channel *ch = opaque; switch (event) { diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c index e0b1bd6..da9dd56 100644 --- a/hw/char/lm32_juart.c +++ b/hw/char/lm32_juart.c @@ -104,7 +104,7 @@ static int juart_can_rx(void *opaque) return !(s->jrx & JRX_FULL); } -static void juart_event(void *opaque, int event) +static void juart_event(void *opaque, QEMUChrEvent event) { } diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c index 32f29c4..8d7a475 100644 --- a/hw/char/lm32_uart.c +++ b/hw/char/lm32_uart.c @@ -235,7 +235,7 @@ static int uart_can_rx(void *opaque) return !(s->regs[R_LSR] & LSR_DR); } -static void uart_event(void *opaque, int event) +static void uart_event(void *opaque, QEMUChrEvent event) { } diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c index 58323ba..2de3680 100644 --- a/hw/char/mcf_uart.c +++ b/hw/char/mcf_uart.c @@ -256,7 +256,7 @@ static void mcf_uart_push_byte(mcf_uart_state *s, uint8_t data) mcf_uart_update(s); } -static void mcf_uart_event(void *opaque, int event) +static void mcf_uart_event(void *opaque, QEMUChrEvent event) { mcf_uart_state *s = (mcf_uart_state *)opaque; diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c index c358ca0..1c7b614 100644 --- a/hw/char/milkymist-uart.c +++ b/hw/char/milkymist-uart.c @@ -180,7 +180,7 @@ static int uart_can_rx(void *opaque) return !(s->regs[R_STAT] & STAT_RX_EVT); } -static void uart_event(void *opaque, int event) +static void uart_event(void *opaque, QEMUChrEvent event) { } diff --git a/hw/char/nrf51_uart.c b/hw/char/nrf51_uart.c index 2777afe..b67fd21 100644 --- a/hw/char/nrf51_uart.c +++ b/hw/char/nrf51_uart.c @@ -245,7 +245,7 @@ static int uart_can_receive(void *opaque) return s->rx_started ? (UART_FIFO_LENGTH - s->rx_fifo_len) : 0; } -static void uart_event(void *opaque, int event) +static void uart_event(void *opaque, QEMUChrEvent event) { NRF51UARTState *s = NRF51_UART(opaque); diff --git a/hw/char/pl011.c b/hw/char/pl011.c index 84ad8ff..23cd544 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -280,7 +280,7 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size) pl011_put_fifo(opaque, *buf); } -static void pl011_event(void *opaque, int event) +static void pl011_event(void *opaque, QEMUChrEvent event) { if (event == CHR_EVENT_BREAK) pl011_put_fifo(opaque, 0x400); diff --git a/hw/char/serial.c b/hw/char/serial.c index b4aa250..992b5ee 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -634,7 +634,7 @@ static void serial_receive1(void *opaque, const uint8_t *buf, int size) serial_update_irq(s); } -static void serial_event(void *opaque, int event) +static void serial_event(void *opaque, QEMUChrEvent event) { SerialState *s = opaque; DPRINTF("event %x\n", event); diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 07dc16b..167f4d8 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -358,7 +358,7 @@ static void sh_serial_receive1(void *opaque, const uint8_t *buf, int size) } } -static void sh_serial_event(void *opaque, int event) +static void sh_serial_event(void *opaque, QEMUChrEvent event) { sh_serial_state *s = opaque; if (event == CHR_EVENT_BREAK) diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c index 2aab04f..f7aba12 100644 --- a/hw/char/terminal3270.c +++ b/hw/char/terminal3270.c @@ -142,7 +142,7 @@ static void terminal_read(void *opaque, const uint8_t *buf, int size) } } -static void chr_event(void *opaque, int event) +static void chr_event(void *opaque, QEMUChrEvent event) { Terminal3270 *t = opaque; CcwDevice *ccw_dev = CCW_DEVICE(t); diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c index cbb304d..a7d34fe 100644 --- a/hw/char/virtio-console.c +++ b/hw/char/virtio-console.c @@ -145,7 +145,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size) virtio_serial_write(port, buf, size); } -static void chr_event(void *opaque, int event) +static void chr_event(void *opaque, QEMUChrEvent event) { VirtConsole *vcon = opaque; VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(vcon); diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index 2c47275..aa6bf02 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -206,7 +206,7 @@ static int uart_can_rx(void *opaque) return s->rx_fifo_len < sizeof(s->rx_fifo); } -static void uart_event(void *opaque, int event) +static void uart_event(void *opaque, QEMUChrEvent event) { } diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index adf2afe..16a4117 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -379,7 +379,7 @@ static void receive(void *opaque, const uint8_t *buf, int size) handle_hw_op(ibe, hw_op); } -static void chr_event(void *opaque, int event) +static void chr_event(void *opaque, QEMUChrEvent event) { IPMIBmcExtern *ibe = opaque; IPMIInterface *s = ibe->parent.intf; diff --git a/hw/mips/boston.c b/hw/mips/boston.c index ca7d813..29b476b 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -98,7 +98,7 @@ enum boston_plat_reg { PLAT_SYS_CTL = 0x48, }; -static void boston_lcd_event(void *opaque, int event) +static void boston_lcd_event(void *opaque, QEMUChrEvent event) { BostonState *s = opaque; if (event == CHR_EVENT_OPENED && !s->lcd_inited) { diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 783cd99..72c03ba 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -545,7 +545,7 @@ static void malta_fpga_reset(void *opaque) snprintf(s->display_text, 9, " "); } -static void malta_fgpa_display_event(void *opaque, int event) +static void malta_fgpa_display_event(void *opaque, QEMUChrEvent event) { MaltaFPGAState *s = opaque; diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c index 4f7b11d..ca87a5c 100644 --- a/hw/riscv/riscv_htif.c +++ b/hw/riscv/riscv_htif.c @@ -96,7 +96,7 @@ static void htif_recv(void *opaque, const uint8_t *buf, int size) * Called by the char dev to supply special events to the HTIF console. * Not used for HTIF. */ -static void htif_event(void *opaque, int event) +static void htif_event(void *opaque, QEMUChrEvent event) { } diff --git a/hw/riscv/sifive_uart.c b/hw/riscv/sifive_uart.c index a403ae9..9350482 100644 --- a/hw/riscv/sifive_uart.c +++ b/hw/riscv/sifive_uart.c @@ -162,7 +162,7 @@ static int uart_can_rx(void *opaque) return s->rx_fifo_len < sizeof(s->rx_fifo); } -static void uart_event(void *opaque, int event) +static void uart_event(void *opaque, QEMUChrEvent event) { } diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index e53696c..3d40b70 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -307,7 +307,7 @@ static void ccid_card_vscard_read(void *opaque, const uint8_t *buf, int size) } } -static void ccid_card_vscard_event(void *opaque, int event) +static void ccid_card_vscard_event(void *opaque, QEMUChrEvent event) { PassthruState *card = opaque; diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 2ba6870..9646fe7 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -461,7 +461,7 @@ static void usb_serial_read(void *opaque, const uint8_t *buf, int size) s->recv_used += size; } -static void usb_serial_event(void *opaque, int event) +static void usb_serial_event(void *opaque, QEMUChrEvent event) { USBSerialState *s = opaque; diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index ddc1a59..0068aa8 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1354,7 +1354,7 @@ static void usbredir_chardev_read(void *opaque, const uint8_t *buf, int size) usbredirparser_do_write(dev->parser); } -static void usbredir_chardev_event(void *opaque, int event) +static void usbredir_chardev_event(void *opaque, QEMUChrEvent event) { USBRedirDevice *dev = opaque; -- cgit v1.1