From 10890873ca8e518d5ef7782281fd4a6aeeda7061 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Mon, 3 Apr 2017 17:41:33 +0200 Subject: s390x: introduce 2.10 compat machine Signed-off-by: Cornelia Huck --- include/hw/compat.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/hw/compat.h b/include/hw/compat.h index 5d5be91..846b90e 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -1,6 +1,9 @@ #ifndef HW_COMPAT_H #define HW_COMPAT_H +#define HW_COMPAT_2_9 \ + /* empty */ + #define HW_COMPAT_2_8 \ {\ .driver = "fw_cfg_mem",\ -- cgit v1.1 From c35fc6aa1840b26f06f9ac79509c7ed9280003ac Mon Sep 17 00:00:00 2001 From: Dong Jia Shi Date: Tue, 14 Feb 2017 04:04:02 +0100 Subject: s390x/css: introduce read-only property type for device ids Let's introduce a read-only property type that handles device ids of the CssDevId type used for channel devices for future use. e.g. exposing the busid of an I/O subchannel that is assigned to a ccw device. Signed-off-by: Dong Jia Shi Signed-off-by: Cornelia Huck --- include/hw/s390x/css.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index c96c862..e88f24b 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -172,6 +172,11 @@ 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; + +#define DEFINE_PROP_CSS_DEV_ID_RO(_n, _s, _f) \ + DEFINE_PROP(_n, _s, _f, css_devid_ro_propinfo, CssDevId) + /** * Create a subchannel for the given bus id. * -- cgit v1.1 From 5b00bef270e8bca9c1906cbc2a49eb376505db34 Mon Sep 17 00:00:00 2001 From: Fei Li Date: Fri, 25 Nov 2016 07:45:14 +0100 Subject: s390x: use enum for adapter type and standardize its naming Let's use an enum for io adapter type, and standardize its naming to CSS_IO_ADAPTER_* by changing S390_PCIPT_ADAPTER to CSS_IO_ADAPTER_PCI. Signed-off-by: Fei Li Reviewed-by: Cornelia Huck Signed-off-by: Cornelia Huck --- include/hw/s390x/css.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index e88f24b..cdc73fe 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -124,8 +124,13 @@ void css_generate_css_crws(uint8_t cssid); void css_clear_sei_pending(void); void css_adapter_interrupt(uint8_t isc); -#define CSS_IO_ADAPTER_VIRTIO 1 -int css_register_io_adapter(uint8_t type, uint8_t isc, bool swap, +typedef enum { + CSS_IO_ADAPTER_VIRTIO = 0, + CSS_IO_ADAPTER_PCI = 1, + CSS_IO_ADAPTER_TYPE_NUMS, +} CssIoAdapterType; + +int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap, bool maskable, uint32_t *id); #ifndef CONFIG_USER_ONLY -- cgit v1.1 From dde522bbc5feb2862afb243bb49c590fe65dce66 Mon Sep 17 00:00:00 2001 From: Fei Li Date: Thu, 24 Nov 2016 11:10:39 +0100 Subject: s390x: register I/O adapters per ISC during init The I/O adapters should exist as soon as the bus/infrastructure exists, and not only when the guest is actually trying to do something with them. While the lazy allocation was not wrong, allocating at init time is cleaner, both for the architecture and the code. Let's adjust this by having each device type (currently for PCI and virtio-ccw) register the adapters for each ISC (as now we don't know which ISC the guest will use) as soon as it initializes. Use a two-dimensional array io_adapters[type][isc] to store adapters in ChannelSubSys, so that we can conveniently get the adapter id by the helper function css_get_adapter_id(type, isc). Signed-off-by: Fei Li Signed-off-by: Cornelia Huck --- include/hw/s390x/css.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index cdc73fe..f1f0d7f 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -23,6 +23,8 @@ #define MAX_CSSID 255 #define MAX_CHPID 255 +#define MAX_ISC 7 + #define MAX_CIWS 62 #define VIRTUAL_CSSID 0xfe @@ -130,8 +132,9 @@ typedef enum { CSS_IO_ADAPTER_TYPE_NUMS, } CssIoAdapterType; -int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap, - bool maskable, uint32_t *id); +uint32_t css_get_adapter_id(CssIoAdapterType type, uint8_t isc); +void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maskable, + Error **errp); #ifndef CONFIG_USER_ONLY SubchDev *css_find_subch(uint8_t m, uint8_t cssid, uint8_t ssid, -- cgit v1.1