DirectX on Linux
Subsystems (4)
cover DirectX on Linux
There is a blog post that goes into more detail about the bigger picture, and walks through all the required pieces to make this work. It is available here:
https://devblogs.microsoft.com/directx/directx-heart-linux . The rest of this cover letter will focus on the Linux Kernel bits.
Overview
====
This is the first draft of the Microsoft Virtual GPU (vGPU) driver. The driver exposes a paravirtualized GPU to user mode applications running in a virtual machine on a Windows host. This enables hardware acceleration in environment such as WSL (Windows Subsystem for Linux) where the Linux virtual machine is able to share the GPU with the Windows host.
The projection is accomplished by exposing the WDDM (Windows Display Driver Model) interface as a set of IOCTL. This allows APIs and user mode driver written against the WDDM GPU abstraction on Windows to be ported to run within a Linux environment. This enables the port of the D3D12 and DirectML APIs as well as their associated user mode driver to Linux. This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSL environment.
Only the rendering/compute aspect of the GPU are projected to the virtual machine, no display functionality is exposed. Further, at this time there are no presentation integration. So although the D3D12 API can be use to render graphics offscreen, there is no path (yet) for pixel to flow from the Linux environment back onto the Windows host desktop. This GPU stack is effectively side-by-side with the native Linux graphics stack.
The driver creates the /dev/dxg device, which can be opened by user mode application and handles their ioctls. The IOCTL interface to the driver is defined in dxgkmthk.h (Dxgkrnl Graphics Port Driver ioctl definitions). The interface matches the D3DKMT interface on Windows. Ioctls are implemented in ioctl.c.
When a VM starts, hyper-v on the host adds virtual GPU devices to the VM via the hyper-v driver. The host offers several VM bus channels to the
VM: the global channel and one channel per virtual GPU, assigned to the VM.
The driver registers with the hyper-v driver (hv_driver) for the arrival of VM bus channels. dxg_probe_device recognizes the vGPU channels and creates the corresponding objects (dxgadapter for vGPUs and dxgglobal for the global channel).
The driver uses the hyper-V VM bus interface to communicate with the host. dxgvmbus.c implements the communication interface.
The global channel has 8GB of IO space assigned by the host. This space is managed by the host and used to give the guest direct CPU access to some allocations. Video memory is allocated on the host except in the case of existing_sysmem allocations. The Windows host allocates memory for the GPU on behalf of the guest. The Linux guest can access that memory by mapping GPU virtual address to allocations and then referencing those GPU virtual address from within GPU command buffers submitted to the GPU. For allocations which require CPU access, the allocation is mapped by the host into a location in the 8GB of IO space reserved in the guest for that purpose. The Windows host uses the nested CPU page table to ensure that this guest IO space always map to the correct location for the allocation as it may migrate between dedicated GPU memory (e.g. VRAM, firmware reserved DDR) and shared system memory (regular DDR) over its lifetime. The Linux guest maps a user mode CPU virtual address to an allocation IO space range for direct access by user mode APIs and drivers.
Implementation of LX_DXLOCK2 ioctl
=================
We would appreciate your feedback on the implementation of the LX_DXLOCK2 ioctl.
This ioctl is used to get a CPU address to an allocation, which is resident in video/system memory on the host. The way it works:
1. The driver sends the Lock message to the host
2. The host allocates space in the VM IO space and maps it to the allocation memory
3. The host returns the address in IO space for the mapped allocation
4. The driver (in dxg_map_iospace) allocates a user mode virtual address range using vm_mmap and maps it to the IO space using io_remap_ofn_range)
5. The VA is returned to the application
Internal objects
========
The following objects are created by the driver (defined in dxgkrnl.h):
- dxgadapter - represents a virtual GPU
- dxgprocess - tracks per process state (handle table of created objects, list of objects, etc.)
- dxgdevice - a container for other objects (contexts, paging queues, allocations, GPU synchronization objects)
- dxgcontext - represents thread of GPU execution for packet scheduling.
- dxghwqueue - represents thread of GPU execution of hardware scheduling
- dxgallocation - represents a GPU accessible allocation
- dxgsyncobject - represents a GPU synchronization object
- dxgresource - collection of dxgalloction objects
- dxgsharedresource, dxgsharedsyncobj - helper objects to share objects between different dxgdevice objects, which can belong to different
processes
Object handles
=======
All GPU objects, created by the driver, are accessible by a handle (d3dkmt_handle). Each process has its own handle table, which is implemented in hmgr.c. For each API visible object, created by the driver, there is an object, created on the host. For example, the is a dxgprocess object on the host for each dxgprocess object in the VM, etc. The object handles have the same value in the host and the VM, which is done to avoid translation from the guest handles to the host handles.
Signaling CPU events by the host
================
The WDDM interface provides a way to signal CPU event objects when execution of a context reached certain point. The way it is implemented:
- application sends an event_fd via ioctl to the driver
- eventfd_ctx_get is used to get a pointer to the file object (eventfd_ctx)
- the pointer to sent the host via a VM bus message
- when GPU execution reaches a certain point, the host sends a message to the VM with the event pointer
- signal_guest_event() handles the messages and eventually eventfd_signal() is called.
Sasha Levin (4):
gpu: dxgkrnl: core code
gpu: dxgkrnl: hook up dxgkrnl
Drivers: hv: vmbus: hook up dxgkrnl
gpu: dxgkrnl: create a MAINTAINERS entry
MAINTAINERS | 7 + drivers/gpu/Makefile | 2 +- drivers/gpu/dxgkrnl/Kconfig | 10 + drivers/gpu/dxgkrnl/Makefile | 12 + drivers/gpu/dxgkrnl/d3dkmthk.h | 1635 +++++++++ drivers/gpu/dxgkrnl/dxgadapter.c | 1399 ++++++++ drivers/gpu/dxgkrnl/dxgkrnl.h | 913 ++++++ drivers/gpu/dxgkrnl/dxgmodule.c | 692 ++++ drivers/gpu/dxgkrnl/dxgprocess.c | 355 ++ drivers/gpu/dxgkrnl/dxgvmbus.c | 2955 +++++++++++++++++ drivers/gpu/dxgkrnl/dxgvmbus.h | 859 +++++ drivers/gpu/dxgkrnl/hmgr.c | 593 ++++ drivers/gpu/dxgkrnl/hmgr.h | 107 + drivers/gpu/dxgkrnl/ioctl.c | 5269 ++++++++++++++++++++++++++++++ drivers/gpu/dxgkrnl/misc.c | 280 ++ drivers/gpu/dxgkrnl/misc.h | 288 ++ drivers/video/Kconfig | 2 + include/linux/hyperv.h | 16 + 18 files changed, 15393 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/dxgkrnl/Kconfig create mode 100644 drivers/gpu/dxgkrnl/Makefile create mode 100644 drivers/gpu/dxgkrnl/d3dkmthk.h create mode 100644 drivers/gpu/dxgkrnl/dxgadapter.c create mode 100644 drivers/gpu/dxgkrnl/dxgkrnl.h create mode 100644 drivers/gpu/dxgkrnl/dxgmodule.c create mode 100644 drivers/gpu/dxgkrnl/dxgprocess.c create mode 100644 drivers/gpu/dxgkrnl/dxgvmbus.c create mode 100644 drivers/gpu/dxgkrnl/dxgvmbus.h create mode 100644 drivers/gpu/dxgkrnl/hmgr.c create mode 100644 drivers/gpu/dxgkrnl/hmgr.h create mode 100644 drivers/gpu/dxgkrnl/ioctl.c create mode 100644 drivers/gpu/dxgkrnl/misc.c create mode 100644 drivers/gpu/dxgkrnl/misc.h
Signature · 1 line
2.25.1
RFC PATCH 1/4 gpu: dxgkrnl: core code
Add support for a Hyper-V based vGPU implementation that exposes the DirectX API to Linux userspace.
--- drivers/gpu/dxgkrnl/Kconfig | 10 + drivers/gpu/dxgkrnl/Makefile | 12 + drivers/gpu/dxgkrnl/d3dkmthk.h | 1635 +++++++++ drivers/gpu/dxgkrnl/dxgadapter.c | 1399 ++++++++ drivers/gpu/dxgkrnl/dxgkrnl.h | 913 ++++++ drivers/gpu/dxgkrnl/dxgmodule.c | 692 ++++ drivers/gpu/dxgkrnl/dxgprocess.c | 355 ++ drivers/gpu/dxgkrnl/dxgvmbus.c | 2955 +++++++++++++++++ drivers/gpu/dxgkrnl/dxgvmbus.h | 859 +++++ drivers/gpu/dxgkrnl/hmgr.c | 593 ++++ drivers/gpu/dxgkrnl/hmgr.h | 107 + drivers/gpu/dxgkrnl/ioctl.c | 5269 ++++++++++++++++++++++++++++++ drivers/gpu/dxgkrnl/misc.c | 280 ++ drivers/gpu/dxgkrnl/misc.h | 288 ++ 14 files changed, 15367 insertions(+) create mode 100644 drivers/gpu/dxgkrnl/Kconfig create mode 100644 drivers/gpu/dxgkrnl/Makefile create mode 100644 drivers/gpu/dxgkrnl/d3dkmthk.h create mode 100644 drivers/gpu/dxgkrnl/dxgadapter.c create mode 100644 drivers/gpu/dxgkrnl/dxgkrnl.h create mode 100644 drivers/gpu/dxgkrnl/dxgmodule.c create mode 100644 drivers/gpu/dxgkrnl/dxgprocess.c create mode 100644 drivers/gpu/dxgkrnl/dxgvmbus.c create mode 100644 drivers/gpu/dxgkrnl/dxgvmbus.h create mode 100644 drivers/gpu/dxgkrnl/hmgr.c create mode 100644 drivers/gpu/dxgkrnl/hmgr.h create mode 100644 drivers/gpu/dxgkrnl/ioctl.c create mode 100644 drivers/gpu/dxgkrnl/misc.c create mode 100644 drivers/gpu/dxgkrnl/misc.h
drivers/gpu/dxgkrnl/Kconfig new file +10 -0
@@ -0,0 +1,10 @@ +# +# dxgkrnl configuration +# + +config DXGKRNL + tristate "Microsoft virtual GPU support" + depends on HYPERV + help + This driver supports Microsoft virtual GPU. +
drivers/gpu/dxgkrnl/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0 +# Makefile for the Linux video drivers. +# 5 Aug 1999, James Simmons, <mailto:[email protected]> +# Rewritten to use lists instead of if-statements. + +# Each configuration option enables a list of files. + +# Uncomment to enable printing debug messages by default +#ccflags-y := -DDEBUG + +obj-$(CONFIG_DXGKRNL) += dxgkrnl.o +dxgkrnl-y := dxgmodule.o hmgr.o misc.o dxgadapter.o ioctl.o dxgvmbus.o dxgprocess.o
drivers/gpu/dxgkrnl/d3dkmthk.h new file +1635 -0
1,635 lines not on this page · raw message
drivers/gpu/dxgkrnl/dxgadapter.c new file +1399 -0
1,343 lines not on this page · raw message
drivers/gpu/dxgkrnl/dxgkrnl.h new file +913 -0
913 lines not on this page · raw message
drivers/gpu/dxgkrnl/dxgmodule.c new file +692 -0
692 lines not on this page · raw message
drivers/gpu/dxgkrnl/dxgprocess.c new file +355 -0
355 lines not on this page · raw message
drivers/gpu/dxgkrnl/dxgvmbus.c new file +2955 -0
2,955 lines not on this page · raw message
drivers/gpu/dxgkrnl/dxgvmbus.h new file +859 -0
859 lines not on this page · raw message
drivers/gpu/dxgkrnl/hmgr.c new file +593 -0
593 lines not on this page · raw message
drivers/gpu/dxgkrnl/hmgr.h new file +107 -0
107 lines not on this page · raw message
drivers/gpu/dxgkrnl/ioctl.c new file +5269 -0
5,269 lines not on this page · raw message
drivers/gpu/dxgkrnl/misc.c new file +280 -0
280 lines not on this page · raw message
drivers/gpu/dxgkrnl/misc.h new file +288 -0
288 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.25.1
Part of the diff is not shown here. View the raw message.
Re: [RFC PATCH 1/4] gpu: dxgkrnl: core code
drivers/gpu/dxgkrnl/d3dkmthk.h line 1474
Quoted 12 lines · Sasha Levin
drivers/gpu/dxgkrnl/d3dkmthk.h new file +12
-0+/* +* Dxgkrnl Graphics Port Driver ioctl definitions +* +*/ + +#define LX_IOCTL_DIR_WRITE 0x1 +#define LX_IOCTL_DIR_READ 0x2 + +#define LX_IOCTL_DIR (_ioctl) (((_ioctl) >> 30) & 0x3) +#define LX_IOCTL_SIZE (_ioctl) (((_ioctl) >> 16) & 0x3FFF) +#define LX_IOCTL_TYPE (_ioctl) (((_ioctl) >> 8) & 0xFF) +#define LX_IOCTL_CODE (_ioctl) (((_ioctl) >> 0) & 0xFF)
Why create new ioctl macros, can't the "normal" kernel macros work properly?
Quoted 7 lines
drivers/gpu/dxgkrnl/d3dkmthk.h new file +7
-0+#define LX_IOCTL (_dir, _size, _type, _code) ( \ + (((uint)(_dir) & 0x3) << 30) | \ + (((uint)(_size) & 0x3FFF) << 16) | \ + (((uint)(_type) & 0xFF) << 8) | \ + (((uint)(_code) & 0xFF) << 0)) + +#define LX_IO (_type, _code) LX_IOCTL(0, 0, (_type), (_code))
drivers/gpu/dxgkrnl/d3dkmthk.h line 1492
Quoted 10 lines
drivers/gpu/dxgkrnl/d3dkmthk.h new file +10
-0+#define LX_IOR (_type, _code, _size) \ + LX_IOCTL(LX_IOCTL_DIR_READ, (_size), (_type), (_code)) +#define LX_IOW (_type, _code, _size) \ + LX_IOCTL(LX_IOCTL_DIR_WRITE, (_size), (_type), (_code)) +#define LX_IOWR (_type, _code, _size) \ + LX_IOCTL(LX_IOCTL_DIR_WRITE | \ + LX_IOCTL_DIR_READ, (_size), (_type), (_code)) + +#define LX_DXOPENADAPTERFROMLUID \ + LX_IOWR(0x47, 0x01, sizeof(struct d3dkmt_openadapterfromluid))
<snip>
These structures do not seem to be all using the correct types for a "real" ioctl in the kernel, so you will have to fix them all up before this will work properly.
Quoted 1 line
+void
ioctl_desc_init(void);
Very odd global name you are using here :)
Anyway, neat stuff, glad to see it posted, great work!
greg k-h
Re: [RFC PATCH 1/4] gpu: dxgkrnl: core code
In reply to Sasha Levindrivers/gpu/dxgkrnl/misc.h line 54
Quoted 3 lines · Sasha Levin
drivers/gpu/dxgkrnl/misc.h new file +3
-0+ +#define DXGK_MAX_LOCK_DEPTH 64 +#define W_MAX_PATH 260
We already have a max path number, why use a different one?
drivers/gpu/dxgkrnl/misc.h line 62
Quoted 7 lines
drivers/gpu/dxgkrnl/misc.h new file +7
-0+#define d3dkmt_handle u32 +#define d3dgpu_virtual_address u64 +#define winwchar u16 +#define winhandle u64 +#define ntstatus int +#define winbool u32 +#define d3dgpu_size_t u64
These are all ripe for a simple search/replace in your editor before you do your next version :)
thanks,
greg k-h
Re: [RFC PATCH 1/4] gpu: dxgkrnl: core code
Quoted 6 lines · Greg KH
drivers/gpu/dxgkrnl/misc.h line 54
Quoted 3 lines · Sasha Levin
drivers/gpu/dxgkrnl/misc.h new file +3
-0+ +#define DXGK_MAX_LOCK_DEPTH 64 +#define W_MAX_PATH 260We already have a max path number, why use a different one?
It's max path for Windows, not Linux (thus the "W_" prefix) :)
Maybe changing it to WIN_MAX_PATH or such will make it better?
Quoted 10 lines
drivers/gpu/dxgkrnl/misc.h line 62
Quoted 7 lines
drivers/gpu/dxgkrnl/misc.h new file +7
-0+#define d3dkmt_handle u32 +#define d3dgpu_virtual_address u64 +#define winwchar u16 +#define winhandle u64 +#define ntstatus int +#define winbool u32 +#define d3dgpu_size_t u64These are all ripe for a simple search/replace in your editor before you do your next version :)
I've actually attempted that, and reverted that change, mostly because the whole 'handle' thing became very confusing.
Note that we have a few 'handles', each with a different size, and thus calling get_something_something_handle() type of functions becase very confusing since it's not clear what handle we're working with in that case.
With regards to the rest, I wanted to leave stuff like 'winbool' to document the expected ABI between the Windows and Linux side of things. Ideally it would be 'bool' or 'u8', but as you see we had to use 'u32' here which I feel lessens our ability to have the code document itself.
I don't feel too strongly against doing the conversion, and I won't object to doing it if you do, but just be aware that I've tried it and preferred to go back (even though our coding style doesn't like this) :)
Signature · 2 lines
Thanks, Sasha
Re: [RFC PATCH 1/4] gpu: dxgkrnl: core code
Quoted 9 lines · Sasha Levin
Quoted 6 lines · Greg KH
drivers/gpu/dxgkrnl/misc.h line 54
Quoted 3 lines · Sasha Levin
drivers/gpu/dxgkrnl/misc.h new file +3
-0+ +#define DXGK_MAX_LOCK_DEPTH 64 +#define W_MAX_PATH 260We already have a max path number, why use a different one?
It's max path for Windows, not Linux (thus the "W_" prefix) :)
Ah, not obvious :)
Quoted 1 line
Maybe changing it to
WIN_MAX_PATHor such will make it better?
Probably.
Quoted 11 lines
Quoted 10 lines
drivers/gpu/dxgkrnl/misc.h line 62
Quoted 7 lines
drivers/gpu/dxgkrnl/misc.h new file +7
-0+#define d3dkmt_handle u32 +#define d3dgpu_virtual_address u64 +#define winwchar u16 +#define winhandle u64 +#define ntstatus int +#define winbool u32 +#define d3dgpu_size_t u64These are all ripe for a simple search/replace in your editor before you do your next version :)
Quoted 2 lines
I've actually attempted that, and reverted that change, mostly because the whole 'handle' thing became very confusing.
Yeah, "handles" in windows can be a mess, with some being pointers and others just integers. Trying to make a specific typedef for it is usually the better way overall, that way you can get the compiler to check for mistakes. These #defines will not really help with that.
But, 'ntstatus' should be ok to just make "int" everywhere, right?
Quoted 4 lines
Note that we have a few 'handles', each with a different size, and thus calling
get_something_something_handle()type of functions becase very confusing since it's not clear what handle we're working with in that case.
Yeah, typedefs can help there.
Quoted 4 lines
With regards to the rest, I wanted to leave stuff like 'winbool' to document the expected ABI between the Windows and Linux side of things. Ideally it would be 'bool' or 'u8', but as you see we had to use 'u32' here which I feel lessens our ability to have the code document itself.
'bool' probably will not work as I think it's compiler dependent, __u8 is probably best.
thanks,
greg k-h
Re: [RFC PATCH 1/4] gpu: dxgkrnl: core code
In reply to Sasha LevinQuoted 64 lines · Sasha Levin
drivers/gpu/dxgkrnl/dxgmodule.c new file +64
-0+static int dxgglobal_init_global_channel (struct hv_device *hdev) +{ +int ret =0 ; + +TRACE_DEBUG (1 ,"%s %x %x" , __func__, hdev->vendor_id, hdev->device_id); + { +TRACE_DEBUG (1 ,"device type : %pUb\n" , &hdev->dev_type); +TRACE_DEBUG (1 ,"device channel: %pUb %p primary: %p\n" , + &hdev->channel->offermsg.offer.if_type, + hdev->channel, hdev->channel->primary_channel); + } + +if (dxgglobal->hdev) { +/* This device should appear only once */ +pr_err ("dxgglobal already initialized\n" ); + ret = -EBADE ; + goto error; + } + + dxgglobal->hdev = hdev; + + ret =dxgvmbuschannel_init (&dxgglobal->channel, hdev); +if (ret) { +pr_err ("dxgvmbuschannel_init failed: %d\n" , ret); + goto error; + } + + ret =dxgglobal_getiospace (dxgglobal); +if (ret) { +pr_err ("getiospace failed: %d\n" , ret); + goto error; + } + + ret =dxgvmb_send_set_iospace_region (dxgglobal->mmiospace_base, + dxgglobal->mmiospace_size,0 ); +if (ret) { +pr_err ("send_set_iospace_region failed\n" ); + goto error; + } + +hv_set_drvdata (hdev, dxgglobal); + +if (alloc_chrdev_region (&dxgglobal->device_devt,0 ,1 ,"dxgkrnl" ) <0 ) { +pr_err ("alloc_chrdev_region failed\n" ); + ret = -ENODEV ; + goto error; + } + dxgglobal->devt_initialized = true; + dxgglobal->device_class =class_create (THIS_MODULE ,"dxgkdrv" ); +if (dxgglobal->device_class =NULL ) { +pr_err ("class_create failed\n" ); + ret = -ENODEV ; + goto error; + } + dxgglobal->device_class->devnode = dxg_devnode; + dxgglobal->device =device_create (dxgglobal->device_class,NULL , + dxgglobal->device_devt,NULL ,"dxg" ); +if (dxgglobal->device =NULL ) { +pr_err ("device_create failed\n" ); + ret = -ENODEV ; + goto error; + } + dxgglobaldev = dxgglobal->device; +cdev_init (&dxgglobal->device_cdev, &dxgk_fops);
drivers/gpu/dxgkrnl/dxgmodule.c line 394
Quoted 10 lines
drivers/gpu/dxgkrnl/dxgmodule.c new file +10
-0+ ret =cdev_add (&dxgglobal->device_cdev, dxgglobal->device_devt,1 ); +if (ret <0 ) { +pr_err ("cdev_add failed: %d\n" , ret); + goto error; + } + dxgglobal->cdev_initialized = true; + +error: +return ret; +}
As you only are asking for a single char dev node, please just use the misc device api instead of creating your own class and major number on the fly. It's much simpler and easier overall to make sure you got all of the above logic correct.
thanks,
greg k-h
RFC PATCH 2/4 gpu: dxgkrnl: hook up dxgkrnl
In reply to Sasha LevinConnect the dxgkrnl module to the drivers/gpu/ makefile and Kconfig.
--- drivers/gpu/Makefile | 2 +- drivers/video/Kconfig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/Makefile +1 -1
@@ -3,6 +3,6 @@ # taken to initialize them in the correct order. Link order is the only way # to ensure this currently. obj-$(CONFIG_TEGRA_HOST1X) += host1x/ -obj-y += drm/ vga/ +obj-y += drm/ vga/ dxgkrnl/ obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/ obj-$(CONFIG_TRACE_GPU_MEM) += trace/
drivers/video/Kconfig +2 -0
@@ -19,6 +19,8 @@ source "drivers/gpu/ipu-v3/Kconfig" source "drivers/gpu/drm/Kconfig" +source "drivers/gpu/dxgkrnl/Kconfig" + menu "Frame buffer Devices" source "drivers/video/fbdev/Kconfig" endmenu
Signature · 1 line
2.25.1
kbuild test robot
build botRe: [RFC PATCH 2/4] gpu: dxgkrnl: hook up dxgkrnl
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…
Hi Sasha,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v5.7-rc6 next-20200519]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Sasha-Levin/DirectX-on-Linux/20200520-004214 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 642b151f45dd54809ea00ecd3976a56c1ec9b53d config: x86_64-allyesconfig (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/gpu/dxgkrnl/hmgr.c:91:6: warning: no previous prototype for function 'get_instance' [-Wmissing-prototypes]
uint get_instance(d3dkmt_handle h)
^drivers/gpu/dxgkrnl/hmgr.c:91:1: note: declare 'static' if the function is not intended to be used outside of this translation unit uint get_instance(d3dkmt_handle h)
^
static
>> drivers/gpu/dxgkrnl/hmgr.c:178:6: warning: no previous prototype for function 'print_status' [-Wmissing-prototypes]
void print_status(struct hmgrtable *table)
^drivers/gpu/dxgkrnl/hmgr.c:178:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void print_status(struct hmgrtable *table)
^
static
>> drivers/gpu/dxgkrnl/hmgr.c:549:21: warning: no previous prototype for function 'hmgrtable_get_entry_type' [-Wmissing-prototypes]
enum hmgrentry_type hmgrtable_get_entry_type(struct hmgrtable *table,
^drivers/gpu/dxgkrnl/hmgr.c:549:1: note: declare 'static' if the function is not intended to be used outside of this translation unit enum hmgrentry_type hmgrtable_get_entry_type(struct hmgrtable *table,
^
staticdrivers/gpu/dxgkrnl/hmgr.c:173:20: warning: unused function 'is_empty' [-Wunused-function]
static inline bool is_empty(struct hmgrtable *table)
^
4 warnings generated.
--
>> drivers/gpu/dxgkrnl/dxgadapter.c:281:6: warning: no previous prototype for function 'dxgdevice_mark_destroyed' [-Wmissing-prototypes]
void dxgdevice_mark_destroyed(struct dxgdevice *device)
^drivers/gpu/dxgkrnl/dxgadapter.c:281:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void dxgdevice_mark_destroyed(struct dxgdevice *device)
^
static
>> drivers/gpu/dxgkrnl/dxgadapter.c:664:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
refcount_inc_not_zero(&resource->refcount);
^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/dxgadapter.c:1326:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] refcount_inc_not_zero(&syncobj->refcount);
^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
3 warnings generated.
--
In file included from drivers/gpu/dxgkrnl/ioctl.c:21:drivers/gpu/dxgkrnl/dxgvmbus.h:826:26: warning: implicit conversion from enumeration type 'enum dxgkvmb_commandtype' to different enumeration type 'enum dxgkvmb_commandtype_global' [-Wenum-conversion]command->command_type = DXGK_VMBCOMMAND_INVALID;
~ ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/dxgkrnl/ioctl.c:1568:5: warning: no previous prototype for function 'validate_alloc' [-Wmissing-prototypes]
int validate_alloc(struct dxgallocation *alloc0,
^drivers/gpu/dxgkrnl/ioctl.c:1568:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int validate_alloc(struct dxgallocation *alloc0,
^
static
>> drivers/gpu/dxgkrnl/ioctl.c:4734:5: warning: no previous prototype for function 'assign_resource_handles' [-Wmissing-prototypes]
int assign_resource_handles(struct dxgprocess *process,
^drivers/gpu/dxgkrnl/ioctl.c:4734:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int assign_resource_handles(struct dxgprocess *process,
^
static
>> drivers/gpu/dxgkrnl/ioctl.c:4793:5: warning: no previous prototype for function 'open_resource' [-Wmissing-prototypes]
int open_resource(struct dxgprocess *process,
^drivers/gpu/dxgkrnl/ioctl.c:4793:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int open_resource(struct dxgprocess *process,
^
static
4 warnings generated.
--
In file included from drivers/gpu/dxgkrnl/dxgvmbus.c:22:drivers/gpu/dxgkrnl/dxgvmbus.h:826:26: warning: implicit conversion from enumeration type 'enum dxgkvmb_commandtype' to different enumeration type 'enum dxgkvmb_commandtype_global' [-Wenum-conversion]command->command_type = DXGK_VMBCOMMAND_INVALID;
~ ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/dxgkrnl/dxgvmbus.c:108:6: warning: no previous prototype for function 'signal_guest_event' [-Wmissing-prototypes]
void signal_guest_event(struct dxgkvmb_command_host_to_vm *packet,
^drivers/gpu/dxgkrnl/dxgvmbus.c:108:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void signal_guest_event(struct dxgkvmb_command_host_to_vm *packet,
^
static
>> drivers/gpu/dxgkrnl/dxgvmbus.c:126:6: warning: no previous prototype for function 'process_inband_packet' [-Wmissing-prototypes]
void process_inband_packet(struct dxgvmbuschannel *channel,
^drivers/gpu/dxgkrnl/dxgvmbus.c:126:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void process_inband_packet(struct dxgvmbuschannel *channel,
^
static
>> drivers/gpu/dxgkrnl/dxgvmbus.c:158:6: warning: no previous prototype for function 'process_completion_packet' [-Wmissing-prototypes]
void process_completion_packet(struct dxgvmbuschannel *channel,
^drivers/gpu/dxgkrnl/dxgvmbus.c:158:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void process_completion_packet(struct dxgvmbuschannel *channel,
^
static
>> drivers/gpu/dxgkrnl/dxgvmbus.c:785:5: warning: no previous prototype for function 'create_existing_sysmem' [-Wmissing-prototypes]
int create_existing_sysmem(struct dxgdevice *device,
^drivers/gpu/dxgkrnl/dxgvmbus.c:785:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int create_existing_sysmem(struct dxgdevice *device,
^
staticdrivers/gpu/dxgkrnl/dxgvmbus.c:88:20: warning: unused function 'command_vm_to_host_init0' [-Wunused-function] static inline void command_vm_to_host_init0(struct dxgkvmb_command_vm_to_host
^
6 warnings generated.
vim +/get_instance +91 drivers/gpu/dxgkrnl/hmgr.c
9cc562c3695b5b Sasha Levin 2020-05-19 90
9cc562c3695b5b Sasha Levin 2020-05-19 @91 uint get_instance(d3dkmt_handle h)
9cc562c3695b5b Sasha Levin 2020-05-19 92 {
9cc562c3695b5b Sasha Levin 2020-05-19 93 return (h & HMGRHANDLE_INSTANCE_MASK) >> HMGRHANDLE_INSTANCE_SHIFT;
9cc562c3695b5b Sasha Levin 2020-05-19 94 }
9cc562c3695b5b Sasha Levin 2020-05-19 95
9cc562c3695b5b Sasha Levin 2020-05-19 96 static bool is_handle_valid(struct hmgrtable *table, d3dkmt_handle h,
9cc562c3695b5b Sasha Levin 2020-05-19 97 bool ignore_destroyed, enum hmgrentry_type t)
9cc562c3695b5b Sasha Levin 2020-05-19 98 {
9cc562c3695b5b Sasha Levin 2020-05-19 99 uint index = get_index(h);
9cc562c3695b5b Sasha Levin 2020-05-19 100 uint unique = get_unique(h);
9cc562c3695b5b Sasha Levin 2020-05-19 101 struct hmgrentry *entry;
9cc562c3695b5b Sasha Levin 2020-05-19 102
9cc562c3695b5b Sasha Levin 2020-05-19 103 if (index >= table->table_size) {
9cc562c3695b5b Sasha Levin 2020-05-19 104 pr_err("%s Invalid index %x %d\n", __func__, h, index);
9cc562c3695b5b Sasha Levin 2020-05-19 105 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 106 }
9cc562c3695b5b Sasha Levin 2020-05-19 107
9cc562c3695b5b Sasha Levin 2020-05-19 108 entry = &table->entry_table[index];
9cc562c3695b5b Sasha Levin 2020-05-19 109 if (unique != entry->unique) {
9cc562c3695b5b Sasha Levin 2020-05-19 110 pr_err("%s Invalid unique %x %d %d %d %p",
9cc562c3695b5b Sasha Levin 2020-05-19 111 __func__, h, unique, entry->unique,
9cc562c3695b5b Sasha Levin 2020-05-19 112 index, entry->object);
9cc562c3695b5b Sasha Levin 2020-05-19 113 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 114 }
9cc562c3695b5b Sasha Levin 2020-05-19 115
9cc562c3695b5b Sasha Levin 2020-05-19 116 if (entry->destroyed && !ignore_destroyed) {
9cc562c3695b5b Sasha Levin 2020-05-19 117 pr_err("%s Invalid destroyed", __func__);
9cc562c3695b5b Sasha Levin 2020-05-19 118 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 119 }
9cc562c3695b5b Sasha Levin 2020-05-19 120
9cc562c3695b5b Sasha Levin 2020-05-19 121 if (entry->type == HMGRENTRY_TYPE_FREE) {
9cc562c3695b5b Sasha Levin 2020-05-19 122 pr_err("%s Entry is freed %x %d", __func__, h, index);
9cc562c3695b5b Sasha Levin 2020-05-19 123 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 124 }
9cc562c3695b5b Sasha Levin 2020-05-19 125
9cc562c3695b5b Sasha Levin 2020-05-19 126 if (t != HMGRENTRY_TYPE_FREE && t != entry->type) {
9cc562c3695b5b Sasha Levin 2020-05-19 127 pr_err("%s type mismatch %x %d %d", __func__, h,
9cc562c3695b5b Sasha Levin 2020-05-19 128 t, entry->type);
9cc562c3695b5b Sasha Levin 2020-05-19 129 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 130 }
9cc562c3695b5b Sasha Levin 2020-05-19 131
9cc562c3695b5b Sasha Levin 2020-05-19 132 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 133 }
9cc562c3695b5b Sasha Levin 2020-05-19 134
9cc562c3695b5b Sasha Levin 2020-05-19 135 static d3dkmt_handle build_handle(uint index, uint unique, uint instance)
9cc562c3695b5b Sasha Levin 2020-05-19 136 {
9cc562c3695b5b Sasha Levin 2020-05-19 137 uint handle_bits;
9cc562c3695b5b Sasha Levin 2020-05-19 138
9cc562c3695b5b Sasha Levin 2020-05-19 139 handle_bits = (index << HMGRHANDLE_INDEX_SHIFT) & HMGRHANDLE_INDEX_MASK;
9cc562c3695b5b Sasha Levin 2020-05-19 140 handle_bits |= (unique << HMGRHANDLE_UNIQUE_SHIFT) &
9cc562c3695b5b Sasha Levin 2020-05-19 141 HMGRHANDLE_UNIQUE_MASK;
9cc562c3695b5b Sasha Levin 2020-05-19 142 handle_bits |= (instance << HMGRHANDLE_INSTANCE_SHIFT) &
9cc562c3695b5b Sasha Levin 2020-05-19 143 HMGRHANDLE_INSTANCE_MASK;
9cc562c3695b5b Sasha Levin 2020-05-19 144
9cc562c3695b5b Sasha Levin 2020-05-19 145 return (d3dkmt_handle) handle_bits;
9cc562c3695b5b Sasha Levin 2020-05-19 146 }
9cc562c3695b5b Sasha Levin 2020-05-19 147
9cc562c3695b5b Sasha Levin 2020-05-19 148 inline uint hmgrtable_get_used_entry_count(struct hmgrtable *table)
9cc562c3695b5b Sasha Levin 2020-05-19 149 {
9cc562c3695b5b Sasha Levin 2020-05-19 150 DXGKRNL_ASSERT(table->table_size >= table->free_count);
9cc562c3695b5b Sasha Levin 2020-05-19 151 return (table->table_size - table->free_count);
9cc562c3695b5b Sasha Levin 2020-05-19 152 }
9cc562c3695b5b Sasha Levin 2020-05-19 153
9cc562c3695b5b Sasha Levin 2020-05-19 154 bool hmgrtable_mark_destroyed(struct hmgrtable *table, d3dkmt_handle h)
9cc562c3695b5b Sasha Levin 2020-05-19 155 {
9cc562c3695b5b Sasha Levin 2020-05-19 156 if (!is_handle_valid(table, h, false, HMGRENTRY_TYPE_FREE))
9cc562c3695b5b Sasha Levin 2020-05-19 157 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 158
9cc562c3695b5b Sasha Levin 2020-05-19 159 table->entry_table[get_index(h)].destroyed = true;
9cc562c3695b5b Sasha Levin 2020-05-19 160 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 161 }
9cc562c3695b5b Sasha Levin 2020-05-19 162
9cc562c3695b5b Sasha Levin 2020-05-19 163 bool hmgrtable_unmark_destroyed(struct hmgrtable *table, d3dkmt_handle h)
9cc562c3695b5b Sasha Levin 2020-05-19 164 {
9cc562c3695b5b Sasha Levin 2020-05-19 165 if (!is_handle_valid(table, h, true, HMGRENTRY_TYPE_FREE))
9cc562c3695b5b Sasha Levin 2020-05-19 166 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 167
9cc562c3695b5b Sasha Levin 2020-05-19 168 DXGKRNL_ASSERT(table->entry_table[get_index(h)].destroyed);
9cc562c3695b5b Sasha Levin 2020-05-19 169 table->entry_table[get_index(h)].destroyed = 0;
9cc562c3695b5b Sasha Levin 2020-05-19 170 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 171 }
9cc562c3695b5b Sasha Levin 2020-05-19 172
9cc562c3695b5b Sasha Levin 2020-05-19 173 static inline bool is_empty(struct hmgrtable *table)
9cc562c3695b5b Sasha Levin 2020-05-19 174 {
9cc562c3695b5b Sasha Levin 2020-05-19 175 return (table->free_count == table->table_size);
9cc562c3695b5b Sasha Levin 2020-05-19 176 }
9cc562c3695b5b Sasha Levin 2020-05-19 177
9cc562c3695b5b Sasha Levin 2020-05-19 @178 void print_status(struct hmgrtable *table)
9cc562c3695b5b Sasha Levin 2020-05-19 179 {
9cc562c3695b5b Sasha Levin 2020-05-19 180 int i;
9cc562c3695b5b Sasha Levin 2020-05-19 181
9cc562c3695b5b Sasha Levin 2020-05-19 182 TRACE_DEBUG(1, "hmgrtable head, tail %p %d %d\n",
9cc562c3695b5b Sasha Levin 2020-05-19 183 table, table->free_handle_list_head,
9cc562c3695b5b Sasha Levin 2020-05-19 184 table->free_handle_list_tail);
9cc562c3695b5b Sasha Levin 2020-05-19 185 if (table->entry_table == NULL)
9cc562c3695b5b Sasha Levin 2020-05-19 186 return;
9cc562c3695b5b Sasha Levin 2020-05-19 187 for (i = 0; i < 3; i++) {
9cc562c3695b5b Sasha Levin 2020-05-19 188 if (table->entry_table[i].type != HMGRENTRY_TYPE_FREE)
9cc562c3695b5b Sasha Levin 2020-05-19 189 TRACE_DEBUG(1, "hmgrtable entry %p %d %p\n",
9cc562c3695b5b Sasha Levin 2020-05-19 190 table, i, table->entry_table[i].object);
9cc562c3695b5b Sasha Levin 2020-05-19 191 else
9cc562c3695b5b Sasha Levin 2020-05-19 192 TRACE_DEBUG(1, "hmgrtable entry %p %d %d %d\n",
9cc562c3695b5b Sasha Levin 2020-05-19 193 table, i,
9cc562c3695b5b Sasha Levin 2020-05-19 194 table->entry_table[i].next_free_index,
9cc562c3695b5b Sasha Levin 2020-05-19 195 table->entry_table[i].prev_free_index);
9cc562c3695b5b Sasha Levin 2020-05-19 196 }
9cc562c3695b5b Sasha Levin 2020-05-19 197 }
9cc562c3695b5b Sasha Levin 2020-05-19 198 :::::: The code at line 91 was first introduced by commit :::::: 9cc562c3695b5b44c0c931c76bdc24e8c4f33587 gpu: dxgkrnl: core code
:::::: TO: Sasha Levin <[email protected]>
:::::: CC: 0day robot <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kbuild test robot
build botRe: [RFC PATCH 2/4] gpu: dxgkrnl: hook up dxgkrnl
In reply to Sasha Levin[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…
Hi Sasha,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Sasha-Levin/DirectX-on-Linux/20200520-004214 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 642b151f45dd54809ea00ecd3976a56c1ec9b53d config: i386-allyesconfig (attached as .config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce: # save the attached .config to linux build tree make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/printk.h:326:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/gpu/dxgkrnl/dxgmodule.c:14:drivers/gpu/dxgkrnl/dxgmodule.c: In function 'dxgglobal_getiospace':
>> drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'resource_size_t {aka unsigned int}' [-Wformat=]#define pr_fmt2(fmt) "dxgk:err: " fmt
^include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'func(&id, ##__VA_ARGS__); ^~~~~~~~~~~include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, ^~~~~~~~~~~~~~~~~~include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg' dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt' dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg' dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) ^~~~~~~ >> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2' dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) ^~~~~~~ >> drivers/gpu/dxgkrnl/dxgmodule.c:305:2: note: in expansion of macro 'TRACE_DEBUG'
TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
^~~~~~~~~~~drivers/gpu/dxgkrnl/dxgmodule.c:305:47: note: format string is defined here
TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
~~~^
%x
In file included from include/linux/printk.h:326:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/gpu/dxgkrnl/dxgmodule.c:14:drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 7 has type 'resource_size_t {aka unsigned int}' [-Wformat=] #define pr_fmt2(fmt) "dxgk:err: " fmt
^include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'func(&id, ##__VA_ARGS__); ^~~~~~~~~~~include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, ^~~~~~~~~~~~~~~~~~include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg' dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) ^~~~~~~ >> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2' dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) ^~~~~~~ >> drivers/gpu/dxgkrnl/dxgmodule.c:305:2: note: in expansion of macro 'TRACE_DEBUG'
TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
^~~~~~~~~~~drivers/gpu/dxgkrnl/dxgmodule.c:305:52: note: format string is defined here
TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
~~~^
%xdrivers/gpu/dxgkrnl/dxgmodule.c: At top level:drivers/gpu/dxgkrnl/dxgmodule.c:509:4: error: 'HV_GPUP_DXGK_VGPU_GUID' undeclared here (not in a function); did you mean 'HV_KVP_GUID'? { HV_GPUP_DXGK_VGPU_GUID },
^~~~~~~~~~~~~~~~~~~~~~HV_KVP_GUIDdrivers/gpu/dxgkrnl/dxgmodule.c:511:4: error: 'HV_GPUP_DXGK_GLOBAL_GUID' undeclared here (not in a function); did you mean 'HV_GPUP_DXGK_VGPU_GUID'? { HV_GPUP_DXGK_GLOBAL_GUID },
^~~~~~~~~~~~~~~~~~~~~~~~HV_GPUP_DXGK_VGPU_GUID
--
In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from include/linux/eventfd.h:12,
from drivers/gpu/dxgkrnl/ioctl.c:14:drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_create_allocation':include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=] #define KERN_SOH "001" /* ASCII Start Of Header */
^include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
#define KERN_ERR KERN_SOH "3" /* error conditions */
^~~~~~~~include/linux/printk.h:299:9: note: in expansion of macro 'KERN_ERR'printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~
>> drivers/gpu/dxgkrnl/ioctl.c:1265:4: note: in expansion of macro 'pr_err'
pr_err("private data size is too big: %d %d %ld",
^~~~~~drivers/gpu/dxgkrnl/ioctl.c:1265:50: note: format string is defined here
pr_err("private data size is too big: %d %d %ld",
~~^
%ddrivers/gpu/dxgkrnl/ioctl.c: At top level:drivers/gpu/dxgkrnl/ioctl.c:1568:5: warning: no previous prototype for 'validate_alloc' [-Wmissing-prototypes] int validate_alloc(struct dxgallocation *alloc0,
^~~~~~~~~~~~~~drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_create_sync_object':drivers/gpu/dxgkrnl/ioctl.c:2493:7: warning: variable 'host_event_added' set but not used [-Wunused-but-set-variable] bool host_event_added = false;
^~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_signal_sync_object':
>> drivers/gpu/dxgkrnl/ioctl.c:2973:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
NULL, (void *)host_event_id, 0);
^drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_signal_sync_object_gpu2':drivers/gpu/dxgkrnl/ioctl.c:3199:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (void *)host_event_id, 0);
^drivers/gpu/dxgkrnl/ioctl.c: At top level:drivers/gpu/dxgkrnl/ioctl.c:4734:5: warning: no previous prototype for 'assign_resource_handles' [-Wmissing-prototypes] int assign_resource_handles(struct dxgprocess *process,
^~~~~~~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/ioctl.c:4793:5: warning: no previous prototype for 'open_resource' [-Wmissing-prototypes] int open_resource(struct dxgprocess *process,
^~~~~~~~~~~~~
--drivers/gpu/dxgkrnl/dxgvmbus.c:108:6: warning: no previous prototype for 'signal_guest_event' [-Wmissing-prototypes] void signal_guest_event(struct dxgkvmb_command_host_to_vm *packet,
^~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:126:6: warning: no previous prototype for 'process_inband_packet' [-Wmissing-prototypes] void process_inband_packet(struct dxgvmbuschannel *channel,
^~~~~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:158:6: warning: no previous prototype for 'process_completion_packet' [-Wmissing-prototypes] void process_completion_packet(struct dxgvmbuschannel *channel,
^~~~~~~~~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:785:5: warning: no previous prototype for 'create_existing_sysmem' [-Wmissing-prototypes] int create_existing_sysmem(struct dxgdevice *device,
^~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/printk.h:326:0,
from include/linux/kernel.h:15,
from drivers/gpu/dxgkrnl/dxgvmbus.c:14:drivers/gpu/dxgkrnl/dxgvmbus.c: In function 'dxgvmb_send_create_allocation':
>> drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'unsigned int' [-Wformat=]
#define pr_fmt2(fmt) "dxgk:err: " fmt
^include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'func(&id, ##__VA_ARGS__); ^~~~~~~~~~~include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, ^~~~~~~~~~~~~~~~~~include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg' dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt' dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg' dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) ^~~~~~~ >> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2' dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) ^~~~~~~ >> drivers/gpu/dxgkrnl/dxgvmbus.c:1139:2: note: in expansion of macro 'TRACE_DEBUG'
TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld",
^~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:1139:57: note: format string is defined here
TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld",
~~^
%d
In file included from include/linux/printk.h:326:0,
from include/linux/kernel.h:15,
from drivers/gpu/dxgkrnl/dxgvmbus.c:14:drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%ld' expects argument of type 'long int', but argument 7 has type 'unsigned int' [-Wformat=] #define pr_fmt2(fmt) "dxgk:err: " fmt
^include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'func(&id, ##__VA_ARGS__); ^~~~~~~~~~~include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, ^~~~~~~~~~~~~~~~~~include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg' dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) ^~~~~~~ >> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2' dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) ^~~~~~~ >> drivers/gpu/dxgkrnl/dxgvmbus.c:1139:2: note: in expansion of macro 'TRACE_DEBUG'
TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld", ^~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:1139:61: note: format string is defined here TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld", ~~^
%ddrivers/gpu/dxgkrnl/dxgvmbus.c: In function 'dxgvmb_send_signal_sync_object':
>> drivers/gpu/dxgkrnl/dxgvmbus.c:1632:31: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
command->cpu_event_handle = (winhandle) cpu_event_handle;
^drivers/gpu/dxgkrnl/dxgvmbus.c: In function 'dxgvmb_send_lock2':drivers/gpu/dxgkrnl/dxgvmbus.c:1797:32: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] args->data = dxg_map_iospace((uint64_t) result.
^
vim +215 drivers/gpu/dxgkrnl/misc.h
9cc562c3695b5b44 Sasha Levin 2020-05-19 212
9cc562c3695b5b44 Sasha Levin 2020-05-19 213 #undef pr_fmt
9cc562c3695b5b44 Sasha Levin 2020-05-19 214 #define pr_fmt(fmt) "dxgk:err: " fmt
9cc562c3695b5b44 Sasha Levin 2020-05-19 @215 #define pr_fmt2(fmt) "dxgk:err: " fmt
9cc562c3695b5b44 Sasha Levin 2020-05-19 216
9cc562c3695b5b44 Sasha Levin 2020-05-19 217 #define DXGKDEBUG 1
9cc562c3695b5b44 Sasha Levin 2020-05-19 218 /* #define USEPRINTK 1 */
9cc562c3695b5b44 Sasha Levin 2020-05-19 219
9cc562c3695b5b44 Sasha Levin 2020-05-19 220 #ifndef DXGKDEBUG
9cc562c3695b5b44 Sasha Levin 2020-05-19 221 #define TRACE_DEBUG(...)
9cc562c3695b5b44 Sasha Levin 2020-05-19 222 #define TRACE_DEFINE(...)
9cc562c3695b5b44 Sasha Levin 2020-05-19 223 #define TRACE_FUNC_ENTER(...)
9cc562c3695b5b44 Sasha Levin 2020-05-19 224 #define TRACE_FUNC_EXIT(...)
9cc562c3695b5b44 Sasha Levin 2020-05-19 225 #else
9cc562c3695b5b44 Sasha Levin 2020-05-19 226 #ifdef USEPRINTK
9cc562c3695b5b44 Sasha Levin 2020-05-19 227 #define TRACE_DEBUG(level, fmt, ...)\
9cc562c3695b5b44 Sasha Levin 2020-05-19 228 printk(KERN_DEBUG pr_fmt2(fmt), ##__VA_ARGS__);
9cc562c3695b5b44 Sasha Levin 2020-05-19 229
9cc562c3695b5b44 Sasha Levin 2020-05-19 230 #define TRACE_DEBUG2(level, offset, fmt, ...) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 231 do { \
9cc562c3695b5b44 Sasha Levin 2020-05-19 232 if (offset == 0) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 233 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 234 else \
9cc562c3695b5b44 Sasha Levin 2020-05-19 235 printk(KERN_DEBUG pr_fmt2(fmt), ##__VA_ARGS__); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 236 } while (false)
9cc562c3695b5b44 Sasha Levin 2020-05-19 237
9cc562c3695b5b44 Sasha Levin 2020-05-19 238 #define TRACE_FUNC_ENTER(msg) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 239 printk(KERN_DEBUG "dxgk: %s", msg)
9cc562c3695b5b44 Sasha Levin 2020-05-19 240 #define TRACE_FUNC_EXIT(msg, ret) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 241 do { \
9cc562c3695b5b44 Sasha Levin 2020-05-19 242 if (!NT_SUCCESS(ret)) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 243 dxg_pr_err("%s %x %d", msg, ret, ret); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 244 else \
9cc562c3695b5b44 Sasha Levin 2020-05-19 245 printk(KERN_DEBUG "dxgk: %s end", msg); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 246 } while (false)
9cc562c3695b5b44 Sasha Levin 2020-05-19 247 #define TRACE_FUNC_EXIT_ERR(msg, ret) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 248 do { \
9cc562c3695b5b44 Sasha Levin 2020-05-19 249 if (!NT_SUCCESS(ret)) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 250 dxg_pr_err("%s %x", msg, ret); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 251 } while (false)
9cc562c3695b5b44 Sasha Levin 2020-05-19 252 #else
9cc562c3695b5b44 Sasha Levin 2020-05-19 253 #define TRACE_DEBUG(level, fmt, ...)\9cc562c3695b5b44 Sasha Levin 2020-05-19 @254 dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)9cc562c3695b5b44 Sasha Levin 2020-05-19 255
:::::: The code at line 215 was first introduced by commit :::::: 9cc562c3695b5b44c0c931c76bdc24e8c4f33587 gpu: dxgkrnl: core code
:::::: TO: Sasha Levin <[email protected]>
:::::: CC: 0day robot <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kbuild test robot
build botRe: [RFC PATCH 2/4] gpu: dxgkrnl: hook up dxgkrnl
In reply to Sasha Levin[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…
Hi Sasha,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v5.7-rc6 next-20200519]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Sasha-Levin/DirectX-on-Linux/20200520-004214 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 642b151f45dd54809ea00ecd3976a56c1ec9b53d config: i386-allyesconfig (attached as .config) reproduce: # apt-get install sparse # sparse version: v0.6.1-193-gb8fad4bc-dirty # save the attached .config to linux build tree make C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
sparse warnings: (new ones prefixed by >>)
drivers/gpu/dxgkrnl/dxgvmbus.c:1709:51: sparse: got unsigned long long [usertype] *fence_values
drivers/gpu/dxgkrnl/dxgvmbus.c:1805:65: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got sn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:1805:65: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:1805:65: sparse: got void **
drivers/gpu/dxgkrnl/dxgvmbus.c:1863:41: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:1863:41: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:1863:41: sparse: got unsigned long long *
drivers/gpu/dxgkrnl/dxgvmbus.c:1933:51: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got uvoid const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:1933:51: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:1933:51: sparse: got unsigned int const [usertype] *allocation_list
drivers/gpu/dxgkrnl/dxgvmbus.c:1938:38: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got uvoid const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:1938:38: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:1938:38: sparse: got unsigned int const [usertype] *priorities
drivers/gpu/dxgkrnl/dxgvmbus.c:2000:51: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got uvoid const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2000:51: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2000:51: sparse: got unsigned int const [usertype] *allocation_list
drivers/gpu/dxgkrnl/dxgvmbus.c:2016:69: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2016:69: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2016:69: sparse: got unsigned char [usertype] *
drivers/gpu/dxgkrnl/dxgvmbus.c:2097:68: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2097:68: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2097:68: sparse: got unsigned int [usertype] *resources
drivers/gpu/dxgkrnl/dxgvmbus.c:2101:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got uvoid const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2101:46: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2101:46: sparse: got unsigned int const [usertype] *allocations
drivers/gpu/dxgkrnl/dxgvmbus.c:2144:68: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2144:68: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2144:68: sparse: got unsigned int [usertype] *resources
drivers/gpu/dxgkrnl/dxgvmbus.c:2148:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2148:46: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2148:46: sparse: got unsigned int [usertype] *allocations
drivers/gpu/dxgkrnl/dxgvmbus.c:2167:33: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2167:33: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2167:33: sparse: got unsigned long long *
drivers/gpu/dxgkrnl/dxgvmbus.c:2173:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got unsigned invoid const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2173:55: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2173:55: sparse: got unsigned int enum d3dddi_reclaim_result *
drivers/gpu/dxgkrnl/dxgvmbus.c:2250:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got n:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2250:46: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2250:46: sparse: got void *priv_drv_data
drivers/gpu/dxgkrnl/dxgvmbus.c:2283:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got ref] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2283:49: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2283:49: sparse: got unsigned int *
drivers/gpu/dxgkrnl/dxgvmbus.c:2286:34: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got ref] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2286:34: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2286:34: sparse: got unsigned int *
drivers/gpu/dxgkrnl/dxgvmbus.c:2290:31: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got sn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2290:31: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2290:31: sparse: got void **
drivers/gpu/dxgkrnl/dxgvmbus.c:2294:31: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2294:31: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2294:31: sparse: got unsigned long long *
drivers/gpu/dxgkrnl/dxgvmbus.c:2298:41: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got eref] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2298:41: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2298:41: sparse: got unsigned char *
drivers/gpu/dxgkrnl/dxgvmbus.c:2352:38: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got n:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2352:38: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2352:38: sparse: got void *private_data
drivers/gpu/dxgkrnl/dxgvmbus.c:2384:52: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got eref] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2384:52: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2384:52: sparse: got unsigned char *
drivers/gpu/dxgkrnl/dxgvmbus.c:2411:59: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2411:59: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2411:59: sparse: got unsigned int [usertype] *written_primaries
drivers/gpu/dxgkrnl/dxgvmbus.c:2418:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got n:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2418:46: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2418:46: sparse: got void *priv_drv_data
drivers/gpu/dxgkrnl/dxgvmbus.c:2458:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2458:54: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2458:54: sparse: got struct dxgk_gpuclockdata *
drivers/gpu/dxgkrnl/dxgvmbus.c:2523:59: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2523:59: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2523:59: sparse: got unsigned int [usertype] *allocations
drivers/gpu/dxgkrnl/dxgvmbus.c:2543:63: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got struct dxgkvmb_command_quevoid const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2543:63: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2543:63: sparse: got struct dxgkvmb_command_queryallocationresidency_return *
drivers/gpu/dxgkrnl/dxgvmbus.c:2587:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got n:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2587:46: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2587:46: sparse: got void *priv_drv_data
drivers/gpu/dxgkrnl/dxgvmbus.c:2600:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got eref] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2600:40: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2600:40: sparse: got unsigned char *
drivers/gpu/dxgkrnl/dxgvmbus.c:2632:50: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2632:50: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2632:50: sparse: got unsigned long long *
drivers/gpu/dxgkrnl/dxgvmbus.c:2636:57: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2636:57: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2636:57: sparse: got unsigned long long *
drivers/gpu/dxgkrnl/dxgvmbus.c:2641:33: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2641:33: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2641:33: sparse: got unsigned long long *
drivers/gpu/dxgkrnl/dxgvmbus.c:2646:33: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2646:33: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2646:33: sparse: got unsigned long long *
drivers/gpu/dxgkrnl/dxgvmbus.c:2677:41: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got void const [noderef] <asn:1> *from @@
drivers/gpu/dxgkrnl/dxgvmbus.c:2677:41: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/dxgkrnl/dxgvmbus.c:2677:41: sparse: got struct d3dkmt_getdevicestate *
drivers/gpu/dxgkrnl/dxgvmbus.c:962:41: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:1009:33: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:1180:63: sparse: sparse: dereference of noderef expression
>> drivers/gpu/dxgkrnl/dxgvmbus.c:1632:57: sparse: sparse: non size-preserving pointer to integer cast
drivers/gpu/dxgkrnl/dxgvmbus.c:1805:49: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:1862:41: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2166:32: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2283:33: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2285:34: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2289:31: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2293:31: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2458:33: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2632:33: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2636:33: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2640:33: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2645:33: sparse: sparse: dereference of noderef expression drivers/gpu/dxgkrnl/dxgvmbus.c:2677:32: sparse: sparse: dereference of noderef expression
vim +1632 drivers/gpu/dxgkrnl/dxgvmbus.c
9cc562c3695b5b Sasha Levin 2020-05-19 1594
9cc562c3695b5b Sasha Levin 2020-05-19 1595 int dxgvmb_send_signal_sync_object(struct dxgprocess *process,
9cc562c3695b5b Sasha Levin 2020-05-19 1596 struct dxgvmbuschannel *channel,
9cc562c3695b5b Sasha Levin 2020-05-19 1597 struct d3dddicb_signalflags flags,
9cc562c3695b5b Sasha Levin 2020-05-19 1598 uint64_t legacy_fence_value,
9cc562c3695b5b Sasha Levin 2020-05-19 1599 d3dkmt_handle context,
9cc562c3695b5b Sasha Levin 2020-05-19 1600 uint object_count,
9cc562c3695b5b Sasha Levin 2020-05-19 1601 d3dkmt_handle __user *objects,
9cc562c3695b5b Sasha Levin 2020-05-19 1602 uint context_count,
9cc562c3695b5b Sasha Levin 2020-05-19 1603 d3dkmt_handle __user *contexts,
9cc562c3695b5b Sasha Levin 2020-05-19 1604 uint fence_count,
9cc562c3695b5b Sasha Levin 2020-05-19 1605 uint64_t __user *fences,
9cc562c3695b5b Sasha Levin 2020-05-19 1606 struct eventfd_ctx *cpu_event_handle,
9cc562c3695b5b Sasha Levin 2020-05-19 1607 d3dkmt_handle device)
9cc562c3695b5b Sasha Levin 2020-05-19 1608 {
9cc562c3695b5b Sasha Levin 2020-05-19 1609 int ret = 0;
9cc562c3695b5b Sasha Levin 2020-05-19 1610 struct dxgkvmb_command_signalsyncobject *command = NULL;
9cc562c3695b5b Sasha Levin 2020-05-19 1611 uint object_size = object_count * sizeof(d3dkmt_handle);
9cc562c3695b5b Sasha Levin 2020-05-19 1612 uint context_size = context_count * sizeof(d3dkmt_handle);
9cc562c3695b5b Sasha Levin 2020-05-19 1613 uint fence_size = fences ? fence_count * sizeof(uint64_t) : 0;
9cc562c3695b5b Sasha Levin 2020-05-19 1614 uint8_t *current_pos;
9cc562c3695b5b Sasha Levin 2020-05-19 1615 uint cmd_size = sizeof(struct dxgkvmb_command_signalsyncobject) +
9cc562c3695b5b Sasha Levin 2020-05-19 1616 object_size + context_size + fence_size;
9cc562c3695b5b Sasha Levin 2020-05-19 1617
9cc562c3695b5b Sasha Levin 2020-05-19 1618 if (context)
9cc562c3695b5b Sasha Levin 2020-05-19 1619 cmd_size += sizeof(d3dkmt_handle);
9cc562c3695b5b Sasha Levin 2020-05-19 1620
9cc562c3695b5b Sasha Levin 2020-05-19 1621 command = dxgmem_alloc(process, DXGMEM_VMBUS, cmd_size);
9cc562c3695b5b Sasha Levin 2020-05-19 1622 if (command == NULL) {
9cc562c3695b5b Sasha Levin 2020-05-19 1623 ret = STATUS_NO_MEMORY;
9cc562c3695b5b Sasha Levin 2020-05-19 1624 goto cleanup;
9cc562c3695b5b Sasha Levin 2020-05-19 1625 }
9cc562c3695b5b Sasha Levin 2020-05-19 1626
9cc562c3695b5b Sasha Levin 2020-05-19 1627 command_vgpu_to_host_init2(&command->hdr,
9cc562c3695b5b Sasha Levin 2020-05-19 1628 DXGK_VMBCOMMAND_SIGNALSYNCOBJECT,
9cc562c3695b5b Sasha Levin 2020-05-19 1629 process->host_handle);
9cc562c3695b5b Sasha Levin 2020-05-19 1630
9cc562c3695b5b Sasha Levin 2020-05-19 1631 if (flags.enqueue_cpu_event)
9cc562c3695b5b Sasha Levin 2020-05-19 @1632 command->cpu_event_handle = (winhandle) cpu_event_handle;
9cc562c3695b5b Sasha Levin 2020-05-19 1633 else
9cc562c3695b5b Sasha Levin 2020-05-19 1634 command->device = device;
9cc562c3695b5b Sasha Levin 2020-05-19 1635 command->flags = flags;
9cc562c3695b5b Sasha Levin 2020-05-19 1636 command->fence_value = legacy_fence_value;
9cc562c3695b5b Sasha Levin 2020-05-19 1637 command->object_count = object_count;
9cc562c3695b5b Sasha Levin 2020-05-19 1638 command->context_count = context_count;
9cc562c3695b5b Sasha Levin 2020-05-19 1639 current_pos = (uint8_t *) &command[1];
9cc562c3695b5b Sasha Levin 2020-05-19 1640 ret = dxg_copy_from_user(current_pos, objects, object_size);
9cc562c3695b5b Sasha Levin 2020-05-19 1641 if (ret) {
9cc562c3695b5b Sasha Levin 2020-05-19 1642 pr_err("Failed to read objects %p %d",
9cc562c3695b5b Sasha Levin 2020-05-19 1643 objects, object_size);
9cc562c3695b5b Sasha Levin 2020-05-19 1644 goto cleanup;
9cc562c3695b5b Sasha Levin 2020-05-19 1645 }
9cc562c3695b5b Sasha Levin 2020-05-19 1646 current_pos += object_size;
9cc562c3695b5b Sasha Levin 2020-05-19 1647 if (context) {
9cc562c3695b5b Sasha Levin 2020-05-19 1648 command->context_count++;
9cc562c3695b5b Sasha Levin 2020-05-19 1649 *(d3dkmt_handle *) current_pos = context;
9cc562c3695b5b Sasha Levin 2020-05-19 1650 current_pos += sizeof(d3dkmt_handle);
9cc562c3695b5b Sasha Levin 2020-05-19 1651 }
9cc562c3695b5b Sasha Levin 2020-05-19 1652 if (context_size) {
9cc562c3695b5b Sasha Levin 2020-05-19 1653 ret = dxg_copy_from_user(current_pos, contexts, context_size);
9cc562c3695b5b Sasha Levin 2020-05-19 1654 if (ret) {
9cc562c3695b5b Sasha Levin 2020-05-19 1655 pr_err("Failed to read contexts %p %d",
9cc562c3695b5b Sasha Levin 2020-05-19 1656 contexts, context_size);
9cc562c3695b5b Sasha Levin 2020-05-19 1657 goto cleanup;
9cc562c3695b5b Sasha Levin 2020-05-19 1658 }
9cc562c3695b5b Sasha Levin 2020-05-19 1659 current_pos += context_size;
9cc562c3695b5b Sasha Levin 2020-05-19 1660 }
9cc562c3695b5b Sasha Levin 2020-05-19 1661 if (fence_size) {
9cc562c3695b5b Sasha Levin 2020-05-19 1662 ret = dxg_copy_from_user(current_pos, fences, fence_size);
9cc562c3695b5b Sasha Levin 2020-05-19 1663 if (ret) {
9cc562c3695b5b Sasha Levin 2020-05-19 1664 pr_err("Failed to read fences %p %d",
9cc562c3695b5b Sasha Levin 2020-05-19 1665 fences, fence_size);
9cc562c3695b5b Sasha Levin 2020-05-19 1666 goto cleanup;
9cc562c3695b5b Sasha Levin 2020-05-19 1667 }
9cc562c3695b5b Sasha Levin 2020-05-19 1668 }
9cc562c3695b5b Sasha Levin 2020-05-19 1669
9cc562c3695b5b Sasha Levin 2020-05-19 1670 ret = dxgvmb_send_sync_msg_ntstatus(channel, command, cmd_size);
9cc562c3695b5b Sasha Levin 2020-05-19 1671
9cc562c3695b5b Sasha Levin 2020-05-19 1672 cleanup:
9cc562c3695b5b Sasha Levin 2020-05-19 1673 if (command)
9cc562c3695b5b Sasha Levin 2020-05-19 1674 dxgmem_free(process, DXGMEM_VMBUS, command);
9cc562c3695b5b Sasha Levin 2020-05-19 1675 TRACE_FUNC_EXIT_ERR(__func__, ret);
9cc562c3695b5b Sasha Levin 2020-05-19 1676 return ret;
9cc562c3695b5b Sasha Levin 2020-05-19 1677 }
9cc562c3695b5b Sasha Levin 2020-05-19 1678 :::::: The code at line 1632 was first introduced by commit :::::: 9cc562c3695b5b44c0c931c76bdc24e8c4f33587 gpu: dxgkrnl: core code
:::::: TO: Sasha Levin <[email protected]>
:::::: CC: 0day robot <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [RFC PATCH 2/4] gpu: dxgkrnl: hook up dxgkrnl
In reply to Sasha LevinHi Sasha,
url: https://github.com/0day-ci/linux/commits/Sasha-Levin/DirectX-on-Linux/20200520-004214 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 642b151f45dd54809ea00ecd3976a56c1ec9b53d config: i386-allyesconfig (attached as .config)
If you fix the issue, kindly add following tag as appropriate
New smatch warnings:drivers/gpu/dxgkrnl/dxgadapter.c:923 dxgallocation_destroy() error: we previously assumed 'alloc->owner.device' could be null (see line 919) drivers/gpu/dxgkrnl/dxgadapter.c:1246 dxgsyncobject_create() error: we previously assumed 'syncobj' could be null (see line 1205) drivers/gpu/dxgkrnl/dxgadapter.c:1248 dxgsyncobject_create() warn: variable dereferenced before check 'syncobj' (see line 1246) drivers/gpu/dxgkrnl/dxgvmbus.c:205 dxgvmbuschannel_receive() warn: inconsistent indenting drivers/gpu/dxgkrnl/dxgvmbus.c:240 dxgvmb_send_sync_msg() warn: inconsistent indenting drivers/gpu/dxgkrnl/dxgvmbus.c:2310 dxgvmb_send_create_hwqueue() error: we previously assumed 'command' could be null (see line 2234)
Old smatch warnings:drivers/gpu/dxgkrnl/dxgvmbus.c:246 dxgvmb_send_sync_msg() warn: inconsistent indenting
# https://github.com/0day-ci/linux/commit/09405fa255395b8e7fb7c8a886b18028b907487c
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 09405fa255395b8e7fb7c8a886b18028b907487c
vim +923 drivers/gpu/dxgkrnl/dxgadapter.c
9cc562c3695b5b Sasha Levin 2020-05-19 911 void dxgallocation_destroy(struct dxgallocation *alloc)
9cc562c3695b5b Sasha Levin 2020-05-19 912 {
9cc562c3695b5b Sasha Levin 2020-05-19 913 struct dxgprocess *process = alloc->process;
9cc562c3695b5b Sasha Levin 2020-05-19 914 struct d3dkmt_destroyallocation2 args = { };
9cc562c3695b5b Sasha Levin 2020-05-19 915
9cc562c3695b5b Sasha Levin 2020-05-19 916 dxgallocation_stop(alloc);
9cc562c3695b5b Sasha Levin 2020-05-19 917 if (alloc->resource_owner)
9cc562c3695b5b Sasha Levin 2020-05-19 918 dxgresource_remove_alloc(alloc->owner.resource, alloc);
9cc562c3695b5b Sasha Levin 2020-05-19 @919 else if (alloc->owner.device)
^^^^^^^^^^^^^^^^^^^Checked.
9cc562c3695b5b Sasha Levin 2020-05-19 920 dxgdevice_remove_alloc(alloc->owner.device, alloc);
^^^^^^^^^^^^^^^^^^^Freed here?
9cc562c3695b5b Sasha Levin 2020-05-19 921 dxgallocation_free_handle(alloc);
9cc562c3695b5b Sasha Levin 2020-05-19 922 if (alloc->alloc_handle && !alloc->resource_owner) {
9cc562c3695b5b Sasha Levin 2020-05-19 @923 args.device = alloc->owner.device->handle;
^^^^^^^^^^^^^^^^^^^Unchecked dereference.
9cc562c3695b5b Sasha Levin 2020-05-19 924 args.alloc_count = 1;
9cc562c3695b5b Sasha Levin 2020-05-19 925 args.flags.assume_not_in_use = 1;
9cc562c3695b5b Sasha Levin 2020-05-19 926 dxgvmb_send_destroy_allocation(process,
9cc562c3695b5b Sasha Levin 2020-05-19 927 alloc->owner.device,
9cc562c3695b5b Sasha Levin 2020-05-19 928 &alloc->owner.device->adapter->
9cc562c3695b5b Sasha Levin 2020-05-19 929 channel, &args,
9cc562c3695b5b Sasha Levin 2020-05-19 930 &alloc->alloc_handle);
9cc562c3695b5b Sasha Levin 2020-05-19 931 }
9cc562c3695b5b Sasha Levin 2020-05-19 932 if (alloc->gpadl) {
9cc562c3695b5b Sasha Levin 2020-05-19 933 TRACE_DEBUG(1, "Teardown gpadl %d", alloc->gpadl);
9cc562c3695b5b Sasha Levin 2020-05-19 934 vmbus_teardown_gpadl(dxgglobal_get_vmbus(), alloc->gpadl);
9cc562c3695b5b Sasha Levin 2020-05-19 935 TRACE_DEBUG(1, "Teardown gpadl end");
9cc562c3695b5b Sasha Levin 2020-05-19 936 alloc->gpadl = 0;
9cc562c3695b5b Sasha Levin 2020-05-19 937 }
9cc562c3695b5b Sasha Levin 2020-05-19 938 if (alloc->priv_drv_data)
9cc562c3695b5b Sasha Levin 2020-05-19 939 dxgmem_free(alloc->process, DXGMEM_ALLOCPRIVATE,
9cc562c3695b5b Sasha Levin 2020-05-19 940 alloc->priv_drv_data);
9cc562c3695b5b Sasha Levin 2020-05-19 941 if (alloc->cpu_address_mapped)
9cc562c3695b5b Sasha Levin 2020-05-19 942 pr_err("Alloc IO space is mapped: %p", alloc);
9cc562c3695b5b Sasha Levin 2020-05-19 943 dxgmem_free(alloc->process, DXGMEM_ALLOCATION, alloc);
9cc562c3695b5b Sasha Levin 2020-05-19 944 }---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
kbuild test robot
build botRe: [RFC PATCH 2/4] gpu: dxgkrnl: hook up dxgkrnl
In reply to Sasha Levin[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…
Hi Sasha,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v5.7-rc7 next-20200529]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Sasha-Levin/DirectX-on-Linux/20200520-004214 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 642b151f45dd54809ea00ecd3976a56c1ec9b53d config: i386-allmodconfig (attached as .config) compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/printk.h:326,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/gpu/dxgkrnl/dxgmodule.c:14:drivers/gpu/dxgkrnl/dxgmodule.c: In function 'dxgglobal_getiospace':drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=] 215 | #define pr_fmt2(fmt) "dxgk:err: " fmt
| ^~~~~~~~~~~~include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 | func(&id, ##__VA_ARGS__); | ^~~~~~~~~~~include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 | _dynamic_func_call(fmt,__dynamic_dev_dbg, | ^~~~~~~~~~~~~~~~~~include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
114 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
114 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg' 254 | dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) | ^~~~~~~ >> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2'
254 | dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
| ^~~~~~~drivers/gpu/dxgkrnl/dxgmodule.c:305:2: note: in expansion of macro 'TRACE_DEBUG' 305 | TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
| ^~~~~~~~~~~drivers/gpu/dxgkrnl/dxgmodule.c:305:47: note: format string is defined here 305 | TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
| ~~~^ | | | long long unsigned int | %x
In file included from include/linux/printk.h:326,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/gpu/dxgkrnl/dxgmodule.c:14:drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 7 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=] 215 | #define pr_fmt2(fmt) "dxgk:err: " fmt
| ^~~~~~~~~~~~include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 | func(&id, ##__VA_ARGS__); | ^~~~~~~~~~~include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 | _dynamic_func_call(fmt,__dynamic_dev_dbg, | ^~~~~~~~~~~~~~~~~~include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
114 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
114 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg' 254 | dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) | ^~~~~~~ >> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2'
254 | dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
| ^~~~~~~drivers/gpu/dxgkrnl/dxgmodule.c:305:2: note: in expansion of macro 'TRACE_DEBUG' 305 | TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
| ^~~~~~~~~~~drivers/gpu/dxgkrnl/dxgmodule.c:305:52: note: format string is defined here 305 | TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
| ~~~^ | | | long long unsigned int | %x
drivers/gpu/dxgkrnl/dxgmodule.c: At top level:drivers/gpu/dxgkrnl/dxgmodule.c:509:4: error: 'HV_GPUP_DXGK_VGPU_GUID' undeclared here (not in a function) 509 | { HV_GPUP_DXGK_VGPU_GUID },
| ^~~~~~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/dxgmodule.c:511:4: error: 'HV_GPUP_DXGK_GLOBAL_GUID' undeclared here (not in a function) 511 | { HV_GPUP_DXGK_GLOBAL_GUID },
| ^~~~~~~~~~~~~~~~~~~~~~~~
--drivers/gpu/dxgkrnl/dxgvmbus.c:108:6: warning: no previous prototype for 'signal_guest_event' [-Wmissing-prototypes] 108 | void signal_guest_event(struct dxgkvmb_command_host_to_vm *packet,
| ^~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:126:6: warning: no previous prototype for 'process_inband_packet' [-Wmissing-prototypes] 126 | void process_inband_packet(struct dxgvmbuschannel *channel,
| ^~~~~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:158:6: warning: no previous prototype for 'process_completion_packet' [-Wmissing-prototypes] 158 | void process_completion_packet(struct dxgvmbuschannel *channel,
| ^~~~~~~~~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:785:5: warning: no previous prototype for 'create_existing_sysmem' [-Wmissing-prototypes] 785 | int create_existing_sysmem(struct dxgdevice *device,
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/printk.h:326,
from include/linux/kernel.h:15,
from drivers/gpu/dxgkrnl/dxgvmbus.c:14:drivers/gpu/dxgkrnl/dxgvmbus.c: In function 'dxgvmb_send_create_allocation':
>> drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'unsigned int' [-Wformat=]
215 | #define pr_fmt2(fmt) "dxgk:err: " fmt
| ^~~~~~~~~~~~include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 | func(&id, ##__VA_ARGS__); | ^~~~~~~~~~~include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 | _dynamic_func_call(fmt,__dynamic_dev_dbg, | ^~~~~~~~~~~~~~~~~~include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg' 114 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt' 114 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg' 254 | dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) | ^~~~~~~ >> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2'
254 | dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
| ^~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:1139:2: note: in expansion of macro 'TRACE_DEBUG' 1139 | TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld", | ^~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:1139:57: note: format string is defined here 1139 | TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld",
| ~~^ | | | long int | %d
In file included from include/linux/printk.h:326,
from include/linux/kernel.h:15,
from drivers/gpu/dxgkrnl/dxgvmbus.c:14:drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%ld' expects argument of type 'long int', but argument 7 has type 'unsigned int' [-Wformat=] 215 | #define pr_fmt2(fmt) "dxgk:err: " fmt
| ^~~~~~~~~~~~include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 | func(&id, ##__VA_ARGS__); | ^~~~~~~~~~~include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 | _dynamic_func_call(fmt,__dynamic_dev_dbg, | ^~~~~~~~~~~~~~~~~~include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
114 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
114 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg' 254 | dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__) | ^~~~~~~ >> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2'
254 | dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
| ^~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:1139:2: note: in expansion of macro 'TRACE_DEBUG' 1139 | TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld", | ^~~~~~~~~~~drivers/gpu/dxgkrnl/dxgvmbus.c:1139:61: note: format string is defined here 1139 | TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld",
| ~~^ | | | long int | %d
drivers/gpu/dxgkrnl/dxgvmbus.c: In function 'dxgvmb_send_signal_sync_object':drivers/gpu/dxgkrnl/dxgvmbus.c:1632:31: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1632 | command->cpu_event_handle = (winhandle) cpu_event_handle;
| ^drivers/gpu/dxgkrnl/dxgvmbus.c: In function 'dxgvmb_send_lock2':drivers/gpu/dxgkrnl/dxgvmbus.c:1797:32: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1797 | args->data = dxg_map_iospace((uint64_t) result.
| ^
--
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from include/linux/eventfd.h:12,
from drivers/gpu/dxgkrnl/ioctl.c:14:drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_create_allocation':
>> include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=]
5 | #define KERN_SOH "001" /* ASCII Start Of Header */
| ^~~~~~include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH' 11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~include/linux/printk.h:299:9: note: in expansion of macro 'KERN_ERR' 299 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~drivers/gpu/dxgkrnl/ioctl.c:1265:4: note: in expansion of macro 'pr_err'
1265 | pr_err("private data size is too big: %d %d %ld",
| ^~~~~~drivers/gpu/dxgkrnl/ioctl.c:1265:50: note: format string is defined here
1265 | pr_err("private data size is too big: %d %d %ld",
| ~~^ | | | long int | %d
drivers/gpu/dxgkrnl/ioctl.c: At top level:drivers/gpu/dxgkrnl/ioctl.c:1568:5: warning: no previous prototype for 'validate_alloc' [-Wmissing-prototypes] 1568 | int validate_alloc(struct dxgallocation *alloc0,
| ^~~~~~~~~~~~~~drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_create_sync_object':drivers/gpu/dxgkrnl/ioctl.c:2493:7: warning: variable 'host_event_added' set but not used [-Wunused-but-set-variable] 2493 | bool host_event_added = false;
| ^~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_signal_sync_object':
>> drivers/gpu/dxgkrnl/ioctl.c:2973:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
2973 | NULL, (void *)host_event_id, 0);
| ^drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_signal_sync_object_gpu2':drivers/gpu/dxgkrnl/ioctl.c:3199:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
3199 | (void *)host_event_id, 0);
| ^drivers/gpu/dxgkrnl/ioctl.c: At top level:drivers/gpu/dxgkrnl/ioctl.c:4734:5: warning: no previous prototype for 'assign_resource_handles' [-Wmissing-prototypes] 4734 | int assign_resource_handles(struct dxgprocess *process,
| ^~~~~~~~~~~~~~~~~~~~~~~drivers/gpu/dxgkrnl/ioctl.c:4793:5: warning: no previous prototype for 'open_resource' [-Wmissing-prototypes] 4793 | int open_resource(struct dxgprocess *process,
| ^~~~~~~~~~~~~
vim +/dev_dbg +254 drivers/gpu/dxgkrnl/misc.h
9cc562c3695b5b Sasha Levin 2020-05-19 212
9cc562c3695b5b Sasha Levin 2020-05-19 213 #undef pr_fmt
9cc562c3695b5b Sasha Levin 2020-05-19 214 #define pr_fmt(fmt) "dxgk:err: " fmt
9cc562c3695b5b Sasha Levin 2020-05-19 @215 #define pr_fmt2(fmt) "dxgk:err: " fmt
9cc562c3695b5b Sasha Levin 2020-05-19 216
9cc562c3695b5b Sasha Levin 2020-05-19 217 #define DXGKDEBUG 1
9cc562c3695b5b Sasha Levin 2020-05-19 218 /* #define USEPRINTK 1 */
9cc562c3695b5b Sasha Levin 2020-05-19 219
9cc562c3695b5b Sasha Levin 2020-05-19 220 #ifndef DXGKDEBUG
9cc562c3695b5b Sasha Levin 2020-05-19 221 #define TRACE_DEBUG(...)
9cc562c3695b5b Sasha Levin 2020-05-19 222 #define TRACE_DEFINE(...)
9cc562c3695b5b Sasha Levin 2020-05-19 223 #define TRACE_FUNC_ENTER(...)
9cc562c3695b5b Sasha Levin 2020-05-19 224 #define TRACE_FUNC_EXIT(...)
9cc562c3695b5b Sasha Levin 2020-05-19 225 #else
9cc562c3695b5b Sasha Levin 2020-05-19 226 #ifdef USEPRINTK
9cc562c3695b5b Sasha Levin 2020-05-19 227 #define TRACE_DEBUG(level, fmt, ...)\
9cc562c3695b5b Sasha Levin 2020-05-19 228 printk(KERN_DEBUG pr_fmt2(fmt), ##__VA_ARGS__);
9cc562c3695b5b Sasha Levin 2020-05-19 229
9cc562c3695b5b Sasha Levin 2020-05-19 230 #define TRACE_DEBUG2(level, offset, fmt, ...) \
9cc562c3695b5b Sasha Levin 2020-05-19 231 do { \
9cc562c3695b5b Sasha Levin 2020-05-19 232 if (offset == 0) \
9cc562c3695b5b Sasha Levin 2020-05-19 233 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
9cc562c3695b5b Sasha Levin 2020-05-19 234 else \
9cc562c3695b5b Sasha Levin 2020-05-19 235 printk(KERN_DEBUG pr_fmt2(fmt), ##__VA_ARGS__); \
9cc562c3695b5b Sasha Levin 2020-05-19 236 } while (false)
9cc562c3695b5b Sasha Levin 2020-05-19 237
9cc562c3695b5b Sasha Levin 2020-05-19 238 #define TRACE_FUNC_ENTER(msg) \
9cc562c3695b5b Sasha Levin 2020-05-19 239 printk(KERN_DEBUG "dxgk: %s", msg)
9cc562c3695b5b Sasha Levin 2020-05-19 240 #define TRACE_FUNC_EXIT(msg, ret) \
9cc562c3695b5b Sasha Levin 2020-05-19 241 do { \
9cc562c3695b5b Sasha Levin 2020-05-19 242 if (!NT_SUCCESS(ret)) \
9cc562c3695b5b Sasha Levin 2020-05-19 243 dxg_pr_err("%s %x %d", msg, ret, ret); \
9cc562c3695b5b Sasha Levin 2020-05-19 244 else \
9cc562c3695b5b Sasha Levin 2020-05-19 245 printk(KERN_DEBUG "dxgk: %s end", msg); \
9cc562c3695b5b Sasha Levin 2020-05-19 246 } while (false)
9cc562c3695b5b Sasha Levin 2020-05-19 247 #define TRACE_FUNC_EXIT_ERR(msg, ret) \
9cc562c3695b5b Sasha Levin 2020-05-19 248 do { \
9cc562c3695b5b Sasha Levin 2020-05-19 249 if (!NT_SUCCESS(ret)) \
9cc562c3695b5b Sasha Levin 2020-05-19 250 dxg_pr_err("%s %x", msg, ret); \
9cc562c3695b5b Sasha Levin 2020-05-19 251 } while (false)
9cc562c3695b5b Sasha Levin 2020-05-19 252 #else
9cc562c3695b5b Sasha Levin 2020-05-19 253 #define TRACE_DEBUG(level, fmt, ...)\9cc562c3695b5b Sasha Levin 2020-05-19 @254 dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)9cc562c3695b5b Sasha Levin 2020-05-19 255
:::::: The code at line 254 was first introduced by commit :::::: 9cc562c3695b5b44c0c931c76bdc24e8c4f33587 gpu: dxgkrnl: core code
:::::: TO: Sasha Levin <[email protected]>
:::::: CC: 0day robot <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
RFC PATCH 3/4 Drivers: hv: vmbus: hook up dxgkrnl
In reply to Sasha LevinRegister a new device type with vmbus.
--- include/linux/hyperv.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
include/linux/hyperv.h +16 -0
@@ -1352,6 +1352,22 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size); .guid = GUID_INIT(0xda0a7802, 0xe377, 0x4aac, 0x8e, 0x77, \0x05 ,0x58 ,0xeb ,0x10 ,0x73 ,0xf8 ) +/* +* GPU paravirtualization global DXGK channel +* {DDE9CBC0-5060-4436-9448-EA1254A5D177} + */ +#define HV_GPUP_DXGK_GLOBAL_GUID \ + .guid = GUID_INIT(0xdde9cbc0, 0x5060, 0x4436, 0x94, 0x48, \ + 0xea, 0x12, 0x54, 0xa5, 0xd1, 0x77) + +/* +* GPU paravirtualization per virtual GPU DXGK channel +* {6E382D18-3336-4F4B-ACC4-2B7703D4DF4A} +*/ +#define HV_GPUP_DXGK_VGPU_GUID \ + .guid = GUID_INIT(0x6e382d18, 0x3336, 0x4f4b, 0xac, 0xc4, \ + 0x2b, 0x77, 0x3, 0xd4, 0xdf, 0x4a) +/* * Synthetic FC GUID * {2f9bcc4a-0069-4af3-b76b-6fd0be528cda}
Signature · 1 line
2.25.1
RFC PATCH 4/4 gpu: dxgkrnl: create a MAINTAINERS entry
In reply to Sasha Levin--- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
@@ -4997,6 +4997,13 @@ F: Documentation/filesystems/dnotify.txt F: fs/notify/dnotify/ F: include/linux/dnotify.h +DirectX GPU DRIVER +M: Sasha Levin <[email protected]> +M: Iouri Tarassov <[email protected]> +L: [email protected] +S: Supported +F: drivers/gpu/dxgcore/ + DISK GEOMETRY AND PARTITION HANDLING M: Andries Brouwer <[email protected]> S: Maintained
Signature · 1 line
2.25.1
Hi Sasha
So obviously great that Microsoft is trying to upstream all this, and very much welcome and all that.
But I guess there's a bunch of rather fundamental issues before we look into any kind of code details. And that might make this quite a hard sell for upstream to drivers/gpu subsystem:
- From the blog it sounds like the userspace is all closed. That includes the hw specific part and compiler chunks, all stuff we've generally expected to be able to look in the past for any kind of other driver. It's event documented here:
https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements
What's your plan here?
btw since the main goal here (at least at first) seems to be get compute and ML going the official work-around here is to relabel your driver as an accelerator driver (just sed -e s/vGPU/vaccel/ over the entire thing or so) and then Olof and Greg will take it into drivers/accel ...
- Next up (but that's not really a surprise for a fresh vendor driver) at a more technical level, this seems to reinvent the world, from device enumeration (why is this not exposed as /dev/dri/card0 so it better integrates with existing linux desktop stuff, in case that becomes a goal ever) down to reinvented kref_put_mutex (and please look at drm_device->struct_mutex for an example of how bad of a nightmare that locking pattern is and how many years it took us to untangle that one.
- Why DX12 on linux? Looking at this feels like classic divide and conquer (or well triple E from the 90s), we have vk, we have drm_syncobj, we have an entire ecosystem of winsys layers that work across vendors. Is the plan here that we get a dx12 driver for other hw mesa drivers from you guys, so this is all consistent and we have a nice linux platform? How does this integrate everywhere else with linux winsys standards, like dma-buf for passing stuff around, dma-fence/sync_file/drm_syncobj for syncing, drm_fourcc/modifiers for some idea how it all meshes together?
- There's been a pile of hallway track/private discussions about moving on from the buffer-based memory managed model to something more modern. That relates to your DXLOCK2 question, but there's a lot more to userspace managed gpu memory residency than just that. monitored fences are another part. Also, to avoid a platform split we need to figure out how to tie this back into the dma-buf and dma-fence (including various uapi flavours) or it'll be made of fail. dx12 has all that in some form, except 0 integration with the linux stuff we have (no surprise, since linux isn't windows). Finally if we go to the trouble of a completely revamped I think ioctls aren't a great idea, something like iouring (the gossip name is drm_uring) would be a lot better. Also for easier paravirt we'd need 0 cpu pointers in any such new interface. Adding a few people who've been involved in these discussions thus far, mostly under a drm/hmm.ko heading iirc.
I think the above are the really big ticket items around what's the plan here and are we solving even the right problem.
Cheers, Daniel
Quoted 198 lines · Sasha Levin
There is a blog post that goes into more detail about the bigger picture, and walks through all the required pieces to make this work. It is available here:
https://devblogs.microsoft.com/directx/directx-heart-linux . The rest of this cover letter will focus on the Linux Kernel bits.Overview
====This is the first draft of the Microsoft Virtual GPU (vGPU) driver. The driver exposes a paravirtualized GPU to user mode applications running in a virtual machine on a Windows host. This enables hardware acceleration in environment such as WSL (Windows Subsystem for Linux) where the Linux virtual machine is able to share the GPU with the Windows host.
The projection is accomplished by exposing the WDDM (Windows Display Driver Model) interface as a set of IOCTL. This allows APIs and user mode driver written against the WDDM GPU abstraction on Windows to be ported to run within a Linux environment. This enables the port of the D3D12 and DirectML APIs as well as their associated user mode driver to Linux. This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSL environment.
Only the rendering/compute aspect of the GPU are projected to the virtual machine, no display functionality is exposed. Further, at this time there are no presentation integration. So although the D3D12 API can be use to render graphics offscreen, there is no path (yet) for pixel to flow from the Linux environment back onto the Windows host desktop. This GPU stack is effectively side-by-side with the native Linux graphics stack.
The driver creates the
/dev/dxgdevice, which can be opened by user mode application and handles their ioctls. The IOCTL interface to the driver is defined indxgkmthk.h(Dxgkrnl Graphics Port Driver ioctl definitions). The interface matches the D3DKMT interface on Windows. Ioctls are implemented inioctl.c.When a VM starts, hyper-v on the host adds virtual GPU devices to the VM via the hyper-v driver. The host offers several VM bus channels to the
VM: the global channel and one channel per virtual GPU, assigned to the VM.The driver registers with the hyper-v driver (
hv_driver) for the arrival of VM bus channels.dxg_probe_devicerecognizes the vGPU channels and creates the corresponding objects (dxgadapter for vGPUs and dxgglobal for the global channel).The driver uses the hyper-V VM bus interface to communicate with the host.
dxgvmbus.cimplements the communication interface.The global channel has 8GB of IO space assigned by the host. This space is managed by the host and used to give the guest direct CPU access to some allocations. Video memory is allocated on the host except in the case of
existing_sysmemallocations. The Windows host allocates memory for the GPU on behalf of the guest. The Linux guest can access that memory by mapping GPU virtual address to allocations and then referencing those GPU virtual address from within GPU command buffers submitted to the GPU. For allocations which require CPU access, the allocation is mapped by the host into a location in the 8GB of IO space reserved in the guest for that purpose. The Windows host uses the nested CPU page table to ensure that this guest IO space always map to the correct location for the allocation as it may migrate between dedicated GPU memory (e.g. VRAM, firmware reserved DDR) and shared system memory (regular DDR) over its lifetime. The Linux guest maps a user mode CPU virtual address to an allocation IO space range for direct access by user mode APIs and drivers.Implementation of
LX_DXLOCK2ioctl
=================We would appreciate your feedback on the implementation of the
LX_DXLOCK2ioctl.This ioctl is used to get a CPU address to an allocation, which is resident in video/system memory on the host. The way it works:
1. The driver sends the Lock message to the host
2. The host allocates space in the VM IO space and maps it to the allocation memory
3. The host returns the address in IO space for the mapped allocation
4. The driver (in
dxg_map_iospace) allocates a user mode virtual address range usingvm_mmapand maps it to the IO space usingio_remap_ofn_range)5. The VA is returned to the application
Internal objects
========The following objects are created by the driver (defined in
dxgkrnl.h):- dxgadapter - represents a virtual GPU
- dxgprocess - tracks per process state (handle table of created objects, list of objects, etc.)
- dxgdevice - a container for other objects (contexts, paging queues, allocations, GPU synchronization objects)
- dxgcontext - represents thread of GPU execution for packet scheduling.
- dxghwqueue - represents thread of GPU execution of hardware scheduling
- dxgallocation - represents a GPU accessible allocation
- dxgsyncobject - represents a GPU synchronization object
- dxgresource - collection of dxgalloction objects
- dxgsharedresource, dxgsharedsyncobj - helper objects to share objects between different dxgdevice objects, which can belong to different
processesObject handles
=======All GPU objects, created by the driver, are accessible by a handle (
d3dkmt_handle). Each process has its own handle table, which is implemented inhmgr.c. For each API visible object, created by the driver, there is an object, created on the host. For example, the is a dxgprocess object on the host for each dxgprocess object in the VM, etc. The object handles have the same value in the host and the VM, which is done to avoid translation from the guest handles to the host handles.Signaling CPU events by the host
================The WDDM interface provides a way to signal CPU event objects when execution of a context reached certain point. The way it is implemented:
- application sends an
event_fdvia ioctl to the driver-
eventfd_ctx_getis used to get a pointer to the file object (eventfd_ctx)- the pointer to sent the host via a VM bus message
- when GPU execution reaches a certain point, the host sends a message to the VM with the event pointer
-
signal_guest_event()handles the messages and eventuallyeventfd_signal()is called.Sasha Levin (4):
gpu: dxgkrnl: core code
gpu: dxgkrnl: hook up dxgkrnl
Drivers: hv: vmbus: hook up dxgkrnl
gpu: dxgkrnl: create aMAINTAINERSentryMAINTAINERS | 7 + drivers/gpu/Makefile | 2 +- drivers/gpu/dxgkrnl/Kconfig | 10 + drivers/gpu/dxgkrnl/Makefile | 12 + drivers/gpu/dxgkrnl/d3dkmthk.h | 1635 +++++++++ drivers/gpu/dxgkrnl/dxgadapter.c | 1399 ++++++++ drivers/gpu/dxgkrnl/dxgkrnl.h | 913 ++++++ drivers/gpu/dxgkrnl/dxgmodule.c | 692 ++++ drivers/gpu/dxgkrnl/dxgprocess.c | 355 ++ drivers/gpu/dxgkrnl/dxgvmbus.c | 2955 +++++++++++++++++ drivers/gpu/dxgkrnl/dxgvmbus.h | 859 +++++ drivers/gpu/dxgkrnl/hmgr.c | 593 ++++ drivers/gpu/dxgkrnl/hmgr.h | 107 + drivers/gpu/dxgkrnl/ioctl.c | 5269 ++++++++++++++++++++++++++++++ drivers/gpu/dxgkrnl/misc.c | 280 ++ drivers/gpu/dxgkrnl/misc.h | 288 ++ drivers/video/Kconfig | 2 + include/linux/hyperv.h | 16 + 18 files changed, 15393 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/dxgkrnl/Kconfig create mode 100644 drivers/gpu/dxgkrnl/Makefile create mode 100644 drivers/gpu/dxgkrnl/d3dkmthk.h create mode 100644 drivers/gpu/dxgkrnl/dxgadapter.c create mode 100644 drivers/gpu/dxgkrnl/dxgkrnl.h create mode 100644 drivers/gpu/dxgkrnl/dxgmodule.c create mode 100644 drivers/gpu/dxgkrnl/dxgprocess.c create mode 100644 drivers/gpu/dxgkrnl/dxgvmbus.c create mode 100644 drivers/gpu/dxgkrnl/dxgvmbus.h create mode 100644 drivers/gpu/dxgkrnl/hmgr.c create mode 100644 drivers/gpu/dxgkrnl/hmgr.h create mode 100644 drivers/gpu/dxgkrnl/ioctl.c create mode 100644 drivers/gpu/dxgkrnl/misc.c create mode 100644 drivers/gpu/dxgkrnl/misc.h
Quoted 7 lines
--
2.25.1_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Hi Daniel,
Quoted 8 lines · Daniel Vetter
Hi Sasha
So obviously great that Microsoft is trying to upstream all this, and very much welcome and all that.
But I guess there's a bunch of rather fundamental issues before we look into any kind of code details. And that might make this quite a hard sell for upstream to
drivers/gpusubsystem:
Let me preface my answers by saying that speaking personally I very much dislike that the userspace is closed and wish I could do something about it.
Quoted 8 lines
- From the blog it sounds like the userspace is all closed. That includes the hw specific part and compiler chunks, all stuff we've generally expected to be able to look in the past for any kind of other driver. It's event documented here:
https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements
What's your plan here?
Let me answer with a (genuine) question: does this driver have anything to do with DRM even after we enable graphics on it? I'm still trying to figure it out.
There is an open source DX12 Galluim driver (that lives here:
https://gitlab.freedesktop.org/kusma/mesa/-/tree/msclc-d3d12) with open source compiler and so on.
The plan is for Microsoft to provide shims to allow the existing Linux userspace interact with DX12; I'll explain below why we had to pipe DX12 all the way into the Linux guest, but this is *not* to introduce DX12 into the Linux world as competition. There is no intent for anyone in the Linux world to start coding for the DX12 API.
This is why I'm not sure whether this touches DRM on the Linux side of things. Nothing is actually rendered on Linux but rather piped to Windows to be done there.
Quoted 5 lines
btw since the main goal here (at least at first) seems to be get compute and ML going the official work-around here is to relabel your driver as an accelerator driver (just sed -e s/vGPU/vaccel/ over the entire thing or so) and then Olof and Greg will take it into
drivers/accel...
This submission is not a case of "we want it upstream NOW" but rather "let's work together to figure out how to do it right" :)
I thought about placing this driver in drivers/hyper-v/ given that it's basically just a pipe between the host and the guest. There is no fancy logic in this drivers. Maybe the right place is indeed drivers/accel or drivers/hyper-v but I'd love if we agree on that rather than doing that as a workaround and 6 months down the road enabling graphics.
Quoted 8 lines
- Next up (but that's not really a surprise for a fresh vendor driver) at a more technical level, this seems to reinvent the world, from device enumeration (why is this not exposed as
/dev/dri/card0so it better integrates with existing linux desktop stuff, in case that becomes a goal ever) down to reinventedkref_put_mutex(and please look atdrm_device->struct_mutexfor an example of how bad of a nightmare that locking pattern is and how many years it took us to untangle that one.
I'd maybe note that neither of us here at Microsoft is an expert in the Linux DRM world. Stuff might have been done in a certain way because we didn't know better.
Quoted 1 line
- Why DX12 on linux? Looking at this feels like classic divide and
There is a single usecase for this: WSL2 developer who wants to run machine learning on his GPU. The developer is working on his laptop, which is running Windows and that laptop has a single GPU that Windows is using.
Since the GPU is being used by Windows, we can't assign it directly to the Linux guest, but instead we can use GPU Partitioning to give the guest access to the GPU. This means that the guest needs to be able to "speak" DX12, which is why we pulled DX12 into Linux.
Quoted 8 lines
conquer (or well triple E from the 90s), we have vk, we have
drm_syncobj, we have an entire ecosystem of winsys layers that work across vendors. Is the plan here that we get a dx12 driver for other hw mesa drivers from you guys, so this is all consistent and we have a nice linux platform? How does this integrate everywhere else with linux winsys standards, like dma-buf for passing stuff around, dma-fence/sync_file/drm_syncobj for syncing, drm_fourcc/modifiers for some idea how it all meshes together?
Let me point you to this blog post that has more information about the graphics side of things:
https://www.collabora.com/news-and-blog/news-and-events/introducing-opencl-and-opengl-on-directx.html
.
The intent is to wrap DX12 with shims to work with the existing ecosystem; DX12 isn't a new player on it's own and thus isn't trying to divide/conquer anything.
Quoted 15 lines
- There's been a pile of hallway track/private discussions about moving on from the buffer-based memory managed model to something more modern. That relates to your DXLOCK2 question, but there's a lot more to userspace managed gpu memory residency than just that. monitored fences are another part. Also, to avoid a platform split we need to figure out how to tie this back into the dma-buf and dma-fence (including various uapi flavours) or it'll be made of fail. dx12 has all that in some form, except 0 integration with the linux stuff we have (no surprise, since linux isn't windows). Finally if we go to the trouble of a completely revamped I think ioctls aren't a great idea, something like iouring (the gossip name is
drm_uring) would be a lot better. Also for easier paravirt we'd need 0 cpu pointers in any such new interface. Adding a few people who've been involved in these discussions thus far, mostly under adrm/hmm.koheading iirc.
Quoted 2 lines
I think the above are the really big ticket items around what's the plan here and are we solving even the right problem.
Part of the reason behind this implementation is simplicity. Again, no objections around moving to uring and doing other improvements.
Signature · 2 lines
Thanks, Sasha
Quoted 7 lines · Sasha Levin
Quoted 2 lines
- Why DX12 on linux? Looking at this feels like classic divide and
There is a single usecase for this: WSL2 developer who wants to run machine learning on his GPU. The developer is working on his laptop, which is running Windows and that laptop has a single GPU that Windows is using.
It does not feel right conceptually. If the target is a Windows API (DX12/ML), why bother with Linux environments? Make it a Windows executable, thereby skipping the WSL translation layer and passthrough.
Quoted 34 lines · Sasha Levin
Hi Daniel,
Quoted 8 lines · Daniel Vetter
Hi Sasha
So obviously great that Microsoft is trying to upstream all this, and very much welcome and all that.
But I guess there's a bunch of rather fundamental issues before we look into any kind of code details. And that might make this quite a hard sell for upstream to
drivers/gpusubsystem:Let me preface my answers by saying that speaking personally I very much dislike that the userspace is closed and wish I could do something about it.
Quoted 8 lines
- From the blog it sounds like the userspace is all closed. That includes the hw specific part and compiler chunks, all stuff we've generally expected to be able to look in the past for any kind of other driver. It's event documented here:
https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements
What's your plan here?
Let me answer with a (genuine) question: does this driver have anything to do with DRM even after we enable graphics on it? I'm still trying to figure it out.
There is an open source DX12 Galluim driver (that lives here:
https://gitlab.freedesktop.org/kusma/mesa/-/tree/msclc-d3d12) with open source compiler and so on.
Quoted 5 lines
The plan is for Microsoft to provide shims to allow the existing Linux userspace interact with DX12; I'll explain below why we had to pipe DX12 all the way into the Linux guest, but this is *not* to introduce DX12 into the Linux world as competition. There is no intent for anyone in the Linux world to start coding for the DX12 API.
If that really is the case why is microsoft recommending developers to break compatibility with native Linux and use the DX12 API's here:
https://devblogs.microsoft.com/directx/in-the-works-opencl-and-opengl-mapping-layers-to-directx/
Quote:
"Make it easier for developers to port their apps to D3D12. For developers looking to move from older OpenCL and OpenGL API versions to D3D12, the open source mapping layers will provide helpful example code on how to use the D3D12 Translation Layer library."
If developers of applications that use OpenCL and OpenGL API's were to follow this advice and transition to D3D12 their applications would no longer work on Linux systems unless using WSL2. Is Microsoft planning on creating a D3D12/DirectML frontend that doesn't depend on WSL2?
Quoted 54 lines
This is why I'm not sure whether this touches DRM on the Linux side of things. Nothing is actually rendered on Linux but rather piped to Windows to be done there.
Quoted 5 lines
btw since the main goal here (at least at first) seems to be get compute and ML going the official work-around here is to relabel your driver as an accelerator driver (just sed -e s/vGPU/vaccel/ over the entire thing or so) and then Olof and Greg will take it into
drivers/accel...This submission is not a case of "we want it upstream NOW" but rather "let's work together to figure out how to do it right" :)
I thought about placing this driver in
drivers/hyper-v/given that it's basically just a pipe between the host and the guest. There is no fancy logic in this drivers. Maybe the right place is indeeddrivers/accelordrivers/hyper-vbut I'd love if we agree on that rather than doing that as a workaround and 6 months down the road enabling graphics.Quoted 8 lines
- Next up (but that's not really a surprise for a fresh vendor driver) at a more technical level, this seems to reinvent the world, from device enumeration (why is this not exposed as
/dev/dri/card0so it better integrates with existing linux desktop stuff, in case that becomes a goal ever) down to reinventedkref_put_mutex(and please look atdrm_device->struct_mutexfor an example of how bad of a nightmare that locking pattern is and how many years it took us to untangle that one.I'd maybe note that neither of us here at Microsoft is an expert in the Linux DRM world. Stuff might have been done in a certain way because we didn't know better.
Quoted 1 line
- Why DX12 on linux? Looking at this feels like classic divide and
There is a single usecase for this: WSL2 developer who wants to run machine learning on his GPU. The developer is working on his laptop, which is running Windows and that laptop has a single GPU that Windows is using.
Since the GPU is being used by Windows, we can't assign it directly to the Linux guest, but instead we can use GPU Partitioning to give the guest access to the GPU. This means that the guest needs to be able to "speak" DX12, which is why we pulled DX12 into Linux.
Quoted 8 lines
conquer (or well triple E from the 90s), we have vk, we have
drm_syncobj, we have an entire ecosystem of winsys layers that work across vendors. Is the plan here that we get a dx12 driver for other hw mesa drivers from you guys, so this is all consistent and we have a nice linux platform? How does this integrate everywhere else with linux winsys standards, like dma-buf for passing stuff around, dma-fence/sync_file/drm_syncobj for syncing, drm_fourcc/modifiers for some idea how it all meshes together?
Quoted 8 lines
Let me point you to this blog post that has more information about the graphics side of things:
https://www.collabora.com/news-and-blog/news-and-events/introducing-opencl-and-opengl-on-directx.html
.The intent is to wrap DX12 with shims to work with the existing ecosystem; DX12 isn't a new player on it's own and thus isn't trying to divide/conquer anything.
Shouldn't tensorflow/machine learning be going through the opencl compatibility layer/shims instead of talking directly to DX12/DirectML?
If tensorflow or any other machine learning software uses DX12 API's directly then they won't be compatible with Linux unless running on top of WSL2.
Quoted 28 lines
Quoted 16 lines
- There's been a pile of hallway track/private discussions about moving on from the buffer-based memory managed model to something more modern. That relates to your DXLOCK2 question, but there's a lot more to userspace managed gpu memory residency than just that. monitored fences are another part. Also, to avoid a platform split we need to figure out how to tie this back into the dma-buf and dma-fence (including various uapi flavours) or it'll be made of fail. dx12 has all that in some form, except 0 integration with the linux stuff we have (no surprise, since linux isn't windows). Finally if we go to the trouble of a completely revamped I think ioctls aren't a great idea, something like iouring (the gossip name is
drm_uring) would be a lot better. Also for easier paravirt we'd need 0 cpu pointers in any such new interface. Adding a few people who've been involved in these discussions thus far, mostly under adrm/hmm.koheading iirc.Quoted 2 lines
I think the above are the really big ticket items around what's the plan here and are we solving even the right problem.
Part of the reason behind this implementation is simplicity. Again, no objections around moving to uring and doing other improvements.
--
Thanks,
Sasha
Dave Airlie
maintainerQuoted 25 lines · Sasha Levin
There is a blog post that goes into more detail about the bigger picture, and walks through all the required pieces to make this work. It is available here:
https://devblogs.microsoft.com/directx/directx-heart-linux . The rest of this cover letter will focus on the Linux Kernel bits.Overview
====This is the first draft of the Microsoft Virtual GPU (vGPU) driver. The driver exposes a paravirtualized GPU to user mode applications running in a virtual machine on a Windows host. This enables hardware acceleration in environment such as WSL (Windows Subsystem for Linux) where the Linux virtual machine is able to share the GPU with the Windows host.
The projection is accomplished by exposing the WDDM (Windows Display Driver Model) interface as a set of IOCTL. This allows APIs and user mode driver written against the WDDM GPU abstraction on Windows to be ported to run within a Linux environment. This enables the port of the D3D12 and DirectML APIs as well as their associated user mode driver to Linux. This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSL environment.
Quoted 7 lines
Only the rendering/compute aspect of the GPU are projected to the virtual machine, no display functionality is exposed. Further, at this time there are no presentation integration. So although the D3D12 API can be use to render graphics offscreen, there is no path (yet) for pixel to flow from the Linux environment back onto the Windows host desktop. This GPU stack is effectively side-by-side with the native Linux graphics stack.
Okay I've had some caffiene and absorbed some more of this.
This is a driver that connects a binary blob interface in the Windows kernel drivers to a binary blob that you run inside a Linux guest. It's a binary transport between two binary pieces. Personally this holds little of interest to me, I can see why it might be nice to have this upstream, but I don't forsee any other Linux distributor ever enabling it or having to ship it, it's purely a WSL2 pipe. I'm not saying I'd be happy to see this in the tree, since I don't see the value of maintaining it upstream, but it probably should just exists in a drivers/hyperv type area.
Having said that, I hit one stumbling block:
"Further, at this time there are no presentation integration. "
If we upstream this driver as-is into some hyperv specific place, and you decide to add presentation integration this is more than likely going to mean you will want to interact with dma-bufs and dma-fences. If the driver is hidden away in a hyperv place it's likely we won't even notice that feature landing until it's too late.
I would like to see a coherent plan for presentation support (not code, just an architectural diagram), because I think when you contemplate how that works it will change the picture of how this driver looks and intergrates into the rest of the Linux graphics ecosystem.
As-is I'd rather this didn't land under my purview, since I don't see the value this adds to the Linux ecosystem at all, and I think it's important when putting a burden on upstream that you provide some value.
Dave.
Quoted 37 lines · Dave Airlie
Quoted 25 lines · Sasha Levin
There is a blog post that goes into more detail about the bigger picture, and walks through all the required pieces to make this work. It is available here:
https://devblogs.microsoft.com/directx/directx-heart-linux . The rest of this cover letter will focus on the Linux Kernel bits.Overview
====This is the first draft of the Microsoft Virtual GPU (vGPU) driver. The driver exposes a paravirtualized GPU to user mode applications running in a virtual machine on a Windows host. This enables hardware acceleration in environment such as WSL (Windows Subsystem for Linux) where the Linux virtual machine is able to share the GPU with the Windows host.
The projection is accomplished by exposing the WDDM (Windows Display Driver Model) interface as a set of IOCTL. This allows APIs and user mode driver written against the WDDM GPU abstraction on Windows to be ported to run within a Linux environment. This enables the port of the D3D12 and DirectML APIs as well as their associated user mode driver to Linux. This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSL environment.
Quoted 7 lines
Only the rendering/compute aspect of the GPU are projected to the virtual machine, no display functionality is exposed. Further, at this time there are no presentation integration. So although the D3D12 API can be use to render graphics offscreen, there is no path (yet) for pixel to flow from the Linux environment back onto the Windows host desktop. This GPU stack is effectively side-by-side with the native Linux graphics stack.
Okay I've had some caffiene and absorbed some more of this.
Quoted 9 lines
This is a driver that connects a binary blob interface in the Windows kernel drivers to a binary blob that you run inside a Linux guest. It's a binary transport between two binary pieces. Personally this holds little of interest to me, I can see why it might be nice to have this upstream, but I don't forsee any other Linux distributor ever enabling it or having to ship it, it's purely a WSL2 pipe. I'm not saying I'd be happy to see this in the tree, since I don't see the value of maintaining it upstream, but it probably should just exists in a
drivers/hypervtype area.
Yup as-is (especially with the goal of this being aimed at ml/compute only) drivers/hyperv sounds a bunch more reasonable than drivers/gpu.
Quoted 8 lines
Having said that, I hit one stumbling block:
"Further, at this time there are no presentation integration. "If we upstream this driver as-is into some hyperv specific place, and you decide to add presentation integration this is more than likely going to mean you will want to interact with dma-bufs and dma-fences. If the driver is hidden away in a hyperv place it's likely we won't even notice that feature landing until it's too late.
I've recently added regex matches to MAINTAINERS so we'll see dma_buf/fence/anything show up on dri-devel. So that part is solved hopefully.
Quoted 5 lines
I would like to see a coherent plan for presentation support (not code, just an architectural diagram), because I think when you contemplate how that works it will change the picture of how this driver looks and intergrates into the rest of the Linux graphics ecosystem.
Yeah once we have the feature-creep to presentation support all the integration fun starts, with all the questions about "why does this not look like any other linux gpu driver". We have that already with nvidia insisting they just can't implement any of the upstream gpu uapi we have, but at least they're not in-tree, so not our problem from an upstream maintainership pov.
But once this dx12 pipe is landed and then we want to extend it it's still going to have all the "we can't ever release the sources to any of the parts we usually expect to be open for gpu drivers in upstream" problems. Then we're stuck at a rather awkward point of why one vendor gets an exception and all the others dont.
Quoted 4 lines
As-is I'd rather this didn't land under my purview, since I don't see the value this adds to the Linux ecosystem at all, and I think it's important when putting a burden on upstream that you provide some value.
Well there is some in the form of "more hw/platform support". But given that gpus evolved rather fast, including the entire integration ecosystem (it's by far not just the hw drivers that move quickly). So that value deprecates a lot faster than for other kernel subsystems. And all that's left is the pain of not breaking anything without actually being able to evolve the overall stack in any meaningful way. -Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
SGV5IGd1eXMsDQoNClRoYW5rcyBmb3IgdGhlIGRpc2N1c3Npb24uIEkgbWF5IG5vdCBiZSBhYmxl IHRvIGltbWVkaWF0ZWx5IGFuc3dlciBhbGwgb2YgeW91ciBxdWVzdGlvbnMsIGJ1dCBJJ2xsIGRv IG15IGJlc3Qg8J+Yii4NCg0KZHJpdmVycy9oeXBlcnYgc291bmRzIGxpa2UgaXQgY291bGQgYmUg YSBiZXR0ZXIgbG9jYXRpb24uIFdlIHdlcmVuJ3QgdG9vIHN1cmUgd2hlcmUgdG8gcHV0IHRoaXMs IHdlIHRob3VnaCAvZHJpdmVycy9ncHUgd291bGQgYmUgYXBwcm9wcmlhdGUgZ2l2ZW4gdGhpcyBk ZWFsIHdpdGggR1BVcywgYnV0IEkgZ2V0IHlvdXIgcG9pbnQuLi4gdGhpcyBpcyBhIHZHUFUgZHJp dmVyIHRoYXQgcmVhbGx5IG9ubHkgd29ya3Mgd2hlbiBiZWluZyBydW4gdW5kZXIgSHlwZXItViwg c28gZHJpdmVycy9oeXBlcnYgaXMgbGlrZWx5IG1vcmUgYXBwcm9wcmlhdGUuDQoNCkluIHRlcm0g b2YgcHJlc2VudGF0aW9uLCBJIG5lZWQgdG8gY2xhcmlmeSBhIGZldyB0aGluZ3MuIFdlIGFubm91 bmNlZCB0b2RheSB0aGF0IHd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MgZXZvbHZlZCByYXRoZXIgZmFzdCwgaW5jbHVkaW5nIHRoZSBlbnRpcmUgaW50ZWdyYXRpb24g ZWNvc3lzdGVtIChpdCdzIGJ5IGZhciBub3QganVzdCB0aGUgaHcgZHJpdmVycyB0aGF0IG1vdmUg cXVpY2tseSkuIFNvIHRoYXQgdmFsdWUgZGVwcmVjYXRlcyBhIGxvdCBmYXN0ZXIgdGhhbiBmb3Ig b3RoZXIga2VybmVsIHN1YnN5c3RlbXMuDQpBbmQgYWxsIHRoYXQncyBsZWZ0IGlzIHRoZSBwYWlu IG9mIG5vdCBicmVha2luZyBhbnl0aGluZyB3aXRob3V0IGFjdHVhbGx5IGJlaW5nIGFibGUgdG8g ZXZvbHZlIHRoZSBvdmVyYWxsIHN0YWNrIGluIGFueSBtZWFuaW5nZnVsIHdheS4NCi1EYW5pZWwN Ci0tDQpEYW5pZWwgVmV0dGVyDQpTb2Z0d2FyZSBFbmdpbmVlciwgSW50ZWwgQ29ycG9yYXRpb24N Cis0MSAoMCkgNzkgMzY1IDU3IDQ4IC0gDQoraHR0cHM6Ly9uYW0wNi5zYWZlbGlua3MucHJvdGVj dGlvbi5vdXRsb29rLmNvbS8/dXJsPWh0dHAlM0ElMkYlMkZibG9nLmYNCitmd2xsLmNoJTJGJmFt cDtkYXRhPTAyJTdDMDElN0NzcHJvbm92byU0MG1pY3Jvc29mdC5jb20lN0MzZjE4ZTQ2MTkyYjI0 Yw0KK2NjZjZhMDA4ZDdmYzQ4OTA2MyU3QzcyZjk4OGJmODZmMTQxYWY5MWFiMmQ3Y2QwMTFkYjQ3 JTdDMSU3QzAlN0M2MzcyNTUyDQorNjA5MTA3MzUyMzAmYW1wO3NkYXRhPWhBSVYxd0oyOVdGOUlY VHZKbTNkcjRTdEN3UHpGMEdkTzJpV1B5Zm5FbGclM0QmYW0NCitwO3Jlc2VydmVkPTANCg=
Hi Steve,
Sounds all good, some more comments and details below.
Quoted 11 lines · Steve Pronovost
Hey guys,
Thanks for the discussion. I may not be able to immediately answer all of your questions, but I'll do my best 😊.
drivers/hypervsounds like it could be a better location. We weren't too sure where to put this, we though /drivers/gpu would be appropriate given this deal with GPUs, but I get your point... this is a vGPU driver that really only works when being run under Hyper-V, sodrivers/hypervis likely more appropriate.
I think "it's a virtual gpu" is the wrong sales pitch, as is "only runs on $platform". We have lots of drm drivers in drivers/gpu that fit that bill. The better pitch I think is "it's a not a gpu, it's a dx12 protocol pipe" and "we actually do not want to integrate with the linux gpu ecosystem and primitives, we want to integrate with dx12 ecosystem and primitives to make the seamless rdp/rail/vail stuff work nicely". Below some more thoughts on the technical said.
Quoted 29 lines
In term of presentation, I need to clarify a few things. We announced today that we're also adding support for Linux GUI applications. The way this will work is roughly as follow. We're writing a Wayland compositor that will essentially bridge over RDP-RAIL (RAIL=Remote Application Integrated Locally). We're starting from a Weston base. Weston already has an RDP Backend, but that's for a full desktop remoting scheme. Weston draws a desktop and remote it over RDP... and then you can peek at that desktop using an rdp client on the Windows side. RAIL works differently. In that case our wayland compositor no longer paint a desktop... instead it simply forward individual visual /
wl_surfaceover the RDP RAIL channel such that these visual can be displayed on the Windows desktop. The RDP client create proxy window for each of these top level visual and their content is filled with the data coming over the RDP channel. All pixels are owned by the RDP server/WSL... so these windows looks different than native window are they are painted and themed by WSL. The proxy window on the host gather input and inject back over RDP... This is essentially how application remoting works on windows and this is all publicly documented as part of the various RDP protocol specification. As a matter of fact, for the RDP server on the Weston side we are looking at continue to leverage FreeRDP (and provide fixes/enhancement as needed to the public project). Further, we're looking at further improvement down this path to avoid having to copy the content over the RAIL channel and instead just share/swap buffer between the guest and the host. We have extension to the RDP protocol, called VAIL (Virtualized Application Integrated Locally) which does that today. Today this is only use in Windows on Windows for very specific scenario. We're looking at extending the public RDP protocol with these VAIL extension to make this an official Microsoft supported protocol which would allow us to target this in WSL. We have finished designing this part in details. Our
Quoted 9 lines
goal would be to leverage something along the line of
wl_drm, dma-buf, dma-fence, etc... This compositor and all our contribution to FreeRDP will be fully open source, including our design doc. We're not quite sure yet whether this will be offered as a separate project entirely distinct from it's Weston root... or if we'll propose an extension to Weston to operate in this mode. We would like to build it such that in theory any Wayland compositor could add support for this mode of operation if they want to remote application to a Windows host (over the network, or on the same box).
Sounds like a solid plan for presentation. I think this is all up to wayland/weston folks to figure out with you, from the kernel side I have only one concern (and I discussed that with a few folks already on irc, I think they're at least on this thread involved within microsoft too in some form): If we do integrate with linux concepts like wl_drm/dma-buf/fence and so on then we end up with a normal gpu driver, with with lots of blobby components all around that can't be opened (since large chunks written by hw vendors, so nothing microsoft can do about them). That's the awkward exception (why microsoft but not other gpu hw vendors/plaforms/whatever?) that we need to avoid.
But wayland doesn't really need dma-buf and the wl_drm protocols afaiui, as long as the egl extensions work you can have whatever private wayland protocol in your winsys code you want to shovel the buffers and syncobj from client to the wayland-rdp-rail compositor. If that uses dx12 native handles for these things we side-step the awkward exception question for linux gpu stack since it all stays 100% contained in drivers/hv. Just try to avoid the nvidia fail of insisting that you need your own set of egl extensions (egl_streams and egl_drm_kms_reinvented_but_badly and a few others iirc) for everything, that makes it very painful for all the compositor projects since they need duplicated code for no good reason :-)
Also looking at the fun the virtio folks have right now trying to get virgl dma-buf handles in the guest shared with other virtio devices or virgl instance in some other guest and getting it working ... If you avoid the dma-buf integration that might also sidestep a lot of technical headaches and be the simpler solution. At least as long as we're talking about wsl2 only.
Quoted 4 lines
We see
/dev/dxgreally as a projection of the GPU when running in WSL such that the GPU can be shared between WSL and the host... not something that would coexist "at the same time" with a real DRM GPU.
Quoted 12 lines
We have consider the possibility of bringing DX to Linux with no Windows cord attached. I'm not ready to discuss this at this time 😊... but in the hypothetical that we were do this, DX would be running on top of DRI/DRM on native Linux. We likely would be contributing some changes to DRM to address area of divergence and get better mapping for our user mode driver, but we wouldn't try to shoehorn
/dev/dxginto the picture. In that hypothetical world, we would essentially have DX target DRM on native Linux and DX continue to target DXG in WSL to share the GPU with the host. I think this further reinforce the point you guys were making that the right place for our current dxgkrnl driver to live in would be /drivers/hyperv/dxgkrnl. In insight, I totally agree 😊.
We had a pile of discussions on irc about some of the ideas floating around for extending drm with some of the newer memory/sync concepts. So very much interested, but that's indeed a different fish and most likely will look a lot different to the dxgkrnl interface, while ofc still aiming to give the same power to apps. At least that's the goal, but aside from some prototype in some place this really doesn't exist yet anywhere.
Quoted 2 lines
I think this cover all questions, let me know if I missed anything.
I think it's all good.
Cheers, Daniel
Quoted 130 lines
Thanks,
Steve-----Original Message-----
From: Daniel Vetter <[email protected]>
Sent: Tuesday, May 19, 2020 4:01 PM
To: Dave Airlie <[email protected]>
Cc: Sasha Levin <[email protected]>; [email protected]; Stephen Hemminger <[email protected]>; Ursulin, Tvrtko < [email protected]>; Greg Kroah-Hartman <[email protected]>; Haiyang Zhang <[email protected]>; LKML <[email protected]>; dri-devel <[email protected]>; Chris Wilson < [email protected]>; Steve Pronovost <[email protected]>; Linux Fbdev development list <[email protected]>; Iouri Tarassov <[email protected]>; Deucher, Alexander < [email protected]>; KY Srinivasan <[email protected]>; Wei Liu < [email protected]>; Hawking Zhang <[email protected]>
Subject: [EXTERNAL] Re: [RFC PATCH 0/4] DirectX on LinuxQuoted 8 lines · Dave Airlie
Quoted 6 lines · Sasha Levin
There is a blog post that goes into more detail about the bigger picture, and walks through all the required pieces to make this work. It is available here:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fde
vblogs.microsoft.com%2Fdirectx%2Fdirectx-heart-linux&data=02%7C01%7Cspronovo% 40microsoft.com%7C3f18e46192b24cccf6a008d7fc489063%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637255260910730243&sdata=IRRknzg%2F6Myzj3JXESN7GgmN6AcUV3DxhL95P%2ButtCw%3D&reserved=0 . The rest of this cover letter will focus on the Linux Kernel bits.
Quoted 11 lines
Quoted 11 lines
Overview
========This is the first draft of the Microsoft Virtual GPU (vGPU) driver. The driver exposes a paravirtualized GPU to user mode applications running in a virtual machine on a Windows host. This enables hardware acceleration in environment such as WSL (Windows Subsystem for Linux) where the Linux virtual machine is able to share the GPU with the Windows host.
Quoted 8 lines
Quoted 8 lines
The projection is accomplished by exposing the WDDM (Windows Display Driver Model) interface as a set of IOCTL. This allows APIs and user mode driver written against the WDDM GPU abstraction on Windows to be ported to run within a Linux environment. This enables the port of the
D3D12 and DirectML APIs as well as their associated user mode driver to Linux. This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSLenvironment.
Quoted 11 lines
Quoted 8 lines
Only the rendering/compute aspect of the GPU are projected to the virtual machine, no display functionality is exposed. Further, at this time there are no presentation integration. So although the D3D12 API can be use to render graphics offscreen, there is no path (yet) for pixel to flow from the Linux environment back onto the Windows host desktop. This GPU stack is effectively side-by-side with the native Linux graphics stack.
Okay I've had some caffiene and absorbed some more of this.
Quoted 9 lines
This is a driver that connects a binary blob interface in the Windows kernel drivers to a binary blob that you run inside a Linux guest. It's a binary transport between two binary pieces. Personally this holds little of interest to me, I can see why it might be nice to have this upstream, but I don't forsee any other Linux distributor ever enabling it or having to ship it, it's purely a WSL2 pipe. I'm not saying I'd be happy to see this in the tree, since I don't see the value of maintaining it upstream, but it probably should just exists in a
drivers/hypervtype area.Yup as-is (especially with the goal of this being aimed at ml/compute only)
drivers/hypervsounds a bunch more reasonable thandrivers/gpu.Quoted 8 lines
Having said that, I hit one stumbling block:
"Further, at this time there are no presentation integration. "If we upstream this driver as-is into some hyperv specific place, and you decide to add presentation integration this is more than likely going to mean you will want to interact with dma-bufs and dma-fences. If the driver is hidden away in a hyperv place it's likely we won't even notice that feature landing until it's too late.
I've recently added regex matches to
MAINTAINERSso we'll see dma_buf/fence/anything show up on dri-devel. So that part is solved hopefully.Quoted 5 lines
I would like to see a coherent plan for presentation support (not code, just an architectural diagram), because I think when you contemplate how that works it will change the picture of how this driver looks and intergrates into the rest of the Linux graphics ecosystem.
Yeah once we have the feature-creep to presentation support all the integration fun starts, with all the questions about "why does this not look like any other linux gpu driver". We have that already with nvidia insisting they just can't implement any of the upstream gpu uapi we have, but at least they're not in-tree, so not our problem from an upstream maintainership pov.
But once this dx12 pipe is landed and then we want to extend it it's still going to have all the "we can't ever release the sources to any of the parts we usually expect to be open for gpu drivers in upstream" problems. Then we're stuck at a rather awkward point of why one vendor gets an exception and all the others dont.
Quoted 4 lines
As-is I'd rather this didn't land under my purview, since I don't see the value this adds to the Linux ecosystem at all, and I think it's important when putting a burden on upstream that you provide some value.
Well there is some in the form of "more hw/platform support". But given that gpus evolved rather fast, including the entire integration ecosystem (it's by far not just the hw drivers that move quickly). So that value deprecates a lot faster than for other kernel subsystems.
And all that's left is the pain of not breaking anything without actually being able to evolve the overall stack in any meaningful way. -Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 -(quoted diff) +3
-0+https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.f +fwll.ch%2F&data=02%7C01%7Cspronovo%40microsoft.com%7C3f18e46192b24c +ccf6a008d7fc489063%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372552<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.f+fwll.ch%2F&data=02%7C01%7Cspronovo%40microsoft.com%7C3f18e46192b24c+ccf6a008d7fc489063%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372552>
+60910735230&sdata=hAIV1wJ29WF9IXTvJm3dr4StCwPzF0GdO2iWPyfnElg%3D&am +p;reserved=0
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thanks Daniel, more below.
From: Daniel Vetter <[email protected]>
Sent: Wednesday, May 20, 2020 12:41 AM
To: Steve Pronovost <[email protected]>
Cc: Dave Airlie <[email protected]>; Sasha Levin <[email protected]>; [email protected]; Stephen Hemminger <[email protected]>; Ursulin, Tvrtko <[email protected]>; Greg Kroah-Hartman <[email protected]>; Haiyang Zhang <[email protected]>; LKML <[email protected]>; dri-devel <[email protected]>; Chris Wilson <[email protected]>; Linux Fbdev development list <[email protected]>; Iouri Tarassov <[email protected]>; Deucher, Alexander <[email protected]>; KY Srinivasan <[email protected]>; Wei Liu <[email protected]>; Hawking Zhang <[email protected]>
Subject: Re: [EXTERNAL] Re: [RFC PATCH 0/4] DirectX on Linux
Hi Steve,
Sounds all good, some more comments and details below.
On Wed, May 20, 2020 at 5:47 AM Steve Pronovost <[email protected]<mailto:[email protected]>> wrote:
Hey guys,
Thanks for the discussion. I may not be able to immediately answer all of your questions, but I'll do my best 😊.
drivers/hyperv sounds like it could be a better location. We weren't too sure where to put this, we though /drivers/gpu would be appropriate given this deal with GPUs, but I get your point... this is a vGPU driver that really only works when being run under Hyper-V, so drivers/hyperv is likely more appropriate.
I think "it's a virtual gpu" is the wrong sales pitch, as is "only runs on $platform". We have lots of drm drivers in drivers/gpu that fit that bill. The better pitch I think is "it's a not a gpu, it's a dx12 protocol pipe" and "we actually do not want to integrate with the linux gpu ecosystem and primitives, we want to integrate with dx12 ecosystem and primitives to make the seamless rdp/rail/vail stuff work nicely". Below some more thoughts on the technical said.
[spronovo] Agreed. As I mentioned in another reply, that protocol isn’t tied to DX… but the point you are making is still valid. This is really a projection of the Windows native abstraction of a GPU that windows user mode driver (dx, gl, cl, vulkan, cuda, etc…) are familiar with and use to communicate with the GPU… This effectively enable porting of these user mode driver to Linux inside of WSL and allow them to share the GPU with the host. Our goal is to offer CL/EGL/GLX/CUDA/… API support for applications running inside of WSL and integrate their output on the Windows desktop through the Wayland compositor we are building. The fact that we are using layer to implement some of these APIs (to reduce our partners work among other thing) is just an implementation details that most application shouldn’t have to worry about… “it just works” 😊. From that perspective we’re fine moving the driver under a different node than /driver/gpu 😊.
In term of presentation, I need to clarify a few things. We announced today that we're also adding support for Linux GUI applications. The way this will work is roughly as follow. We're writing a Wayland compositor that will essentially bridge over RDP-RAIL (RAIL=Remote Application Integrated Locally). We're starting from a Weston base. Weston already has an RDP Backend, but that's for a full desktop remoting scheme. Weston draws a desktop and remote it over RDP... and then you can peek at that desktop using an rdp client on the Windows side. RAIL works differently. In that case our wayland compositor no longer paint a desktop... instead it simply forward individual visual / wl_surface over the RDP RAIL channel such that these visual can be displayed on the Windows desktop. The RDP client create proxy window for each of these top level visual and their content is filled with the data coming over the RDP channel. All pixels are owned by the RDP server/WSL... so these windows looks different than native window are they are painted and themed by WSL. The proxy window on the host gather input and inject back over RDP... This is essentially how application remoting works on windows and this is all publicly documented as part of the various RDP protocol specification. As a matter of fact, for the RDP server on the Weston side we are looking at continue to leverage FreeRDP (and provide fixes/enhancement as needed to the public project). Further, we're looking at further improvement down this path to avoid having to copy the content over the RAIL channel and instead just share/swap buffer between the guest and the host. We have extension to the RDP protocol, called VAIL (Virtualized Application Integrated Locally) which does that today. Today this is only use in Windows on Windows for very specific scenario. We're looking at extending the public RDP protocol with these VAIL extension to make this an official Microsoft supported protocol which would allow us to target this in WSL. We have finished designing this part in details. Our goal would be to leverage something along the line of wl_drm, dma-buf, dma-fence, etc... This compositor and all our contribution to FreeRDP will be fully open source, including our design doc. We're not quite sure yet whether this will be offered as a separate project entirely distinct from it's Weston root... or if we'll propose an extension to Weston to operate in this mode. We would like to build it such that in theory any Wayland compositor could add support for this mode of operation if they want to remote application to a Windows host (over the network, or on the same box).
Sounds like a solid plan for presentation. I think this is all up to wayland/weston folks to figure out with you, from the kernel side I have only one concern (and I discussed that with a few folks already on irc, I think they're at least on this thread involved within microsoft too in some form): If we do integrate with linux concepts like wl_drm/dma-buf/fence and so on then we end up with a normal gpu driver, with with lots of blobby components all around that can't be opened (since large chunks written by hw vendors, so nothing microsoft can do about them). That's the awkward exception (why microsoft but not other gpu hw vendors/plaforms/whatever?) that we need to avoid.
But wayland doesn't really need dma-buf and the wl_drm protocols afaiui, as long as the egl extensions work you can have whatever private wayland protocol in your winsys code you want to shovel the buffers and syncobj from client to the wayland-rdp-rail compositor. If that uses dx12 native handles for these things we side-step the awkward exception question for linux gpu stack since it all stays 100% contained in drivers/hv. Just try to avoid the nvidia fail of insisting that you need your own set of egl extensions (egl_streams and egl_drm_kms_reinvented_but_badly and a few others iirc) for everything, that makes it very painful for all the compositor projects since they need duplicated code for no good reason :-)
[spronovo] Agreed. I haven’t fully dig into the details for the VAIL enhancement to our Wayland compositor that enables buffer sharing/swapping. This is something we do on window and are quite familiar with the mechanic/concept around this… but new to doing this under Wayland. I’m sharing early thinking so apology if I get some stuff wrong 😊… I fundamentally agree with the spirit of what you are saying. Fundamentally our goal here is that we want to avoid having Wayland client do anything non-standard to interop with our projected graphics stack. We want Wayland client to work unmodified. It’s not entirely clear to me at the moment whether this buffer handshake is entirely hidden inside of Mesa (where we could do whatever we want as you say, and just reuse what we already have) or visible to some Wayland client, in which case we would want to ensure we present a public interface that is compatible. I gather from your suggestion that it is the former. In a nutshell we want to be as standard as possible so things just work and avoid having to chase a never ending set of app compat problem 😊.
Also looking at the fun the virtio folks have right now trying to get virgl dma-buf handles in the guest shared with other virtio devices or virgl instance in some other guest and getting it working ... If you avoid the dma-buf integration that might also sidestep a lot of technical headaches and be the simpler solution. At least as long as we're talking about wsl2 only.
[spronovo] Yeah, will definitely look into this.
We see /dev/dxg really as a projection of the GPU when running in WSL such that the GPU can be shared between WSL and the host... not something that would coexist "at the same time" with a real DRM GPU.
We have consider the possibility of bringing DX to Linux with no Windows cord attached. I'm not ready to discuss this at this time 😊... but in the hypothetical that we were do this, DX would be running on top of DRI/DRM on native Linux. We likely would be contributing some changes to DRM to address area of divergence and get better mapping for our user mode driver, but we wouldn't try to shoehorn /dev/dxg into the picture. In that hypothetical world, we would essentially have DX target DRM on native Linux and DX continue to target DXG in WSL to share the GPU with the host. I think this further reinforce the point you guys were making that the right place for our current dxgkrnl driver to live in would be /drivers/hyperv/dxgkrnl. In insight, I totally agree 😊.
We had a pile of discussions on irc about some of the ideas floating around for extending drm with some of the newer memory/sync concepts. So very much interested, but that's indeed a different fish and most likely will look a lot different to the dxgkrnl interface, while ofc still aiming to give the same power to apps. At least that's the goal, but aside from some prototype in some place this really doesn't exist yet anywhere.
[spronovo] There are indeed some very interesting and hard challenges if we wanted to do this 😊. But yeah, this would be totally separate from the dxgkrnl interface. Dxgkrnl is really meant for WSL (or Linux in a Windows hosted VM)... which we should have made clearer and avoid some of the confusion.
I think this cover all questions, let me know if I missed anything.
I think it's all good.
Cheers, Daniel
Thanks,
Steve
-----Original Message-----
From: Daniel Vetter <[email protected]<mailto:[email protected]>>
Sent: Tuesday, May 19, 2020 4:01 PM
To: Dave Airlie <[email protected]<mailto:[email protected]>>
Cc: Sasha Levin <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]>; Stephen Hemminger <[email protected]<mailto:[email protected]>>; Ursulin, Tvrtko <[email protected]<mailto:[email protected]>>; Greg Kroah-Hartman <[email protected]<mailto:[email protected]>>; Haiyang Zhang <[email protected]<mailto:[email protected]>>; LKML <[email protected]<mailto:[email protected]>>; dri-devel <[email protected]<mailto:[email protected]>>; Chris Wilson <[email protected]<mailto:[email protected]>>; Steve Pronovost <[email protected]<mailto:[email protected]>>; Linux Fbdev development list <[email protected]<mailto:[email protected]>>; Iouri Tarassov <[email protected]<mailto:[email protected]>>; Deucher, Alexander <[email protected]<mailto:[email protected]>>; KY Srinivasan <[email protected]<mailto:[email protected]>>; Wei Liu <[email protected]<mailto:[email protected]>>; Hawking Zhang <[email protected]<mailto:[email protected]>>
Subject: [EXTERNAL] Re: [RFC PATCH 0/4] DirectX on Linux
Quoted 38 lines · On Wed, May 20, 2020 at 12:42 AM Dave Airlie…
Quoted 26 lines · On Wed, 20 May 2020 at 02:33, Sasha Levin…
There is a blog post that goes into more detail about the bigger
picture, and walks through all the required pieces to make this
work. It is available here:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fde
vblogs.microsoft.com<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvblogs.microsoft.com%2F&data=02%7C01%7Cspronovo%40microsoft.com%7C5e9c6fb0890844aef87c08d7fc91265e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637255572659005449&sdata=gVJvYw%2BRkrdugZw5LzWbYXzoAoT2KhVjRZLs%2Ft%2BG3aY%3D&reserved=0>%2Fdirectx%2Fdirectx-heart-linux&data=02%7C01%7Cspronovo%40microsoft.com<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2F40microsoft.com%2F&data=02%7C01%7Cspronovo%40microsoft.com%7C5e9c6fb0890844aef87c08d7fc91265e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637255572659015442&sdata=0TfOBiUpDLctMq7EZmK7N3xdPFeqauzsXJPODRCErXU%3D&reserved=0>%7C3f18e46192b24cccf6a008d7fc489063%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637255260910730243&sdata=IRRknzg%2F6Myzj3JXESN7GgmN6AcUV3DxhL95P%2ButtCw%3D&reserved=0 . The rest of this cover letter will focus on the Linux Kernel bits.Overview
========This is the first draft of the Microsoft Virtual GPU (vGPU) driver. The driver exposes a paravirtualized GPU to user mode applications running in a virtual machine on a Windows host. This enables hardware acceleration in environment such as WSL (Windows Subsystem for Linux) where the Linux virtual machine is able to share the GPU with the Windows host.
The projection is accomplished by exposing the WDDM (Windows Display Driver Model) interface as a set of IOCTL. This allows APIs and user mode driver written against the WDDM GPU abstraction on Windows to be ported to run within a Linux environment. This enables the port of the
D3D12 and DirectML APIs as well as their associated user mode driver to Linux. This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSL environment.Quoted 7 lines
Only the rendering/compute aspect of the GPU are projected to the virtual machine, no display functionality is exposed. Further, at this time there are no presentation integration. So although the D3D12 API can be use to render graphics offscreen, there is no path (yet) for pixel to flow from the Linux environment back onto the Windows host desktop. This GPU stack is effectively side-by-side with the native Linux graphics stack.
Okay I've had some caffiene and absorbed some more of this.
Quoted 9 lines
This is a driver that connects a binary blob interface in the Windows kernel drivers to a binary blob that you run inside a Linux guest. It's a binary transport between two binary pieces. Personally this holds little of interest to me, I can see why it might be nice to have this upstream, but I don't forsee any other Linux distributor ever enabling it or having to ship it, it's purely a WSL2 pipe. I'm not saying I'd be happy to see this in the tree, since I don't see the value of maintaining it upstream, but it probably should just exists in a
drivers/hypervtype area.
Yup as-is (especially with the goal of this being aimed at ml/compute only) drivers/hyperv sounds a bunch more reasonable than drivers/gpu.
Quoted 8 lines
Having said that, I hit one stumbling block:
"Further, at this time there are no presentation integration. "If we upstream this driver as-is into some hyperv specific place, and you decide to add presentation integration this is more than likely going to mean you will want to interact with dma-bufs and dma-fences. If the driver is hidden away in a hyperv place it's likely we won't even notice that feature landing until it's too late.
I've recently added regex matches to MAINTAINERS so we'll see dma_buf/fence/anything show up on dri-devel. So that part is solved hopefully.
Quoted 5 lines
I would like to see a coherent plan for presentation support (not code, just an architectural diagram), because I think when you contemplate how that works it will change the picture of how this driver looks and intergrates into the rest of the Linux graphics ecosystem.
Yeah once we have the feature-creep to presentation support all the integration fun starts, with all the questions about "why does this not look like any other linux gpu driver". We have that already with nvidia insisting they just can't implement any of the upstream gpu uapi we have, but at least they're not in-tree, so not our problem from an upstream maintainership pov.
But once this dx12 pipe is landed and then we want to extend it it's still going to have all the "we can't ever release the sources to any of the parts we usually expect to be open for gpu drivers in upstream" problems. Then we're stuck at a rather awkward point of why one vendor gets an exception and all the others dont.
Quoted 4 lines
As-is I'd rather this didn't land under my purview, since I don't see the value this adds to the Linux ecosystem at all, and I think it's important when putting a burden on upstream that you provide some value.
Well there is some in the form of "more hw/platform support". But given that gpus evolved rather fast, including the entire integration ecosystem (it's by far not just the hw drivers that move quickly). So that value deprecates a lot faster than for other kernel subsystems. And all that's left is the pain of not breaking anything without actually being able to evolve the overall stack in any meaningful way.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 -
+https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.f
+fwll.ch%2F&data=02%7C01%7Cspronovo%40microsoft.com%7C3f18e46192b24c +ccf6a008d7fc489063%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372552<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.f+fwll.ch%2F&data=02%7C01%7Cspronovo%40microsoft.com%7C3f18e46192b24c+ccf6a008d7fc489063%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372552> +60910735230&sdata=hAIV1wJ29WF9IXTvJm3dr4StCwPzF0GdO2iWPyfnElg%3D&am
+p;reserved=0
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.ffwll.ch%2F&data=02%7C01%7Cspronovo%40microsoft.com%7C5e9c6fb0890844aef87c08d7fc91265e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637255572659025436&sdata=me6tZuh9c4YKPTcOdY5%2FlgE%2B52usSI%2F5QRUCsCy%2FTfQ%3D&reserved=0>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
W3Jlc2VuZGluZyBhcyBwbGFpbiB0ZXh0LCBzb3JyeSBhYm91dCB0aGF0XQ0KDQpUaGFua3MgRGFu aWVsLCBtb3JlIGJlbG93Lg0KDQpGcm9tOiBEYW5pZWwgVmV0dGVyIDxtYWlsdG86ZGFuaWVsQGZm d2xsLmNoPiANClNlbnQ6IFdlZG5lc2RheSwgTWF5IDIwLCAyMDIwIDEyOjQxIEFNDQpUbzogU3Rl dmUgUHJvbm92b3N0IDxtYWlsdG86c3Byb25vdm9AbWljcm9zb2Z0LmNvbT4NCkNjOiBEYXZlIEFp cmxpZSA8bWFpbHRvOmFpcmxpZWRAZ21haWwuY29tPjsgU2FzaGEgTGV2aW4gPG1haWx0bzpzYXNo YWxAa2VybmVsLm9yZz47IG1haWx0bzpsaW51eC1oeXBlcnZAdmdlci5rZXJuZWwub3JnOyBTdGVw aGVuIEhlbW1pbmdlciA8bWFpbHRvOnN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dDMSU3QzAlN0M2MzcyNTUyDQorNjA5MTA3MzUy MzAmYW1wO3NkYXRhPWhBSVYxd0oyOVdGOUlYVHZKbTNkcjRTdEN3UHpGMEdkTzJpV1B5Zm5FbGcl M0QmYW0NCitwO3Jlc2VydmVkPTANCg0KDQotLSANCkRhbmllbCBWZXR0ZXINClNvZnR3YXJlIEVu Z2luZWVyLCBJbnRlbCBDb3Jwb3JhdGlvbg0KKzQxICgwKSA3OSAzNjUgNTcgNDggLSBodHRwczov L25hbTA2LnNhZmVsaW5rcy5wcm90ZWN0aW9uLm91dGxvb2suY29tLz91cmw9aHR0cCUzQSUyRiUy RmJsb2cuZmZ3bGwuY2glMkYmZGF0YT0wMiU3QzAxJTdDc3Byb25vdm8lNDBtaWNyb3NvZnQuY29t JTdDNWU5YzZmYjA4OTA4NDRhZWY4N2MwOGQ3ZmM5MTI2NWUlN0M3MmY5ODhiZjg2ZjE0MWFmOTFh YjJkN2NkMDExZGI0NyU3QzElN0MwJTdDNjM3MjU1NTcyNjU5MDI1NDM2JnNkYXRhPW1lNnRadWg5 YzRZS1BUY09kWTUlMkZsZ0UlMkI1MnVzU0klMkY1UVJVQ3NDeSUyRlRmUSUzRCZyZXNlcnZlZD0w DQo
Hi!
Quoted 2 lines
Thanks for the discussion. I may not be able to immediately answer all of your questions, but I'll do my best ????.
Could you do something with your email settings? Because this is not how you should use email on lkml. "[EXTERNAL]" in the subject, top-posting, unwrapped lines...
Thank you,
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Dave Airlie
maintainerQuoted 62 lines · Dave Airlie
Quoted 25 lines · Sasha Levin
There is a blog post that goes into more detail about the bigger picture, and walks through all the required pieces to make this work. It is available here:
https://devblogs.microsoft.com/directx/directx-heart-linux . The rest of this cover letter will focus on the Linux Kernel bits.Overview
====This is the first draft of the Microsoft Virtual GPU (vGPU) driver. The driver exposes a paravirtualized GPU to user mode applications running in a virtual machine on a Windows host. This enables hardware acceleration in environment such as WSL (Windows Subsystem for Linux) where the Linux virtual machine is able to share the GPU with the Windows host.
The projection is accomplished by exposing the WDDM (Windows Display Driver Model) interface as a set of IOCTL. This allows APIs and user mode driver written against the WDDM GPU abstraction on Windows to be ported to run within a Linux environment. This enables the port of the D3D12 and DirectML APIs as well as their associated user mode driver to Linux. This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSL environment.
Quoted 7 lines
Only the rendering/compute aspect of the GPU are projected to the virtual machine, no display functionality is exposed. Further, at this time there are no presentation integration. So although the D3D12 API can be use to render graphics offscreen, there is no path (yet) for pixel to flow from the Linux environment back onto the Windows host desktop. This GPU stack is effectively side-by-side with the native Linux graphics stack.
Okay I've had some caffiene and absorbed some more of this.
This is a driver that connects a binary blob interface in the Windows kernel drivers to a binary blob that you run inside a Linux guest. It's a binary transport between two binary pieces. Personally this holds little of interest to me, I can see why it might be nice to have this upstream, but I don't forsee any other Linux distributor ever enabling it or having to ship it, it's purely a WSL2 pipe. I'm not saying I'd be happy to see this in the tree, since I don't see the value of maintaining it upstream, but it probably should just exists in a
drivers/hypervtype area.Having said that, I hit one stumbling block:
"Further, at this time there are no presentation integration. "If we upstream this driver as-is into some hyperv specific place, and you decide to add presentation integration this is more than likely going to mean you will want to interact with dma-bufs and dma-fences. If the driver is hidden away in a hyperv place it's likely we won't even notice that feature landing until it's too late.
I would like to see a coherent plan for presentation support (not code, just an architectural diagram), because I think when you contemplate how that works it will change the picture of how this driver looks and intergrates into the rest of the Linux graphics ecosystem.
Quoted 4 lines
As-is I'd rather this didn't land under my purview, since I don't see the value this adds to the Linux ecosystem at all, and I think it's important when putting a burden on upstream that you provide some value.
I also have another concern from a legal standpoint I'd rather not review the ioctl part of this. I'd probably request under DRI developers abstain as well.
This is a Windows kernel API being smashed into a Linux driver. I don't want to be tainted by knowledge of an API that I've no idea of the legal status of derived works. (it this all covered patent wise under OIN?)
I don't want to ever be accused of designing a Linux kernel API with illgotten D3DKMT knowledge, I feel tainting myself with knowledge of a properietary API might cause derived work issues.
Dave.
Quoted 20 lines
Quoted 15 lines
Having said that, I hit one stumbling block:
"Further, at this time there are no presentation integration. "If we upstream this driver as-is into some hyperv specific place, and you decide to add presentation integration this is more than likely going to mean you will want to interact with dma-bufs and dma-fences. If the driver is hidden away in a hyperv place it's likely we won't even notice that feature landing until it's too late.
I would like to see a coherent plan for presentation support (not code, just an architectural diagram), because I think when you contemplate how that works it will change the picture of how this driver looks and intergrates into the rest of the Linux graphics ecosystem.
Quoted 4 lines
As-is I'd rather this didn't land under my purview, since I don't see the value this adds to the Linux ecosystem at all, and I think it's important when putting a burden on upstream that you provide some value.
Quoted 7 lines
I also have another concern from a legal standpoint I'd rather not review the ioctl part of this. I'd probably request under DRI developers abstain as well.
This is a Windows kernel API being smashed into a Linux driver. I don't want to be tainted by knowledge of an API that I've no idea of the legal status of derived works. (it this all covered patent wise under OIN?)
If you can't look onto it, perhaps it is not suitable to merge into kernel...?
What would be legal requirements so this is "safe to look at"? We should really require submitter to meet them...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 24 lines · Pavel Machek
Quoted 24 lines
Quoted 15 lines
Having said that, I hit one stumbling block:
"Further, at this time there are no presentation integration. "If we upstream this driver as-is into some hyperv specific place, and you decide to add presentation integration this is more than likely going to mean you will want to interact with dma-bufs and dma-fences. If the driver is hidden away in a hyperv place it's likely we won't even notice that feature landing until it's too late.
I would like to see a coherent plan for presentation support (not code, just an architectural diagram), because I think when you contemplate how that works it will change the picture of how this driver looks and intergrates into the rest of the Linux graphics ecosystem.
Quoted 4 lines
As-is I'd rather this didn't land under my purview, since I don't see the value this adds to the Linux ecosystem at all, and I think it's important when putting a burden on upstream that you provide some value.
I also have another concern from a legal standpoint I'd rather not review the ioctl part of this. I'd probably request under DRI developers abstain as well.
Quoted 8 lines
Quoted 3 lines
This is a Windows kernel API being smashed into a Linux driver. I don't want to be tainted by knowledge of an API that I've no idea of the legal status of derived works. (it this all covered patent wise under OIN?)
If you can't look onto it, perhaps it is not suitable to merge into kernel...?
What would be legal requirements so this is "safe to look at"? We should really require submitter to meet them...
Could you walk me through your view on what the function of the "Signed-off-by" tag is?
Signature · 2 lines
Thanks, Sasha
Hi
Am 19.05.20 um 18:32 schrieb Sasha Levin:
Quoted 5 lines
There is a blog post that goes into more detail about the bigger picture, and walks through all the required pieces to make this work. It is available here:
https://devblogs.microsoft.com/directx/directx-heart-linux . The rest of this cover letter will focus on the Linux Kernel bits.
That's quite a surprise. Thanks for your efforts to contribute.
Quoted 27 lines
Overview
========This is the first draft of the Microsoft Virtual GPU (vGPU) driver. The driver exposes a paravirtualized GPU to user mode applications running in a virtual machine on a Windows host. This enables hardware acceleration in environment such as WSL (Windows Subsystem for Linux) where the Linux virtual machine is able to share the GPU with the Windows host.
The projection is accomplished by exposing the WDDM (Windows Display Driver Model) interface as a set of IOCTL. This allows APIs and user mode driver written against the WDDM GPU abstraction on Windows to be ported to run within a Linux environment. This enables the port of the D3D12 and DirectML APIs as well as their associated user mode driver to Linux. This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSL environment.
Only the rendering/compute aspect of the GPU are projected to the virtual machine, no display functionality is exposed. Further, at this time there are no presentation integration. So although the D3D12 API can be use to render graphics offscreen, there is no path (yet) for pixel to flow from the Linux environment back onto the Windows host desktop. This GPU stack is effectively side-by-side with the native Linux graphics stack.
Quoted 5 lines
The driver creates the
/dev/dxgdevice, which can be opened by user mode application and handles their ioctls. The IOCTL interface to the driver is defined indxgkmthk.h(Dxgkrnl Graphics Port Driver ioctl definitions). The interface matches the D3DKMT interface on Windows. Ioctls are implemented inioctl.c.
Echoing what others said, you're not making a DRM driver. The driver should live outside of the DRM code.
I have one question about the driver API: on Windows, DirectX versions are loosly tied to Windows releases. So I guess you can change the kernel interface among DirectX versions?
If so, how would this work on Linux in the long term? If there ever is a DirectX 13 or 14 with incompatible kernel interfaces, how would you plan to update the Linux driver?
Best regards
Thomas
Quoted 160 lines
When a VM starts, hyper-v on the host adds virtual GPU devices to the VM via the hyper-v driver. The host offers several VM bus channels to the
VM: the global channel and one channel per virtual GPU, assigned to the VM.The driver registers with the hyper-v driver (
hv_driver) for the arrival of VM bus channels.dxg_probe_devicerecognizes the vGPU channels and creates the corresponding objects (dxgadapter for vGPUs and dxgglobal for the global channel).The driver uses the hyper-V VM bus interface to communicate with the host.
dxgvmbus.cimplements the communication interface.The global channel has 8GB of IO space assigned by the host. This space is managed by the host and used to give the guest direct CPU access to some allocations. Video memory is allocated on the host except in the case of
existing_sysmemallocations. The Windows host allocates memory for the GPU on behalf of the guest. The Linux guest can access that memory by mapping GPU virtual address to allocations and then referencing those GPU virtual address from within GPU command buffers submitted to the GPU. For allocations which require CPU access, the allocation is mapped by the host into a location in the 8GB of IO space reserved in the guest for that purpose. The Windows host uses the nested CPU page table to ensure that this guest IO space always map to the correct location for the allocation as it may migrate between dedicated GPU memory (e.g. VRAM, firmware reserved DDR) and shared system memory (regular DDR) over its lifetime. The Linux guest maps a user mode CPU virtual address to an allocation IO space range for direct access by user mode APIs and drivers.Implementation of
LX_DXLOCK2ioctl
==================================We would appreciate your feedback on the implementation of the
LX_DXLOCK2ioctl.This ioctl is used to get a CPU address to an allocation, which is resident in video/system memory on the host. The way it works:
1. The driver sends the Lock message to the host
2. The host allocates space in the VM IO space and maps it to the allocation memory
3. The host returns the address in IO space for the mapped allocation
4. The driver (in
dxg_map_iospace) allocates a user mode virtual address range usingvm_mmapand maps it to the IO space usingio_remap_ofn_range)5. The VA is returned to the application
Internal objects
================The following objects are created by the driver (defined in
dxgkrnl.h):- dxgadapter - represents a virtual GPU
- dxgprocess - tracks per process state (handle table of created objects, list of objects, etc.)
- dxgdevice - a container for other objects (contexts, paging queues, allocations, GPU synchronization objects)
- dxgcontext - represents thread of GPU execution for packet scheduling.
- dxghwqueue - represents thread of GPU execution of hardware scheduling
- dxgallocation - represents a GPU accessible allocation
- dxgsyncobject - represents a GPU synchronization object
- dxgresource - collection of dxgalloction objects
- dxgsharedresource, dxgsharedsyncobj - helper objects to share objects between different dxgdevice objects, which can belong to different
processesObject handles
==============All GPU objects, created by the driver, are accessible by a handle (
d3dkmt_handle). Each process has its own handle table, which is implemented inhmgr.c. For each API visible object, created by the driver, there is an object, created on the host. For example, the is a dxgprocess object on the host for each dxgprocess object in the VM, etc. The object handles have the same value in the host and the VM, which is done to avoid translation from the guest handles to the host handles.Signaling CPU events by the host
================================The WDDM interface provides a way to signal CPU event objects when execution of a context reached certain point. The way it is implemented:
- application sends an
event_fdvia ioctl to the driver-
eventfd_ctx_getis used to get a pointer to the file object (eventfd_ctx)- the pointer to sent the host via a VM bus message
- when GPU execution reaches a certain point, the host sends a message to the VM with the event pointer
-
signal_guest_event()handles the messages and eventuallyeventfd_signal()is called.Sasha Levin (4):
gpu: dxgkrnl: core code
gpu: dxgkrnl: hook up dxgkrnl
Drivers: hv: vmbus: hook up dxgkrnl
gpu: dxgkrnl: create aMAINTAINERSentryMAINTAINERS | 7 + drivers/gpu/Makefile | 2 +- drivers/gpu/dxgkrnl/Kconfig | 10 + drivers/gpu/dxgkrnl/Makefile | 12 + drivers/gpu/dxgkrnl/d3dkmthk.h | 1635 +++++++++ drivers/gpu/dxgkrnl/dxgadapter.c | 1399 ++++++++ drivers/gpu/dxgkrnl/dxgkrnl.h | 913 ++++++ drivers/gpu/dxgkrnl/dxgmodule.c | 692 ++++ drivers/gpu/dxgkrnl/dxgprocess.c | 355 ++ drivers/gpu/dxgkrnl/dxgvmbus.c | 2955 +++++++++++++++++ drivers/gpu/dxgkrnl/dxgvmbus.h | 859 +++++ drivers/gpu/dxgkrnl/hmgr.c | 593 ++++ drivers/gpu/dxgkrnl/hmgr.h | 107 + drivers/gpu/dxgkrnl/ioctl.c | 5269 ++++++++++++++++++++++++++++++ drivers/gpu/dxgkrnl/misc.c | 280 ++ drivers/gpu/dxgkrnl/misc.h | 288 ++ drivers/video/Kconfig | 2 + include/linux/hyperv.h | 16 + 18 files changed, 15393 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/dxgkrnl/Kconfig create mode 100644 drivers/gpu/dxgkrnl/Makefile create mode 100644 drivers/gpu/dxgkrnl/d3dkmthk.h create mode 100644 drivers/gpu/dxgkrnl/dxgadapter.c create mode 100644 drivers/gpu/dxgkrnl/dxgkrnl.h create mode 100644 drivers/gpu/dxgkrnl/dxgmodule.c create mode 100644 drivers/gpu/dxgkrnl/dxgprocess.c create mode 100644 drivers/gpu/dxgkrnl/dxgvmbus.c create mode 100644 drivers/gpu/dxgkrnl/dxgvmbus.h create mode 100644 drivers/gpu/dxgkrnl/hmgr.c create mode 100644 drivers/gpu/dxgkrnl/hmgr.h create mode 100644 drivers/gpu/dxgkrnl/ioctl.c create mode 100644 drivers/gpu/dxgkrnl/misc.c create mode 100644 drivers/gpu/dxgkrnl/misc.h
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
PkVjaG9pbmcgd2hhdCBvdGhlcnMgc2FpZCwgeW91J3JlIG5vdCBtYWtpbmcgYSBEUk0gZHJpdmVy LiBUaGUgZHJpdmVyIHNob3VsZCBsaXZlIG91dHNpZGUgb2YgdGhlIERSTSBjb2RlLg0KDQpBZ3Jl ZWQsIHBsZWFzZSBzZWUgbXkgZWFybGllciByZXBseS4gV2UnbGwgYmUgbW92aW5nIHRoZSBkcml2 ZXIgdG8gZHJpdmVycy9oeXBlcnYgbm9kZSBvciBzb21ldGhpbmcgc2ltaWxhci4gQXBvbG9neSBm b3IgdGhlIGNvbmZ1c2lvbiBoZXJlLg0KDQo+IEkgaGF2ZSBvbmUgcXVlc3Rpb24gYWJvdXQgdGhl IGRyaXZlciBBUEk6IG9uIFdpbmRvd3MsIERpcmVjdFggdmVyc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p c2MuYyAgY3JlYXRlIG1vZGUgMTAwNjQ0IA0KPiBkcml2ZXJzL2dwdS9keGdrcm5sL21pc2MuaA0K PiANCg0KLS0NClRob21hcyBaaW1tZXJtYW5uDQpHcmFwaGljcyBEcml2ZXIgRGV2ZWxvcGVyDQpT VVNFIFNvZnR3YXJlIFNvbHV0aW9ucyBHZXJtYW55IEdtYkgNCk1heGZlbGRzdHIuIDUsIDkwNDA5 IE7DvHJuYmVyZywgR2VybWFueQ0KKEhSQiAzNjgwOSwgQUcgTsO8cm5iZXJnKQ0KR2VzY2jDpGZ0 c2bDvGhyZXI6IEZlbGl4IEltZW5kw7ZyZmZlcg0KDQo
Hi Steve,
thank you for the fast reply.
Am 20.05.20 um 09:42 schrieb Steve Pronovost:
Quoted 10 lines
Quoted 1 line
Echoing what others said, you're not making a DRM driver. The driver should live outside of the DRM code.
Agreed, please see my earlier reply. We'll be moving the driver to
drivers/hypervnode or something similar. Apology for the confusion here.Quoted 2 lines
I have one question about the driver API: on Windows, DirectX versions are loosly tied to Windows releases. So I guess you can change the kernel interface among DirectX versions? If so, how would this work on Linux in the long term? If there ever is a DirectX 13 or 14 with incompatible kernel interfaces, how would you plan to update the Linux driver?
You should think of the communication over the VM Bus for the vGPU projection as a strongly versioned interface. We will be keeping compatibility with older version of that interface as it evolves over time so we can continue to run older guest (we already do). This protocol isn't actually tied to the DX API. It is a generic abstraction for the GPU that can be used for any APIs (for example the NVIDIA CUDA driver that we announced is going over the same protocol to access the GPU).
New version of user mode DX can either take advantage or sometime require new services from this kernel abstraction. This mean that pulling a new version of user mode DX can mean having to also pull a new version of this vGPU kernel driver. For WSL, these essentially ships together. The kernel driver ships as part of our WSL2 Linux Kernel integration. User mode DX bits ships with Windows.
Just a friendly advise: maintaining a proprietary component within a Linux environment is tough. You will need a good plan for long-term interface stability and compatibility with the other components.
Best regards
Thomas
Quoted 232 lines
-----Original Message-----
From: Thomas Zimmermann <[email protected]>
Sent: Wednesday, May 20, 2020 12:11 AM
To: Sasha Levin <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Stephen Hemminger <[email protected]>; [email protected]; Steve Pronovost <[email protected]>; Iouri Tarassov <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [EXTERNAL] Re: [RFC PATCH 0/4] DirectX on LinuxHi
Am 19.05.20 um 18:32 schrieb Sasha Levin:
Quoted 5 lines
There is a blog post that goes into more detail about the bigger picture, and walks through all the required pieces to make this work. It is available here:
https://devblogs.microsoft.com/directx/directx-heart-linux . The rest of this cover letter will focus on the Linux Kernel bits.That's quite a surprise. Thanks for your efforts to contribute.
Quoted 27 lines
Overview
========This is the first draft of the Microsoft Virtual GPU (vGPU) driver. The driver exposes a paravirtualized GPU to user mode applications running in a virtual machine on a Windows host. This enables hardware acceleration in environment such as WSL (Windows Subsystem for Linux) where the Linux virtual machine is able to share the GPU with the Windows host.
The projection is accomplished by exposing the WDDM (Windows Display Driver Model) interface as a set of IOCTL. This allows APIs and user mode driver written against the WDDM GPU abstraction on Windows to be ported to run within a Linux environment. This enables the port of the D3D12 and DirectML APIs as well as their associated user mode driver to Linux. This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSL environment.
Only the rendering/compute aspect of the GPU are projected to the virtual machine, no display functionality is exposed. Further, at this time there are no presentation integration. So although the D3D12 API can be use to render graphics offscreen, there is no path (yet) for pixel to flow from the Linux environment back onto the Windows host desktop. This GPU stack is effectively side-by-side with the native Linux graphics stack.
Quoted 5 lines
The driver creates the
/dev/dxgdevice, which can be opened by user mode application and handles their ioctls. The IOCTL interface to the driver is defined indxgkmthk.h(Dxgkrnl Graphics Port Driver ioctl definitions). The interface matches the D3DKMT interface on Windows. Ioctls are implemented inioctl.c.Echoing what others said, you're not making a DRM driver. The driver should live outside of the DRM code.
I have one question about the driver API: on Windows, DirectX versions are loosly tied to Windows releases. So I guess you can change the kernel interface among DirectX versions?
If so, how would this work on Linux in the long term? If there ever is a DirectX 13 or 14 with incompatible kernel interfaces, how would you plan to update the Linux driver?
Best regards
ThomasQuoted 147 lines
When a VM starts, hyper-v on the host adds virtual GPU devices to the VM via the hyper-v driver. The host offers several VM bus channels to the
VM: the global channel and one channel per virtual GPU, assigned to the VM.The driver registers with the hyper-v driver (
hv_driver) for the arrival of VM bus channels.dxg_probe_devicerecognizes the vGPU channels and creates the corresponding objects (dxgadapter for vGPUs and dxgglobal for the global channel).The driver uses the hyper-V VM bus interface to communicate with the host.
dxgvmbus.cimplements the communication interface.The global channel has 8GB of IO space assigned by the host. This space is managed by the host and used to give the guest direct CPU access to some allocations. Video memory is allocated on the host except in the case of
existing_sysmemallocations. The Windows host allocates memory for the GPU on behalf of the guest. The Linux guest can access that memory by mapping GPU virtual address to allocations and then referencing those GPU virtual address from within GPU command buffers submitted to the GPU. For allocations which require CPU access, the allocation is mapped by the host into a location in the 8GB of IO space reserved in the guest for that purpose. The Windows host uses the nested CPU page table to ensure that this guest IO space always map to the correct location for the allocation as it may migrate between dedicated GPU memory (e.g. VRAM, firmware reserved DDR) and shared system memory (regular DDR) over its lifetime. The Linux guest maps a user mode CPU virtual address to an allocation IO space range for direct access by user mode APIs and drivers.Implementation of
LX_DXLOCK2ioctl
==================================We would appreciate your feedback on the implementation of the
LX_DXLOCK2ioctl.This ioctl is used to get a CPU address to an allocation, which is resident in video/system memory on the host. The way it works:
1. The driver sends the Lock message to the host
2. The host allocates space in the VM IO space and maps it to the allocation memory
3. The host returns the address in IO space for the mapped allocation
4. The driver (in
dxg_map_iospace) allocates a user mode virtual address range usingvm_mmapand maps it to the IO space usingio_remap_ofn_range)5. The VA is returned to the application
Internal objects
================The following objects are created by the driver (defined in
dxgkrnl.h):- dxgadapter - represents a virtual GPU
- dxgprocess - tracks per process state (handle table of created objects, list of objects, etc.)
- dxgdevice - a container for other objects (contexts, paging queues, allocations, GPU synchronization objects)
- dxgcontext - represents thread of GPU execution for packet scheduling.
- dxghwqueue - represents thread of GPU execution of hardware scheduling
- dxgallocation - represents a GPU accessible allocation
- dxgsyncobject - represents a GPU synchronization object
- dxgresource - collection of dxgalloction objects
- dxgsharedresource, dxgsharedsyncobj - helper objects to share objects between different dxgdevice objects, which can belong to different
processesObject handles
==============All GPU objects, created by the driver, are accessible by a handle (
d3dkmt_handle). Each process has its own handle table, which is implemented inhmgr.c. For each API visible object, created by the driver, there is an object, created on the host. For example, the is a dxgprocess object on the host for each dxgprocess object in the VM, etc. The object handles have the same value in the host and the VM, which is done to avoid translation from the guest handles to the host handles.Signaling CPU events by the host
================================The WDDM interface provides a way to signal CPU event objects when execution of a context reached certain point. The way it is implemented:
- application sends an
event_fdvia ioctl to the driver-
eventfd_ctx_getis used to get a pointer to the file object (eventfd_ctx)- the pointer to sent the host via a VM bus message
- when GPU execution reaches a certain point, the host sends a message to the VM with the event pointer
-
signal_guest_event()handles the messages and eventuallyeventfd_signal()is called.Sasha Levin (4):
gpu: dxgkrnl: core code
gpu: dxgkrnl: hook up dxgkrnl
Drivers: hv: vmbus: hook up dxgkrnl
gpu: dxgkrnl: create aMAINTAINERSentryMAINTAINERS | 7 + drivers/gpu/Makefile | 2 +- drivers/gpu/dxgkrnl/Kconfig | 10 + drivers/gpu/dxgkrnl/Makefile | 12 + drivers/gpu/dxgkrnl/d3dkmthk.h | 1635 +++++++++ drivers/gpu/dxgkrnl/dxgadapter.c | 1399 ++++++++ drivers/gpu/dxgkrnl/dxgkrnl.h | 913 ++++++ drivers/gpu/dxgkrnl/dxgmodule.c | 692 ++++ drivers/gpu/dxgkrnl/dxgprocess.c | 355 ++ drivers/gpu/dxgkrnl/dxgvmbus.c | 2955 +++++++++++++++++ drivers/gpu/dxgkrnl/dxgvmbus.h | 859 +++++ drivers/gpu/dxgkrnl/hmgr.c | 593 ++++ drivers/gpu/dxgkrnl/hmgr.h | 107 + drivers/gpu/dxgkrnl/ioctl.c | 5269 ++++++++++++++++++++++++++++++ drivers/gpu/dxgkrnl/misc.c | 280 ++ drivers/gpu/dxgkrnl/misc.h | 288 ++ drivers/video/Kconfig | 2 + include/linux/hyperv.h | 16 + 18 files changed, 15393 insertions(+), 1 deletion(-) create modeQuoted 15 lines
100644
drivers/gpu/dxgkrnl/Kconfigcreate mode 100644drivers/gpu/dxgkrnl/Makefilecreate mode 100644drivers/gpu/dxgkrnl/d3dkmthk.hcreate mode 100644drivers/gpu/dxgkrnl/dxgadapter.ccreate mode 100644drivers/gpu/dxgkrnl/dxgkrnl.hcreate mode 100644drivers/gpu/dxgkrnl/dxgmodule.ccreate mode 100644drivers/gpu/dxgkrnl/dxgprocess.ccreate mode 100644drivers/gpu/dxgkrnl/dxgvmbus.ccreate mode 100644drivers/gpu/dxgkrnl/dxgvmbus.hcreate mode 100644drivers/gpu/dxgkrnl/hmgr.ccreate mode 100644drivers/gpu/dxgkrnl/hmgr.hcreate mode 100644drivers/gpu/dxgkrnl/ioctl.ccreate mode 100644drivers/gpu/dxgkrnl/misc.ccreate mode 100644drivers/gpu/dxgkrnl/misc.h--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
Hi!
Quoted 9 lines
Quoted 5 lines
The driver creates the
/dev/dxgdevice, which can be opened by user mode application and handles their ioctls. The IOCTL interface to the driver is defined indxgkmthk.h(Dxgkrnl Graphics Port Driver ioctl definitions). The interface matches the D3DKMT interface on Windows. Ioctls are implemented inioctl.c.Echoing what others said, you're not making a DRM driver. The driver should live outside of the DRM code.
Actually, this sounds to me like "this should not be merged into linux kernel". I mean, we already have DRM API on Linux. We don't want another one, do we?
And at the very least... this misses API docs for /dev/dxg. Code can't really be reviewed without that.
Best regards,
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 8 lines · Pavel Machek
Hi!
Quoted 6 lines
Quoted 5 lines
The driver creates the
/dev/dxgdevice, which can be opened by user mode application and handles their ioctls. The IOCTL interface to the driver is defined indxgkmthk.h(Dxgkrnl Graphics Port Driver ioctl definitions). The interface matches the D3DKMT interface on Windows. Ioctls are implemented inioctl.c.
Quoted 6 lines
Quoted 3 lines
Echoing what others said, you're not making a DRM driver. The driver should live outside of the DRM code.
Actually, this sounds to me like "this should not be merged into linux kernel". I mean, we already have DRM API on Linux. We don't want another one, do we?
This driver doesn't have any display functionality.
Quoted 2 lines
And at the very least... this misses API docs for
/dev/dxg. Code can't really be reviewed without that.
The docs live here: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/
Signature · 2 lines
Thanks, Sasha
Quoted 9 lines · Sasha Levin
Quoted 8 lines · Pavel Machek
Hi!
Quoted 6 lines
Quoted 5 lines
The driver creates the
/dev/dxgdevice, which can be opened by user mode application and handles their ioctls. The IOCTL interface to the driver is defined indxgkmthk.h(Dxgkrnl Graphics Port Driver ioctl definitions). The interface matches the D3DKMT interface on Windows. Ioctls are implemented inioctl.c.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Echoing what others said, you're not making a DRM driver. The driver should live outside of the DRM code.
Actually, this sounds to me like "this should not be merged into linux kernel". I mean, we already have DRM API on Linux. We don't want another one, do we?
This driver doesn't have any display functionality.
Graphics cards without displays connected are quite common. I may be wrong, but I believe we normally handle them using DRM...
Quoted 4 lines
Quoted 2 lines
And at the very least... this misses API docs for
/dev/dxg. Code can't really be reviewed without that.The docs live here: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/
I don't see "/dev/dxg" being metioned there. Plus, kernel API documentation should really go to Documentation, and be suitably licensed.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 14 lines · Pavel Machek
Quoted 13 lines · Sasha Levin
Quoted 12 lines · Pavel Machek
Hi!
Quoted 9 lines
Quoted 5 lines
The driver creates the
/dev/dxgdevice, which can be opened by user mode application and handles their ioctls. The IOCTL interface to the driver is defined indxgkmthk.h(Dxgkrnl Graphics Port Driver ioctl definitions). The interface matches the D3DKMT interface on Windows. Ioctls are implemented inioctl.c.Echoing what others said, you're not making a DRM driver. The driver should live outside of the DRM code.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Actually, this sounds to me like "this should not be merged into linux kernel". I mean, we already have DRM API on Linux. We don't want another one, do we?
This driver doesn't have any display functionality.
Graphics cards without displays connected are quite common. I may be wrong, but I believe we normally handle them using DRM...
This is more similar to the accelerators that live in drivers/misc/ right now.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
And at the very least... this misses API docs for
/dev/dxg. Code can't really be reviewed without that.The docs live here: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/
I don't see "
/dev/dxg" being metioned there. Plus, kernel API
Right, this is because this entire codebase is just a pipe to the API I've linked, it doesn't implement anything new on it's own.
Quoted 2 lines
documentation should really go to Documentation, and be suitably licensed.
While I don't mind copying the docs into Documentation, I'm concerned that over time they will diverge from the docs on the website. This is similar to how other documentation (such as the virtio spec) live out of tree to avoid these issues.
w.r.t the licensing, again: this was sent under GPL2 (note the SPDX tags in each file), and the patches carry a S-O-B by someone who was a Microsoft employee at the time the patches were sent.
Signature · 2 lines
Thanks, Sasha