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: Mark Cave-Ayland
Subject: Re: [PATCH v2 07/11] scsi-disk: allow truncated MODE SELECT requests
Date: Mon, 30 May 2022 22:00:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0

On 26/05/2022 13:06, Paolo Bonzini wrote:

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.

Okay let me double-check this again to confirm whether the issue is with MODE SENSE, MODE SELECT or both. Adding a quirk to control the behaviour is fairly easy to do.

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);
          }


ATB,

Mark.



reply via email to

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