From patchwork Mon Aug 8 21:04:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 9269879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E80B607D6 for ; Mon, 8 Aug 2016 22:14:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FA3925EF7 for ; Mon, 8 Aug 2016 22:14:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5405B27FE4; Mon, 8 Aug 2016 22:14:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EEC9125EF7 for ; Mon, 8 Aug 2016 22:14:50 +0000 (UTC) Received: from localhost ([::1]:60173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWsos-0006Et-4d for patchwork-qemu-devel@patchwork.kernel.org; Mon, 08 Aug 2016 18:14:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWrkx-0004qx-PE for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:06:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWrkt-0006Jk-IY for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:06:42 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:27615 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWrkt-0006Jc-Br for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:06:39 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u78Kxk6m105409 for ; Mon, 8 Aug 2016 17:06:39 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0a-001b2d01.pphosted.com with ESMTP id 24nbs0rngw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 08 Aug 2016 17:06:38 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Aug 2016 15:06:38 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 8 Aug 2016 15:06:28 -0600 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: mdroth@linux.vnet.ibm.com Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id D49191FF0043; Mon, 8 Aug 2016 15:06:10 -0600 (MDT) Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u78L6SEs22610040; Mon, 8 Aug 2016 14:06:28 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4C838C604C; Mon, 8 Aug 2016 15:06:28 -0600 (MDT) Received: from localhost (unknown [9.80.86.168]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id B08EEC6037; Mon, 8 Aug 2016 15:06:27 -0600 (MDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 8 Aug 2016 16:04:27 -0500 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470690267-31454-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1470690267-31454-1-git-send-email-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16080821-0028-0000-0000-00000554C78A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005568; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000178; SDB=6.00741898; UDB=6.00349152; IPR=6.00514456; BA=6.00004651; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012252; XFM=3.00000011; UTC=2016-08-08 21:06:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16080821-0029-0000-0000-00002E349FA3 Message-Id: <1470690267-31454-57-git-send-email-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-08_15:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608080226 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 56/56] ide: fix halted IO segfault at reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: John Snow If one attempts to perform a system_reset after a failed IO request that causes the VM to enter a paused state, QEMU will segfault trying to free up the pending IO requests. These requests have already been completed and freed, though, so all we need to do is NULL them before we enter the paused state. Existing AHCI tests verify that halted requests are still resumed successfully after a STOP event. Analyzed-by: Laszlo Ersek Reviewed-by: Laszlo Ersek Signed-off-by: John Snow Message-id: 1469635201-11918-2-git-send-email-jsnow@redhat.com Signed-off-by: John Snow (cherry picked from commit 87ac25fd1fed05a30a93d27dbeb2a4c4b83ec95f) Signed-off-by: Michael Roth --- hw/ide/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index 41e6a2d..e87dc57 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -806,6 +806,7 @@ static void ide_dma_cb(void *opaque, int ret) } if (ret < 0) { if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s->dma_cmd))) { + s->bus->dma->aiocb = NULL; return; } }