From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5Xpw-0007Ww-In for qemu-devel@nongnu.org; Mon, 19 Sep 2011 03:00:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5Xpv-0007qG-Ge for qemu-devel@nongnu.org; Mon, 19 Sep 2011 03:00:16 -0400 Message-ID: <4E76E86C.3010707@redhat.com> Date: Mon, 19 Sep 2011 08:59:56 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1315989802-18753-1-git-send-email-agraf@suse.de> <1315989802-18753-2-git-send-email-agraf@suse.de> <20110915031437.GR9025@yookeroo.fritz.box> <4E71A2D2.2080008@redhat.com> <20110916030616.GZ9025@yookeroo.fritz.box> <4E7327E4.7040708@redhat.com> <20110916152731.27f76f7d@BR8GGW75.de.ibm.com> <1316188291.2777.25.camel@pasglop> <20110919085555.67e7e4b8@BR8GGW75.de.ibm.com> In-Reply-To: <20110919085555.67e7e4b8@BR8GGW75.de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 01/58] spapr: proper qdevification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: David Gibson , qemu-ppc@nongnu.org, Alexander Graf , qemu-devel Developers On 09/19/2011 08:55 AM, Thomas Huth wrote: >> > Note that in addition to that, the PAPR spec specifies only one >> > "device" (whatever that means) per vscsi instance. > Really? In that case, I wonder why Linux is using the "Logical unit > addressing format" with target IDs and bus numbers instead of the > "Flat space addressing method" for vscsi ... according to > drivers/scsi/ibmvscsi/ibmvscsi.c : > > static inline u16 lun_from_dev(struct scsi_device *dev) > { > return (0x2<< 14) | (dev->id<< 8) | (dev->channel<< 5) | dev->lun; > } > > In case there's really only one device per vscsi instance, shouldn't > that code use addressing method 0x1 instead of 0x2 here? As long as dev->id == 0, dev->channel == 0, dev->lun < 31, the three addressing methods are all equivalent. Some comments in ibmvscsi.c say that iOS needs non-zero channels, so there does seem to be someone else who doesn't follow the PAPR spec too well. :) Paolo