s390x/css: {c,h,t,r,x}sch: require enable AND device number valid

According to the PoP, subchannels are only considered operational if
they are enabled _and_ the device number is valid. With the current
checks being enabled _or_ having a valid device number was
sufficient. This caused qemu to allow IO on subchannels that were not
enabled.

Fix the checks to require both bits to be set.

Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
Sascha Silbe 2016-09-19 21:12:03 +02:00 committed by Christian Borntraeger
parent 6b5ffb14b7
commit c679e74d2e

View File

@ -775,7 +775,7 @@ int css_do_xsch(SubchDev *sch)
PMCW *p = &sch->curr_status.pmcw; PMCW *p = &sch->curr_status.pmcw;
int ret; int ret;
if (!(p->flags & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA))) { if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
@ -815,7 +815,7 @@ int css_do_csch(SubchDev *sch)
PMCW *p = &sch->curr_status.pmcw; PMCW *p = &sch->curr_status.pmcw;
int ret; int ret;
if (!(p->flags & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA))) { if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
@ -837,7 +837,7 @@ int css_do_hsch(SubchDev *sch)
PMCW *p = &sch->curr_status.pmcw; PMCW *p = &sch->curr_status.pmcw;
int ret; int ret;
if (!(p->flags & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA))) { if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
@ -913,7 +913,7 @@ int css_do_ssch(SubchDev *sch, ORB *orb)
PMCW *p = &sch->curr_status.pmcw; PMCW *p = &sch->curr_status.pmcw;
int ret; int ret;
if (!(p->flags & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA))) { if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
@ -990,7 +990,7 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len)
uint16_t stctl; uint16_t stctl;
IRB irb; IRB irb;
if (!(p->flags & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA))) { if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {
return 3; return 3;
} }
@ -1196,7 +1196,7 @@ int css_do_rsch(SubchDev *sch)
PMCW *p = &sch->curr_status.pmcw; PMCW *p = &sch->curr_status.pmcw;
int ret; int ret;
if (!(p->flags & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA))) { if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }