Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp434766ybx; Wed, 6 Nov 2019 20:10:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwerSu2EoKawEPt8RZwI5x2vF7h8fDKk2HCYtePOcBekV0Kdqjetm3GAeBbltHtOpKNWKYY X-Received: by 2002:aa7:d299:: with SMTP id w25mr1449363edq.14.1573099815956; Wed, 06 Nov 2019 20:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573099815; cv=none; d=google.com; s=arc-20160816; b=iftthKFyjtN/+OGnwnNVgd0WrcUsdQeOLDXWL4W76Burzhv1MF4WixLCZ8GNwqZp71 gO72858KyEhrZx23/GnbDQFiSFBSEFmhq7Az8JoxX0hcPThuRo9gYf1J0TwjGBniSFYV l34yfTAVcucaMdzxvq72S9IJgSUjPX2gbpr9AWGlP0qsQQ0mzlxRN8yDVxIcWW1J/oSw Q/9AgtJw63VdC4FaEpuoabOW9qgVpw+F611htM9/TD28U4Nmf9QN7INpvq7lpJDkdE2l QikxEDUrOfV2KKBHhMC2sJiaNPNaxTe/agi8fifA1lrgs0ClgGs5gIvmoq0RdHWiB568 ke+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=YSIEdqcLrogv35u/q3ac44m/gQYEQosg5vjXwg1Frog=; b=hu2RAG1QD8Pd8xSumdyGPWDuaLIECad2Crtyoc5qUEch5DArrjLSyc+DRvfyDlcAix 31Y/u+nwBAyRjkXsDHvTisy/+daOgxxWlhmvx/TACSwK5qjlpL64y103bqyuw63TEpD/ s6GKzAgba1r1nY72lCDlsqBZTSxlWGro8tVwWMwLBG+aifQXLpMrn6lgytUXbv/VLvAh RML/WRJmo1VUhrxWsNvLDiDWCON8Hd0qvoyVsJGESfNTdfg6sX2G6TkQkqxyV8IAUo6i AbGfXdYZAb7fMrBE5OLMdcWwxOQvxgN7rkS729h/TN4aL5ryq8GFtA+gvy7AWlgCLFYn yEDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Kv5Shbw2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27si672577ejb.147.2019.11.06.20.09.52; Wed, 06 Nov 2019 20:10:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Kv5Shbw2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733115AbfKGEI7 (ORCPT + 99 others); Wed, 6 Nov 2019 23:08:59 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:34186 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733094AbfKGEI7 (ORCPT ); Wed, 6 Nov 2019 23:08:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573099737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YSIEdqcLrogv35u/q3ac44m/gQYEQosg5vjXwg1Frog=; b=Kv5Shbw2uYdpjl7xPUJp0kikDCTV436Av2zR0n2DdCcWiHGK1mx9guuVQYRsSaiuc0yLwY bWa3ixK3Cg8XwDj6dRa/hMwkQAeiLkdAsLgP6NNPVVw5Vm78dxJEUheCTNiOQu6/1UbsHx kPgHiYQeyJ3EIdD04wf9j0IrUrZt+bw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-355-b64OKsVqNKabWfY1H8bGSQ-1; Wed, 06 Nov 2019 23:08:54 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3D7B107ACC3; Thu, 7 Nov 2019 04:08:52 +0000 (UTC) Received: from [10.72.12.214] (ovpn-12-214.pek2.redhat.com [10.72.12.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4851960870; Thu, 7 Nov 2019 04:08:16 +0000 (UTC) Subject: Re: [PATCH v5] vhost: introduce mdev based hardware backend To: Tiwei Bie Cc: "Michael S. Tsirkin" , alex.williamson@redhat.com, maxime.coquelin@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, dan.daly@intel.com, cunming.liang@intel.com, zhihong.wang@intel.com, lingshan.zhu@intel.com References: <20191105115332.11026-1-tiwei.bie@intel.com> <16f31c27-3a0e-09d7-3925-dc9777f5e229@redhat.com> <20191106122249.GA3235@___> <20191106075607-mutt-send-email-mst@kernel.org> <580dfa2c-f1ff-2f6f-bbc8-1c4b0a829a3d@redhat.com> <20191106144952.GA10926@___> From: Jason Wang Message-ID: <914081d6-40ee-f184-ff43-c3d4cd885fba@redhat.com> Date: Thu, 7 Nov 2019 12:08:08 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191106144952.GA10926@___> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: b64OKsVqNKabWfY1H8bGSQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/11/6 =E4=B8=8B=E5=8D=8810:49, Tiwei Bie wrote: >>>>>> +=09default: >>>>>> +=09=09/* >>>>>> +=09=09 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and >>>>>> +=09=09 * VHOST_SET_LOG_FD are not used yet. >>>>>> +=09=09 */ >>>>> If we don't even use them, there's probably no need to call >>>>> vhost_dev_ioctl(). This may help to avoid confusion when we want to d= evelop >>>>> new API for e.g dirty page tracking. >>>> Good point. It's better to reject these ioctls for now. >>>> >>>> PS. One thing I may need to clarify is that, we need the >>>> VHOST_SET_OWNER ioctl to get the vq->handle_kick to work. >>>> So if we don't call vhost_dev_ioctl(), we will need to >>>> call vhost_dev_set_owner() directly. >> I may miss something, it looks to me the there's no owner check in >> vhost_vring_ioctl() and the vhost_poll_start() can make sure handle_kick >> works? > Yeah, there is no owner check in vhost_vring_ioctl(). > IIUC, vhost_poll_start() will start polling the file. And when > event arrives, vhost_poll_wakeup() will be called, and it will > queue work to work_list and wakeup worker to finish the work. > And the worker is created by vhost_dev_set_owner(). > Right, rethink about this. It looks to me we need: - Keep VHOST_SET_OWNER, this could be used for future control vq where=20 it needs a kthread to access the userspace memory - Temporarily filter=C2=A0 SET_LOG_BASE and SET_LOG_FD until we finalize th= e=20 API for dirty page tracking. - For kick through kthread, it looks sub-optimal but we can address this=20 in the future, e.g call handle_vq_kick directly in vhost_poll_queue=20 (probably a flag for vhost_poll) and deal with the synchronization in=20 vhost_poll_flush carefully. Thanks