From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=pbonzini@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 90BBD221E06B0 for ; Thu, 14 Dec 2017 01:02:05 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D988C00DBB1; Thu, 14 Dec 2017 09:06:45 +0000 (UTC) Received: from [10.36.116.220] (ovpn-116-220.ams2.redhat.com [10.36.116.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F8DD17D77; Thu, 14 Dec 2017 09:06:40 +0000 (UTC) To: "zhengxiang (A)" , Laszlo Ersek Cc: edk2-devel@lists.01.org, Ard Biesheuvel , Jordan Justen , Shannon Zhao , Maxime Coquelin References: <20171213031632.11856-1-zhengxiang9@huawei.com> <06533b91-8ff0-1ad2-56fa-5f2c4f56bb19@redhat.com> <7161de6e-99c2-ed81-bbf6-c7a89336c36d@redhat.com> From: Paolo Bonzini Message-ID: Date: Thu, 14 Dec 2017 10:06:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 14 Dec 2017 09:06:45 +0000 (UTC) Subject: Re: [PATCH] OvmfPkg/VirtioScsiDxe: Allocate all required vrings at VirtioScsiInit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Dec 2017 09:02:06 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 14/12/2017 07:55, zhengxiang (A) wrote: > Hello Laszlo and Paolo, > > Thanks for your review! > > On 2017/12/13 19:16, Laszlo Ersek wrote: >> On 12/13/17 10:29, Paolo Bonzini wrote: >>> On 13/12/2017 09:35, Laszlo Ersek wrote: >>>> Perhaps you can update vhost-scsi similarly to the last patch of >>>> Maxime's v4 series, even without "VIRTIO_SCSI_F_MQ" -- in the >>>> SET_FEATURES request handler, just destroy the unused virtqueues that >>>> have not been configured by the guest driver until that time? >>> Yes, this is the right solution. We can assume that if the descriptor >>> address is equal to zero, the queue is not in use. This is not in the >>> spec as far as I can see, but it is QEMU's assumption. I will send a >>> patch to the virtio specification. > > I would try this solution! However, is there any possibility that the allocated > descriptor address is exactly equal to zero and the queue is in use? That would break QEMU's virtio implementation, so it's pretty unlikely. Paolo > Moreover, is it feasible to skip the vhost_virtqueue_start() call for the unused > queues in vhost_dev_start() in QEMU? > > > > Thanks, > Xiang > >