[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/8] s390x/css: {c, h, t, r, x}sch: require enable A
From: |
Christian Borntraeger |
Subject: |
[Qemu-devel] [PATCH 7/8] s390x/css: {c, h, t, r, x}sch: require enable AND device number valid |
Date: |
Tue, 27 Sep 2016 13:48:36 +0200 |
From: Sascha Silbe <address@hidden>
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 <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: Halil Pasic <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
---
hw/s390x/css.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index b0e81ef..0f2580d 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -775,7 +775,7 @@ int css_do_xsch(SubchDev *sch)
PMCW *p = &sch->curr_status.pmcw;
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;
goto out;
}
@@ -815,7 +815,7 @@ int css_do_csch(SubchDev *sch)
PMCW *p = &sch->curr_status.pmcw;
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;
goto out;
}
@@ -837,7 +837,7 @@ int css_do_hsch(SubchDev *sch)
PMCW *p = &sch->curr_status.pmcw;
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;
goto out;
}
@@ -913,7 +913,7 @@ int css_do_ssch(SubchDev *sch, ORB *orb)
PMCW *p = &sch->curr_status.pmcw;
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;
goto out;
}
@@ -990,7 +990,7 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int
*irb_len)
uint16_t stctl;
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;
}
@@ -1196,7 +1196,7 @@ int css_do_rsch(SubchDev *sch)
PMCW *p = &sch->curr_status.pmcw;
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;
goto out;
}
--
2.5.5
- [Qemu-devel] [PATCH 0/8] next patches for s390x/kvm, Christian Borntraeger, 2016/09/27
- [Qemu-devel] [PATCH 1/8] s390x/pci: re-arrange variable declarations, Christian Borntraeger, 2016/09/27
- [Qemu-devel] [PATCH 8/8] s390x/kvm: fix build against qemu_uuid, Christian Borntraeger, 2016/09/27
- [Qemu-devel] [PATCH 5/8] pc-bios/s390-ccw: enable subchannel for IPL I/O devices, Christian Borntraeger, 2016/09/27
- [Qemu-devel] [PATCH 2/8] s390x/pci: assign msix io region for each pci device, Christian Borntraeger, 2016/09/27
- [Qemu-devel] [PATCH 6/8] pc-bios/s390-ccw.img: rebuild image, Christian Borntraeger, 2016/09/27
- [Qemu-devel] [PATCH 4/8] s390x/kvm: Fix potential deadlock in sigp handling, Christian Borntraeger, 2016/09/27
- [Qemu-devel] [PATCH 7/8] s390x/css: {c, h, t, r, x}sch: require enable AND device number valid,
Christian Borntraeger <=
- [Qemu-devel] [PATCH 3/8] s390x/pci: code cleanup, Christian Borntraeger, 2016/09/27