From patchwork Tue Jul 18 12:11:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 790226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xBfCB3C8mz9s03 for ; Tue, 18 Jul 2017 22:11:18 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xBfC96yJLzDrH7 for ; Tue, 18 Jul 2017 22:11:17 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xBfC119kFzDrGv for ; Tue, 18 Jul 2017 22:11:09 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76754C0587EA; Tue, 18 Jul 2017 12:11:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 76754C0587EA Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 76754C0587EA Received: from thh440s.str.redhat.com (dhcp-200-180.str.redhat.com [10.33.200.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1EB87EA5B; Tue, 18 Jul 2017 12:11:04 +0000 (UTC) From: Thomas Huth To: slof@lists.ozlabs.org Date: Tue, 18 Jul 2017 14:11:04 +0200 Message-Id: <1500379864-340-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 18 Jul 2017 12:11:05 +0000 (UTC) Subject: [SLOF] [PATCH] virtio-scsi: Allow LUNs bigger than 255 X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" The virtio-scsi device expects LUNs according to a "Single level LUN structure" as defined in the "SCSI Architecture Model" specification. SLOF currently only uses the "Single level LUN structure using peripheral device addressing method" which provides the possibility to specify up to 256 different LUNs. To be able to use LUNs greater than 255, the "Single level LUN structure using flat space addressing method" has to be used instead. This can be done by setting the top-most bits to "01" instead of "00" in the first byte of the two LUN bytes. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1431584 Signed-off-by: Thomas Huth --- board-qemu/slof/virtio-scsi.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/board-qemu/slof/virtio-scsi.fs b/board-qemu/slof/virtio-scsi.fs index d52741e..d7ce3cc 100644 --- a/board-qemu/slof/virtio-scsi.fs +++ b/board-qemu/slof/virtio-scsi.fs @@ -144,6 +144,7 @@ scsi-open ; : dev-generate-srplun ( target lun-id -- srplun ) + dup ff > IF 4000 or THEN \ Use the LUN "flat space addressing method" swap 0100 or 10 << or 20 << ;