From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165589530484115.398051588581552; Wed, 22 Jun 2022 03:55:04 -0700 (PDT) Received: from localhost ([::1]:42612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3y0l-0006Qh-Q5 for importer@patchew.org; Wed, 22 Jun 2022 06:55:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzU-0003Xv-Jg; Wed, 22 Jun 2022 06:53:45 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzS-0005R5-TO; Wed, 22 Jun 2022 06:53:44 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyD-000CTX-0I; Wed, 22 Jun 2022 11:52:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XBW7Pn4aogUXe0Mh+FwaA6VfGnoQ/OTbXuLlU+sKvQM=; b=I+2ttPpEAa2i0xc6qhUOq8hzch 9yos4Yoz7/vbmludZB8Ke8ArXIu0hvHZMBJo4VtnH0cwtl7EVQeNZVEq25kIp+tL6WLDepiKVxHVp 5PdM8b+IHuuDMgU7/ja8I8j+N1kGtUYe7YNtt24As0DOLD5n1kLw2P0ICkLmeU9Bh4R0PZkEocEMM qq7CC0aESSuN272iDM7sE6v96IRX2f/GuBdMnO4/FuJSGAl2MOCpbtCCHAr4FZqXt4/ZJIrrVQ71i 2eiot2Z/61nGUa0ldHgpbc1U22y2Pg9L7CArmCEolHK2nCcZUj5ZUsJPTpGFz6vSD/z5OzEb3Ib6/ XRiDASqgKUWg/3uXd5UownDMiVn1NBhGZjZqsAQHsX0Ttaw1qx1NvfN5N4+rs0trVWBnmreyuTWCC tdrvHCDRoxtEQ9gkrQf59Cz5tECKndWQ1nWD5M38BqsB2sIusWI6xxvvv36EWzcHiwV2ddQUk/nHE Go882czxnfwzKS4Wu2psp1ErLuTO8tgigJu/7No6svhQ1TH0nE/3WOLipT5tKuqFDSoiTJWpmJ67+ l8X3ugF6eisHb0VvmNHhKTH9EwZBgwDYgHmaT2I88Nq8IogjJ7bdYCChmnM7Yl8Oq/Vub3VMUud/7 HW5U6Pxti3R4pI6q/ZoZXMQB9DPApMUCt85v8/iyk=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:01 +0100 Message-Id: <20220622105314.802852-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 01/14] scsi-disk: add new quirks bitmap to SCSIDiskState X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655895305718100001 Content-Type: text/plain; charset="utf-8" Since the MacOS SCSI implementation is quite old (and Apple added some firm= ware customisations to their drives for m68k Macs) there is need to add a mechan= ism to correctly handle Apple-specific quirks. Add a new quirks bitmap to SCSIDiskState that can be used to enable these features as required. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/scsi/scsi-disk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 072686ed58..8c28dd8566 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -94,6 +94,7 @@ struct SCSIDiskState { uint16_t port_index; uint64_t max_unmap_size; uint64_t max_io_size; + uint32_t quirks; QEMUBH *bh; char *version; char *serial; --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655896004359734.026420983683; Wed, 22 Jun 2022 04:06:44 -0700 (PDT) Received: from localhost ([::1]:40322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3yC3-0007wn-4d for importer@patchew.org; Wed, 22 Jun 2022 07:06:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzY-0003ZO-Im; Wed, 22 Jun 2022 06:53:48 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzX-0005Rg-2P; Wed, 22 Jun 2022 06:53:48 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyH-000CTX-7n; Wed, 22 Jun 2022 11:52:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VJ8memk3OEaFs/fHyCocfyjLGPsn2s817p2kBMOunq8=; b=aLWPVDxE2sP3s3mVN6brpFVhJj ASwGeLvGOjDCXf94ol05KBpCemjGxnf/+490tZWM3PA8o3qC82Z7C9SOH8p6M2LkygvZTL57bz8NK WJhJMroQS4LLqgFGdBLY+wN5eDiiW6KvLSN1WZJ46uns4F4P3r6nvJSIkticrf7d+MuOkshd/UQ4e WvHVbAec6bsyBtd/+JV3eXX6HO2bmo61z/AZ+wIK9eFsmM4yLM6lki1tcfUNCsuAoNDoEjqaxkjW+ kOGzUBl7JLAdsj+BTp/Gop7ie3dqc61jhZh3QRBscGAb0sr6VnrW5ABGW0GhdDA5zfTHMrGFcrhza obUBRbkMMCztcexz5urIjzOgoKMKCc4sNgeK0FS9JVecgIjg2mZx1kh1NbymkLonJ014zy/qoiYKA qWVNIREor/bajYtWtgiVW2iZCDbBFTMDKXWBvHmhw8AmJKwviG4ydA6s9i6kJRir28eCbE79MHOVn wgd7B8TAofjxp4iR8RB2g0yLOb01GKoPOoW6jxuUaXB7eAj/IhwGradCZRNL5RoC2bOhd8TWaqBQI QIjAmJbOi2CtJu0ovnSCk21XfHFlX4BlEcMdnG8owRpLuszaxVsYfvr/LMqm1Qi2gAfOMJS+n2l19 duv72u2O7Jp1E1MJUAMIrDWc0btHr2M9mLPGoPDO0=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:02 +0100 Message-Id: <20220622105314.802852-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 02/14] scsi-disk: add MODE_PAGE_APPLE_VENDOR quirk for Macintosh X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655896006627100001 Content-Type: text/plain; charset="utf-8" One of the mechanisms MacOS uses to identify CDROM drives compatible with M= acOS is to send a custom MODE SELECT command for page 0x30 to the drive. The response to this is a hard-coded manufacturer string which must match in or= der for the CDROM to be usable within MacOS. Add an implementation of the MODE SELECT page 0x30 response guarded by a ne= wly defined SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR quirk bit so that CDROM driv= es attached to non-Apple machines function exactly as before. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/scsi/scsi-disk.c | 17 +++++++++++++++++ include/hw/scsi/scsi.h | 3 +++ include/scsi/constants.h | 1 + 3 files changed, 21 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 8c28dd8566..64f9418dc9 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1085,6 +1085,7 @@ static int mode_sense_page(SCSIDiskState *s, int page= , uint8_t **p_outbuf, [MODE_PAGE_R_W_ERROR] =3D (1 << TYPE_DISK) | (1 << TY= PE_ROM), [MODE_PAGE_AUDIO_CTL] =3D (1 << TYPE_ROM), [MODE_PAGE_CAPABILITIES] =3D (1 << TYPE_ROM), + [MODE_PAGE_APPLE_VENDOR] =3D (1 << TYPE_ROM), }; =20 uint8_t *p =3D *p_outbuf + 2; @@ -1229,6 +1230,20 @@ static int mode_sense_page(SCSIDiskState *s, int pag= e, uint8_t **p_outbuf, p[19] =3D (16 * 176) & 0xff; break; =20 + case MODE_PAGE_APPLE_VENDOR: + if (s->quirks & (1 << SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR)) { + length =3D 0x1e; + if (page_control =3D=3D 1) { /* Changeable Values */ + break; + } + + memset(p, 0, length); + strcpy((char *)p + 8, "APPLE COMPUTER, INC "); + break; + } else { + return -1; + } + default: return -1; } @@ -3086,6 +3101,8 @@ static Property scsi_cd_properties[] =3D { DEFAULT_MAX_IO_SIZE), DEFINE_PROP_INT32("scsi_version", SCSIDiskState, qdev.default_scsi_ver= sion, 5), + DEFINE_PROP_BIT("quirk_mode_page_apple_vendor", SCSIDiskState, quirks, + SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR, 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 1ffb367f94..e090ea1b40 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -226,4 +226,7 @@ SCSIDevice *scsi_device_get(SCSIBus *bus, int channel, = int target, int lun); /* scsi-generic.c. */ extern const SCSIReqOps scsi_generic_req_ops; =20 +/* scsi-disk.c */ +#define SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR 0 + #endif diff --git a/include/scsi/constants.h b/include/scsi/constants.h index 2a32c08b5e..891aa0f45c 100644 --- a/include/scsi/constants.h +++ b/include/scsi/constants.h @@ -234,6 +234,7 @@ #define MODE_PAGE_FAULT_FAIL 0x1c #define MODE_PAGE_TO_PROTECT 0x1d #define MODE_PAGE_CAPABILITIES 0x2a +#define MODE_PAGE_APPLE_VENDOR 0x30 #define MODE_PAGE_ALLS 0x3f /* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor * of MODE_PAGE_SENSE_POWER */ --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655895487208176.3579909031198; Wed, 22 Jun 2022 03:58:07 -0700 (PDT) Received: from localhost ([::1]:51716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3y3h-0004NQ-Pl for importer@patchew.org; Wed, 22 Jun 2022 06:58:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzY-0003ZN-Ip; Wed, 22 Jun 2022 06:53:48 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzX-0005Ri-79; Wed, 22 Jun 2022 06:53:48 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyL-000CTX-Fu; Wed, 22 Jun 2022 11:52:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mKmsDgbA3n34jb7Qo8bj3PSUQhXK5nQ7TWNJ8rMuoo8=; b=S85nOwackOuiYupVPK1cHfpyFT kdYdXnT+0BkONsH9v50G7kdqOzImaEzE9y+/jcvvKdNkwrnY35r4L4QKZW2IOTMo5m1+6GYEgVO5n 8lDVyxznUwpnCT/qrMYJgiOtDCJiubx15jzmsLJC+puCsPVjvFvah91ABI74I/sscfYN+68vWF9FS bjq5z+/sIRyahaDWHi3UvMvcFQOlqyR4AfiePGo0uY0golUXX+KxfpllxJ39Qea6s+9KIxrPXB1IE 1FgACC0BLxAt6sIS6IamKxd+4ruhFvbCVwPkr5iYOG6a6yib7NjZ7xXJOoQd/5TruBlqEc15z9/bw EOi1mMjeyamLonZw8vdDLWFEhQ9UFDD4RIN4gaVszO/tyfAfpRtHx1nJ2VmV6pfsIgWJF+nhsgVDP fwbLj9E8as2O5Eg+uMDNzKv7gSHbpXohB2Ovfvs5SkKj884yU8C9o8N9+dW9U3oJYA7TFBB3RpOFM hYOZ0DodaVp2CNdQFVzQ9GiGf73FpkK4qyb32xOOhYzXgxRv3yFYjppvFDKMmpqW6pMhBSHDEux4x 1rnkbq4QxhX3Vsfr6YMvqRk13QhWTjWYEzG6neg7vJMNUr0VDuh1CjOP1DDlZfY1D/ZG308BP6K5R QXwJen4SmWu/OwNnCTL3qjO+wQUf8zbv43/h8bCho=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:03 +0100 Message-Id: <20220622105314.802852-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 03/14] q800: implement compat_props to enable quirk_mode_page_apple_vendor for scsi-cd devices X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655895488722100001 Content-Type: text/plain; charset="utf-8" By default quirk_mode_page_apple_vendor should be enabled for all scsi-cd d= evices connected to the q800 machine to enable MacOS to detect and use them. Signed-off-by: Mark Cave-Ayland --- hw/m68k/q800.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 099a758c6f..6fabd35529 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -686,6 +686,11 @@ static void q800_init(MachineState *machine) } } =20 +static GlobalProperty hw_compat_q800[] =3D { + { "scsi-cd", "quirk_mode_page_apple_vendor", "on"}, +}; +static const size_t hw_compat_q800_len =3D G_N_ELEMENTS(hw_compat_q800); + static void q800_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -695,6 +700,7 @@ static void q800_machine_class_init(ObjectClass *oc, vo= id *data) mc->max_cpus =3D 1; mc->block_default_type =3D IF_SCSI; mc->default_ram_id =3D "m68k_mac.ram"; + compat_props_add(mc->compat_props, hw_compat_q800, hw_compat_q800_len); } =20 static const TypeInfo q800_machine_typeinfo =3D { --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655895749459482.3476883850135; Wed, 22 Jun 2022 04:02:29 -0700 (PDT) Received: from localhost ([::1]:60046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3y7w-0001ul-G6 for importer@patchew.org; Wed, 22 Jun 2022 07:02:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzd-0003oP-8O; Wed, 22 Jun 2022 06:53:53 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzb-0005SC-MA; Wed, 22 Jun 2022 06:53:52 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyL-000CTX-QH; Wed, 22 Jun 2022 11:52:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1tbTNNf1JfvQvlLYgy4qUuuVuD00+MuLV7j3l93jr4U=; b=fxZSvJoAYY6JxGOJTAlj0H3uzv iwIn/FSlzD2oCEYTCvqubDEBgQzJcm6nUTk4gZzW97hmUv4bbniAC9Yk4aTKrZvdcVoLsM3im/qII ZRR2ysCCCnPit2ha7JJFr/N0YOKsBJT4QQ01Mc5fBmEvAci642eJYWmX2zwNpwCdEVoE/eh8DFcnm rpI0/OA3ya2QIltwXYlAZ61rX55fq62DpoD2/PwO2vCfYHnqqgdNg8qU4tJykBKvq3J8LZvZudUwe 6AWe7Hj8PXGHoVDBmI8n9a1oLFmdO0kgsHDTsM28qeDqHlFbIP39zaDPc1ffblRBwoBnU2Ig4p47r Dd4LVDO+vzwxpuNPtEwcCqbSeMeBIaheqk8rAlPFt91wz+v+YsE6sY7yor1vQO4om4cJP8R1AZgeX EzrhMZAnUwLOKV2hjX0bElemh5iubIU5vgZuWl/6yKAZSsW+8YFIRluRQ5q23DRRFy63qRhygqNJi YqQPPSOl8buwK4aznU0cPqnsCukGtupSBD1NHkAUh4+AFzyA2q0cAGXUCXoX0Y0g3QmZaOjvQUUZb SJOHHgy0AMUA8B/p4W4oyN26kJkoZUUd8ahIzN3KXGpNA24820HlIvRPfH7DK/G6wadadLuY4z6yN REMbULe+WvwByusLMNMhFw4/m1S0QZPYIF7rIec00=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:04 +0100 Message-Id: <20220622105314.802852-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 04/14] scsi-disk: add SCSI_DISK_QUIRK_MODE_SENSE_ROM_USE_DBD quirk for Macintosh X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655895749938100001 Content-Type: text/plain; charset="utf-8" During SCSI bus enumeration A/UX sends a MODE SENSE command to the CDROM wi= th the DBD bit unset and expects the response to include a block descriptor. A= s per the latest SCSI documentation, QEMU currently force-disables the block descriptor for CDROM devices but the A/UX driver expects the requested block descriptor to be returned. If the block descriptor is not returned in the response then A/UX becomes confused, since the block descriptor returned in the MODE SENSE response is used to generate a subsequent MODE SELECT command which is then invalid. Add a new SCSI_DISK_QUIRK_MODE_SENSE_ROM_USE_DBD quirk to allow this behavi= our to be enabled as required. Note that an additional workaround is required f= or the previous SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR quirk which must never return a block descriptor even though the DBD bit is left unset. Signed-off-by: Mark Cave-Ayland --- hw/scsi/scsi-disk.c | 27 +++++++++++++++++++++++---- include/hw/scsi/scsi.h | 1 + 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 64f9418dc9..41bcf07272 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1279,10 +1279,27 @@ static int scsi_disk_emulate_mode_sense(SCSIDiskReq= *r, uint8_t *outbuf) dev_specific_param |=3D 0x80; /* Readonly. */ } } else { - /* MMC prescribes that CD/DVD drives have no block descriptors, - * and defines no device-specific parameter. */ - dev_specific_param =3D 0x00; - dbd =3D true; + if (s->quirks & (1 << SCSI_DISK_QUIRK_MODE_SENSE_ROM_USE_DBD)) { + /* Use DBD from the request... */ + dev_specific_param =3D 0x00; + + /* + * ... unless we receive a request for MODE_PAGE_APPLE_VENDOR + * which should never return a block descriptor even though DB= D is + * not set, otherwise CDROM detection fails in MacOS + */ + if (s->quirks & (1 << SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR) = && + page =3D=3D MODE_PAGE_APPLE_VENDOR) { + dbd =3D true; + } + } else { + /* + * MMC prescribes that CD/DVD drives have no block descriptors, + * and defines no device-specific parameter. + */ + dev_specific_param =3D 0x00; + dbd =3D true; + } } =20 if (r->req.cmd.buf[0] =3D=3D MODE_SENSE) { @@ -3103,6 +3120,8 @@ static Property scsi_cd_properties[] =3D { 5), DEFINE_PROP_BIT("quirk_mode_page_apple_vendor", SCSIDiskState, quirks, SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR, 0), + DEFINE_PROP_BIT("quirk_mode_sense_rom_use_dbd", SCSIDiskState, quirks, + SCSI_DISK_QUIRK_MODE_SENSE_ROM_USE_DBD, 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index e090ea1b40..845d05722b 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -228,5 +228,6 @@ extern const SCSIReqOps scsi_generic_req_ops; =20 /* scsi-disk.c */ #define SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR 0 +#define SCSI_DISK_QUIRK_MODE_SENSE_ROM_USE_DBD 1 =20 #endif --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655895504892226.25530371435468; Wed, 22 Jun 2022 03:58:24 -0700 (PDT) Received: from localhost ([::1]:52120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3y3w-0004gj-4j for importer@patchew.org; Wed, 22 Jun 2022 06:58:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzh-00043t-Hk; Wed, 22 Jun 2022 06:53:57 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzf-0005SY-00; Wed, 22 Jun 2022 06:53:57 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyQ-000CTX-2A; Wed, 22 Jun 2022 11:52:41 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UxuWZPsof1famT7rIcFgQmOzGApL9EiOptDoXpPK2Jk=; b=LREt9G55yxurSjUbgx2SMJtRqa RizSWtxBYuo3AapqyCU7TNZ4RY113EbxO/DBsvtJKb7R6XyOVwSP0VDWRQZx0OWEtT5FNQOFMo4Ac byZGrQLsjK8ixmcOnbFRXT6TMZAeuLQesL9UaUhd8fr46V7VLZEm5R96cNMSV6O1U6NaWkPcws4gT Z1GXZnCsNXGxwhqNvzuWSVJTzXl/msk94pNOlXRrJQUYpBhIsk3HfBhUaugRIrdkD5+qmN67gdKqg tBrSdmaeXv/jx4F1slzvoPB2MDtsYLeUkNxysy6oPGmT9m5bvzbwz7zzf/IsxiWEs+1mWlGjWpRAj K0ocVj5MsS4IJXdCBrcvKnLFrNi0VLS4nfgffjYh1rNcfwD1OmXI0DJNo0T6jWecjT83oUbSnSkJT E7BzbLDiyPZpCkd1boi8FTiXmdICY6XLDgsQeQc0VhneGHCCMXjipR9rCxy+ClTqmiXik9tGq1Gbp FBtG9u4xmhmYbbaRqKds8CKPCIPrEDPQMSSpSARfJIJj8k2rL/Vcx6+ZgOkRjIctWWFIEoiyCefMp V3nzFixbFy1v7JEPfgzPzv2zFOnARVGzRs9XrW+xq0reC8CS4wvQAQ6L3K7re9htQSLnKz0zOHqw2 xIDQSZVCtp2c6KAPfeiRVZT/d6OL1OXW+sXs6ntd8=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:05 +0100 Message-Id: <20220622105314.802852-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 05/14] q800: implement compat_props to enable quirk_mode_sense_rom_use_dbd for scsi-cd devices X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655895506625100001 Content-Type: text/plain; charset="utf-8" By default quirk_mode_sense_rom_use_dbd should be enabled for all scsi-cd d= evices connected to the q800 machine to correctly report the CDROM block descripto= r back to A/UX. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/m68k/q800.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 6fabd35529..4745f72c92 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -688,6 +688,7 @@ static void q800_init(MachineState *machine) =20 static GlobalProperty hw_compat_q800[] =3D { { "scsi-cd", "quirk_mode_page_apple_vendor", "on"}, + { "scsi-cd", "quirk_mode_sense_rom_use_dbd", "on"}, }; static const size_t hw_compat_q800_len =3D G_N_ELEMENTS(hw_compat_q800); =20 --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655895344429890.5034744818231; Wed, 22 Jun 2022 03:55:44 -0700 (PDT) Received: from localhost ([::1]:44364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3y1P-0007cS-DS for importer@patchew.org; Wed, 22 Jun 2022 06:55:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzk-0004El-JP; Wed, 22 Jun 2022 06:54:00 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzi-0005TE-UX; Wed, 22 Jun 2022 06:54:00 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyT-000CTX-Uy; Wed, 22 Jun 2022 11:52:46 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aNUgQmbmhqQ8p8jWaNuFYtuMnRy////2vI3krZvzKv4=; b=sh3ndCJLfpaQe2ym8/rAXcVcIs X7ssqtvwbDQFvlicLM/81eYQ+LS2GUSpN6qPoqchc5yQ8hPua2G/fluOfN4Zby7W2UcSYKnUh3SJ6 O8KszkkJrhl+8ycE1KM2ibY2YSLfqk72kxVS5kJ/9Q16JgxS/NEfYtQbDAVsj6xZ1pyWiahd2YLNH JpnZB3/JMo/yPKynvm6in8WVvgRbR7Uzx0nr1BZ3/uo7/u8nKGlbGhTgtt6a5AP+wcmNfj6b1PR/A B6QIs9Dvmvx23RGNphYaDiZAHiUBxtwN0lwOVQpvtCSb1eH5nUy4lkf1BtRK9lXNlqos2EFE4cvRE dtiKNM1MXDVUZqebugJmM9igDzwBzozaC8NvZkiG6JhOjzA84peycX8dhD/mECFTeLtZ03gd4TzWp slG4lvq9fCSFsoL+Aoox7tW48qGy/COoQL3cURdAkYNVUAk3X0HXoJpTgC51g3E1/jbuROKh8ZZxC pDX+iUlmgGlfzvY8CZEhnZBGclnqrg/nKv08Im/NxZTJMxXWXLOpTTrgljChHEnR/cFovli4/WcUr hy58kTSJG4FLkhq7S9goqjnN+xWW3i0snNYrcSBxQanr2FQ4MYdMoYYWBfY0aSgu1kkjiUSYZGZc2 XGD2rNaW/aTAXb3x/ATiw8i8dWkHSqsr/6BDJmvpw=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:06 +0100 Message-Id: <20220622105314.802852-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 06/14] scsi-disk: add SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPLE quirk for Macintosh X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655895345477100001 Content-Type: text/plain; charset="utf-8" Both MacOS and A/UX make use of vendor-specific MODE SELECT commands with P= F=3D0 to identify SCSI devices: - MacOS sends a MODE SELECT command with PF=3D0 for the MODE_PAGE_VENDOR_SP= ECIFIC (0x0) mode page containing 2 bytes before initialising a disk - A/UX (installed on disk) sends a MODE SELECT command with PF=3D0 during S= CSI bus enumeration, and gets stuck in an infinite loop if it fails Add a new SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPLE quirk to allow bo= th PF=3D0 MODE SELECT commands and implement a MODE_PAGE_VENDOR_SPECIFIC (0x0) mode page which is compatible with MacOS. Signed-off-by: Mark Cave-Ayland --- hw/scsi/scsi-disk.c | 30 ++++++++++++++++++++++++++++-- include/hw/scsi/scsi.h | 1 + include/scsi/constants.h | 1 + 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 41bcf07272..ce915f326e 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1079,6 +1079,7 @@ static int mode_sense_page(SCSIDiskState *s, int page= , uint8_t **p_outbuf, int page_control) { static const int mode_sense_valid[0x3f] =3D { + [MODE_PAGE_VENDOR_SPECIFIC] =3D (1 << TYPE_DISK) | (1 << TY= PE_ROM), [MODE_PAGE_HD_GEOMETRY] =3D (1 << TYPE_DISK), [MODE_PAGE_FLEXIBLE_DISK_GEOMETRY] =3D (1 << TYPE_DISK), [MODE_PAGE_CACHING] =3D (1 << TYPE_DISK) | (1 << TY= PE_ROM), @@ -1244,6 +1245,22 @@ static int mode_sense_page(SCSIDiskState *s, int pag= e, uint8_t **p_outbuf, return -1; } =20 + case MODE_PAGE_VENDOR_SPECIFIC: + if (s->qdev.type =3D=3D TYPE_DISK && (s->quirks & + (1 << SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPLE))) { + length =3D 0x2; + if (page_control =3D=3D 1) { /* Changeable Values */ + p[0] =3D 0xff; + p[1] =3D 0xff; + break; + } + p[0] =3D 0; + p[1] =3D 0; + break; + } else { + return -1; + } + default: return -1; } @@ -1570,9 +1587,12 @@ static void scsi_disk_emulate_mode_select(SCSIDiskRe= q *r, uint8_t *inbuf) int bd_len; int pass; =20 - /* We only support PF=3D1, SP=3D0. */ if ((r->req.cmd.buf[1] & 0x11) !=3D 0x10) { - goto invalid_field; + if (!(s->quirks & + (1 << SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPLE))) { + /* We only support PF=3D1, SP=3D0. */ + goto invalid_field; + } } =20 if (len < hdr_len) { @@ -3070,6 +3090,9 @@ static Property scsi_hd_properties[] =3D { DEFINE_PROP_UINT16("rotation_rate", SCSIDiskState, rotation_rate, 0), DEFINE_PROP_INT32("scsi_version", SCSIDiskState, qdev.default_scsi_ver= sion, 5), + DEFINE_PROP_BIT("quirk_mode_page_vendor_specific_apple", SCSIDiskState, + quirks, SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPL= E, + 0), DEFINE_BLOCK_CHS_PROPERTIES(SCSIDiskState, qdev.conf), DEFINE_PROP_END_OF_LIST(), }; @@ -3122,6 +3145,9 @@ static Property scsi_cd_properties[] =3D { SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR, 0), DEFINE_PROP_BIT("quirk_mode_sense_rom_use_dbd", SCSIDiskState, quirks, SCSI_DISK_QUIRK_MODE_SENSE_ROM_USE_DBD, 0), + DEFINE_PROP_BIT("quirk_mode_page_vendor_specific_apple", SCSIDiskState, + quirks, SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPL= E, + 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 845d05722b..011cb84753 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -229,5 +229,6 @@ extern const SCSIReqOps scsi_generic_req_ops; /* scsi-disk.c */ #define SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR 0 #define SCSI_DISK_QUIRK_MODE_SENSE_ROM_USE_DBD 1 +#define SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPLE 2 =20 #endif diff --git a/include/scsi/constants.h b/include/scsi/constants.h index 891aa0f45c..6a8bad556a 100644 --- a/include/scsi/constants.h +++ b/include/scsi/constants.h @@ -225,6 +225,7 @@ #define TYPE_NO_LUN 0x7f =20 /* Mode page codes for mode sense/set */ +#define MODE_PAGE_VENDOR_SPECIFIC 0x00 #define MODE_PAGE_R_W_ERROR 0x01 #define MODE_PAGE_HD_GEOMETRY 0x04 #define MODE_PAGE_FLEXIBLE_DISK_GEOMETRY 0x05 --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655895827630743.0440580027272; Wed, 22 Jun 2022 04:03:47 -0700 (PDT) Received: from localhost ([::1]:33174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3y9C-0002t4-GP for importer@patchew.org; Wed, 22 Jun 2022 07:03:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzq-0004bY-G9; Wed, 22 Jun 2022 06:54:06 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzo-0005Ts-VV; Wed, 22 Jun 2022 06:54:06 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyY-000CTX-6R; Wed, 22 Jun 2022 11:52:50 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=445j6yhRsZQ18OxLojcfBAM3WNj3gP5q9l/as7NXJ/g=; b=aUH+NLsZ4DQHf4b9E8kI3ESIbE aK88TWMFkuzLXS9kO4Pqs7qOjUBuw5tgsKL6Tsyz2MCkYzGDWoJS9g+kMwxz9kF/iO4q9ObZn5SO+ +VUh50E7ZOQgrxRd7z8ppT7xL7Pt+3Yh66cWEUNjIW4+URONMcCpAKGpKfHbg4pSdpyCoB9qpqnmL O+Uuz5as2xUbTNaMYqv7BT1Vonx6jjH0jlLatWYYlm8mRYdfBCkyYSMVkY5CR5d698kCFvmB0YowI 4j/T93/4uRskQ6eLjp/wosQl17axQ0YiNPLMItpRJu24f0zjHJcru9fVTEEJzeJeMmywok0JDPjVm hWQfbLzjPWbFyWkNUwH5ypw1rZROWsxorWqQsCMEW9F9e3ARomUMjnfvQBJT+HmGspbuQJEl28yMr GzRjjbBNuwXIalPVMtGrcRtGLgNW+DuJfCz4HsQp2S91ejtKgf5y786h12amdIpju5c4PN+yVlyv9 6kzXH9nJHA3U8OS3j62eUjcI6VVwm8KkoK4BAu2AK9eyRNwsdfozZY8TiNvp6gFAR5GvVFTUE2zxB RFW2XtALjfIszy3YvVhsbzJGc0Kp/s9H2Jk7rlQ01DahJoRPt3/PFKBP6tzcGo581jWD/NDn0C0xi wml0OCE+UjTXu9Z3P6APDk8ZGHuja4wbqSiw+2aV0=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:07 +0100 Message-Id: <20220622105314.802852-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 07/14] q800: implement compat_props to enable quirk_mode_page_vendor_specific_apple for scsi devices X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655895828709100002 Content-Type: text/plain; charset="utf-8" By default quirk_mode_page_vendor_specific_apple should be enabled for both= scsi-hd and scsi-cd devices to allow MacOS to format SCSI disk devices, and A/UX to enumerate SCSI CDROM devices succesfully without getting stuck in a loop. Signed-off-by: Mark Cave-Ayland --- hw/m68k/q800.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 4745f72c92..b774a5b20a 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -687,8 +687,10 @@ static void q800_init(MachineState *machine) } =20 static GlobalProperty hw_compat_q800[] =3D { + { "scsi-hd", "quirk_mode_page_vendor_specific_apple", "on"}, { "scsi-cd", "quirk_mode_page_apple_vendor", "on"}, { "scsi-cd", "quirk_mode_sense_rom_use_dbd", "on"}, + { "scsi-cd", "quirk_mode_page_vendor_specific_apple", "on"}, }; static const size_t hw_compat_q800_len =3D G_N_ELEMENTS(hw_compat_q800); =20 --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655896003462630.0972026681902; Wed, 22 Jun 2022 04:06:43 -0700 (PDT) Received: from localhost ([::1]:40402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3yC2-0007zp-7D for importer@patchew.org; Wed, 22 Jun 2022 07:06:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzt-0004oe-Tf; Wed, 22 Jun 2022 06:54:09 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzs-0005UF-AY; Wed, 22 Jun 2022 06:54:09 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyc-000CTX-DE; Wed, 22 Jun 2022 11:52:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nGNOWG6fop6xkocURliDQI+5P2GkAVoxMSMGWwzk5Ho=; b=zTe5wfud2UOJrvRkpZnGDnX2by o9AwjNzS1XFVxQBAV4deAA93siyOOw3WOHTtMz41/YzFac8EkFJ3px6c/ksrdCXc4BbxP3exfimT5 VH0PbIjV54AlBmvMGUcCnwpL7fcp0aZu8qatcTBBUrq2/TV6VbkcAuaYFpMPizmxSY7RYZ+yp+SpX XdhDM/WWXzupGnfnfJ3vwY8Y4Gr8tYiUHfZ5/r/KN6vNuHYjnS6/98b3mpugqOjfZg+AQNWooQZm3 HU/ltfxPALKvmhvaNhT2hY2lkS+KJjBfUQUUh+4NQoi8YhfbIIZdUGqOfyIWUeUPxy5ryRNttbPbc nKMM8aHOpBusoYJdX0+ZkK42za8CogYD7yywu41DkeO6NXCR4ZYER8WO3/nPYdacAou5Bpjlb2YKd a9EKCsbpgDmUExKO4yhAN7TtpI0O3ruYlzGrmNrDiUa5u1azIjOkN+2yAJ54pwBMNzrwrt12GkikF cLGGKONE3rEEDBl5mFqET2RJydNY3lF6UORf/wllxt2BARhXzllfPYDqvsr8nu6H2ewPJGCvl/+dt MmyezSLhzUJC4//SORqyuLIcaumfFcZ/oqkrg34WyAb2r4b3aIV+IBvt3ChamCDV0kLmKM0nJ5MsG 8kIUw7jc/bJxElwMTdEpjNg1Z1085fsXevBRcr1sg=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:08 +0100 Message-Id: <20220622105314.802852-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 08/14] scsi-disk: add FORMAT UNIT command X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655896004521100001 When initialising a drive ready to install MacOS, Apple HD SC Setup first a= ttempts to format the drive. Add a simple FORMAT UNIT command which simply returns = success to allow the format to succeed. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/scsi/scsi-disk.c | 4 ++++ hw/scsi/trace-events | 1 + 2 files changed, 5 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index ce915f326e..f09c1acae2 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2180,6 +2180,9 @@ static int32_t scsi_disk_emulate_command(SCSIRequest = *req, uint8_t *buf) trace_scsi_disk_emulate_command_WRITE_SAME( req->cmd.buf[0] =3D=3D WRITE_SAME_10 ? 10 : 16, r->req.cmd= .xfer); break; + case FORMAT_UNIT: + trace_scsi_disk_emulate_command_FORMAT_UNIT(r->req.cmd.xfer); + break; default: trace_scsi_disk_emulate_command_UNKNOWN(buf[0], scsi_command_name(buf[0])); @@ -2586,6 +2589,7 @@ static const SCSIReqOps *const scsi_disk_reqops_dispa= tch[256] =3D { [VERIFY_10] =3D &scsi_disk_emulate_reqops, [VERIFY_12] =3D &scsi_disk_emulate_reqops, [VERIFY_16] =3D &scsi_disk_emulate_reqops, + [FORMAT_UNIT] =3D &scsi_disk_emulate_reqops, =20 [READ_6] =3D &scsi_disk_dma_reqops, [READ_10] =3D &scsi_disk_dma_reqops, diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events index 20fb0dc162..03b2640934 100644 --- a/hw/scsi/trace-events +++ b/hw/scsi/trace-events @@ -334,6 +334,7 @@ scsi_disk_emulate_command_UNMAP(size_t xfer) "Unmap (le= n %zd)" scsi_disk_emulate_command_VERIFY(int bytchk) "Verify (bytchk %d)" scsi_disk_emulate_command_WRITE_SAME(int cmd, size_t xfer) "WRITE SAME %d = (len %zd)" scsi_disk_emulate_command_UNKNOWN(int cmd, const char *name) "Unknown SCSI= command (0x%2.2x=3D%s)" +scsi_disk_emulate_command_FORMAT_UNIT(size_t xfer) "Format Unit (len %zu)" scsi_disk_dma_command_READ(uint64_t lba, uint32_t len) "Read (sector %" PR= Id64 ", count %u)" scsi_disk_dma_command_WRITE(const char *cmd, uint64_t lba, int len) "Write= %s(sector %" PRId64 ", count %u)" scsi_disk_new_request(uint32_t lun, uint32_t tag, const char *line) "Comma= nd: lun=3D%d tag=3D0x%x data=3D%s" --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655895548951496.8326077236741; Wed, 22 Jun 2022 03:59:08 -0700 (PDT) Received: from localhost ([::1]:52890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3y4h-0005Cm-A7 for importer@patchew.org; Wed, 22 Jun 2022 06:59:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzx-00051k-AJ; Wed, 22 Jun 2022 06:54:13 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37894) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzv-0005Ue-Gx; Wed, 22 Jun 2022 06:54:13 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyg-000CTX-N8; Wed, 22 Jun 2022 11:52:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bhsUdSsraJqovbQCxXheYzofNcvtG8Qou8t2HxOQhCM=; b=HK1IB9r7zM1JN5Qy7Aar3EWGe5 FuHiZ3MiMGedV8ijidvv/b0KivdtYB41XeVPIQ3Gy6FjLB2Y/lu1Fk0JDCnpGkVB2Y2Fznx1maHeD vLiL0U7eGC2ka9Ez6K5PABNmCKIFqoIvjXSQFIhXXkDs5qF3MOAYEMfXZxAAPjDvfBcUvt557B4gh nt6K3NuaGJxilgzvelDM20Yatkziuw+orxAsp/L12Ao6MZXCYfv/d/0W1W7uJLtsULYwT3o44LpCm 70/TSjNnC2x0lM/gG7r9sWIAVt0sWboC6AUcsW2I/ID5hW/vzrCwQt+oDB7x6DaJS1WEpYdebU9Ps 9nVC3ReIn+onIVvFkSqP3UB6n9t1OSvXkg+RH+xwx43LBCfQwrsccflHpc94WQ22O1idgtPSlb59/ D6TnkUrfVwk/DXSQDemVsJru9GHsSiLDrVLJcf64CZSWarghYEIvBXhQJKbFX4nhtp14H7RXEOMIq tZzzGe3HjMGH205ylWPcWLmNk5h3zFoCzDw208m8h7KkOhERNqQgqupDQss/6kHOVv2xxef3exR78 DjNz0CT02Dx6yWthHDtBeUSGsIXoUTV6NFvy/2X9Q4p1BsWMwJ4h/Sujhlr8s5CdwEaB11izlWOdL qdqNW7D4gHnEjytgldCVo5syYjkGTOgkuoCZGnWB0=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:09 +0100 Message-Id: <20220622105314.802852-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 09/14] scsi-disk: add SCSI_DISK_QUIRK_MODE_PAGE_TRUNCATED quirk for Macintosh X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655895550114100001 Content-Type: text/plain; charset="utf-8" When A/UX configures the CDROM device it sends a truncated MODE SELECT requ= est for page 1 (MODE_PAGE_R_W_ERROR) which is only 6 bytes in length rather than 10. This seems to be due to bug in Apple's code which calculates the CDB me= ssage length incorrectly. The work at [1] suggests that 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 su= cceed. Alter the mode page request length check so that truncated requests are all= owed if the SCSI_DISK_QUIRK_MODE_PAGE_TRUNCATED quirk is enabled, whilst also ad= ding a trace event to enable the condition to be detected. [1] https://68kmla.org/bb/index.php?threads/scsi2sd-project-anyone-interest= ed.29040/page-7#post-316444 Signed-off-by: Mark Cave-Ayland --- hw/scsi/scsi-disk.c | 7 ++++++- hw/scsi/trace-events | 1 + include/hw/scsi/scsi.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index f09c1acae2..b225ec1a4c 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1552,7 +1552,10 @@ 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; + if (!(s->quirks & SCSI_DISK_QUIRK_MODE_PAGE_TRUNCATED)) { + goto invalid_param_len; + } + trace_scsi_disk_mode_select_page_truncated(page, page_len, len= ); } =20 if (!change) { @@ -3152,6 +3155,8 @@ static Property scsi_cd_properties[] =3D { DEFINE_PROP_BIT("quirk_mode_page_vendor_specific_apple", SCSIDiskState, quirks, SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPL= E, 0), + DEFINE_PROP_BIT("quirk_mode_page_truncated", SCSIDiskState, quirks, + SCSI_DISK_QUIRK_MODE_PAGE_TRUNCATED, 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events index 03b2640934..8e927ff62d 100644 --- a/hw/scsi/trace-events +++ b/hw/scsi/trace-events @@ -339,6 +339,7 @@ scsi_disk_dma_command_READ(uint64_t lba, uint32_t len) = "Read (sector %" PRId64 " scsi_disk_dma_command_WRITE(const char *cmd, uint64_t lba, int len) "Write= %s(sector %" PRId64 ", count %u)" scsi_disk_new_request(uint32_t lun, uint32_t tag, const char *line) "Comma= nd: lun=3D%d tag=3D0x%x data=3D%s" scsi_disk_aio_sgio_command(uint32_t tag, uint8_t cmd, uint64_t lba, int le= n, uint32_t timeout) "disk aio sgio: tag=3D0x%x cmd=3D0x%x (sector %" PRId6= 4 ", count %d) timeout=3D%u" +scsi_disk_mode_select_page_truncated(int page, int len, int page_len) "pag= e %d expected length %d but received length %d" =20 # scsi-generic.c scsi_generic_command_complete_noio(void *req, uint32_t tag, int statuc) "C= ommand complete %p tag=3D0x%x status=3D%d" diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 011cb84753..e284e3a4ec 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -230,5 +230,6 @@ extern const SCSIReqOps scsi_generic_req_ops; #define SCSI_DISK_QUIRK_MODE_PAGE_APPLE_VENDOR 0 #define SCSI_DISK_QUIRK_MODE_SENSE_ROM_USE_DBD 1 #define SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPLE 2 +#define SCSI_DISK_QUIRK_MODE_PAGE_TRUNCATED 3 =20 #endif --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655895826655902.905304146252; Wed, 22 Jun 2022 04:03:46 -0700 (PDT) Received: from localhost ([::1]:33044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3y99-0002na-6W for importer@patchew.org; Wed, 22 Jun 2022 07:03:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzx-00053q-Ts; Wed, 22 Jun 2022 06:54:13 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3xzw-0005Uk-Bh; Wed, 22 Jun 2022 06:54:13 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyk-000CTX-Nh; Wed, 22 Jun 2022 11:52:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dVqkXbp44Eb4+DEf6/nTZk4/xN5DSBvf6xpw5GXo2Nw=; b=JO9/0GrghJXyrYmVv2GombnnLZ URiozmteGTpV/hkMiU4TyqMpIfms25XFuwyXS2czE6G5972HV/H1HwM89m3acrBTMtU4u7ATGCrKu FJSBU943cofP4YWAVH2hP7NnWun7tXpX4nHFFFKB8q0Ul9mOvRfZPEOlUUv9tQc6PQbj0p3tx+J2q 1DCtkt4bTVSzgF6sezGgoKJU4QQ2y8THMEtFNwLVyMHGDyP5V47Ql5LbgzoXONsnk1St2yH11otJj C90czqjRUeO4EtyuNBk1YLd5d6iXUzwvqzClpcVG6tT+WVhos4oWXldVhoAVtB9JV4I4ZkuTevuld LDj/JbZ6UNRxZWR3Q3KKSSNvtbPYmGZGNtLnTcyf6rWmbEcDUcJajLU9/hVaPz+RPgXB803HBGMzf 3lpc6qe6I8yne8Us3znIw35uu31yABRcR+sVQY1WQ204th0rnfihbdGZvyR2pIOKXCIvyVs1tyxdy P0TAQ3OFKKeu3ibz2ieMWRvqffMDSAJmXYj9C/hpGDNCI7lbPKRW5icn4cn6RbOBtt/3+PX6XrwnE 4F5kYOtxgUHQ+bDIrza+Skdj3tUtOpWaQu3GOPAIBsuQ01sgh9JyhSREYHfwbziTN/np4jm/d1lW9 NngOlXDjRytGG3p+La23D8wDQh/g6JBxoracG8KU0=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:10 +0100 Message-Id: <20220622105314.802852-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 10/14] q800: implement compat_props to enable quirk_mode_page_truncated for scsi-cd devices X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655895828708100001 Content-Type: text/plain; charset="utf-8" By default quirk_mode_page_truncated should be enabled for all scsi-cd devi= ces connected to the q800 machine to allow A/UX to enumerate SCSI CDROM devices without hanging. Signed-off-by: Mark Cave-Ayland --- hw/m68k/q800.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index b774a5b20a..3254ffb5c4 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -691,6 +691,7 @@ static GlobalProperty hw_compat_q800[] =3D { { "scsi-cd", "quirk_mode_page_apple_vendor", "on"}, { "scsi-cd", "quirk_mode_sense_rom_use_dbd", "on"}, { "scsi-cd", "quirk_mode_page_vendor_specific_apple", "on"}, + { "scsi-cd", "quirk_mode_page_truncated", "on"}, }; static const size_t hw_compat_q800_len =3D G_N_ELEMENTS(hw_compat_q800); =20 --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655896181188159.19398628964984; Wed, 22 Jun 2022 04:09:41 -0700 (PDT) Received: from localhost ([::1]:48930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3yEt-0005Uu-NX for importer@patchew.org; Wed, 22 Jun 2022 07:09:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3y03-0005O0-HG; Wed, 22 Jun 2022 06:54:19 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3y01-0005VE-1i; Wed, 22 Jun 2022 06:54:18 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyl-000CTX-AW; Wed, 22 Jun 2022 11:53:03 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=fR1Oy9W+Xu92DlbOOc7CXAQKUKAY9ogsV4xn/aN/XAA=; b=KL5uDnneGOL89itqx0uBQYJEpe fxZNBFOTWSSTPw0XaIlYQlX0LB3TFXsfTHJRhHBAi1roK08Wbx+lwtPy7mIt66NWTssJtoff/0T+F i3/WJmAMKr1o5Tz6ksX96hJCBI4ag0/bjJEbGCJ+fUia4AkAobbydlQC1bRJ+pxrRi3x3q7ctKOgB VGkJNDSNgsyHHieJAG/Sr0x/Ij+GX7uJtQ2VqOaU6SbgGKLTu7u8DDezGQh4czTEZXChYavBWdeET C4Rkxav93n4f8+R6h+pCPpmT8gp/7w6kvuVFG7brAZyuJIpDaZB2nh3XvHaIbRRhAsCvUH6zl7lnV OrQOhmRyTsz3FJw7bp4uUbnGDcbHVd15LkxySZY4j/B4Jfkk5UiG2exCRgOZGWEjKeO599IPqGrfO Mey2VnoRkGHkHUNlYSUjqo7LznqSURsst4TnoZ5BHJWi9jCZwCpUQ5xZbTEX09nieNq4dSZES/4ul YCYTj0zoNqwjggvGHsePIwNteb2LGImgDUZ9yZzeGbtQ/v+PSpHspXvnzA6G+Le3vBR1qRLJ9xs87 6qeeYeHEomqpxsvwoCKa7S/yF6z3t99c57+0OpbDMe+quPuvCc+HmBZNO8Co/cBVgloUMnSCAKBK5 lLk74cQ0QbajzJZwdSP+ALTRyfqWzdzoLlY9yBEF0=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:11 +0100 Message-Id: <20220622105314.802852-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 11/14] scsi-disk: allow the MODE_PAGE_R_W_ERROR AWRE bit to be changeable for CDROM drives X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655896182997100001 Content-Type: text/plain; charset="utf-8" A/UX sends a MODE_PAGE_R_W_ERROR command with the AWRE bit set to 0 when en= umerating CDROM drives. Since the bit is currently hardcoded to 1 then indicate that = the AWRE bit can be changed (even though we don't care about the value) so that the MODE_PAGE_R_W_ERROR page can be set successfully. Signed-off-by: Mark Cave-Ayland --- hw/scsi/scsi-disk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index b225ec1a4c..3659583e13 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1188,6 +1188,10 @@ static int mode_sense_page(SCSIDiskState *s, int pag= e, uint8_t **p_outbuf, case MODE_PAGE_R_W_ERROR: length =3D 10; if (page_control =3D=3D 1) { /* Changeable Values */ + if (s->qdev.type =3D=3D TYPE_ROM) { + /* Automatic Write Reallocation Enabled */ + p[0] =3D 0x80; + } break; } p[0] =3D 0x80; /* Automatic Write Reallocation Enabled */ --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655896306566633.4338438524759; Wed, 22 Jun 2022 04:11:46 -0700 (PDT) Received: from localhost ([::1]:53280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3yGu-0000Oq-VK for importer@patchew.org; Wed, 22 Jun 2022 07:11:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3y03-0005Pe-VH; Wed, 22 Jun 2022 06:54:19 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3y01-0005VI-B8; Wed, 22 Jun 2022 06:54:19 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyp-000CTX-Lm; Wed, 22 Jun 2022 11:53:04 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=McmL4ezjk5q8bNEj7Y+7OTinT8/N2LxnDXtwxpHnSWc=; b=dO5qaekcoG1Nxk6fE9DHoPEt3h fmw/8ScSxWRnSXIMs/umOPFqJY51uiSWHoHbCYE/cGQiLcCbiX8T2IqNQKQ5rGJ5lYvUfgBMOzq+Y VbIK9LNAer6sOchKcvZwqK5pltsprPho0bgF3aHDxl39UPq7L6bVnUD8BQTl8gLcnOG17Q9HAP6a2 w/64qZSyfBaQSUIRiglUrIdJpSYydU1iiiD8Q/B2lvVJqpGhJ9ryRo2wiKfg7iWaje1VeMD4L9Lbk kwVmHucUw7+RXmt2C3QvAmbSKrZW9oQHip50kPxxnp5WACRExaic2W8LLpgcSPBL1Z3xZKSopJWi9 tokeMe6BQNQuX2e9oFc1yuIskJ9OGe9jarzUzVf8M1dbiTVQc0NfhjMVlvMJGvg0QJ9Eh+Wk5it7X iRDDp0DP0ZxDDlB7Yqx2V4M0t0S2sC0Vp9fzqN5itZVDeYfAAg1WL8gRTY4qUJhYeSPNQhTRBxVhB qbLRBXitj3iqEnxwHzKxOvIdV03ipwdBJjvPAUZw9N/QY5lvAQVUHZ6CstrbbVzGpDkoVEqRTBsaY 6fCAXhIu5sCbjcnuQ0XxVTuuqmn4tWMgGCvpQbURn8tY4OSRT+tbZZ+CSDsAozcdnHweNiWjogRdB wgYKpZmWMYztaEIw90KTSNSw0XJX9xjXrvDEEqcTo=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:12 +0100 Message-Id: <20220622105314.802852-13-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 12/14] scsi-disk: allow MODE SELECT block descriptor to set the block size X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655896307444100001 Content-Type: text/plain; charset="utf-8" The MODE SELECT command can contain an optional block descriptor that can b= e used to set the device block size. If the block descriptor is present then updat= e the block size on the SCSI device accordingly. This allows CDROMs to be used with A/UX which requires a CDROM drive which = is capable of switching from a 2048 byte sector size to a 512 byte sector size. Signed-off-by: Mark Cave-Ayland --- hw/scsi/scsi-disk.c | 6 ++++++ hw/scsi/trace-events | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 3659583e13..9c8bad0283 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1616,6 +1616,12 @@ static void scsi_disk_emulate_mode_select(SCSIDiskRe= q *r, uint8_t *inbuf) goto invalid_param; } =20 + /* Allow changing the block size */ + if (bd_len && p[6] !=3D (s->qdev.blocksize >> 8)) { + s->qdev.blocksize =3D p[6] << 8; + trace_scsi_disk_mode_select_set_blocksize(s->qdev.blocksize); + } + len -=3D bd_len; p +=3D bd_len; =20 diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events index 8e927ff62d..ab238293f0 100644 --- a/hw/scsi/trace-events +++ b/hw/scsi/trace-events @@ -340,6 +340,7 @@ scsi_disk_dma_command_WRITE(const char *cmd, uint64_t l= ba, int len) "Write %s(se scsi_disk_new_request(uint32_t lun, uint32_t tag, const char *line) "Comma= nd: lun=3D%d tag=3D0x%x data=3D%s" scsi_disk_aio_sgio_command(uint32_t tag, uint8_t cmd, uint64_t lba, int le= n, uint32_t timeout) "disk aio sgio: tag=3D0x%x cmd=3D0x%x (sector %" PRId6= 4 ", count %d) timeout=3D%u" scsi_disk_mode_select_page_truncated(int page, int len, int page_len) "pag= e %d expected length %d but received length %d" +scsi_disk_mode_select_set_blocksize(int blocksize) "set block size to %d" =20 # scsi-generic.c scsi_generic_command_complete_noio(void *req, uint32_t tag, int statuc) "C= ommand complete %p tag=3D0x%x status=3D%d" --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655896038344328.78981903177237; Wed, 22 Jun 2022 04:07:18 -0700 (PDT) Received: from localhost ([::1]:42412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3yCa-0000zq-36 for importer@patchew.org; Wed, 22 Jun 2022 07:07:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3y0Q-0006YD-08; Wed, 22 Jun 2022 06:54:42 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3y0O-0005Wj-Gf; Wed, 22 Jun 2022 06:54:41 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyq-000CTX-49; Wed, 22 Jun 2022 11:53:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oyEp14tUYmofAxvrBjLPsWtJ3UbhKgLh+SGK8upG3gI=; b=dRdi6lZ19UtaxPcZBWSmlsK8RY 1qKpyqdRBpLRHYQ7Wn/cAhSRFtxyCTTPSsCvU3WZT1XAyw/vMoL5ZDjxWbFvi6OmgaVezZHENGXmM h4qkZaf5Fznd727vmiCiKSpC7dfBTkqlEkSK6gcR6RSPWiKuZKepYhmJLEa4Lxtcy8ehJbnpLdEdI LauIg3N9wlyJ+etZJ4bo6WXtiNR5i4HiDVebpuEdvmT0deR9kW8CvwF5edb0V8tx/EEwgvTT/S/Bl xF/fY1jl7l/Egy/x6HCI83ftzaRdMiiq8wQzJSXiT2nlBD1Kk8DKQqUXEMZw86v8jiOb/5SaomMgG tiQClNd4nObFviQ0tpOtyyZcodB+y2To1E1riwSlryJK1o4Me/N6jvs/kHhbPQoKh7EJ+eu+/Z1YN /KDynyOG53+Ev5kjnKtRR7hx2WmjRjyNTqCQJuUvKjwmSXJyVRqgIos3uzjoLzMhUI3EzDVmrG6qg qev8QchQlLbWR/imQNOOB77hlwZ69q0euO9nvqeb4j0cMMc7Mv/Sh4xIZAa/Wr+0uKBLtfVBxCYPJ PDS/z5CFD6++qMTnxGZ4lr2vUYUEa6+UrJNIamMe67+YDiuBCSdnO0yuEXc07aKdeEXOhWSNQcb7s gkU0ShbWym0hdbM8isqZNRDf5V2IKcwRBgKI13OLk=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:13 +0100 Message-Id: <20220622105314.802852-14-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 13/14] q800: add default vendor and product information for scsi-hd devices X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655896038803100001 Content-Type: text/plain; charset="utf-8" The Apple HD SC Setup program uses a SCSI INQUIRY command to check that any= SCSI hard disks detected match a whitelist of vendors and products before allowi= ng the "Initialise" button to prepare an empty disk. Add known-good default vendor and product information using the existing compat_prop mechanism so the user doesn't have to use long command lines to= set the qdev properties manually. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/m68k/q800.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 3254ffb5c4..dccf192e55 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -688,6 +688,9 @@ static void q800_init(MachineState *machine) =20 static GlobalProperty hw_compat_q800[] =3D { { "scsi-hd", "quirk_mode_page_vendor_specific_apple", "on"}, + { "scsi-hd", "vendor", " SEAGATE" }, + { "scsi-hd", "product", " ST225N" }, + { "scsi-hd", "ver", "1.0 " }, { "scsi-cd", "quirk_mode_page_apple_vendor", "on"}, { "scsi-cd", "quirk_mode_sense_rom_use_dbd", "on"}, { "scsi-cd", "quirk_mode_page_vendor_specific_apple", "on"}, --=20 2.30.2 From nobody Thu May 16 06:14:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655896423760597.5856999647374; Wed, 22 Jun 2022 04:13:43 -0700 (PDT) Received: from localhost ([::1]:55702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3yIo-0002I2-NS for importer@patchew.org; Wed, 22 Jun 2022 07:13:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3y0U-0006nf-7P; Wed, 22 Jun 2022 06:54:46 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3y0S-0005XC-Pg; Wed, 22 Jun 2022 06:54:45 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3xyt-000CTX-VR; Wed, 22 Jun 2022 11:53:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CUqoJupH2M+KQg+RIoBU+fI0+vwRBIrvqmU7RnFHdLs=; b=m2WUjgBPNHFVSd3Y3caxcjILlS 1lbJyVcF5knAFvmwuFp1cCJBljceI+7kbBUFu0xGRU0mDqeb6urlJ4wVsmjUlZJ4IRCCr7ausf+nP 2Cf2UJ9PvLZu3ZvCLqovbObprBLt77z1ae39hrmC1VKy/U+y+TjR8BubaZ66a5WoQ3GbVIyL5Tknn S/Y1+U50LYN5jVvdZjw53W5rvpnyWzhUyrMSiWJK47u7wLdHoUsZ6sXUmRr8sdrEvGSwyokh7K97b Lgd7pBTI1K31FW/0dZHnrQ1j8ZWFsh8pkMw0Cww5ffNMekk7z8JtTCQ8PD+UV9Px6pE7Gl4RQsLlj Q0uvvdo89pXTZKmqgAm9MiDtkoAK8TbgKhWy6/1VmGsx7SMWH/cDxhUlYAbh89XW+N9hmHQVpX1KR Uj2ZM5rjso282O/dwg7pPo0IFzaI7wsHk2cuFn9dqoHntSFhgtDTTeEf+uWIrgf38+4KdG6zbf41P beRIRK4gjHYXQPfQZC7ZFqLrDQfHYKnNuEcQwqMTafT5bq1J74+zJ67lp23va7HFeE+AWlCsyDSbz pUXL9gv7NHQ6/gXBeZKSJmz4hbsb90GOnKu4e/jFuktRXZHh5X7PPAoasCiYs8YLo8N3BlbsIksdo 0veKKuSNZEJSrbd/0wq+PSxQa08VtpUAYkLujEMGY=; From: Mark Cave-Ayland To: pbonzini@redhat.com, laurent@vivier.eu, fam@euphon.net, qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 22 Jun 2022 11:53:14 +0100 Message-Id: <20220622105314.802852-15-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> References: <20220622105314.802852-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 14/14] q800: add default vendor and product information for scsi-cd devices X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1655896425179100001 Content-Type: text/plain; charset="utf-8" The MacOS CDROM driver uses a SCSI INQUIRY command to check that any SCSI C= DROMs detected match a whitelist of vendors and products before adding them to the list of available devices. Add known-good default vendor and product information using the existing compat_prop mechanism so the user doesn't have to use long command lines to= set the qdev properties manually. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/m68k/q800.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index dccf192e55..101ab0f803 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -695,6 +695,9 @@ static GlobalProperty hw_compat_q800[] =3D { { "scsi-cd", "quirk_mode_sense_rom_use_dbd", "on"}, { "scsi-cd", "quirk_mode_page_vendor_specific_apple", "on"}, { "scsi-cd", "quirk_mode_page_truncated", "on"}, + { "scsi-cd", "vendor", "MATSHITA" }, + { "scsi-cd", "product", "CD-ROM CR-8005" }, + { "scsi-cd", "ver", "1.0k" }, }; static const size_t hw_compat_q800_len =3D G_N_ELEMENTS(hw_compat_q800); =20 --=20 2.30.2