Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1983952pxb; Thu, 11 Feb 2021 00:53:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5IZ3f48aE+dls26OPuzyUYLL+WAitf3G0OJ117bSJS2hNc2f7iQigKH4ySldC92O2vFK9 X-Received: by 2002:a17:906:ada:: with SMTP id z26mr7289524ejf.218.1613033631430; Thu, 11 Feb 2021 00:53:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613033631; cv=none; d=google.com; s=arc-20160816; b=npsSCf2mUrwXldMp6t/ROEBQpF1y5b0ZB9T6LkQzRX5PQ7XeYbt07FUaanjOAw5Eil h3dNw3idP3AuSvq7eDa736I8HRDsYJ1Nm5CeoYTPRtySFV3wdfOFLHYH/Mwl1PwslD0l /WmCGjYfGZQRt9KhyAPlpaGxROuZbS6u5bv0Wopvxdxjxt8jFkHbhWm6pob9Tza5nDC8 jsaL2VV0RxA8nbENEn14LR+fv+0qIEUGgsapHp7IroFzvBcU4NLp9CYamtLX1F4wIAA2 9paoc0K+/1CWmmyzIaoHZlieOCZ1jKcYh6Ed+onfrYWd5ue6+85UMiVnvgQZiA/jlrUQ L5nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wg5fPTLM+1cZ9yRJ2/wT41q1NwpITJ04WaAL3iNvvr8=; b=Zm4Ffl1zcVJ/v0BS82uWGEmY0ZJ1zQw2dOzLlq9QKWj4QpekstWjkR5IWfZwLI2cym q/14OPK94OGV1bUj7M9Q5oFDjWCSjfQGFnfWhaGJmnwZp+Z4DaUbSOomu8UVRR5KO6EX ecKpvSML5eAhwC0umriQXvMDV5sPJsGaZbazltPUNNM3n+ofbIWqVrG9mYwqeeQd6d+h hTJ6DYWzrBlqIc+5j+LOmXjzBuGhn1Wbs0k8AId9h8jz5OCOQXQDN3ANtLsuWIk7tT8s VAwc16gSRFZ7TzI+UiHRv2MiYbunOczT4MdxmWYufvqkvI4ou7gHgF5B2xs5UWLvUlTk fOeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=CysCp9b6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gf2si3638367ejb.154.2021.02.11.00.53.27; Thu, 11 Feb 2021 00:53:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=CysCp9b6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229636AbhBKIig (ORCPT + 99 others); Thu, 11 Feb 2021 03:38:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbhBKIhV (ORCPT ); Thu, 11 Feb 2021 03:37:21 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03E7CC061574; Thu, 11 Feb 2021 00:36:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wg5fPTLM+1cZ9yRJ2/wT41q1NwpITJ04WaAL3iNvvr8=; b=CysCp9b6F7J9AuOhF4p35Ff0hh Ze5GD0f2KT/7rpHeXg+2xDlZJZvp2BYXw+/rFwdWOcCU9xVt9B5QI0LP8AZnfiXjPGizp/o/Ig+1L x/ztvT+EuNtLqfK3/Sq2jW1wB34ihHTsxf7rN/o52I8DFpT764V9KDdx+qA2/zS0aAzctrbigmHTY MWPEIWWDC+pUtGJali6xzN0ai9GU3KUSv3zYkJG/UE71tfdQk5QAyrLFyuDLZutAbSNMGzY3qDIGQ uoFy5PBAKb6Bi2P0PopaUcMRJy4IujPbSFaJdjeQeTnNgOO793QMQrp/9a+H6utei/t0v1ru0SVIj ccvvlAhg==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lA7SX-009yv8-8z; Thu, 11 Feb 2021 08:36:21 +0000 Date: Thu, 11 Feb 2021 08:36:21 +0000 From: Christoph Hellwig To: Jason Gunthorpe Cc: "Tian, Kevin" , Max Gurtovoy , "cohuck@redhat.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "alex.williamson@redhat.com" , "liranl@nvidia.com" , "oren@nvidia.com" , "tzahio@nvidia.com" , "leonro@nvidia.com" , "yarong@nvidia.com" , "aviadye@nvidia.com" , "shahafs@nvidia.com" , "artemp@nvidia.com" , "kwankhede@nvidia.com" , "ACurrid@nvidia.com" , "gmataev@nvidia.com" , "cjia@nvidia.com" , "mjrosato@linux.ibm.com" , "yishaih@nvidia.com" , "aik@ozlabs.ru" , "Zhao, Yan Y" Subject: Re: [PATCH v2 0/9] Introduce vfio-pci-core subsystem Message-ID: <20210211083621.GA2378134@infradead.org> References: <20210201162828.5938-1-mgurtovoy@nvidia.com> <20210210133452.GW4247@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210210133452.GW4247@nvidia.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 09:34:52AM -0400, Jason Gunthorpe wrote: > > I'm a bit confused about the change from v1 to v2, especially about > > how to inject module specific operations. From live migration p.o.v > > it may requires two hook points at least for some devices (e.g. i40e > > in original Yan's example): > > IMHO, it was too soon to give up on putting the vfio_device_ops in the > final driver- we should try to define a reasonable public/private > split of vfio_pci_device as is the norm in the kernel. No reason we > can't achieve that. > > > register a migration region and intercept guest writes to specific > > registers. [PATCH 4/9] demonstrates the former but not the latter > > (which is allowed in v1). > > And this is why, the ROI to wrapper every vfio op in a PCI op just to > keep vfio_pci_device completely private is poor :( Yes. If Alex has a strong preference to keep some values private a split between vfio_pci_device vfio_pci_device_priv might be doable, but it is somewhat silly. > > Then another question. Once we have this framework in place, do we > > mandate this approach for any vendor specific tweak or still allow > > doing it as vfio_pci_core extensions (such as igd and zdev in this > > series)? > > I would say no to any further vfio_pci_core extensions that are tied > to specific PCI devices. Things like zdev are platform features, they > are not tied to specific PCI devices Yes, ZDEV is just a special case of exposing extra information for any PCI device on s390. It does not fit any split up vfio_pci framework. In fact I wonder why it even has its own config option. > > vfio-mdev is just the channel to bring VFIO APIs through mdev core > > to underlying vendor specific mdev device driver, which is already > > granted flexibility to tweak whatever needs through mdev_parent_ops. > > This is the second thing, and it could just be deleted. The actual > final mdev driver can just use vfio_device_ops directly. The > redirection shim in vfio_mdev.c doesn't add value. Yes, that would simplify a lot of things.