Commit cd0b19a2 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160113' into staging



This first round of s390x patches includes:
- new compat machine
- remove the old s390-virtio machine
- fixes and some cleanup

# gpg: Signature made Wed 13 Jan 2016 14:55:55 GMT using RSA key ID C6F02FAF
# gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"

* remotes/cohuck/tags/s390x-20160113:
  s390x/pci: return real state during listing PCI
  virtio-ccw: fix sanity check for vector
  s390: Introduce CCW_COMPAT_2_5
  s390x/virtio: use qemu_check_nic_model()
  s390x/pci: code cleanup
  s390x/pci: reject some operations to disabled PCI function
  s390x: remove s390-virtio devices
  s390x: remove s390-virtio machine
  s390x: add 2.6 compat machine

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents ed56fdb2 88bfa216
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
obj-y = s390-virtio-bus.o s390-virtio.o
obj-y += s390-virtio.o
obj-y += s390-virtio-hcall.o
obj-y += sclp.o
obj-y += event-facility.o
+5 −1
Original line number Diff line number Diff line
@@ -317,7 +317,7 @@ static IOMMUTLBEntry s390_translate_iommu(MemoryRegion *iommu, hwaddr addr,
        .perm = IOMMU_NONE,
    };

    if (!pbdev->configured || !pbdev->pdev) {
    if (!pbdev->configured || !pbdev->pdev || !(pbdev->fh & FH_ENABLED)) {
        return ret;
    }

@@ -428,6 +428,10 @@ static void s390_msi_ctrl_write(void *opaque, hwaddr addr, uint64_t data,
        return;
    }

    if (!(pbdev->fh & FH_ENABLED)) {
        return;
    }

    ind_bit = pbdev->routes.adapter.ind_offset;
    sum_bit = pbdev->routes.adapter.summary_offset;

+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#define TYPE_S390_PCI_HOST_BRIDGE "s390-pcihost"
#define FH_VIRT 0x00ff0000
#define ENABLE_BIT_OFFSET 31
#define FH_ENABLED (1 << ENABLE_BIT_OFFSET)
#define S390_PCIPT_ADAPTER 2

#define S390_PCI_HOST_BRIDGE(obj) \
+10 −10
Original line number Diff line number Diff line
@@ -105,7 +105,8 @@ static int list_pci(ClpReqRspListPci *rrb, uint8_t *cc)
            pci_get_word(pbdev->pdev->config + PCI_DEVICE_ID));
        stw_p(&rrb->response.fh_list[idx - resume_token].vendor_id,
            pci_get_word(pbdev->pdev->config + PCI_VENDOR_ID));
        stl_p(&rrb->response.fh_list[idx - resume_token].config, 0x80000000);
        stl_p(&rrb->response.fh_list[idx - resume_token].config,
            pbdev->configured << 31);
        stl_p(&rrb->response.fh_list[idx - resume_token].fid, pbdev->fid);
        stl_p(&rrb->response.fh_list[idx - resume_token].fh, pbdev->fh);

@@ -208,12 +209,12 @@ int clp_service_call(S390CPU *cpu, uint8_t r2)

        switch (reqsetpci->oc) {
        case CLP_SET_ENABLE_PCI_FN:
            pbdev->fh = pbdev->fh | 1 << ENABLE_BIT_OFFSET;
            pbdev->fh = pbdev->fh | FH_ENABLED;
            stl_p(&ressetpci->fh, pbdev->fh);
            stw_p(&ressetpci->hdr.rsp, CLP_RC_OK);
            break;
        case CLP_SET_DISABLE_PCI_FN:
            pbdev->fh = pbdev->fh & ~(1 << ENABLE_BIT_OFFSET);
            pbdev->fh = pbdev->fh & ~FH_ENABLED;
            pbdev->error_state = false;
            pbdev->lgstg_blocked = false;
            stl_p(&ressetpci->fh, pbdev->fh);
@@ -313,7 +314,7 @@ int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
    offset = env->regs[r2 + 1];

    pbdev = s390_pci_find_dev_by_fh(fh);
    if (!pbdev) {
    if (!pbdev || !(pbdev->fh & FH_ENABLED)) {
        DPRINTF("pcilg no pci dev\n");
        setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE);
        return 0;
@@ -430,7 +431,7 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
    offset = env->regs[r2 + 1];

    pbdev = s390_pci_find_dev_by_fh(fh);
    if (!pbdev) {
    if (!pbdev || !(pbdev->fh & FH_ENABLED)) {
        DPRINTF("pcistg no pci dev\n");
        setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE);
        return 0;
@@ -521,8 +522,7 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
    end = start + env->regs[r2 + 1];

    pbdev = s390_pci_find_dev_by_fh(fh);

    if (!pbdev) {
    if (!pbdev || !(pbdev->fh & FH_ENABLED)) {
        DPRINTF("rpcit no pci dev\n");
        setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE);
        goto out;
@@ -586,7 +586,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr,
    }

    pbdev = s390_pci_find_dev_by_fh(fh);
    if (!pbdev) {
    if (!pbdev || !(pbdev->fh & FH_ENABLED)) {
        DPRINTF("pcistb no pci dev fh 0x%x\n", fh);
        setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE);
        return 0;
@@ -727,7 +727,7 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar)
    }

    pbdev = s390_pci_find_dev_by_fh(fh);
    if (!pbdev) {
    if (!pbdev || !(pbdev->fh & FH_ENABLED)) {
        DPRINTF("mpcifc no pci dev fh 0x%x\n", fh);
        setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE);
        return 0;
@@ -819,7 +819,7 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar)
           ((uint32_t)pbdev->sum << 7) | pbdev->routes.adapter.summary_offset;
    stl_p(&fib.data, data);

    if (pbdev->fh >> ENABLE_BIT_OFFSET) {
    if (pbdev->fh & FH_ENABLED) {
        fib.fc |= 0x80;
    }

hw/s390x/s390-virtio-bus.c

deleted100644 → 0
+0 −758

File deleted.

Preview size limit exceeded, changes collapsed.

Loading