Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/afaerber/tags/ppc-for-2.0' into…
Browse files Browse the repository at this point in the history
… staging

PowerPC queue for 2.0-rc0

* QEMUMachine include cleanup
* SLOF update
* XICS reset fix
* sPAPR PCI host bridge refactorings

# gpg: Signature made Thu 13 Mar 2014 02:50:51 GMT using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <[email protected]>"
# gpg:                 aka "Andreas Färber <[email protected]>"

* remotes/afaerber/tags/ppc-for-2.0:
  spapr-pci: Convert fprintf() to error_report()
  spapr-pci: Convert to QOM realize
  xics-kvm: Fix reset function
  pseries: Update SLOF firmware image to qemu-slof-20140304
  Move QEMUMachine typedef to qemu/typedefs.h
  Revert "KVM: Split QEMUMachine typedef into separate header"

Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
pm215 committed Mar 13, 2014
2 parents c8d146a + 295d51a commit be86c53
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 50 deletions.
11 changes: 10 additions & 1 deletion hw/intc/xics_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
52 changes: 26 additions & 26 deletions hw/ppc/spapr_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "exec/address-spaces.h"
#include <libfdt.h>
#include "trace.h"
#include "qemu/error-report.h"

#include "hw/pci/pci_bus.h"

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -505,9 +506,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);
char *namebuf;
Expand All @@ -520,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;
Expand All @@ -535,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);
Expand Down Expand Up @@ -605,8 +606,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);
Expand All @@ -623,13 +625,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)
Expand Down Expand Up @@ -712,11 +713,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;
Expand Down
1 change: 0 additions & 1 deletion include/hw/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#define HW_BOARDS_H

#include "sysemu/blockdev.h"
#include "sysemu/qemumachine.h"
#include "hw/qdev.h"
#include "qom/object.h"

Expand Down
1 change: 0 additions & 1 deletion include/hw/xen/xen.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "hw/irq.h"
#include "qemu-common.h"
#include "sysemu/qemumachine.h"

/* xen-machine.c */
enum xen_mode {
Expand Down
1 change: 1 addition & 0 deletions include/qemu/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion include/sysemu/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "config-host.h"
#include "qemu/queue.h"
#include "qom/cpu.h"
#include "sysemu/qemumachine.h"

#ifdef CONFIG_KVM
#include <linux/kvm.h>
Expand Down
16 changes: 0 additions & 16 deletions include/sysemu/qemumachine.h

This file was deleted.

1 change: 0 additions & 1 deletion include/sysemu/qtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include "qemu-common.h"
#include "qapi/error.h"
#include "sysemu/qemumachine.h"

extern bool qtest_allowed;

Expand Down
1 change: 0 additions & 1 deletion kvm-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pc-bios/README
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified pc-bios/slof.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion roms/SLOF
Submodule SLOF updated from e2e8ac to af6b7b

0 comments on commit be86c53

Please sign in to comment.