All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 3/6] scsi: fix parsing of allocation length field
Date: Fri, 18 Nov 2011 14:07:48 +0100	[thread overview]
Message-ID: <4EC658A4.5000404@redhat.com> (raw)
In-Reply-To: <1321277512-9414-4-git-send-email-pbonzini@redhat.com>

Am 14.11.2011 14:31, schrieb Paolo Bonzini:
> - several MMC commands were parsed wrong by QEMU because their allocation
> length/parameter list length is placed in a non-standard position in
> the CDB (i.e. it is different from most commands with the same value in
> bits 5-7).
> 
> - SEND VOLUME TAG length was multiplied by 40 which is not in SMC.  The
> parameter list length is between 32 and 40 bytes.  Same for MEDIUM SCAN
> (spec found at http://ldkelley.com/SCSI2/SCSI2-16.html but not in any of
> the PDFs I have here).
> 
> - READ_POSITION (SSC) conflicts with PRE_FETCH (SBC).  READ_POSITION's
> transfer length is not hardcoded to 20 in SSC; for PRE_FETCH cmd->xfer
> should be 0.  Both fixed.
> 
> - FORMAT MEDIUM (the SSC name for FORMAT UNIT) was missing.  The FORMAT
> UNIT command is still somewhat broken for block devices because its
> parameter list length is not in the CDB.  However it works for CD/DVD
> drives, which mandate the length of the payload.
> 
> - fixed wrong sign-extensions for 32-bit fields (for the LBA field,
> this affects disks >1 TB).
> 
> - several other SBC or SSC commands were missing or parsed wrong.
> 
> - some commands were not in the list of "write" commands.
> 
> Reported-by: Thomas Schmitt <scdbackup@gmx.net>
> Tested-by: Thomas Schmitt <scdbackup@gmx.net> (MMC bits only)
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/scsi-bus.c |   95 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
>  1 files changed, 86 insertions(+), 9 deletions(-)

> @@ -671,11 +696,11 @@ static int scsi_req_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf)
>          cmd->len = 10;
>          break;
>      case 4:
> -        cmd->xfer = ldl_be_p(&buf[10]);
> +        cmd->xfer = ldl_be_p(&buf[10]) & 0xffffffffULL;

Makes me wonder why we don't have an unsigned version of ldl_be_p...

I'll apply this anyway, we can still clean it up on top if we like.

Kevin

  reply	other threads:[~2011-11-18 13:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 13:31 [Qemu-devel] [PATCH v2 0/6] scsi/atapi: MMC fixes Paolo Bonzini
2011-11-14 13:31 ` [Qemu-devel] [PATCH v2 1/6] atapi: kill MODE SENSE(6), fix MODE SENSE(10) Paolo Bonzini
2011-11-14 13:31 ` [Qemu-devel] [PATCH v2 2/6] scsi: update list of commands Paolo Bonzini
2011-11-14 13:31 ` [Qemu-devel] [PATCH v2 3/6] scsi: fix parsing of allocation length field Paolo Bonzini
2011-11-18 13:07   ` Kevin Wolf [this message]
2011-11-18 13:51     ` Paolo Bonzini
2011-11-14 13:31 ` [Qemu-devel] [PATCH v2 4/6] scsi: remove block descriptors from CDs Paolo Bonzini
2011-11-14 13:31 ` [Qemu-devel] [PATCH v2 5/6] scsi: pass down REQUEST SENSE to the device when there is no stored sense Paolo Bonzini
2011-11-14 13:31 ` [Qemu-devel] [PATCH v2 6/6] scsi-block: always use SG_IO for MMC devices Paolo Bonzini
2011-11-18 13:15 ` [Qemu-devel] [PATCH v2 0/6] scsi/atapi: MMC fixes Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2011-11-14  9:40 Paolo Bonzini
2011-11-14  9:40 ` [Qemu-devel] [PATCH v2 3/6] scsi: fix parsing of allocation length field Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EC658A4.5000404@redhat.com \
    --to=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.