diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2013-02-22 09:01:32 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-03-08 21:17:46 +0100 |
commit | 38dd7cc776bbde7edbe60ba5d0abbd156e7e0f2f (patch) | |
tree | 20a39fe3dad1c6892b8c7dad8cbd09f48caadd41 /hw/s390x/css.c | |
parent | 35569cea79fd3f5ccb5b23ca024c7d3aa4d24e75 (diff) | |
download | qemu-38dd7cc776bbde7edbe60ba5d0abbd156e7e0f2f.zip qemu-38dd7cc776bbde7edbe60ba5d0abbd156e7e0f2f.tar.gz qemu-38dd7cc776bbde7edbe60ba5d0abbd156e7e0f2f.tar.bz2 |
s390/css: Fix subchannel detection
We have to consider the m bit to find the real channel subsystem when
determining the last subchannel.
If we fail to take this into account, removal of a subchannel in
the middle of a big list of devices will stop device detection after
a reboot.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/s390x/css.c')
-rw-r--r-- | hw/s390x/css.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 85f6f22..e526a1c 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -988,15 +988,18 @@ int css_do_rchp(uint8_t cssid, uint8_t chpid) return 0; } -bool css_schid_final(uint8_t cssid, uint8_t ssid, uint16_t schid) +bool css_schid_final(int m, uint8_t cssid, uint8_t ssid, uint16_t schid) { SubchSet *set; + uint8_t real_cssid; - if (cssid > MAX_CSSID || ssid > MAX_SSID || !channel_subsys->css[cssid] || - !channel_subsys->css[cssid]->sch_set[ssid]) { + real_cssid = (!m && (cssid == 0)) ? channel_subsys->default_cssid : cssid; + if (real_cssid > MAX_CSSID || ssid > MAX_SSID || + !channel_subsys->css[real_cssid] || + !channel_subsys->css[real_cssid]->sch_set[ssid]) { return true; } - set = channel_subsys->css[cssid]->sch_set[ssid]; + set = channel_subsys->css[real_cssid]->sch_set[ssid]; return schid > find_last_bit(set->schids_used, (MAX_SCHID + 1) / sizeof(unsigned long)); } |