Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7823292ybl; Thu, 16 Jan 2020 06:14:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzfL0AZo+yelWoAFn70NXk1oVgpBIgsyT5yCuLC9V6TwTrfZKxiYsgV66htcmkNoxsbGqeC X-Received: by 2002:a9d:6c0d:: with SMTP id f13mr1872815otq.354.1579184084837; Thu, 16 Jan 2020 06:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579184084; cv=none; d=google.com; s=arc-20160816; b=JMS0JAr6Tujm7vX4McTRhs4iOyn41j7dQraTpGFi9vAnHzgN5ciVsZD2B7/UIyfsfZ rh0oKxwv6cnOFIrfPdBJ624CnrbQQ+2dIjeZ8G56pBS7MVbD9dJH6kYpkB6skbo93dxI NRU/1yWxkF8mfeL/AdhW3hho4ng3OrpOQ43BCyck+w1mnmEnGIpCgO6GMtTX7yVISLrG 3BQ6/TfPpwvjWBrwasFr3zZrWlNmeqKEjQ9g7oCLSp/+X7i8fZSAZyfNdaxHmVO/G7qa gc0vsmpBYfdpys0eSOy2dwmjjlALg0EFuecL1eLKyjXjRDwjciBgyTbyAE9pCoVfWMeb fAQg== 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:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=U59tM/hjwBCgD+03ck/n2U6z9Uy02xUfGBDeEOA+9LE=; b=fLPfxJYovOR/MmsexUkEUjMD9NeYsOYueRJP1rWjFBN0gcUdNUuDfcFDdD+aSEQ62Z toNbqspsf8ry2B5SRVOEmYbJ6L52rGQePCoYcJ1vyIU0XrQVycZc69SI5IvdysVjiF1U 9c/Cj5rrv0cZhIXUSb/lLOQ9dX8sQwM0DpbbOa+5ocpu7ZINxBvajoXrQTUEO6vVybG3 gbTjiCXGDLDahUiHxqqJJmRfmGMqvxTERfQXah8OnCB+yzxOxF38/Ey0PS62hGUtcvs0 nGmGD8kMUmrqoTlLArlFCxCF2imTLGgSae5Y/f3v15kzrcxYkILByFEFnxvwPmo/kfde DTQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cyberus-technology.de header.s=default1911 header.b=WyfDzBV5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si10959914oia.165.2020.01.16.06.14.31; Thu, 16 Jan 2020 06:14:44 -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=fail header.i=@cyberus-technology.de header.s=default1911 header.b=WyfDzBV5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbgAPONQ (ORCPT + 99 others); Thu, 16 Jan 2020 09:13:16 -0500 Received: from www413.your-server.de ([88.198.28.140]:38972 "EHLO www413.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbgAPONP (ORCPT ); Thu, 16 Jan 2020 09:13:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cyberus-technology.de; s=default1911; h=Content-Transfer-Encoding: MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject: Message-ID:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=U59tM/hjwBCgD+03ck/n2U6z9Uy02xUfGBDeEOA+9LE=; b=WyfDzBV5WGLSUyUA00FBOniqR a9Gq85FImZoxDN+FVmHJM5WPuqtJNqSsD7kYaZBj+s4Xmy2Moas2+2QSyFhUZRMngFEhPt126BPHs VnubuCv0JkpbhMzQgHPjWcyx+EBkqC55WkOp/Qv6pUL7FEAZZj4562jJAxepMlTyXqC2tcussZZet BhBpEM4nKD5cZcSXKd7aCjUGXwUQHfmhJK6MX7wyDTb0BS09cdgDXghuEgkfnX3DEkGXMvuotYy+L WYPxWE6bc2Y9rg3nrk0tJ/JFR3VnBOLRGdMI3Syz1AeuJdHqHo117g4GSOBcZfk+fwb9HrLGwqvSx K4ZCQ+DNA==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www413.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1is5tQ-0002lH-BY; Thu, 16 Jan 2020 15:13:04 +0100 Received: from [2a02:8106:231:700:38db:ba68:aa3a:bbaa] (helo=localhost.localdomain) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1is5tQ-0008eN-2d; Thu, 16 Jan 2020 15:13:04 +0100 Message-ID: <9b32e225ee680e61716e300eb1ed8387599cc0dd.camel@cyberus-technology.de> Subject: Re: [RFC PATCH 4/4] drm/i915/gvt: move public gvt headers out into global include From: Julian Stecklina To: Greg KH Cc: intel-gvt-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, zhiyuan.lv@intel.com, hang.yuan@intel.com, Zhenyu Wang , Thomas Prescher Date: Thu, 16 Jan 2020 15:13:01 +0100 In-Reply-To: <20200115152215.GA3830321@kroah.com> References: <4079ce7c26a2d2a3c7e0828ed1ea6008d6e2c805.camel@cyberus-technology.de> <20200109171357.115936-1-julian.stecklina@cyberus-technology.de> <20200109171357.115936-5-julian.stecklina@cyberus-technology.de> <20200115152215.GA3830321@kroah.com> Organization: Cyberus Technology GmbH Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Authenticated-Sender: julian.stecklina@cyberus-technology.de X-Virus-Scanned: Clear (ClamAV 0.101.4/25697/Thu Jan 16 12:42:45 2020) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, Christoph, On Wed, 2020-01-15 at 16:22 +0100, Greg KH wrote: > On Thu, Jan 09, 2020 at 07:13:57PM +0200, Julian Stecklina wrote: > > Now that the GVT interface to hypervisors does not depend on i915/GVT > > internals anymore, we can move the headers to the global include/. > > > > This makes out-of-tree modules for hypervisor integration possible. > > What kind of out-of-tree modules do you need/want for this? The mediated virtualization support in the i915 driver needs a backend to the hypervisor. There is currently one backend for KVM in the tree (drivers/gpu/drm/i915/gvt/kvmgt.c) and at least 3 other hypervisor backends out of tree in various states of development that I know of. We are currently developing one of these. > > Also, as Christoph said, adding exports for functions that are not used > by anything within the kernel tree itself is not ok, that's not how we > work. The exports are used by the KVM hypervisor backend. The patchset I sent basically decouples KVMGT from i915 driver internals. So personally I would count this as a benefit in itself. There is already an indirection in place that looks like it is intended to decouple the hypervisor backends from the i915 driver core: intel_gvt_ops. This is a struct of function pointers that the hypervisor backend uses to talk to the GPU mediator code. Unfortunately, this struct doesn't cover all usecases and the KVM hypervisor backend directly touches the i915 devices' internal state in very few places. My current solution was to wrap these accesses in accessor functions and EXPORT_SYMBOL_GPL them. If the more acceptable solution is to add more function pointers to intel_gvt_ops instead of exporting symbols, I'm happy to go along this route. > And why do they somehow have to be out of the tree? We want them in the > tree, and so should you, as it will save you time and money if they are. I also want these hypervisor backends in the tree, but from a development workflow having the ability to build them as a out-of-tree modules is very convenient. I guess this is also true for the developers working on the other hypervisor backends. When I looked at the status quo in i915/gvt a couple of weeks ago, it seemed like it would be a win for everyone. Let me just clearly say that we have no intention of doing binary blob drivers. :) Thanks, Julian [1] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/i915/gvt/gvt.h#L555