From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjPN7-0007m5-AO for qemu-devel@nongnu.org; Wed, 29 Oct 2014 05:16:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjPN1-0008BV-LG for qemu-devel@nongnu.org; Wed, 29 Oct 2014 05:16:53 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:64662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjPN1-0008BQ-EM for qemu-devel@nongnu.org; Wed, 29 Oct 2014 05:16:47 -0400 Received: by mail-wi0-f169.google.com with SMTP id n3so980631wiv.2 for ; Wed, 29 Oct 2014 02:16:45 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5450B07A.8060103@redhat.com> Date: Wed, 29 Oct 2014 10:16:42 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1414569232-21357-1-git-send-email-hare@suse.de> <1414569232-21357-5-git-send-email-hare@suse.de> In-Reply-To: <1414569232-21357-5-git-send-email-hare@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 04/17] scsi: fixup lba calculation for 6 byte CDBs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hannes Reinecke , qemu-devel@nongnu.org Cc: Alexander Graf , Nic Bellinger , Andreas Faerber On 10/29/2014 08:53 AM, Hannes Reinecke wrote: > 6 byte CDBs do not have a dedicated area for LBAs, and even if > it certainly won't be at byte 0. > > Signed-off-by: Hannes Reinecke > --- > hw/scsi/scsi-bus.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c > index 919a86c..64d0880 100644 > --- a/hw/scsi/scsi-bus.c > +++ b/hw/scsi/scsi-bus.c > @@ -1195,9 +1195,6 @@ static uint64_t scsi_cmd_lba(SCSICommand *cmd) > uint64_t lba; > > switch (buf[0] >> 5) { > - case 0: > - lba = ldl_be_p(&buf[0]) & 0x1fffff; These are bits 0-20 of the first big endian u32, which means the low five bits of byte 1, together with byte 2 and byte 3. The patch as is breaks (obsolete) commands such as READ(6) and WRITE(6). Why did you need it? Paolo > - break; > case 1: > case 2: > case 5: >