From patchwork Fri May 27 08:48:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 9137905 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 9F6D96075C for ; Fri, 27 May 2016 08:49:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9489627CCD for ; Fri, 27 May 2016 08:49:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85A21252D5; Fri, 27 May 2016 08:49:50 +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=-5.9 required=2.0 tests=BAYES_00,FSL_HELO_HOME, 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 8E303252D5 for ; Fri, 27 May 2016 08:49:49 +0000 (UTC) Received: from localhost ([::1]:44680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6DSk-0004VP-O6 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 27 May 2016 04:49:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6DSN-0004VA-84 for qemu-devel@nongnu.org; Fri, 27 May 2016 04:49:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6DSJ-0002Fc-9G for qemu-devel@nongnu.org; Fri, 27 May 2016 04:49:23 -0400 Received: from chuckie.co.uk ([82.165.15.123]:37698 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6DSJ-0002FS-26; Fri, 27 May 2016 04:49:19 -0400 Received: from host31-50-169-25.range31-50.btcentralplus.com ([31.50.169.25] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1b6DSG-0006KI-GU; Fri, 27 May 2016 09:49:17 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, pbonzini@redhat.com, aurelien@aurel32.net Date: Fri, 27 May 2016 09:48:41 +0100 Message-Id: <1464338922-13102-2-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1464338922-13102-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1464338922-13102-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 31.50.169.25 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 1/2] dma-helpers.c: [HACK] disable iovec truncation to nearest sector size 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is not a production fix but is included to allow the following patch to work until a proper solution is found. Otherwise iovecs which are not an exact multiple of 0x200 are artificially truncated causing corruption to the unaligned accesses required by Darwin PPC on the macio controller. Signed-off-by: Mark Cave-Ayland --- dma-helpers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dma-helpers.c b/dma-helpers.c index b521d84..693394a 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -160,9 +160,11 @@ static void dma_blk_cb(void *opaque, int ret) return; } + /* FIXME: this breaks unaligned DMA accesses if (dbs->iov.size & ~BDRV_SECTOR_MASK) { qemu_iovec_discard_back(&dbs->iov, dbs->iov.size & ~BDRV_SECTOR_MASK); } + */ dbs->acb = dbs->io_func(dbs->offset, &dbs->iov, dma_blk_cb, dbs, dbs->io_func_opaque);