summaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2015-07-01 15:28:06 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2015-09-07 16:10:42 +0200
commit3335ddddf9e5ba7743dc8e3f767f4ef857ccd20c (patch)
tree7840baf39cc012e07fac59be1907e6e7d52e745a /hw/s390x
parentfa4463e0432ab66432a28d6b975f8eed99b3f4fa (diff)
downloadqemu-3335ddddf9e5ba7743dc8e3f767f4ef857ccd20c.tar.gz
s390x/event-facility: fix receive mask check
For selective read event, we need to check if any event is requested that is not active instead of whether none of the requested events is active. Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Eric Farman <farman@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/event-facility.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index 0c700effb1..1ca6544e44 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -240,12 +240,13 @@ static void read_event_data(SCLPEventFacility *ef, SCCB *sccb)
sclp_active_selection_mask = sclp_cp_receive_mask;
break;
case SCLP_SELECTIVE_READ:
- if (!(sclp_cp_receive_mask & be32_to_cpu(red->mask))) {
+ sclp_active_selection_mask = be32_to_cpu(red->mask);
+ if (!sclp_cp_receive_mask ||
+ (sclp_active_selection_mask & ~sclp_cp_receive_mask)) {
sccb->h.response_code =
cpu_to_be16(SCLP_RC_INVALID_SELECTION_MASK);
goto out;
}
- sclp_active_selection_mask = be32_to_cpu(red->mask);
break;
default:
sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_FUNCTION);