Received: by 2002:a05:6a10:3150:0:0:0:0 with SMTP id m16csp2775206pxc; Tue, 12 Apr 2022 06:04:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydm+O+LL0GXKqWwbiID4VG8zxa39zWoRC4+enFAEwFH02oFJ9cF/1d8BeayjCBZ5EBEFTa X-Received: by 2002:a17:90b:38d1:b0:1c9:ba10:353b with SMTP id nn17-20020a17090b38d100b001c9ba10353bmr4883414pjb.9.1649768674907; Tue, 12 Apr 2022 06:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649768674; cv=none; d=google.com; s=arc-20160816; b=VcNOGpsOXRmUKBS2pef2Dpnxod6xG0bKNoWdlJgZYMW7BuKM+Ahzlf8tA9cHxXiYNe +20MyCKAAi1ay1KhN6e8PPIzPcr6tiOI80N9azJqz0D+iogIKb5RVRDNS306tHuJMQtw /eExvSZBvufg1lCERYhfCgH2mQgvv/XnK3bxZagAbyCEZ4TXfahQXpE5OgkgqNsblA4U awcKXVia0kTwyqB1H0PnIg+viWucs5/8yKrNgD70W8uvxiKEodzPSvjsLPczUC4iIr10 R+cGayULUCqpLfMEAbZPuJdzLsYrhO94dXtRGsLbgmAPUjDbVBBULIDgBRaHuCmIRPwS TaKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=C8NDoDyqZvQBoGqfHeb040RcvsP4vUZqRpM2TBpIVh8=; b=w9OdbBAphyktxH/ObI4Upda5aa28PjY3JnZOi8jrPMqbKQOGB781WRM17icW1MWt87 2LL30Pb5MdZ/xCDI+HT2ZUvvdMOOaYRjAuZfXc1ikDmbx91zh3rU5+ZORThazA7SM8Db MQBZuZp70nt89GCybkBgYtxz+mHJ7YgVhcguJIDnXH7kt/DStiuBjwh7wmznO7Ef6uSK L4sU/vC0BSOMRRc2eK8x/zYodtGWM0XUHWCAvhyTOAElVTmJWKKsryrCeBy3MFNqMUoW srZ5lV8aQu/6gVBv3o6F+Smyq1HEbEIQ/foCjQK+NooTJKC9qTH1jOREEQTb4byDxOAl 5rog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=eiX8fUOy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk12-20020a17090b33cc00b001c68e9e0e68si15771960pjb.36.2022.04.12.06.04.13; Tue, 12 Apr 2022 06:04:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=eiX8fUOy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347000AbiDKOQe (ORCPT + 99 others); Mon, 11 Apr 2022 10:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347006AbiDKOQb (ORCPT ); Mon, 11 Apr 2022 10:16:31 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 014142DF3 for ; Mon, 11 Apr 2022 07:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=C8NDoDyqZvQBoGqfHeb040RcvsP4vUZqRpM2TBpIVh8=; b=eiX8fUOyFg6kzfTVNVUmza6+Wx fBpDqSkeDwGoweT9Gegf39Lu+hcA9AEK7M0rJjLjDJ/0P++isIIMCySrNTfdDemwdSYiGsoyTKse+ 3vU/9Rt1cgUtBDEL89e+7IT2rKSvVrMeExsmLo0OVnp1doIS5kW3FZ4Ct5EvZo+Pu5dNTUBDrsh98 rLHkxtElLCRXdxm8gcx1WjtoLuZELubYs+3Wik8Z+DrpeOF5VOSiFNRzamhJaLi9ktGhu0sm8FR/t S5fz45rALbWHMNr/VHE9IuLEIDAtp9FyMbgEWWay7tIy3fzPObh/g0KODsowLXaOsXhzdfp58N9o+ UZnXs90g==; Received: from [2001:4bb8:18e:76f5:3747:ef85:d03d:53e4] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndunw-009KHC-IW; Mon, 11 Apr 2022 14:14:09 +0000 From: Christoph Hellwig To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Zhenyu Wang , Zhi Wang Cc: Jason Gunthorpe , intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: refactor the i915 GVT support and move to the modern mdev API v3 Date: Mon, 11 Apr 2022 16:13:29 +0200 Message-Id: <20220411141403.86980-1-hch@lst.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, the GVT code in the i915 is a bit of a mess right now due to strange abstractions and lots of indirect calls. This series refactors various bits to clean that up. The main user visible change is that almost all of the GVT code moves out of the main i915 driver and into the kvmgt module. Tested on my Thinkpad with a Kaby Lake CPU and integrated graphics. Git tree: git://git.infradead.org/users/hch/misc.git i915-gvt Gitweb: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/i915-gvt Changes since v2: - rebased on top of Linx 5.18-rc + "Refactor GVT-g MMIO tracking table and handlers" - don't fold the gvt Makefile into the main Makefile - add the mdev patches to remove the legacy interface that is now unused to the end of the series Changes since v1: - rebased on Linux 5.15 - allow the kvmgvt module to be loaded at any time and thus solve the deadlock when both i915 amd kvmgvt are modular - include the conversion to the modern mdev API Note that I do expect to rebased this again against 5.16-rc1 once released, but I'd like to get this out for review ASAP. Diffstat: b/drivers/gpu/drm/i915/Kconfig | 33 b/drivers/gpu/drm/i915/Makefile | 31 b/drivers/gpu/drm/i915/gvt/cfg_space.c | 89 -- b/drivers/gpu/drm/i915/gvt/cmd_parser.c | 4 b/drivers/gpu/drm/i915/gvt/dmabuf.c | 36 - b/drivers/gpu/drm/i915/gvt/execlist.c | 12 b/drivers/gpu/drm/i915/gvt/gtt.c | 55 + b/drivers/gpu/drm/i915/gvt/gvt.h | 125 ++- b/drivers/gpu/drm/i915/gvt/interrupt.c | 38 + b/drivers/gpu/drm/i915/gvt/kvmgt.c | 1099 +++++++++++++++----------------- b/drivers/gpu/drm/i915/gvt/mmio.c | 4 b/drivers/gpu/drm/i915/gvt/opregion.c | 148 ---- b/drivers/gpu/drm/i915/gvt/page_track.c | 8 b/drivers/gpu/drm/i915/gvt/scheduler.c | 37 - b/drivers/gpu/drm/i915/gvt/trace.h | 2 b/drivers/gpu/drm/i915/gvt/vgpu.c | 22 b/drivers/gpu/drm/i915/i915_drv.c | 7 b/drivers/gpu/drm/i915/i915_drv.h | 1 b/drivers/gpu/drm/i915/i915_trace.h | 1 b/drivers/gpu/drm/i915/intel_gvt.c | 162 +++- b/drivers/gpu/drm/i915/intel_gvt.h | 17 drivers/gpu/drm/i915/gvt/Makefile | 9 drivers/gpu/drm/i915/gvt/gvt.c | 340 --------- drivers/gpu/drm/i915/gvt/hypercall.h | 82 -- drivers/gpu/drm/i915/gvt/mpt.h | 400 ----------- 25 files changed, 929 insertions(+), 1833 deletions(-)