From owner-svn-soc-all@FreeBSD.ORG Sat Sep 7 16:07:02 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 38669AA9 for ; Sat, 7 Sep 2013 16:07:02 +0000 (UTC) (envelope-from zcore@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2509D2800 for ; Sat, 7 Sep 2013 16:07:02 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r87G72Yo088993 for ; Sat, 7 Sep 2013 16:07:02 GMT (envelope-from zcore@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r87G72ql088988 for svn-soc-all@FreeBSD.org; Sat, 7 Sep 2013 16:07:02 GMT (envelope-from zcore@FreeBSD.org) Date: Sat, 7 Sep 2013 16:07:02 GMT Message-Id: <201309071607.r87G72ql088988@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to zcore@FreeBSD.org using -f From: zcore@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257082 - soc2013/zcore/head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Sep 2013 16:07:02 -0000 Author: zcore Date: Sat Sep 7 16:07:01 2013 New Revision: 257082 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257082 Log: support ATA_READ_DMA48 and ATA_WRITE_DMA48 Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Sat Sep 7 16:05:58 2013 (r257081) +++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Sat Sep 7 16:07:01 2013 (r257082) @@ -323,7 +323,7 @@ struct ahci_prdt_entry *prdt = (struct ahci_prdt_entry *)(cfis + 0x80); struct ahci_cmd_hdr *hdr = p->cmd_lst + slot * AHCI_CL_SIZE; - if (cfis[2] == ATA_WRITE_DMA) + if (cfis[2] == ATA_WRITE_DMA || cfis[2] == ATA_WRITE_DMA48) readop = 0; if (!p->iofree) { @@ -334,14 +334,26 @@ return; } - lba = ((cfis[7] & 0xf) << 24) | (cfis[6] << 16) | - (cfis[5] << 8) | cfis[4]; + if (cfis[2] == ATA_READ_DMA48 || cfis[2] == ATA_WRITE_DMA48) { + lba = ((uint64_t)cfis[10] << 40) | + ((uint64_t)cfis[9] << 32) | + ((uint64_t)cfis[8] << 24) | + ((uint64_t)cfis[6] << 16) | + ((uint64_t)cfis[5] << 8) | + cfis[4]; + if (!cfis[12] && !cfis[13]) + len = 65536; + else + len = cfis[13] << 8 | cfis[12]; + } else { + lba = ((cfis[7] & 0xf) << 24) | (cfis[6] << 16) | + (cfis[5] << 8) | cfis[4]; + if (!cfis[12]) + len = 256; + else + len = cfis[12]; + } lba *= blockif_sectsz(p->bctx); - - if (!cfis[12]) - len = 256; - else - len = cfis[12]; len *= blockif_sectsz(p->bctx); /* @@ -500,6 +512,8 @@ break; case ATA_READ_DMA: case ATA_WRITE_DMA: + case ATA_READ_DMA48: + case ATA_WRITE_DMA48: handle_dma(p, slot, cfis); break; default: