Fixes for s390x in the css area.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXj4bbAAoJEN7Pa5PG8C+vZO8P/A/VXyR86+N3pBtHlG0AQHuS
 WelhHVfoI0CyYrxngyEdkMTlr2nmGhMCRoCwEK0OOL8ISyRx4vMbxCbxpNn2bjvg
 g1z8+eHC4FLRDIQCLg3Pl7Pr0rpJpg5P8icskMT5A2fuHEOjCTC6MwHMuxKYl/V0
 HMv0z5djx6NL/08VPwJXmyob/Kd1mP2oTnFvDyoAjQgX04FDjBxpfHqg0QlPvgst
 lupdo2h6u+c6yioHjxaSaO+WzOpBuBnd7Rq9iThXUJG31AlvA8ZT76GfW63j7X71
 8TWoP+vIY1CPaI5+iP+l06N1K7wZGoJa7YVnd2zhv4xv5JGR7YHDQwJ7so0dYP5p
 klyYv42nIY/xUSk3w7ZFG+cB8XyBasYug8ab562JZ+gen5ZOxwnwdeV8PXoafKnu
 ltzXXc+7/5lcwzH9hvK0A6P+c7LdLLtU0U5kvAwOfVVaNqsyepcdp47g2boDelVb
 nUXsCi/Q+2Wlx99IdWdNYo12moIGEj1te/uQxlabKvmh4NtDaAH2OyTw2R/H+J2q
 m0nf360pXEQuu33kI2Ws1OM2x+Uj2PV1dJvPCglupU4s+pKmO7RreRFLiVOfLPaQ
 chVSUwEhCfcwI6hGfHGx1EVmS2ORDfEaGZTUnM+Ic5ZtNUhc5jmF0xCl288M2Cs6
 WoMcMd8AMO1BZFVDfCeb
 =InaB
 -----END PGP SIGNATURE-----

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

Fixes for s390x in the css area.

# gpg: Signature made Wed 20 Jul 2016 15:12:43 BST
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20160720:
  s390x/css: provide a dev_path for css devices
  s390x/css: sch_handle_start_func() handles resume, too
  s390x/css: copy CCW format bit from ORB to SCSW

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
master
Peter Maydell 2016-07-20 20:59:05 +01:00
commit 3b55fbdcb0
4 changed files with 41 additions and 1 deletions

View File

@ -59,11 +59,28 @@ static void virtual_css_bus_reset(BusState *qbus)
css_reset();
}
static char *virtual_css_bus_get_dev_path(DeviceState *dev)
{
CcwDevice *ccw_dev = CCW_DEVICE(dev);
SubchDev *sch = ccw_dev->sch;
VirtualCssBridge *bridge =
VIRTUAL_CSS_BRIDGE(qdev_get_parent_bus(dev)->parent);
/*
* We can't provide a dev path for backward compatibility on
* older machines, as it is visible in the migration stream.
*/
return bridge->css_dev_path ?
g_strdup_printf("/%02x.%1x.%04x", sch->cssid, sch->ssid, sch->devno) :
NULL;
}
static void virtual_css_bus_class_init(ObjectClass *klass, void *data)
{
BusClass *k = BUS_CLASS(klass);
k->reset = virtual_css_bus_reset;
k->get_dev_path = virtual_css_bus_get_dev_path;
}
static const TypeInfo virtual_css_bus_info = {
@ -95,6 +112,12 @@ VirtualCssBus *virtual_css_bus_init(void)
/***************** Virtual-css Bus Bridge Device ********************/
static Property virtual_css_bridge_properties[] = {
DEFINE_PROP_BOOL("css_dev_path", VirtualCssBridge, css_dev_path,
true),
DEFINE_PROP_END_OF_LIST(),
};
static void virtual_css_bridge_class_init(ObjectClass *klass, void *data)
{
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
@ -102,12 +125,13 @@ static void virtual_css_bridge_class_init(ObjectClass *klass, void *data)
hc->unplug = ccw_device_unplug;
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
dc->props = virtual_css_bridge_properties;
}
static const TypeInfo virtual_css_bridge_info = {
.name = TYPE_VIRTUAL_CSS_BRIDGE,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(SysBusDevice),
.instance_size = sizeof(VirtualCssBridge),
.class_init = virtual_css_bridge_class_init,
.interfaces = (InterfaceInfo[]) {
{ TYPE_HOTPLUG_HANDLER },

View File

@ -511,6 +511,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
path = 0x80;
if (!(s->ctrl & SCSW_ACTL_SUSP)) {
/* Start Function triggered via ssch, i.e. we have an ORB */
s->cstat = 0;
s->dstat = 0;
/* Look at the orb and try to execute the channel program. */
@ -524,9 +525,12 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
return;
}
sch->ccw_fmt_1 = !!(orb->ctrl0 & ORB_CTRL0_MASK_FMT);
s->flags |= (sch->ccw_fmt_1) ? SCSW_FLAGS_MASK_FMT : 0;
sch->ccw_no_data_cnt = 0;
suspend_allowed = !!(orb->ctrl0 & ORB_CTRL0_MASK_SPND);
} else {
/* Start Function resumed via rsch, i.e. we don't have an
* ORB */
s->ctrl &= ~(SCSW_ACTL_SUSP | SCSW_ACTL_RESUME_PEND);
/* The channel program had been suspended before. */
suspend_allowed = true;
@ -609,6 +613,7 @@ static void do_subchannel_work(SubchDev *sch, ORB *orb)
} else if (s->ctrl & SCSW_FCTL_HALT_FUNC) {
sch_handle_halt_func(sch);
} else if (s->ctrl & SCSW_FCTL_START_FUNC) {
/* Triggered by both ssch and rsch. */
sch_handle_start_func(sch, orb);
} else {
/* Cannot happen. */

View File

@ -322,6 +322,10 @@ static const TypeInfo ccw_machine_info = {
.driver = TYPE_S390_IPL,\
.property = "iplbext_migration",\
.value = "off",\
}, {\
.driver = TYPE_VIRTUAL_CSS_BRIDGE,\
.property = "css_dev_path",\
.value = "off",\
},
#define CCW_COMPAT_2_5 \

View File

@ -16,7 +16,14 @@
#include "hw/qdev-core.h"
/* virtual css bridge */
typedef struct VirtualCssBridge {
SysBusDevice sysbus_dev;
bool css_dev_path;
} VirtualCssBridge;
#define TYPE_VIRTUAL_CSS_BRIDGE "virtual-css-bridge"
#define VIRTUAL_CSS_BRIDGE(obj) \
OBJECT_CHECK(VirtualCssBridge, (obj), TYPE_VIRTUAL_CSS_BRIDGE)
/* virtual css bus type */
typedef struct VirtualCssBus {