qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 07/11] scsi-disk: allow truncated MODE SELECT requests


From: Paolo Bonzini
Subject: Re: [PATCH v2 07/11] scsi-disk: allow truncated MODE SELECT requests
Date: Thu, 26 May 2022 14:06:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 4/24/22 18:49, Mark Cave-Ayland wrote:
According to [1] this truncated request is accepted on real hardware whereas in
QEMU it generates an INVALID_PARAM_LEN sense code which causes A/UX to get stuck
in a loop retrying the command in an attempt to succeed.

That's for MODE SENSE, not MODE SELECT.

Truncated MODE SELECT is a bit more iffy, so I'd rather have a quirk for this as well.

Paolo

Alter the mode page request length check so that truncated requests are allowed
as per real hardware, adding a trace event to enable the condition to be 
detected.

[1]https://68kmla.org/bb/index.php?threads/scsi2sd-project-anyone-interested.29040/page-7#post-316444

Signed-off-by: Mark Cave-Ayland<mark.cave-ayland@ilande.co.uk>
---
  hw/scsi/scsi-disk.c  | 2 +-
  hw/scsi/trace-events | 1 +
  2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 71fdf132c1..c657e4f5da 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -1525,7 +1525,7 @@ static int mode_select_pages(SCSIDiskReq *r, uint8_t *p, 
int len, bool change)
              goto invalid_param;
          }
          if (page_len > len) {
-            goto invalid_param_len;
+            trace_scsi_disk_mode_select_page_truncated(page, page_len, len);
          }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]