Commit 9d34158a authored by Peter Maydell's avatar Peter Maydell
Browse files

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



s390x fixes and improvements:
- various bugfixes (css/event-facility)
- more efficient adapter interrupt routes setup
- gdb enhancement
- sclp got treated with a lot of remodelling/cleanup

# gpg: Signature made Mon 07 Sep 2015 15:42:43 BST 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-20150907: (23 commits)
  s390/sclp: simplify calculation of rnmax
  s390/sclp: store the increment_size in the sclp device
  s390: unify allocation of initial memory
  s390: move memory calculation into the sclp device
  s390/sclp: ignore memory hotplug operations if it is disabled
  s390: disallow memory hotplug for the s390-virtio machine
  s390: no need to manually parse for slots and maxmem
  s390/sclp: move sclp_service_interrupt into the sclp device
  s390/sclp: move sclp_execute related functions into the SCLP class
  s390/sclp: introduce a root sclp device
  s390/sclp: temporarily fix unassignment/reassignment of memory subregions
  s390/sclp: replace sclp event types with proper defines
  s390/sclp: rework sclp event facility initialization + device realization
  sclp/s390: rework sclp cpu hotplug device notification
  s390x/gdb: support reading/writing of control registers
  s390x/kvm: make setting of in-kernel irq routes more efficient
  pc-bios/s390-ccw: rebuild image
  pc-bios/s390-ccw: Device detection in higher subchannel sets
  s390x/event-facility: fix location of receive mask
  s390x/css: start with cleared cstat/dstat
  ...

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 8f1ed5f5 bd80a8ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5392,7 +5392,7 @@ case "$target_name" in
    echo "TARGET_ABI32=y" >> $config_target_mak
  ;;
  s390x)
    gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml"
    gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml s390-cr.xml"
  ;;
  tricore)
  ;;

gdb-xml/s390-cr.xml

0 → 100644
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0"?>
<!-- Copyright 2015 IBM Corp.

     This work is licensed under the terms of the GNU GPL, version 2 or
     (at your option) any later version. See the COPYING file in the
     top-level directory. -->

<!DOCTYPE feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.s390.cr">
  <reg name="cr0" bitsize="64" type="uint64" group="control"/>
  <reg name="cr1" bitsize="64" type="uint64" group="control"/>
  <reg name="cr2" bitsize="64" type="uint64" group="control"/>
  <reg name="cr3" bitsize="64" type="uint64" group="control"/>
  <reg name="cr4" bitsize="64" type="uint64" group="control"/>
  <reg name="cr5" bitsize="64" type="uint64" group="control"/>
  <reg name="cr6" bitsize="64" type="uint64" group="control"/>
  <reg name="cr7" bitsize="64" type="uint64" group="control"/>
  <reg name="cr8" bitsize="64" type="uint64" group="control"/>
  <reg name="cr9" bitsize="64" type="uint64" group="control"/>
  <reg name="cr10" bitsize="64" type="uint64" group="control"/>
  <reg name="cr11" bitsize="64" type="uint64" group="control"/>
  <reg name="cr12" bitsize="64" type="uint64" group="control"/>
  <reg name="cr13" bitsize="64" type="uint64" group="control"/>
  <reg name="cr14" bitsize="64" type="uint64" group="control"/>
  <reg name="cr15" bitsize="64" type="uint64" group="control"/>
</feature>
+2 −0
Original line number Diff line number Diff line
@@ -228,6 +228,8 @@ static int kvm_s390_add_adapter_routes(S390FLICState *fs,
        routes->gsi[i] = ret;
        routes->adapter.ind_offset++;
    }
    kvm_irqchip_commit_routes(kvm_state);

    /* Restore passed-in structure to original state. */
    routes->adapter.ind_offset = ind_offset;
    return 0;
