aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorXiao Feng Ren <renxiaof@linux.vnet.ibm.com>2017-05-17 02:48:04 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2017-05-19 12:29:01 +0200
commit8f3cf0128cbac1ac19be8515dc184edb88dd5fb1 (patch)
treee5f849d2ec1acaff59b28f6144912baca63788b1 /include/hw
parent274250c30158f60aefb46088a7bb0d711061226c (diff)
downloadqemu-8f3cf0128cbac1ac19be8515dc184edb88dd5fb1.zip
qemu-8f3cf0128cbac1ac19be8515dc184edb88dd5fb1.tar.gz
qemu-8f3cf0128cbac1ac19be8515dc184edb88dd5fb1.tar.bz2
s390x/css: realize css_sch_build_schib
The S390 virtual css support already has a mechanism to build a virtual subchannel information block (schib) and provide virtual subchannels to the guest. However, to pass-through subchannels to a guest, we need to introduce a new mechanism to build its schib according to the real device information. Thus we realize a new css sch_build_schib function to extract the path_masks, chpids, chpid type from sysfs. To reuse the existing code, we refactor css_add_virtual_chpid to css_add_chpid. Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Xiao Feng Ren <renxiaof@linux.vnet.ibm.com> Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> Message-Id: <20170517004813.58227-5-bjsdjshi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/s390x/css.h36
1 files changed, 19 insertions, 17 deletions
diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h
index e61fa74..e59a115 100644
--- a/include/hw/s390x/css.h
+++ b/include/hw/s390x/css.h
@@ -95,6 +95,24 @@ struct SubchDev {
void *driver_data;
};
+/*
+ * Identify a device within the channel subsystem.
+ * Note that this can be used to identify either the subchannel or
+ * the attached I/O device, as there's always one I/O device per
+ * subchannel.
+ */
+typedef struct CssDevId {
+ uint8_t cssid;
+ uint8_t ssid;
+ uint16_t devid;
+ bool valid;
+} CssDevId;
+
+extern PropertyInfo css_devid_propinfo;
+
+#define DEFINE_PROP_CSS_DEV_ID(_n, _s, _f) \
+ DEFINE_PROP(_n, _s, _f, css_devid_propinfo, CssDevId)
+
typedef struct IndAddr {
hwaddr addr;
uint64_t map;
@@ -116,6 +134,7 @@ bool css_devno_used(uint8_t cssid, uint8_t ssid, uint16_t devno);
void css_subch_assign(uint8_t cssid, uint8_t ssid, uint16_t schid,
uint16_t devno, SubchDev *sch);
void css_sch_build_virtual_schib(SubchDev *sch, uint8_t chpid, uint8_t type);
+int css_sch_build_schib(SubchDev *sch, CssDevId *dev_id);
unsigned int css_find_free_chpid(uint8_t cssid);
uint16_t css_build_subchannel_id(SubchDev *sch);
void css_reset(void);
@@ -164,23 +183,6 @@ int css_do_rsch(SubchDev *sch);
int css_do_rchp(uint8_t cssid, uint8_t chpid);
bool css_present(uint8_t cssid);
#endif
-/*
- * Identify a device within the channel subsystem.
- * Note that this can be used to identify either the subchannel or
- * the attached I/O device, as there's always one I/O device per
- * subchannel.
- */
-typedef struct CssDevId {
- uint8_t cssid;
- uint8_t ssid;
- uint16_t devid;
- bool valid;
-} CssDevId;
-
-extern PropertyInfo css_devid_propinfo;
-
-#define DEFINE_PROP_CSS_DEV_ID(_n, _s, _f) \
- DEFINE_PROP(_n, _s, _f, css_devid_propinfo, CssDevId)
extern PropertyInfo css_devid_ro_propinfo;