From: Jun Kamada Subject: Re: [PATCH 1/4] pvSCSI : Add white list to SCSI command emulation Date: Mon, 07 Jul 2008 19:57:35 +0900 Message-ID: <20080707194334.106A.EB2C8575@jp.fujitsu.com> References: <20080703203710.8583.EB2C8575@jp.fujitsu.com> <20080704162154.GA21118@weybridge.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20080704162154.GA21118@weybridge.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Steven Smith Cc: kama@jp.fujitsu.com, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Steven-san, On Fri, 4 Jul 2008 17:21:54 +0100 Steven Smith wrote: > > + bitmap[ERASE] = VSCSIIF_NEED_CMD_EXEC; > > + pre_function[ERASE] = NULL; > > + post_function[ERASE] = NULL; > > + > > + bitmap[MODE_SENSE] = VSCSIIF_NEED_CMD_EXEC; > > + pre_function[MODE_SENSE] = NULL; > > + post_function[MODE_SENSE] = NULL; > > + > > + bitmap[SEND_DIAGNOSTIC] = VSCSIIF_NEED_CMD_EXEC; > > + pre_function[SEND_DIAGNOSTIC] = NULL; > > + post_function[SEND_DIAGNOSTIC] = NULL; > Hmm, careful here. If the DevOffL bit is set on a SEND DIAGNOSTIC > command then it can cause interference in other LUNs on the target, > which would be unfortunate if they're exposed to different VMs. > > > + > > + bitmap[READ_CAPACITY] = VSCSIIF_NEED_CMD_EXEC; > > + pre_function[READ_CAPACITY] = NULL; > > + post_function[READ_CAPACITY] = NULL; > > + > > + bitmap[READ_10] = VSCSIIF_NEED_CMD_EXEC; > > + pre_function[READ_10] = NULL; > > + post_function[READ_10] = NULL; > > + > > + bitmap[WRITE_10] = VSCSIIF_NEED_CMD_EXEC; > > + pre_function[WRITE_10] = NULL; > > + post_function[WRITE_10] = NULL; > Do you know what happens if the SCSI CDB is inconsistent with the > scatter list? For instance, if the CDB says to read 16 sectors but > the frontend-supplied buffer is only big enough for 8, are we going to > end up DMAing over random memory? I consider that native SCSI driver, which generates DMA request, will reject such the inconsistent request. The native driver generates multiple CDB requests according to the number of scatter/gather segments. At the same time, doesn't the native driver check such the inconsistency? So, if there are any inconsistency, pvSCSI backend driver will just get an error from native driver. Perhaps, do you warry about inconsitency between size of some segment frontend driver says, and size of the segment the frontend driver actually allocated? # Sorry, if I misundastood your question. Best regards, ----- Jun Kamada