+9 −0
Original line number Diff line number Diff line
@@ -261,6 +261,9 @@ static CCW1 copy_ccw_from_guest(hwaddr addr, bool fmt1)
        ret.flags = tmp0.flags;
        ret.count = be16_to_cpu(tmp0.count);
        ret.cda = be16_to_cpu(tmp0.cda1) | (tmp0.cda0 << 16);
        if ((ret.cmd_code & 0x0f) == CCW_CMD_TIC) {
            ret.cmd_code &= 0x0f;
        }
    }
    return ret;
}
@@ -287,6 +290,10 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr)
        ((ccw.cmd_code & 0xf0) != 0)) {
        return -EINVAL;
    }
    if (!sch->ccw_fmt_1 && (ccw.count == 0) &&
        (ccw.cmd_code != CCW_CMD_TIC)) {
        return -EINVAL;
    }

    if (ccw.flags & CCW_FLAG_SUSPEND) {
        return -EINPROGRESS;
@@ -392,6 +399,8 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
    path = 0x80;

    if (!(s->ctrl & SCSW_ACTL_SUSP)) {
        s->cstat = 0;
        s->dstat = 0;
        /* Look at the orb and try to execute the channel program. */
        assert(orb != NULL); /* resume does not pass an orb */
        p->intparm = orb->intparm;
+36 −19
Original line number Diff line number Diff line
@@ -27,12 +27,12 @@ typedef struct SCLPEventsBus {
struct SCLPEventFacility {
    SysBusDevice parent_obj;
    SCLPEventsBus sbus;
    SCLPEvent quiesce_event;
    SCLPEvent cpu_hotplug_event;
    /* guest' receive mask */
    unsigned int receive_mask;
};

static SCLPEvent cpu_hotplug;

/* return true if any child has event pending set */
static bool event_pending(SCLPEventFacility *ef)
{
@@ -240,12 +240,13 @@ static void read_event_data(SCLPEventFacility *ef, SCCB *sccb)
        sclp_active_selection_mask = sclp_cp_receive_mask;
        break;
    case SCLP_SELECTIVE_READ:
        if (!(sclp_cp_receive_mask & be32_to_cpu(red->mask))) {
        sclp_active_selection_mask = be32_to_cpu(red->mask);
        if (!sclp_cp_receive_mask ||
            (sclp_active_selection_mask & ~sclp_cp_receive_mask)) {
            sccb->h.response_code =
                    cpu_to_be16(SCLP_RC_INVALID_SELECTION_MASK);
            goto out;
        }
        sclp_active_selection_mask = be32_to_cpu(red->mask);
        break;
    default:
        sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_FUNCTION);
@@ -286,8 +287,26 @@ out:

#define TYPE_SCLP_EVENTS_BUS "s390-sclp-events-bus"

static void sclp_events_bus_realize(BusState *bus, Error **errp)
{
    BusChild *kid;

    /* TODO: recursive realization has to be done in common code */
    QTAILQ_FOREACH(kid, &bus->children, sibling) {
        DeviceState *dev = kid->child;

        object_property_set_bool(OBJECT(dev), true, "realized", errp);
        if (*errp) {
            return;
        }
    }
}

static void sclp_events_bus_class_init(ObjectClass *klass, void *data)
{
    BusClass *bc = BUS_CLASS(klass);

    bc->realize = sclp_events_bus_realize;
}

static const TypeInfo sclp_events_bus_info = {
@@ -324,26 +343,24 @@ static const VMStateDescription vmstate_event_facility = {
     }
};

static int init_event_facility(SCLPEventFacility *event_facility)
static void init_event_facility(Object *obj)
{
    DeviceState *sdev = DEVICE(event_facility);
    DeviceState *quiesce;
    SCLPEventFacility *event_facility = EVENT_FACILITY(obj);
    DeviceState *sdev = DEVICE(obj);

    /* Spawn a new bus for SCLP events */
    qbus_create_inplace(&event_facility->sbus, sizeof(event_facility->sbus),
                        TYPE_SCLP_EVENTS_BUS, sdev, NULL);

    quiesce = qdev_create(&event_facility->sbus.qbus, "sclpquiesce");
    if (!quiesce) {
        return -1;
    }
    qdev_init_nofail(quiesce);

    object_initialize(&cpu_hotplug, sizeof(cpu_hotplug), TYPE_SCLP_CPU_HOTPLUG);
    qdev_set_parent_bus(DEVICE(&cpu_hotplug), BUS(&event_facility->sbus));
    object_property_set_bool(OBJECT(&cpu_hotplug), true, "realized", NULL);

    return 0;
    object_initialize(&event_facility->quiesce_event, sizeof(SCLPEvent),
                      TYPE_SCLP_QUIESCE);
    qdev_set_parent_bus(DEVICE(&event_facility->quiesce_event),
                        &event_facility->sbus.qbus);
    object_initialize(&event_facility->cpu_hotplug_event, sizeof(SCLPEvent),
                      TYPE_SCLP_CPU_HOTPLUG);
    qdev_set_parent_bus(DEVICE(&event_facility->cpu_hotplug_event),
                        &event_facility->sbus.qbus);
    /* the facility will automatically realize the devices via the bus */
}

static void reset_event_facility(DeviceState *dev)
@@ -362,7 +379,6 @@ static void init_event_facility_class(ObjectClass *klass, void *data)
    dc->reset = reset_event_facility;
    dc->vmsd = &vmstate_event_facility;
    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
    k->init = init_event_facility;
    k->command_handler = command_handler;
    k->event_pending = event_pending;
}
@@ -370,6 +386,7 @@ static void init_event_facility_class(ObjectClass *klass, void *data)
static const TypeInfo sclp_event_facility_info = {
    .name          = TYPE_SCLP_EVENT_FACILITY,
    .parent        = TYPE_SYS_BUS_DEVICE,
    .instance_init = init_event_facility,
    .instance_size = sizeof(SCLPEventFacility),
    .class_init    = init_event_facility_class,
    .class_size    = sizeof(SCLPEventFacilityClass),
Loading