summaryrefslogtreecommitdiffstats
path: root/pc-bios/s390-ccw/menu.c
diff options
context:
space:
mode:
authorCollin L. Walling2018-02-23 16:43:17 +0100
committerThomas Huth2018-02-26 07:56:55 +0100
commitdbf2091aba8abc312dbab931b12ebc4ff213ffd6 (patch)
tree26846f90af29617a2a8ae34cdb700e2f59bb6ad9 /pc-bios/s390-ccw/menu.c
parents390-ccw: read user input for boot index via the SCLP console (diff)
downloadqemu-dbf2091aba8abc312dbab931b12ebc4ff213ffd6.tar.gz
qemu-dbf2091aba8abc312dbab931b12ebc4ff213ffd6.tar.xz
qemu-dbf2091aba8abc312dbab931b12ebc4ff213ffd6.zip
s390-ccw: set cp_receive mask only when needed and consume pending service irqs
It is possible while waiting for multiple types of external interrupts that we might have pending irqs remaining between irq consumption and irq-type disabling. Those interrupts could potentially propagate to the guest after IPL completes and cause unwanted behavior. As it is today, the SCLP will only recognize write events that are enabled by the control program's send and receive masks. To limit the window for, and prevent further irqs from, ASCII console events (specifically keystrokes), we should only enable the control program's receive mask when we need it. While we're at it, remove assignment of the (non control program) send and receive masks, as those are actually set by the SCLP. Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'pc-bios/s390-ccw/menu.c')
-rw-r--r--pc-bios/s390-ccw/menu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pc-bios/s390-ccw/menu.c b/pc-bios/s390-ccw/menu.c
index b99ff03298..8d55869448 100644
--- a/pc-bios/s390-ccw/menu.c
+++ b/pc-bios/s390-ccw/menu.c
@@ -11,6 +11,7 @@
#include "libc.h"
#include "s390-ccw.h"
+#include "sclp.h"
#define KEYCODE_NO_INP '\0'
#define KEYCODE_ESCAPE '\033'
@@ -116,8 +117,12 @@ static int get_index(void)
memset(buf, 0, sizeof(buf));
+ sclp_set_write_mask(SCLP_EVENT_MASK_MSG_ASCII, SCLP_EVENT_MASK_MSG_ASCII);
+
len = read_prompt(buf, sizeof(buf) - 1);
+ sclp_set_write_mask(0, SCLP_EVENT_MASK_MSG_ASCII);
+
/* If no input, boot default */
if (len == 0) {
return 0;