From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaEkg-0007c0-Vy for qemu-devel@nongnu.org; Thu, 10 Sep 2015 23:11:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaEkg-0000AP-5Z for qemu-devel@nongnu.org; Thu, 10 Sep 2015 23:11:50 -0400 Date: Fri, 11 Sep 2015 11:11:41 +0800 From: Fam Zheng Message-ID: <20150911031141.GA2592@ad.nay.redhat.com> References: <1441927256-24625-1-git-send-email-jsnow@redhat.com> <1441927256-24625-2-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441927256-24625-2-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 1/1] atapi: abort transfers with 0 byte limits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, armbru@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org On Thu, 09/10 19:20, John Snow wrote: > > + /* Nondata commands permit the byte_count_limit to be 0. > + * If this is a data-transferring PIO command and BCL is 0, > + * we abort at the /ATA/ level, not the ATAPI level. > + * See ATA8 ACS3 section 7.17.6.49 and 7.21.5 */ > + if (!(atapi_cmd_table[s->io_buffer[0]].flags & NONDATA)) { > + /* TODO: Check IDENTIFY data word 125 for default BCL (currently 0) */ > + uint16_t byte_count_limit = s->lcyl | (s->hcyl << 8); > + if !(byte_count_limit || s->atapi_dma) { !( ? Fam