Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5465532pxb; Mon, 7 Feb 2022 02:39:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsdedTPLI6rOipkqial32e6FuFEl9xZLDNLFHsNq37mxFE1YcnJ3HCytwBcv7W+lB4Dk/r X-Received: by 2002:a05:6a00:2394:: with SMTP id f20mr14812422pfc.43.1644230342309; Mon, 07 Feb 2022 02:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644230342; cv=none; d=google.com; s=arc-20160816; b=uhq+WhchZ7CNXtwsmxdW+CjAbc33f4Caq3/xNa5yJB44EkPQvP2rSH20MHZBy4tMXK P26tJ64+q0auRqetsdJZ4OQLFz3XfFxFQ6dl0LdPa/E/wjNfrJYZ9MJ83rK5mQlm2ZSM /tSH4jXQoV6qCtsFCfH7lDl3xqs7h9AWsWz5jZYzbdsGrzEJRNCbJiBVseADl4xVsPRa DXTTjHZ+eTau4ZOm5EZ6SdPFS4sUJ7PCIHvdxLsENtrcwjZrNccIU5sEfSo3HW4bWj9q r8vpOQ7rFJqXUh33IMvgfCHzOfkwCZjPVwZzOYjcFFZEYB3pNHOHIUIZIMLxfg8q0Lrh dqWA== 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=i7c9ryOzhI/0kQjEWR+HV3h9sPC8LGJBKMfIdd7+b88=; b=myUEow9ra04hS5EC4XvB8liUTYZTpHRECrRFXXEWmOrQuFGoTCluYxFVDRHEsd0hQa v4mpzSimYH76DKQbUF9bOPWN/Kc4lEJJsJ4w/QSd3HG+a1vJ8b0ghRLCFZYvJd0VEvBB zc+9qSwCwxbg2Tj8m14L1WXnOuY+h3ky/ZrYLtexiQtHnPSftFPmiVGkTeT544WzXVHA d7rQdPohySdapbfnnBezBzssNHGv2+3ZEYfLt9Im2O1CZPwn2nYlPcqe5SuB/QNG9ymd etZqlIOwiEN+VRRWy05zoCpZkLW2INq28qenDyRKmxPJtulddiZwwjar6T23rurtuS3w IohQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mKpxsjSp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd17si8587258pfb.298.2022.02.07.02.38.46; Mon, 07 Feb 2022 02:39:02 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=mKpxsjSp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346958AbiBEIZr (ORCPT + 99 others); Sat, 5 Feb 2022 03:25:47 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:48636 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238695AbiBEIZo (ORCPT ); Sat, 5 Feb 2022 03:25:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ABC1E61617; Sat, 5 Feb 2022 08:25:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A13E6C340E8; Sat, 5 Feb 2022 08:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644049544; bh=cHRofIRbkCZFNO7G6xt7MUkOdA/E+NK0r5aCmAXSzz8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mKpxsjSpvcXr6Y35B/y3bz1HV2R2tDQ++z1u73YykV6cr3wAMGK5ghG0MXG+5JX2c tzVXK+LSW+20Dla0fFzc0pXpzKZZTyYXsO9Ezq8BtYLTAQS30bHgBDDgIRxsVlDtBA LCWVZ0w/dyYGT8P6fJ1G0rzq136xXLxE1aGWrL30= Date: Sat, 5 Feb 2022 09:25:35 +0100 From: Greg KH To: Iouri Tarassov Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, spronovo@microsoft.com Subject: Re: [PATCH v2 01/24] drivers: hv: dxgkrnl: Driver initialization and creation of dxgadapter Message-ID: References: <98fe53740526526c4df85a3a3d2e13e88c95f229.1644025661.git.iourit@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98fe53740526526c4df85a3a3d2e13e88c95f229.1644025661.git.iourit@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 04, 2022 at 06:33:59PM -0800, Iouri Tarassov wrote: > This is the first commit for adding support for a Hyper-V based > vGPU implementation that exposes the DirectX API to Linux userspace. > > - Handle driver loading, registration for the PCI and VM bus device > notifications > - Add headers for user mode interfaces, internal driver objects and VM bus > communication interface Only add the interfaces for the changes that you need in this commit. Do not add them all and then use them later, that makes it impossible to review. > - Handle initialization of VM bus channels and creation of the dxgadapter > object > - Connect the dxgkrnl module to the drivers/hv/ makefile and Kconfig. > - Create a MAINTAINERS entry > > A PCI device is created for each virtual GPU (vGPU) device, projected by > the host. The device vendor is PCI_VENDOR_ID_MICROSOFT and device id is > PCI_DEVICE_ID_VIRTUAL_RENDER. dxg_pci_probe_device handles arrival of such > devices and it creates dxgadapter objects. The PCI config space of the > vGPU device has luid of the corresponding per GPU VM bus channel. This is > how the adapters are linked to VM bus channels. > > A dxgadapter object represents a virtual GPU, projected to the VM by the > host. This object can start functioning only when the global VM bus > channel and the corresponding per vGPU VM bus channel are initialized in > the guest. Notifications about arrival of vGPU PCI device and VM bus > channels can happen in any order. Therefore, the initial dxgadapter object > state is DXGADAPTER_STATE_WAITING_VMBUS. A list of VM bus channels and a > list of dxgadapter objects are created. When dxgkrnl is notified about a > VM bus channel arrival, if tries to start all adapters, which are not > started yet. > > VM bus interface version is exchanged by reading/writing the PCI config > space of the vGPU device. > > Signed-off-by: Iouri Tarassov > --- > MAINTAINERS | 7 + > drivers/hv/Kconfig | 2 + > drivers/hv/Makefile | 1 + > drivers/hv/dxgkrnl/Kconfig | 26 + > drivers/hv/dxgkrnl/Makefile | 5 + > drivers/hv/dxgkrnl/dxgadapter.c | 172 +++ > drivers/hv/dxgkrnl/dxgkrnl.h | 223 ++++ > drivers/hv/dxgkrnl/dxgmodule.c | 736 ++++++++++++ > drivers/hv/dxgkrnl/dxgprocess.c | 17 + > drivers/hv/dxgkrnl/dxgvmbus.c | 578 +++++++++ > drivers/hv/dxgkrnl/dxgvmbus.h | 855 ++++++++++++++ > drivers/hv/dxgkrnl/hmgr.c | 23 + > drivers/hv/dxgkrnl/hmgr.h | 75 ++ > drivers/hv/dxgkrnl/ioctl.c | 24 + > drivers/hv/dxgkrnl/misc.c | 37 + > drivers/hv/dxgkrnl/misc.h | 89 ++ > include/linux/hyperv.h | 16 + > include/uapi/misc/d3dkmthk.h | 1945 +++++++++++++++++++++++++++++++ > 18 files changed, 4831 insertions(+) Would you want to review a 4800 line patch all at once? Please take some time and review other commits on the mailing list and offer up your comments to them. That will help you understand how to create your own changes better. thanks, greg k-h