From 602a3921ffd62a08c29750d123e0d5d96acc84ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 13 Mar 2014 03:29:51 +0100 Subject: Revert "KVM: Split QEMUMachine typedef into separate header" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9c06a1f79f959fffd09bfb7efc3d76051a6cd2da. The new header sysemu/qemumachine.h is undesired. Suggested-by: Paolo Bonzini Signed-off-by: Andreas Färber --- include/hw/boards.h | 3 ++- include/hw/xen/xen.h | 1 - include/sysemu/kvm.h | 1 - include/sysemu/qemumachine.h | 16 ---------------- include/sysemu/qtest.h | 1 - kvm-stub.c | 1 - 6 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 include/sysemu/qemumachine.h diff --git a/include/hw/boards.h b/include/hw/boards.h index c2096e6ba2..89eb6651e2 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -4,9 +4,10 @@ #define HW_BOARDS_H #include "sysemu/blockdev.h" -#include "sysemu/qemumachine.h" #include "hw/qdev.h" +typedef struct QEMUMachine QEMUMachine; + typedef struct QEMUMachineInitArgs { const QEMUMachine *machine; ram_addr_t ram_size; diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h index e1818213b2..9d549fc83d 100644 --- a/include/hw/xen/xen.h +++ b/include/hw/xen/xen.h @@ -10,7 +10,6 @@ #include "hw/irq.h" #include "qemu-common.h" -#include "sysemu/qemumachine.h" /* xen-machine.c */ enum xen_mode { diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index ed01998aa8..0bee1e8996 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -18,7 +18,6 @@ #include "config-host.h" #include "qemu/queue.h" #include "qom/cpu.h" -#include "sysemu/qemumachine.h" #ifdef CONFIG_KVM #include diff --git a/include/sysemu/qemumachine.h b/include/sysemu/qemumachine.h deleted file mode 100644 index 4cefd56b67..0000000000 --- a/include/sysemu/qemumachine.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * QEMU Machine typedef - * - * Copyright Alexander Graf - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - * - */ - -#ifndef QEMUMACHINE_H -#define QEMUMACHINE_H - -typedef struct QEMUMachine QEMUMachine; - -#endif /* !QEMUMACHINE_H */ diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h index e62281d4bf..224131f298 100644 --- a/include/sysemu/qtest.h +++ b/include/sysemu/qtest.h @@ -16,7 +16,6 @@ #include "qemu-common.h" #include "qapi/error.h" -#include "sysemu/qemumachine.h" extern bool qtest_allowed; diff --git a/kvm-stub.c b/kvm-stub.c index 4ef084e84a..ccdba62d67 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -14,7 +14,6 @@ #include "hw/hw.h" #include "cpu.h" #include "sysemu/kvm.h" -#include "sysemu/qemumachine.h" #ifndef CONFIG_USER_ONLY #include "hw/pci/msi.h" -- cgit v1.2.1 From 7a1a4dac94e5dea21ecc404f362ef2c62f9f089c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 13 Mar 2014 03:40:13 +0100 Subject: Move QEMUMachine typedef to qemu/typedefs.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As reported in commit 9c06a1f79f959fffd09bfb7efc3d76051a6cd2da, xen.h is not self-contained with regards to its use of QEMUMachine. Fix this. Reported-by: Alexander Graf Suggested-by: Paolo Bonzini Signed-off-by: Andreas Färber --- include/hw/boards.h | 2 -- include/qemu/typedefs.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 89eb6651e2..fd9388c695 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -6,8 +6,6 @@ #include "sysemu/blockdev.h" #include "hw/qdev.h" -typedef struct QEMUMachine QEMUMachine; - typedef struct QEMUMachineInitArgs { const QEMUMachine *machine; ram_addr_t ram_size; diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 83c9b1675d..bf8daac659 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -30,6 +30,7 @@ typedef struct MemoryListener MemoryListener; typedef struct MemoryMappingList MemoryMappingList; +typedef struct QEMUMachine QEMUMachine; typedef struct NICInfo NICInfo; typedef struct HCIInfo HCIInfo; typedef struct AudioState AudioState; -- cgit v1.2.1 From 8f3babb74d48e17e8a717b79d57c1fbe6b3b2480 Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Mon, 10 Mar 2014 23:07:58 +1100 Subject: pseries: Update SLOF firmware image to qemu-slof-20140304 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The changelog is: > version: update to 20140304 > Introduce dummy console device > vio-vscsi: Fix CRQ allocation alignment > version: update to 20140204 > virtio-9p: disable unused structure > Make "boot net:dhcp" boot from IPv4 only > Fix virtio device shutdown > Change shutdown method name for virtio-scsi > Add support for 64bit LE ABI v1 and v2 support > Change representation of string environment variable > cas: return error when unknown node found > version: update > Reset obp-tftp arguments before parsing > Enable seamless netboot on IPv6 network > Fix shutdown for virtio devices > Fix zero checksum in UDP header > Handle router advertisement message properly > [oex]hci_exit: Check before freeing/unmapping memory > Work around missing sc 1 traps on pHyp > fix print_version() to return where it came from > usb-xhci: memory freeing and using returns as bool uniformly > Output banner and initial display output in VNC window > use VERSION file to generate FW version > cas: remove warning > Add support for loading little endian ELF binaries. > Add bswap_{16,32,64}p > dhcpv6 and other minor net-snk fixes > Fix missing drop in virtio-fs setup-alias > Find next available alias name > SLOF does not exit if given 1KB disk > boot: enable support for bootindex > pci-properties: add properties to enable hotplug for spapr > e1000: remember node handle > Increase quiesce tokens array size > virtio: timeout after 5sec > Enable IPv6 support in dns > usb-ohci: fix warnings > Add ipv6 support in net-snk > ipv4: fix frame overwriting following arp_send_request > e1000: fix SLOF_dma_map_out arguments > Maintain single global packet buffer for tftp > Increase virtio-net receive queue size > Increase veth receive queue size > Fix dprintf macros at various points > usb-ohci: rewrite done_head processing code > boot: add net in default boot order > block 0 address in the allocator > scsi: make-media-alias fix > usb-xhci: add xhci host controller support > usb-xhci: add xhci support > Avoid veth read/write calls with zero length buffer > boot: include other aliases > usb-core: disable xhci Cc: Andreas Färber Cc: Nikunj A Dadhania Signed-off-by: Alexey Kardashevskiy --- pc-bios/README | 2 +- pc-bios/slof.bin | Bin 873920 -> 921224 bytes roms/SLOF | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pc-bios/README b/pc-bios/README index 2bb6357ea6..8b22080187 100644 --- a/pc-bios/README +++ b/pc-bios/README @@ -17,7 +17,7 @@ - SLOF (Slimline Open Firmware) is a free IEEE 1275 Open Firmware implementation for certain IBM POWER hardware. The sources are at https://github.com/aik/SLOF, and the image currently in qemu is - built from git tag qemu-slof-20131015. + built from git tag qemu-slof-20140304. - sgabios (the Serial Graphics Adapter option ROM) provides a means for legacy x86 software to communicate with an attached serial console as diff --git a/pc-bios/slof.bin b/pc-bios/slof.bin index 92a9831be7..a742bffcae 100644 Binary files a/pc-bios/slof.bin and b/pc-bios/slof.bin differ diff --git a/roms/SLOF b/roms/SLOF index e2e8ac901e..af6b7bf587 160000 --- a/roms/SLOF +++ b/roms/SLOF @@ -1 +1 @@ -Subproject commit e2e8ac901e617573ea383f9cffd136146d0675a4 +Subproject commit af6b7bf5879b6cd6825de2a107cb0e3219fb1df5 -- cgit v1.2.1 From fb0e843a11abae5b959a4b02be7aef617c023b4e Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Thu, 13 Feb 2014 12:08:35 +1100 Subject: xics-kvm: Fix reset function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently interrupt priorities are set to 0 (highest) at the very beginning of the guest execution which is not correct and makes the guest produce random interrupt error messages such as: "Interrupt 0x1001 (real) is invalid, disabling it". This also prevents interrupt states from correct migration. This initializes priority to 0xFF as the emulated XICS does. Suggested-by: Paul Mackerras Signed-off-by: Alexey Kardashevskiy Signed-off-by: Andreas Färber --- hw/intc/xics_kvm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index a5bbc2406d..c93dae053d 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -269,7 +269,16 @@ static void ics_kvm_set_irq(void *opaque, int srcno, int val) static void ics_kvm_reset(DeviceState *dev) { - ics_set_kvm_state(ICS(dev), 1); + ICSState *ics = ICS(dev); + int i; + + memset(ics->irqs, 0, sizeof(ICSIRQState) * ics->nr_irqs); + for (i = 0; i < ics->nr_irqs; i++) { + ics->irqs[i].priority = 0xff; + ics->irqs[i].saved_priority = 0xff; + } + + ics_set_kvm_state(ics, 1); } static void ics_kvm_realize(DeviceState *dev, Error **errp) -- cgit v1.2.1 From c6ba42f6bce0e361e27803622987ffbd05ce7b7a Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Thu, 21 Nov 2013 15:08:55 +1100 Subject: spapr-pci: Convert to QOM realize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This converts the old-style SysBusDevice::init() callback to a new-style DeviceClass::realize() callback. As a part of conversion, this replaces fprintf(stderr) with error_setg() as realize() does not "return" any value, instead it puts the extended error into **errp. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Mike Day Signed-off-by: Andreas Färber --- hw/ppc/spapr_pci.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index cea9469872..f7374937de 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -505,9 +505,9 @@ static AddressSpace *spapr_pci_dma_iommu(PCIBus *bus, void *opaque, int devfn) return &phb->iommu_as; } -static int spapr_phb_init(SysBusDevice *s) +static void spapr_phb_realize(DeviceState *dev, Error **errp) { - DeviceState *dev = DEVICE(s); + SysBusDevice *s = SYS_BUS_DEVICE(dev); sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(s); PCIHostState *phb = PCI_HOST_BRIDGE(s); const char *busname; @@ -521,9 +521,9 @@ static int spapr_phb_init(SysBusDevice *s) if ((sphb->buid != -1) || (sphb->dma_liobn != -1) || (sphb->mem_win_addr != -1) || (sphb->io_win_addr != -1)) { - fprintf(stderr, "Either \"index\" or other parameters must" - " be specified for PAPR PHB, not both\n"); - return -1; + error_setg(errp, "Either \"index\" or other parameters must" + " be specified for PAPR PHB, not both"); + return; } sphb->buid = SPAPR_PCI_BASE_BUID + sphb->index; @@ -536,28 +536,28 @@ static int spapr_phb_init(SysBusDevice *s) } if (sphb->buid == -1) { - fprintf(stderr, "BUID not specified for PHB\n"); - return -1; + error_setg(errp, "BUID not specified for PHB"); + return; } if (sphb->dma_liobn == -1) { - fprintf(stderr, "LIOBN not specified for PHB\n"); - return -1; + error_setg(errp, "LIOBN not specified for PHB"); + return; } if (sphb->mem_win_addr == -1) { - fprintf(stderr, "Memory window address not specified for PHB\n"); - return -1; + error_setg(errp, "Memory window address not specified for PHB"); + return; } if (sphb->io_win_addr == -1) { - fprintf(stderr, "IO window address not specified for PHB\n"); - return -1; + error_setg(errp, "IO window address not specified for PHB"); + return; } if (find_phb(spapr, sphb->buid)) { - fprintf(stderr, "PCI host bridges must have unique BUIDs\n"); - return -1; + error_setg(errp, "PCI host bridges must have unique BUIDs"); + return; } sphb->dtbusname = g_strdup_printf("pci@%" PRIx64, sphb->buid); @@ -624,8 +624,9 @@ static int spapr_phb_init(SysBusDevice *s) sphb->tcet = spapr_tce_new_table(dev, sphb->dma_liobn, sphb->dma_window_size); if (!sphb->tcet) { - fprintf(stderr, "Unable to create TCE table for %s\n", sphb->dtbusname); - return -1; + error_setg(errp, "Unable to create TCE table for %s", + sphb->dtbusname); + return; } address_space_init(&sphb->iommu_as, spapr_tce_get_iommu(sphb->tcet), sphb->dtbusname); @@ -642,13 +643,12 @@ static int spapr_phb_init(SysBusDevice *s) irq = spapr_allocate_lsi(0); if (!irq) { - return -1; + error_setg(errp, "spapr_allocate_lsi failed"); + return; } sphb->lsi_table[i].irq = irq; } - - return 0; } static void spapr_phb_reset(DeviceState *qdev) @@ -731,11 +731,10 @@ static const char *spapr_phb_root_bus_path(PCIHostState *host_bridge, static void spapr_phb_class_init(ObjectClass *klass, void *data) { PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass); - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); hc->root_bus_path = spapr_phb_root_bus_path; - sdc->init = spapr_phb_init; + dc->realize = spapr_phb_realize; dc->props = spapr_phb_properties; dc->reset = spapr_phb_reset; dc->vmsd = &vmstate_spapr_pci; -- cgit v1.2.1 From 295d51aa6a0d3b9a97200913f58a4d8b0c53ac42 Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Thu, 21 Nov 2013 15:08:58 +1100 Subject: spapr-pci: Convert fprintf() to error_report() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexey Kardashevskiy Reviewed-by: Mike Day Signed-off-by: Andreas Färber --- hw/ppc/spapr_pci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index f7374937de..3c54399d9d 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -32,6 +32,7 @@ #include "exec/address-spaces.h" #include #include "trace.h" +#include "qemu/error-report.h" #include "hw/pci/pci_bus.h" @@ -292,7 +293,7 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr, ret_intr_type = RTAS_TYPE_MSIX; break; default: - fprintf(stderr, "rtas_ibm_change_msi(%u) is not implemented\n", func); + error_report("rtas_ibm_change_msi(%u) is not implemented", func); rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); return; } @@ -326,7 +327,7 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr, /* Find a device number in the map to add or reuse the existing one */ ndev = spapr_msicfg_find(phb, config_addr, true); if (ndev >= SPAPR_MSIX_MAX_DEVS || ndev < 0) { - fprintf(stderr, "No free entry for a new MSI device\n"); + error_report("No free entry for a new MSI device"); rtas_st(rets, 0, RTAS_OUT_HW_ERROR); return; } @@ -335,7 +336,7 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr, /* Check if there is an old config and MSI number has not changed */ if (phb->msi_table[ndev].nvec && (req_num != phb->msi_table[ndev].nvec)) { /* Unexpected behaviour */ - fprintf(stderr, "Cannot reuse MSI config for device#%d", ndev); + error_report("Cannot reuse MSI config for device#%d", ndev); rtas_st(rets, 0, RTAS_OUT_HW_ERROR); return; } @@ -345,7 +346,7 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr, irq = spapr_allocate_irq_block(req_num, false, ret_intr_type == RTAS_TYPE_MSI); if (irq < 0) { - fprintf(stderr, "Cannot allocate MSIs for device#%d", ndev); + error_report("Cannot allocate MSIs for device#%d", ndev); rtas_st(rets, 0, RTAS_OUT_HW_ERROR); return; } -- cgit v1.2.1