From nobody Tue Feb 10 03:39:13 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623922891789362.8155816822647; Thu, 17 Jun 2021 02:41:31 -0700 (PDT) Received: from localhost ([::1]:35650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltoWg-0005vX-MB for importer@patchew.org; Thu, 17 Jun 2021 05:41:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltoNG-0002hw-RL for qemu-devel@nongnu.org; Thu, 17 Jun 2021 05:31:48 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:36802) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltoNE-00066C-Nu for qemu-devel@nongnu.org; Thu, 17 Jun 2021 05:31:46 -0400 Received: by mail-ed1-x536.google.com with SMTP id w21so3070033edv.3 for ; Thu, 17 Jun 2021 02:31:43 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id m18sm3328140ejx.56.2021.06.17.02.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 02:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s80JSWWhXUaW8VPewNLASzQ/RLf7bfO/1fOwopy2TkA=; b=d61nTB0fIt1eXIJ73/+FsvAHFY4QHvtuSZISCJS0UQLf6DDg+u1hKUptLvKVKj1wzc Kbvm8b8bglpTsEvOT98UuFLvuosjLMRmdMxPuIwxZ4ElcRceEp3SY4PEUJP72kcLS9qD vKQtFEVsWj7LlTKAULMKjHZj8aukRTjgS1ycPivHA3hhnDtalkWGynbGRlfmq9adjNO3 lefmKygHUOpd8MA9rBj+qBFyrZfAlUFVDmpHZPf77578seAtJN32o00pg5sKezboxVJM UNP+nmiads84yktjtMj39FIgYoYfXSTeJahgk9+UbtgIwdb1NsTW+6f8F5ixN9bFAvZe Kfeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=s80JSWWhXUaW8VPewNLASzQ/RLf7bfO/1fOwopy2TkA=; b=iUHmnQXE1/PVQOhYYQVlaz1pI7Eoa2+6wD9Lde6dgiI+oib9r5JFX4T4qcdGBL4njs Fqqyq+v94P1zt2MHK+mMyoH33C5iRZVz5S0TlNqn+LEBBvWnfU5T6P7ObUnzS0iPa9Si tY9GkdhFA6mOyQfTpFNewBCW0q41p2Y9QzW7kAQBg99XdoYeQL8NkvAyYod9Wj8quJg/ VC3LP1lf52AfLNLE34OFlTavOA4tcuWKT4zXVGBNmT/bmyiCdci2LCt1e2AiaFkIPHEs s6l2e7J/0qMZGqZGZOltWg6g2vLLimr433tLv+dMqajYZKJYeKZoSQkZr3KdHwSTnNRf KOQw== X-Gm-Message-State: AOAM530LH0sEyXMlVy8xk+TyT7UkSJ5Pgs2DZZKA9rF5orv7sQRC2r+i N1SsoEIVh1PJ7sL1VKAiRS+Zqpvxzks= X-Google-Smtp-Source: ABdhPJz+9o2KyZYgxVgzriY/gR2KS1iYhoZhDPSBlG/ygsFN5Gl+rr1cXszEDm9hcNg57fFKXgk5WA== X-Received: by 2002:a05:6402:2742:: with SMTP id z2mr5280719edd.66.1623922302830; Thu, 17 Jun 2021 02:31:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/45] esp: revert 75ef849696 "esp: correctly fill bus id with requested lun" Date: Thu, 17 Jun 2021 11:31:00 +0200 Message-Id: <20210617093134.900014-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210617093134.900014-1-pbonzini@redhat.com> References: <20210617093134.900014-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This commit from nearly 10 years ago is now broken due to the improvements in esp emulation (or perhaps was never correct). It shows up as a bug in detecting the CDROM drive under MacOS. The error is caused by the MacOS CDROM driver sending this CDB with an "S without ATN" command and without DMA: 0x12 0x00 0x00 0x00 0x05 0x00 (INQUIRY) This is a valid INQUIRY command, however with this logic present the 3rd byte (0x0) is copied over the 1st byte (0x12) which silently converts the INQUIRY command to a TEST UNIT READY command before passing it to the QEMU SCSI layer. Since the TEST UNIT READY command has a zero length response the MacOS CDROM driver never receives a response and assumes the CDROM is not present. The logic was to ignore the IDENTIFY byte and copy the LUN over from the CDB, which did store the LUN in bits 5-7 of the second byte in olden times. This however is all obsolete, so just drop the code. Signed-off-by: Mark Cave-Ayland Message-Id: <20210519100803.10293-5-mark.cave-ayland@ilande.co.uk> [Tweaked commit message. - Paolo] Signed-off-by: Paolo Bonzini --- hw/scsi/esp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 8e314ef156..16e4b7ead6 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -260,9 +260,6 @@ static uint32_t get_cmd(ESPState *s, uint32_t maxlen) return 0; } n =3D esp_fifo_pop_buf(&s->fifo, buf, dmalen); - if (n >=3D 3) { - buf[0] =3D buf[2] >> 5; - } n =3D MIN(fifo8_num_free(&s->cmdfifo), n); fifo8_push_all(&s->cmdfifo, buf, n); } --=20 2.31.1