From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xha17-0002Z7-V4 for qemu-devel@nongnu.org; Fri, 24 Oct 2014 04:14:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xha0y-0004vF-Tf for qemu-devel@nongnu.org; Fri, 24 Oct 2014 04:14:37 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:46703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xha0y-0004uz-KO for qemu-devel@nongnu.org; Fri, 24 Oct 2014 04:14:28 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Oct 2014 09:14:26 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id DDC3617D8045 for ; Fri, 24 Oct 2014 09:14:24 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9O8ENMs5833026 for ; Fri, 24 Oct 2014 08:14:24 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9O8EL7S028451 for ; Fri, 24 Oct 2014 02:14:23 -0600 From: Heinz Graalfs Date: Fri, 24 Oct 2014 10:13:44 +0200 Message-Id: <1414138427-60643-1-git-send-email-graalfs@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC 0/3] qemu-char: Add poll timeouts for character backends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: cornelia.huck@de.ibm.com, pbonzini@redhat.com, Heinz Graalfs , borntraeger@de.ibm.com On s390 one can observe system hang situations wrt console input when using 'dataplane=on'. dataplane processing causes an inactive main thread and an active dataplane thread. When a character backend descriptor disappears from the main thread's poll() descriptor array (when can_read() returns 0) it happens that it will never reappear in the poll() array due to missing poll() interrupts. The following patches fix observed hangs on s390 and provide a means to avoid potential hangs in other backends/frontends. The command line to reproduce the hang on s390: qemu-system-s390x -machine s390-ccw-virtio,accel=kvm,usb=off,kernel_irqchip=on -m 1024 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1 -rtc base=utc -drive file=/dev/disk/by-path/ccw-0.0.e7ac,if=none,id=drive-virtio-disk0, format=raw,werror=report,rerror=report,cache=none,aio=native -device virtio-blk-ccw,ioeventfd=on,scsi=off,config-wce=off,devno=fe.0.0001, drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,x-data-plane=on -kernel /guest/vmlinux -append "root=/dev/vda1 console=ttyS0" -chardev stdio,id=sclpcon1,mux=off -device sclplmconsole,chardev=sclpcon1 -nographic -nodefaults Patch 1: Adds timeout to poll() when a frontend returned -EAGAIN on 'can_read'. Patch 2: The SCLP line mode console now returns -EAGAIN on 'can_read' to fix a hang after the backend descriptor disappeared forever from the poll() descriptor array. Patch 3: The ASCII console now returns -EAGAIN on 'can_read' to avoid a potential hang. Heinz Graalfs (3): char: Trigger timeouts on poll() when frontend is unready s390x: Fix hanging SCLP line mode console s390x: Avoid hanging SCLP ASCII console hw/char/sclpconsole-lm.c | 4 ++-- hw/char/sclpconsole.c | 7 ++++++- qemu-char.c | 27 ++++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 4 deletions(-) -- 1.8.3.1