mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
s390x: add flags field for registering I/O adapter
Introduce a new 'flags' field to IoAdapter to contain further characteristics of the adapter, like whether the adapter is subject to adapter-interruption suppression. For the kvm case, pass this value in the 'flags' field when registering an adapter. Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
parent
c9ad8a7a53
commit
1497c16066
7 changed files with 20 additions and 8 deletions
|
@ -48,7 +48,7 @@ void s390_flic_init(void)
|
||||||
|
|
||||||
static int qemu_s390_register_io_adapter(S390FLICState *fs, uint32_t id,
|
static int qemu_s390_register_io_adapter(S390FLICState *fs, uint32_t id,
|
||||||
uint8_t isc, bool swap,
|
uint8_t isc, bool swap,
|
||||||
bool is_maskable)
|
bool is_maskable, uint8_t flags)
|
||||||
{
|
{
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -186,13 +186,14 @@ static int __get_all_irqs(KVMS390FLICState *flic,
|
||||||
|
|
||||||
static int kvm_s390_register_io_adapter(S390FLICState *fs, uint32_t id,
|
static int kvm_s390_register_io_adapter(S390FLICState *fs, uint32_t id,
|
||||||
uint8_t isc, bool swap,
|
uint8_t isc, bool swap,
|
||||||
bool is_maskable)
|
bool is_maskable, uint8_t flags)
|
||||||
{
|
{
|
||||||
struct kvm_s390_io_adapter adapter = {
|
struct kvm_s390_io_adapter adapter = {
|
||||||
.id = id,
|
.id = id,
|
||||||
.isc = isc,
|
.isc = isc,
|
||||||
.maskable = is_maskable,
|
.maskable = is_maskable,
|
||||||
.swap = swap,
|
.swap = swap,
|
||||||
|
.flags = flags,
|
||||||
};
|
};
|
||||||
KVMS390FLICState *flic = KVM_S390_FLIC(fs);
|
KVMS390FLICState *flic = KVM_S390_FLIC(fs);
|
||||||
int r;
|
int r;
|
||||||
|
|
|
@ -110,7 +110,7 @@ VirtualCssBus *virtual_css_bus_init(void)
|
||||||
qbus_set_hotplug_handler(bus, dev, &error_abort);
|
qbus_set_hotplug_handler(bus, dev, &error_abort);
|
||||||
|
|
||||||
css_register_io_adapters(CSS_IO_ADAPTER_VIRTIO, true, false,
|
css_register_io_adapters(CSS_IO_ADAPTER_VIRTIO, true, false,
|
||||||
&error_abort);
|
0, &error_abort);
|
||||||
|
|
||||||
return cbus;
|
return cbus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,6 +225,7 @@ typedef struct IoAdapter {
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
uint8_t isc;
|
uint8_t isc;
|
||||||
|
uint8_t flags;
|
||||||
} IoAdapter;
|
} IoAdapter;
|
||||||
|
|
||||||
typedef struct ChannelSubSys {
|
typedef struct ChannelSubSys {
|
||||||
|
@ -392,10 +393,12 @@ uint32_t css_get_adapter_id(CssIoAdapterType type, uint8_t isc)
|
||||||
*
|
*
|
||||||
* @swap: an indication if byte swap is needed.
|
* @swap: an indication if byte swap is needed.
|
||||||
* @maskable: an indication if the adapter is subject to the mask operation.
|
* @maskable: an indication if the adapter is subject to the mask operation.
|
||||||
|
* @flags: further characteristics of the adapter.
|
||||||
|
* e.g. suppressible, an indication if the adapter is subject to AIS.
|
||||||
* @errp: location to store error information.
|
* @errp: location to store error information.
|
||||||
*/
|
*/
|
||||||
void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maskable,
|
void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maskable,
|
||||||
Error **errp)
|
uint8_t flags, Error **errp)
|
||||||
{
|
{
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
int ret, isc;
|
int ret, isc;
|
||||||
|
@ -413,12 +416,13 @@ void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maskable,
|
||||||
|
|
||||||
for (isc = 0; isc <= MAX_ISC; isc++) {
|
for (isc = 0; isc <= MAX_ISC; isc++) {
|
||||||
id = (type << 3) | isc;
|
id = (type << 3) | isc;
|
||||||
ret = fsc->register_io_adapter(fs, id, isc, swap, maskable);
|
ret = fsc->register_io_adapter(fs, id, isc, swap, maskable, flags);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
adapter = g_new0(IoAdapter, 1);
|
adapter = g_new0(IoAdapter, 1);
|
||||||
adapter->id = id;
|
adapter->id = id;
|
||||||
adapter->isc = isc;
|
adapter->isc = isc;
|
||||||
adapter->type = type;
|
adapter->type = type;
|
||||||
|
adapter->flags = flags;
|
||||||
channel_subsys.io_adapters[type][isc] = adapter;
|
channel_subsys.io_adapters[type][isc] = adapter;
|
||||||
} else {
|
} else {
|
||||||
error_setg_errno(errp, -ret, "Unexpected error %d when "
|
error_setg_errno(errp, -ret, "Unexpected error %d when "
|
||||||
|
|
|
@ -582,7 +582,8 @@ static int s390_pcihost_init(SysBusDevice *dev)
|
||||||
QTAILQ_INIT(&s->pending_sei);
|
QTAILQ_INIT(&s->pending_sei);
|
||||||
QTAILQ_INIT(&s->zpci_devs);
|
QTAILQ_INIT(&s->zpci_devs);
|
||||||
|
|
||||||
css_register_io_adapters(CSS_IO_ADAPTER_PCI, true, false, &error_abort);
|
css_register_io_adapters(CSS_IO_ADAPTER_PCI, true, false,
|
||||||
|
S390_ADAPTER_SUPPRESSIBLE, &error_abort);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,13 @@ typedef enum {
|
||||||
|
|
||||||
uint32_t css_get_adapter_id(CssIoAdapterType type, uint8_t isc);
|
uint32_t css_get_adapter_id(CssIoAdapterType type, uint8_t isc);
|
||||||
void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maskable,
|
void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maskable,
|
||||||
Error **errp);
|
uint8_t flags, Error **errp);
|
||||||
|
|
||||||
|
#ifndef CONFIG_KVM
|
||||||
|
#define S390_ADAPTER_SUPPRESSIBLE 0x01
|
||||||
|
#else
|
||||||
|
#define S390_ADAPTER_SUPPRESSIBLE KVM_S390_ADAPTER_SUPPRESSIBLE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
SubchDev *css_find_subch(uint8_t m, uint8_t cssid, uint8_t ssid,
|
SubchDev *css_find_subch(uint8_t m, uint8_t cssid, uint8_t ssid,
|
||||||
|
|
|
@ -56,7 +56,7 @@ typedef struct S390FLICStateClass {
|
||||||
DeviceClass parent_class;
|
DeviceClass parent_class;
|
||||||
|
|
||||||
int (*register_io_adapter)(S390FLICState *fs, uint32_t id, uint8_t isc,
|
int (*register_io_adapter)(S390FLICState *fs, uint32_t id, uint8_t isc,
|
||||||
bool swap, bool maskable);
|
bool swap, bool maskable, uint8_t flags);
|
||||||
int (*io_adapter_map)(S390FLICState *fs, uint32_t id, uint64_t map_addr,
|
int (*io_adapter_map)(S390FLICState *fs, uint32_t id, uint64_t map_addr,
|
||||||
bool do_map);
|
bool do_map);
|
||||||
int (*add_adapter_routes)(S390FLICState *fs, AdapterRoutes *routes);
|
int (*add_adapter_routes)(S390FLICState *fs, AdapterRoutes *routes);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue