Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp489794ybx; Wed, 6 Nov 2019 21:27:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyuSbXjc7ExBJbwL0O/2d8cPdKS52Q8X8bDGIcNEDOxd/pMkaI6WKphJrJAT3aiwWdlAf01 X-Received: by 2002:a50:c191:: with SMTP id m17mr1561672edf.259.1573104444998; Wed, 06 Nov 2019 21:27:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573104444; cv=none; d=google.com; s=arc-20160816; b=VKXxSlLPxFI/EKpBdbardQPVfs2QF5sdIHxrdZGaimfTlIZzzUpNC7DCUsLeeDQTGp i750Ey2VQp//nam8iiLUFSRXwwjYuRI4Zs2j9IoQUAUqW1jkAIqwsM5uqeSNummOAwc3 zaqJs0AGYAp1s2B6kwg2NzIiPHHIHg1I/vA2if2viNhhCDuAL/RzZMJhPdMNoPN23fg8 etNCN6uzTcW1xU9b7v5QdnlEwJ31CxklQzHKo8rJDZPC9ggjFt9Uc7MhHORRm8tNFe9j XaxfHZF9V2R3R0nOI8cqcdKKcv5dS10ILR/T3AZl27LUWeXpbtOqbJqz03xotYIToEnt h+nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=tcoGB27wPjrm07nAodrCB80lPkgegkg0eiZwHC6L3Go=; b=U3URaWPT62o3bN5iNw04YOdohJyXpQrds5YOg3hCFGR85TyIv3w+/ddNF8WKJG0eIV B6NZlEPBe1FbZyfkW/zCEh++wW0AC1v5Afzl9mgFUJI3YGit0S18TTnvBS31ernwZzpx FCjXgQKriiWqhCRUV1SYirKLANDKycvWgLc/7KViuNzqSZW+p+ANqVSCz4i5WyvOKJPT QEwOz1LhHxZGkZ5JXF+0bREBIJkvoA+/IhdO/yGrwGOtoKDz4sZ2zk/f9X9mVQ3hFXsl jWwtZDTfUs/uJJBnI3w2QdofWiS7mr3TG/EWKwkyn9eLeB52nTSBQnYd4h6ZtCAOmM1j 2gMw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s46si702681edd.336.2019.11.06.21.27.01; Wed, 06 Nov 2019 21:27:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726681AbfKGF0W (ORCPT + 99 others); Thu, 7 Nov 2019 00:26:22 -0500 Received: from mga18.intel.com ([134.134.136.126]:53521 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfKGF0W (ORCPT ); Thu, 7 Nov 2019 00:26:22 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 21:26:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,276,1569308400"; d="scan'208";a="196446989" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74]) by orsmga008.jf.intel.com with ESMTP; 06 Nov 2019 21:26:19 -0800 Date: Thu, 7 Nov 2019 13:27:05 +0800 From: Tiwei Bie To: Jason Wang 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 Subject: Re: [PATCH v5] vhost: introduce mdev based hardware backend Message-ID: <20191107052705.GA28713@___> 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@___> <914081d6-40ee-f184-ff43-c3d4cd885fba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <914081d6-40ee-f184-ff43-c3d4cd885fba@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 12:08:08PM +0800, Jason Wang wrote: > On 2019/11/6 下午10:49, Tiwei Bie wrote: > > > > > > > + default: > > > > > > > + /* > > > > > > > + * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and > > > > > > > + * VHOST_SET_LOG_FD are not used yet. > > > > > > > + */ > > > > > > 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 develop > > > > > > 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 it > needs a kthread to access the userspace memory > > - Temporarily filter  SET_LOG_BASE and SET_LOG_FD until we finalize the API > for dirty page tracking. > > - For kick through kthread, it looks sub-optimal but we can address this in > the future, e.g call handle_vq_kick directly in vhost_poll_queue (probably a > flag for vhost_poll) and deal with the synchronization in vhost_poll_flush > carefully. OK. Thanks, Tiwei > > Thanks > >