Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5886852pxv; Thu, 29 Jul 2021 00:31:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywRh+8KdniMuKzUSToMNVfv9MZ0T3gPuXRorQuRBm8jk6DNgGdZ+q28cxLL4/xulc0i2CZ X-Received: by 2002:a92:874f:: with SMTP id d15mr2673863ilm.294.1627543903085; Thu, 29 Jul 2021 00:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627543903; cv=none; d=google.com; s=arc-20160816; b=Twj6a3rtJTxoB0TlBeEgwFaEHkJ6P2K8JQOM0DovBenv6zlENVIJPJcPoJxcnylVU8 1fG/uIhQXG+9yedJDEM9Q8+RM0PuRk/fqO7Xkbus72KoId03R+jw4eqi27kVSIVx2AZM fc1nI6b3YqUoV9k/KXtiZJOaxjVD2W2qWFj/wHJmPSZJW2jQEdroGCHR1moSZLVQxl2i E9RLYsavs8vnDWJX608rG7Jn56IVJ7dN1dJ5egGicW9K9gBJ6gO0m0BS5ktj+YSAw294 zFTRlBsPlZb2GElEm47DuNCFheCTVABox9e/ljNmKIKmXyDq7Ph4b6WWK2jzhfNU5pn6 WybQ== 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:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Tb+0rRKuqDnjOL1ASnfrRF1A89N4P92fMWjclPMkDss=; b=mJKTsIpAelh0ZShWPrJKh0EiIzHMl4AYHROFQho1Ue7LpO/E4/l0TXQW7tAdxpP8WC ojkogG3eyCd7IOQ8hvxyylEIwEVBs1ntty9kg8nT8zJJz25COlSCmi6UJ7KjDUNrRy2I BiYolJYgOYssuS0ibLO3tPCIyK7MKzslNxeTvcQ9WZNDehw9MgzcTECcj5ORHbBno2Fe WEgiXh3+ZFOH7VfKwqjXR9TQcOhd1Kvr/6H1NcXWA4jLUjVxW44nAJPxlsEDGkT5sxvZ KnX9RCSfw1HqvCzGeSsclQ5XKI/t1mWZO2Eri29UwXzhcEcVoH19YIE4sZPghv2Tl7N7 pWHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=DOm1Ovhg; 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 t26si2475635ioj.103.2021.07.29.00.31.31; Thu, 29 Jul 2021 00:31:43 -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; dkim=pass header.i=@ffwll.ch header.s=google header.b=DOm1Ovhg; 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 S234677AbhG2Ha1 (ORCPT + 99 others); Thu, 29 Jul 2021 03:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234524AbhG2Ha0 (ORCPT ); Thu, 29 Jul 2021 03:30:26 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8859AC061757 for ; Thu, 29 Jul 2021 00:30:23 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id g15so5644818wrd.3 for ; Thu, 29 Jul 2021 00:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=Tb+0rRKuqDnjOL1ASnfrRF1A89N4P92fMWjclPMkDss=; b=DOm1OvhgzgwgHgDIrraZ03XoHOA+d6dH762ZTJo+E6S39/5h6jRhFRd+nsUazfCfLf S2Lkxsdk7hwdmUXxR5OwXDEk4YRTKj7sadSS89ys7t7SG5QJL5cy5+h4oeCB0txEXIsE dEHc7JF5fJepkGCz2g+EKTUszzyxAsZeEzsgs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=Tb+0rRKuqDnjOL1ASnfrRF1A89N4P92fMWjclPMkDss=; b=jubgZZlhFOdPHZk3z8Solw2ToRTFZVViBX/nIyjKhzusHAtyCEr3Rxdw/A+oSPu6Ni ruHD2Xv8jiFBpqSAiBqxiQOmXfE9tMAsgHPNFyL4XRwFf3DJVHfqUwfkZj3uTSCosSTU JCdQruPYaWXYCuXXakPQ5YT29/A7wdI88X3Umh03jhtPmfMbZWyXH/WDr/sCsLJSN5k3 ziLqMtrekeqS6lDx+xUOSgw2BxzgxJxSG/GOg2olEElcMgsvNzMmkYEHTZ2twbLQV3tz 68IdEuQY9iO4XDEeRpNt/wxcpoMaEdMxrIQy0UDciSi7ctLD2odIU14WueT/YUYjtMQh jExg== X-Gm-Message-State: AOAM5300lIrTov8ehnEvu2TMvrfZaq/Tx/DSlePfmZGTdw35V2g2VBY3 49kyLAVOLJODcxR8523PtgOJTw== X-Received: by 2002:a5d:53ca:: with SMTP id a10mr1549831wrw.197.1627543822183; Thu, 29 Jul 2021 00:30:22 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q22sm2207751wmc.16.2021.07.29.00.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 00:30:21 -0700 (PDT) Date: Thu, 29 Jul 2021 09:30:19 +0200 From: Daniel Vetter To: Christoph Hellwig Cc: Jason Gunthorpe , "dri-devel@lists.freedesktop.org" , Greg KH , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , Gerd Hoffmann , "intel-gvt-dev@lists.freedesktop.org" Subject: Re: [Intel-gfx] refactor the i915 GVT support Message-ID: Mail-Followup-To: Christoph Hellwig , Jason Gunthorpe , "dri-devel@lists.freedesktop.org" , Greg KH , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , Gerd Hoffmann , "intel-gvt-dev@lists.freedesktop.org" References: <20210721155355.173183-1-hch@lst.de> <20210722112636.wj277vqhg4dez5ug@sirius.home.kraxel.org> <20210727121224.GA2145868@nvidia.com> <20210728175925.GU1721383@nvidia.com> <20210729072022.GB31896@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210729072022.GB31896@lst.de> X-Operating-System: Linux phenom 5.10.0-7-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 29, 2021 at 09:20:22AM +0200, Christoph Hellwig wrote: > On Wed, Jul 28, 2021 at 02:59:25PM -0300, Jason Gunthorpe wrote: > > On Wed, Jul 28, 2021 at 01:38:58PM +0000, Wang, Zhi A wrote: > > > > > I guess those APIs you were talking about are KVM-only. For other > > > hypervisors, e.g. Xen, ARCN cannot use the APIs you mentioned. Not > > > sure if you have already noticed that VFIO is KVM-only right now. > > > > There is very little hard connection between VFIO and KVM, so no, I > > don't think that is completely true. > > The only connection is the SET_KVM notifier as far as I can tell. > Which is used by a total of two drivers, including i915/gvt. That > being said gvt does not only use vfio, but also does quite a few > direct cals to KVM. > > > In an event, an in-tree version of other hypervisor support for GVT > > needs to go through enabling VFIO support so that the existing API > > multiplexers we have can be used properly, not adding a shim layer > > trying to recreate VFIO inside a GPU driver. > > Yes. And if we go back to actually looking at the series a lot of > it just removes entirely pointless indirect calls that go to generic > code and not even the kvm code, or questionable data structure designs. > If we were to support another upstream hypervisor we'd just need to > union a few fields in struct intel_gpu and maybe introduce a few > methods. Preferably in a way that avoids expensive indirect calls > in the fast path. fwiw I concur with the direction of this series. gvt landed 5 years ago, that should have been plenty of time to merge at least one of the other backends that float around. If it didn't happen in 5 years it aint suddenly happening in the next few, and the abstraction layer should be sunset. Also yes structuring it more as a helper layer with some unions/subclassing than full blown backend abstractor layer would be a good idea too I guess (it usually is the right thing to do). -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch