From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMh9n-0003VJ-Ck for qemu-devel@nongnu.org; Wed, 27 Aug 2014 13:37:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMh9b-0002tM-KM for qemu-devel@nongnu.org; Wed, 27 Aug 2014 13:37:15 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:42680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMh9b-0002t9-Bj for qemu-devel@nongnu.org; Wed, 27 Aug 2014 13:37:03 -0400 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Aug 2014 11:37:02 -0600 From: Michael Roth Date: Wed, 27 Aug 2014 12:36:02 -0500 Message-Id: <1409160982-16389-6-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1409160982-16389-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1409160982-16389-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 05/25] ide: only constrain read/write requests to drive size, not other types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Michael Tokarev Commit 58ac321135a introduced a check to ide dma processing which constrains all requests to drive size. However, apparently, some valid requests (like TRIM) does not fit in this constraint, and fails in 2.1. So check the range only for reads and writes. Cc: qemu-stable@nongnu.org Signed-off-by: Michael Tokarev Signed-off-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi (cherry picked from commit d66168ed687325aa6d338ce3a3cff18ce3098ed6) Signed-off-by: Michael Roth --- hw/ide/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index db191a6..7256592 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -688,7 +688,8 @@ void ide_dma_cb(void *opaque, int ret) sector_num, n, s->dma_cmd); #endif - if (!ide_sect_range_ok(s, sector_num, n)) { + if ((s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) && + !ide_sect_range_ok(s, sector_num, n)) { dma_buf_commit(s); ide_dma_error(s); return; -- 1.9.1