Skip to content

Commit 8d548b3

Browse files
committed
Merge: vfio/nvgrace-gpu: Add vfio pci variant module for grace hopper
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/4776 JIRA: https://issues.redhat.com/browse/RHEL-36542 JIRA: https://issues.redhat.com/browse/RHEL-36543 JIRA: https://issues.redhat.com/browse/RHEL-36544 Adding kernel pieces for VFIO-PCI variant module for NVIDIA's Grace GPU. This module is used for vgpu on Grace-Hopper, and eventually, Grace-Blackwell. The four commits enable the assignment to a guest. To test, NVIDIA is providing a qemu-kvm invocation that will pass the VFIO-PCI device to the variant driver in the guest. This is basic vfio-pci device passthrough enablement, and requires further SMMUv3 updates to make the functionality complete and performant. The four commits backport upstream commits listed in RHEL-36542, -36543, & -36544 which were not included in the kvm: arm: part-1 backport series (by Sebastian Ott). The (first) push will initially be marked as Draft, until NVIDIA provides a method for RH-QE to test the ability to assign a vfio-pci variant device to a guest. Once that's been verified by this author, this MR's draft status will be removed, and the rest of the kernel workflow can continue. Pushing this series now so eyes can see it, and others who want to grab it for testing or additional patch additions can do so. Update: (July 19, 2024) Pulling-out of draft mode: Verified via modified qemu-kvm command line and added instructions in RHEL-19393 (from the non-RHEL qemu-system-aarch64 cmdline), since QE now can test/verify basic assignment functionality. v2: Remove CONFIG for RHEL; disabling build since testing showed it could enable crash of guest if nvidia-smi test was run after assignment of Hopper vGPU to guest. Upstream commit to repair unlikely to make 9.5 functional freeze. Take incremental step of getting 90% of functionality into RHEL kernel, and await last vma-related, v2 upstream post & acceptance of partner patch. No code changes. v3: Fix CONFIG to disable for all arch's for now. Signed-off-by: Donald Dutile <ddutile@redhat.com> Approved-by: Eric Auger <eric.auger@redhat.com> Approved-by: Sebastian Ott <sebott@redhat.com> Approved-by: Cornelia Huck <cohuck@redhat.com> Approved-by: Alex Williamson <alex.williamson@redhat.com> Approved-by: Gavin Shan <gshan@redhat.com> Approved-by: Jerry Snitselaar <jsnitsel@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Lucas Zampieri <lzampier@redhat.com>
2 parents dd70aa3 + 3897786 commit 8d548b3

File tree

8 files changed

+930
-1
lines changed

8 files changed

+930
-1
lines changed

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20286,6 +20286,12 @@ F: drivers/vfio/mdev/
2028620286
F: include/linux/mdev.h
2028720287
F: samples/vfio-mdev/
2028820288

20289+
VFIO NVIDIA GRACE GPU DRIVER
20290+
M: Ankit Agrawal <ankita@nvidia.com>
20291+
L: kvm@vger.kernel.org
20292+
S: Supported
20293+
F: drivers/vfio/pci/nvgrace-gpu/
20294+
2028920295
VFIO PCI DEVICE SPECIFIC DRIVERS
2029020296
R: Jason Gunthorpe <jgg@nvidia.com>
2029120297
R: Yishai Hadas <yishaih@nvidia.com>

drivers/vfio/pci/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,6 @@ endif
6262

6363
source "drivers/vfio/pci/mlx5/Kconfig"
6464

65+
source "drivers/vfio/pci/nvgrace-gpu/Kconfig"
66+
6567
endmenu

drivers/vfio/pci/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ vfio-pci-$(CONFIG_VFIO_PCI_IGD) += vfio_pci_igd.o
99
obj-$(CONFIG_VFIO_PCI) += vfio-pci.o
1010

1111
obj-$(CONFIG_MLX5_VFIO_PCI) += mlx5/
12+
13+
obj-$(CONFIG_NVGRACE_GPU_VFIO_PCI) += nvgrace-gpu/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
config NVGRACE_GPU_VFIO_PCI
3+
tristate "VFIO support for the GPU in the NVIDIA Grace Hopper Superchip"
4+
depends on ARM64 || (COMPILE_TEST && 64BIT)
5+
select VFIO_PCI_CORE
6+
help
7+
VFIO support for the GPU in the NVIDIA Grace Hopper Superchip is
8+
required to assign the GPU device to userspace using KVM/qemu/etc.
9+
10+
If you don't know what to do here, say N.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
obj-$(CONFIG_NVGRACE_GPU_VFIO_PCI) += nvgrace-gpu-vfio-pci.o
3+
nvgrace-gpu-vfio-pci-y := main.o

0 commit comments

Comments
 (0)