Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2594834pxt; Mon, 9 Aug 2021 04:32:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3H2Y+N4sGA4i6oKmDj7bffhajC8uZ6eAFHlSgRZC02D/Y6mZ3qLiKVJORi8UH8H7u5+Yo X-Received: by 2002:a92:dac9:: with SMTP id o9mr491391ilq.124.1628508723117; Mon, 09 Aug 2021 04:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628508723; cv=none; d=google.com; s=arc-20160816; b=Gyxd2Qsn7NVUPVQsbFL9MxligFYvrD2oiSOF0bk4HSaLj/HH0Oi6Zd2qcaFAQ/OHo+ fCbtmwzPP/lm+1J7khSolEcSC4CxCHu8kyieYEGfVPo05JVOWAT+iI5Q5vbdEYobkQOT S2D/wt0rU68v8NlJYx4i7UeRV+qhH4U7+jERXFMixr83+ol7NxZNJmfpUdB51w6CgBaj So3EJRo7wsEKQ/XRD/ib88bJK3VxnJcFTHX9KZUryWRd2NUhj+VEvM+GkTl+bxuxTgOe LoLBwNu2GH4OjxeTm6SROW2Wj4Zd72AExjRGuOBjR4IKOGUkqSeBcK/D/Ga4Aw7r8oBj /0eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:user-agent:message-id:organization:subject :to:cc:from:references:in-reply-to:content-transfer-encoding :mime-version; bh=W/4Ht7R2CT8BBD/j/BiE2QTmbKSd7TUMPc/KUhigWqA=; b=vefyjPoG7NWVeMCxm1vuBuEus7s73SGnkPOc5ompLx36FnnDQ7LCdhaQSTu/7lhZto l0j8OcVVFjUFpokmLSuMWRUC5W8W5tOJBb5eldGOWr1s7ynoTCXEiNOfiIgu0DjGnwRJ xH80TZ5CIXZhXNC/1KS9ME0TAIbIA3r82fzGaPlg+F23DYFka8yJYUo339CmOdnaWdRY t1SK8wKNeCVEftXUJJnCbWb0MHWtrIRypeJZ6zV0nUJciuAsaxwATpvonemdcaZbOfBP gkc+5HjSshci7Lw+RW9hRcskglQLHhcgdnHKw1KlJ4sbPbI1TcXH1u2vp1/8ji5ClVbO yIWw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si7541129jad.35.2021.08.09.04.31.51; Mon, 09 Aug 2021 04:32:03 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235232AbhHILaI convert rfc822-to-8bit (ORCPT + 99 others); Mon, 9 Aug 2021 07:30:08 -0400 Received: from mga14.intel.com ([192.55.52.115]:48696 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234982AbhHILaH (ORCPT ); Mon, 9 Aug 2021 07:30:07 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10070"; a="214401531" X-IronPort-AV: E=Sophos;i="5.84,307,1620716400"; d="scan'208";a="214401531" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2021 04:29:44 -0700 X-IronPort-AV: E=Sophos;i="5.84,307,1620716400"; d="scan'208";a="514915165" Received: from scotter-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.9.32]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2021 04:29:42 -0700 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT In-Reply-To: <20210721155355.173183-5-hch@lst.de> References: <20210721155355.173183-1-hch@lst.de> <20210721155355.173183-5-hch@lst.de> From: Joonas Lahtinen Cc: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org To: Christoph Hellwig , Jani Nikula , Rodrigo Vivi , Zhenyu Wang , Zhi Wang Subject: Re: [PATCH 04/21] drm/i915/gvt: move the gvt code into kvmgt.ko Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Message-ID: <162850857939.5634.17747219922172884449@jlahtine-mobl.ger.corp.intel.com> User-Agent: alot/0.8.1 Date: Mon, 09 Aug 2021 14:29:39 +0300 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Christoph Hellwig (2021-07-21 18:53:38) > Instead of having an option to build the gvt code into the main i915 > module, just move it into the kvmgt.ko module. This only requires > a new struct with three entries that the main i915 module needs to > request before enabling VGPU passthrough operations. > > This also conveniently streamlines the GVT initialization and avoids > the need for the global device pointer. > > Signed-off-by: Christoph Hellwig Hi, Thanks for putting the work into this. This conversion has been requested for a long time. For clarity, should we call the module i915_kvmgt? How far would we be from dynamically modprobing/rmmoding the kvmgt module in order to eliminate the enable_gvt parameter? > + > +/* > + * Exported here so that the exports only get created when GVT support is > + * actually enabled. > + */ > +EXPORT_SYMBOL_NS_GPL(i915_gem_object_alloc, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_object_create_shmem, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_object_init, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_object_ggtt_pin_ww, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_object_pin_map, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_object_set_to_cpu_domain, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(__i915_gem_object_flush_map, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(__i915_gem_object_set_pages, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_gtt_insert, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_prime_export, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_ww_ctx_init, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_ww_ctx_backoff, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_gem_ww_ctx_fini, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_ppgtt_create, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_request_add, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_request_create, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_request_wait, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_reserve_fence, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_unreserve_fence, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_vm_release, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(i915_vma_move_to_active, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(intel_context_create, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(intel_context_unpin, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(__intel_context_do_pin, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(intel_ring_begin, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(intel_runtime_pm_get, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(intel_runtime_pm_put_unchecked, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(intel_uncore_forcewake_for_reg, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(intel_uncore_forcewake_get, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(intel_uncore_forcewake_put, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(shmem_pin_map, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(shmem_unpin_map, I915_GVT); > +EXPORT_SYMBOL_NS_GPL(__px_dma, I915_GVT); This list is also a concern. At the least the double underscore functions should be eliminated from being exported. Zhi and Zhenyu, can we have some further patches to clean that up? Regards, Joonas