Received: from eggs.gnu.org ([208.118.235.92]:48212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfXR6-000214-PZ for qemu-devel@nongnu.org; Thu, 23 May 2013 11:28:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfXR0-0001Xh-Kl for qemu-devel@nongnu.org; Thu, 23 May 2013 11:28:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfXR0-0001X8-Cx for qemu-devel@nongnu.org; Thu, 23 May 2013 11:28:06 -0400 Date: Thu, 23 May 2013 23:27:58 +0800 From: Asias He Message-ID: <20130523152758.GA21158@hj.localdomain> References: <519D6478.8060403@us.ibm.com> <20130523005355.GA11949@hj.localdomain> <20130523094809.GM4725@redhat.com> <519E2C21.3000103@us.ibm.com> <519E2E7D.4080502@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <519E2E7D.4080502@redhat.com> Subject: Re: [Qemu-devel] qemu seabios issue with vhost-scsi List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Stefan Hajnoczi , Gleb Natapov , Badari Pulavarty , qemu-devel , "Nicholas A. Bellinger" On Thu, May 23, 2013 at 04:58:05PM +0200, Paolo Bonzini wrote: > Il 23/05/2013 16:48, Badari Pulavarty ha scritto: > >> The common virtio-scsi code in QEMU should guard against this. In > >> virtio-blk data plane I hit a similar case and ended up starting the > >> data plane thread (equivalent to vhost here) *before* the status > >> register is set to DRIVER_OK. > > > > Thats exactly what my debug in vhost_scsi_set_status() shows. > > > > set status started 0 val 0 > > set status started 0 val 0 > > set status started 0 val 0 > > set status started 0 val 0 > > set status started 0 val 0 > > set status started 0 val 3 > > Program received signal SIGSEGV, Segmentation fault. > > > > We never got a chance to call vhost_scsi_start() as we are waiting > > for DRIVER_OK. Reproduced the SIGSEGV and verified that replacing the bios.bin with the one from seabios.git makes the guest boot. > This is the fix in SeaBIOS: > > commit 5a7730db57ab0715223421e65b54fb50d6fefe5c > Author: Asias He > Date: Fri Mar 15 09:45:15 2013 +0800 > > virtio-scsi: Set _DRIVER_OK flag before scsi target scanning > > Before we start scsi target scanning, we need to set the > VIRTIO_CONFIG_S_DRIVER_OK flag so the device can do setup properly. > > This fix a bug when booting tcm_vhost with seabios. > > Signed-off-by: Asias He > Acked-by: Paolo Bonzini > > > > Still, Gleb is right that SeaBIOS should not be able to crash QEMU; > exit(1) is fine, SIGSEGV is not. Agree too. > Paolo -- Asias