updpkg pkgrel=2: add linux 6.8 patches

the eventfd fix is currently not enabled yet.

need to add the follow_pfn patch next for 6.10/6.11 support
This commit is contained in:
Lily Tsuru 2024-09-29 22:33:37 -04:00
parent 7108916b9e
commit 93dd13b3d1
5 changed files with 153 additions and 14 deletions

View file

@ -2,7 +2,7 @@
pkgbase='nvidia-merged' pkgbase='nvidia-merged'
pkgname=('lib32-nvidia-merged-utils' 'lib32-opencl-nvidia-merged' 'nvidia-merged-dkms' 'nvidia-merged-settings' 'nvidia-merged-utils' 'opencl-nvidia-merged' 'vgpu-unlock-rs') pkgname=('lib32-nvidia-merged-utils' 'lib32-opencl-nvidia-merged' 'nvidia-merged-dkms' 'nvidia-merged-settings' 'nvidia-merged-utils' 'opencl-nvidia-merged' 'vgpu-unlock-rs')
pkgrel=1 pkgrel=2
arch=('x86_64') arch=('x86_64')
makedepends=('git' 'rust') makedepends=('git' 'rust')
url='https://krutavshah.github.io/GPU_Virtualization-Wiki/' url='https://krutavshah.github.io/GPU_Virtualization-Wiki/'
@ -10,14 +10,15 @@ license=('custom')
options=('!strip') options=('!strip')
groups=('nvidia-merged') groups=('nvidia-merged')
# version # version. If the vGPU package version is different,
# it must be specified.
pkgver=535.129.03 pkgver=535.129.03
_vgpupkgver=535.129.03 _vgpupkgver=${pkgver}
# FIXME: Do we really need to use ${CARCH}? As far as I'm aware # FIXME: Do we really need to use ${CARCH}? As far as I'm aware
# the vGPU suite is x86_64 only. # the vGPU suite is x86_64 only.
_generalpkg="NVIDIA-Linux-${CARCH}-535.129.03" _generalpkg="NVIDIA-Linux-${CARCH}-${pkgver}"
_vgpupkg="NVIDIA-Linux-${CARCH}-${pkgver}-vgpu-kvm" _vgpupkg="NVIDIA-Linux-${CARCH}-${_vgpupkgver}-vgpu-kvm"
_patchedpkg="NVIDIA-Linux-${CARCH}-${pkgver}-merged-vgpu-kvm-patched" _patchedpkg="NVIDIA-Linux-${CARCH}-${pkgver}-merged-vgpu-kvm-patched"
# revs for git repos # revs for git repos
@ -27,13 +28,18 @@ _vgpu_unlock_rev="ba66a6c6eeb16eb8e2d2ec368d6605b974070d4b"
source=( source=(
'0001-Fix-NVIDIA-blob-patch-not-using-BASEDIR.patch' '0001-Fix-NVIDIA-blob-patch-not-using-BASEDIR.patch'
'0002-vGPU-and-Desktop-in-harmony.patch' '0002-vGPU-and-Desktop-in-harmony.patch'
'dkms-conftest-iosys-fix.patch'
'nvidia-iommu-api-fix.patch'
'nvidia-drm-defs-fix.patch'
'nvidia-eventfd-fix.patch'
'nvidia-smi' 'nvidia-smi'
'nvidia-vgpu.conf' 'nvidia-vgpu.conf'
'vgpu_unlock-rs.conf' 'vgpu_unlock-rs.conf'
'nvidia-drm-outputclass.conf' 'nvidia-drm-outputclass.conf'
'nvidia-utils.sysusers' 'nvidia-utils.sysusers'
'nvidia.rules' 'nvidia.rules'
'nvidia-conftest-iosys-fix.patch'
"https://us.download.nvidia.com/XFree86/Linux-${CARCH}/${pkgver}/${_generalpkg}.run" "https://us.download.nvidia.com/XFree86/Linux-${CARCH}/${pkgver}/${_generalpkg}.run"
"file://${_vgpupkg}.run" "file://${_vgpupkg}.run"
"git+https://github.com/VGPU-Community-Drivers/vGPU-Unlock-patcher.git#commit=${_patcher_rev}" "git+https://github.com/VGPU-Community-Drivers/vGPU-Unlock-patcher.git#commit=${_patcher_rev}"
@ -41,13 +47,16 @@ source=(
sha256sums=('ae6b1cf5cc5e177e5502ebed4b64f058524bf5514e1d6cda911e2966b2749b16' sha256sums=('ae6b1cf5cc5e177e5502ebed4b64f058524bf5514e1d6cda911e2966b2749b16'
'a66368ac6e409d002238dc6f5b1833bee1573e65386b0537bbcca9cc130b9d2a' 'a66368ac6e409d002238dc6f5b1833bee1573e65386b0537bbcca9cc130b9d2a'
'594339458c2208936ee12e51de515173801566256983e524d67e1da1081e2260'
'437232dfa868999dd252ee95ee88625fb3e8231c0b705510904b6822512c56ba'
'f1e9e0d4ebbd35d14ef28c79f8ed8a0c22ff5e49765dd42119106f39078b4682'
'a26f0ee66e140be1f93e52ff965da59490a33b13f40c56629071eab2553ce48f'
'eb51808257e7898d37d4575f40ada424cabf5dcad61017dd677ff5a0b25dead4' 'eb51808257e7898d37d4575f40ada424cabf5dcad61017dd677ff5a0b25dead4'
'5ea0d9edfcf282cea9b204291716a9a4d6d522ba3a6bc28d78edf505b6dc7949' '5ea0d9edfcf282cea9b204291716a9a4d6d522ba3a6bc28d78edf505b6dc7949'
'eafb28461fbe8a37cef3121f4b0ad53ad459ba389d9afb91e79c6c8d93ba5ea9' 'eafb28461fbe8a37cef3121f4b0ad53ad459ba389d9afb91e79c6c8d93ba5ea9'
'be99ff3def641bb900c2486cce96530394c5dc60548fc4642f19d3a4c784134d' 'be99ff3def641bb900c2486cce96530394c5dc60548fc4642f19d3a4c784134d'
'd8d1caa5d72c71c6430c2a0d9ce1a674787e9272ccce28b9d5898ca24e60a167' 'd8d1caa5d72c71c6430c2a0d9ce1a674787e9272ccce28b9d5898ca24e60a167'
'0e54249a7754b668b436f0f7aa7e95fff68edbb12a93dbee4660e09a8c695f84' '0e54249a7754b668b436f0f7aa7e95fff68edbb12a93dbee4660e09a8c695f84'
'594339458c2208936ee12e51de515173801566256983e524d67e1da1081e2260'
'e6dca5626a2608c6bb2a046cfcb7c1af338b9e961a7dd90ac09bb8a126ff002e' 'e6dca5626a2608c6bb2a046cfcb7c1af338b9e961a7dd90ac09bb8a126ff002e'
'2a53940da16c7c8bf001e5da0f53983192f4d09ec84cab713fbb424ac11df743' '2a53940da16c7c8bf001e5da0f53983192f4d09ec84cab713fbb424ac11df743'
'f3363d6cfef99147017329d08bedb81e473af91e7cda06d59576768a5a27b62f' 'f3363d6cfef99147017329d08bedb81e473af91e7cda06d59576768a5a27b62f'
@ -78,15 +87,11 @@ prepare() {
cd "${_patchedpkg}" cd "${_patchedpkg}"
# patch kernel driver # patch kernel driver
patch -p1 < ../nvidia-conftest-iosys-fix.patch patch -p1 < ../dkms-conftest-iosys-fix.patch
patch -p1 < ../nvidia-iommu-api-fix.patch
patch -p1 < ../nvidia-drm-defs-fix.patch
# sed \
# -e 's|__UTILS_PATH__|/usr/bin|' \
# -e 's|Icon=.*|Icon=nvidia-settings|' \
# -i nvidia-settings.desktop
bsdtar -xf nvidia-persistenced-init.tar.bz2 bsdtar -xf nvidia-persistenced-init.tar.bz2
#gunzip nvidia-{cuda-mps-control,modprobe,persistenced,settings,smi,xconfig}.1.gz
sed \ sed \
-e "s/__VERSION_STRING/${pkgver}/" \ -e "s/__VERSION_STRING/${pkgver}/" \

90
nvidia-drm-defs-fix.patch Normal file
View file

@ -0,0 +1,90 @@
diff --git a/usr/src/nvidia-535.129.03-orig/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
index 6c68d82..6044b8f 100644
--- a/usr/src/nvidia-535.129.03-orig/nvidia-drm/nvidia-drm-drv.c
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
@@ -1287,29 +1287,29 @@ static const struct drm_ioctl_desc nv_drm_ioctls[] = {
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_IMPORT_NVKMS_MEMORY,
nv_drm_gem_import_nvkms_memory_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_IMPORT_USERSPACE_MEMORY,
nv_drm_gem_import_userspace_memory_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_MAP_OFFSET,
nv_drm_gem_map_offset_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GET_DEV_INFO,
nv_drm_get_dev_info_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
#if defined(NV_DRM_FENCE_AVAILABLE)
DRM_IOCTL_DEF_DRV(NVIDIA_FENCE_SUPPORTED,
nv_drm_fence_supported_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_PRIME_FENCE_CONTEXT_CREATE,
nv_drm_prime_fence_context_create_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_PRIME_FENCE_ATTACH,
nv_drm_gem_prime_fence_attach_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
#endif
DRM_IOCTL_DEF_DRV(NVIDIA_GET_CLIENT_CAPABILITY,
@@ -1318,37 +1318,37 @@ static const struct drm_ioctl_desc nv_drm_ioctls[] = {
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
DRM_IOCTL_DEF_DRV(NVIDIA_GET_CRTC_CRC32,
nv_drm_get_crtc_crc32_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GET_CRTC_CRC32_V2,
nv_drm_get_crtc_crc32_v2_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_EXPORT_NVKMS_MEMORY,
nv_drm_gem_export_nvkms_memory_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_ALLOC_NVKMS_MEMORY,
nv_drm_gem_alloc_nvkms_memory_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_EXPORT_DMABUF_MEMORY,
nv_drm_gem_export_dmabuf_memory_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_IDENTIFY_OBJECT,
nv_drm_gem_identify_object_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_DMABUF_SUPPORTED,
nv_drm_dmabuf_supported_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GET_DPY_ID_FOR_CONNECTOR_ID,
nv_drm_get_dpy_id_for_connector_id_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GET_CONNECTOR_ID_FOR_DPY_ID,
nv_drm_get_connector_id_for_dpy_id_ioctl,
- DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(NVIDIA_GRANT_PERMISSIONS,
nv_drm_grant_permission_ioctl,
- DRM_UNLOCKED|DRM_MASTER),
+ DRM_MASTER),
DRM_IOCTL_DEF_DRV(NVIDIA_REVOKE_PERMISSIONS,
nv_drm_revoke_permission_ioctl,
- DRM_UNLOCKED|DRM_MASTER),
+ DRM_MASTER),
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
};

22
nvidia-eventfd-fix.patch Normal file
View file

@ -0,0 +1,22 @@
diff --git a/usr/src/nvidia-535.129.03-orig/nvidia-vgpu-vfio/nvidia-vgpu-vfio.c b/kernel/nvidia-vgpu-vfio/nvidia-vgpu-vfio.c
index a2620f6..b1f434f 100644
--- a/usr/src/nvidia-535.129.03-orig/nvidia-vgpu-vfio/nvidia-vgpu-vfio.c
+++ b/kernel/nvidia-vgpu-vfio/nvidia-vgpu-vfio.c
@@ -2872,7 +2872,7 @@ static irqreturn_t vgpu_msix_handler(int irq, void *arg)
}
if (trigger != NULL)
- eventfd_signal(trigger, 1);
+ eventfd_signal(trigger);
else
return IRQ_NONE;
@@ -3185,7 +3185,7 @@ NV_STATUS nv_vgpu_inject_interrupt(void *vgpuRef)
}
NV_SPIN_UNLOCK_IRQRESTORE(&vgpu_dev->intr_info_lock, eflags);
- eventfd_signal(trigger, 1);
+ eventfd_signal(trigger);
return status;
}

View file

@ -0,0 +1,22 @@
diff --git a/usr/src/nvidia-535.129.03-orig/nvidia/nv-pci.c b/kernel/nvidia/nv-pci.c
index 326833e..74ac5c7 100644
--- a/usr/src/nvidia-535.129.03-orig/nvidia/nv-pci.c
+++ b/kernel/nvidia/nv-pci.c
@@ -31,6 +31,7 @@
#if defined(NV_VGPU_KVM_BUILD)
#include "nv-vgpu-vfio-interface.h"
+#include <linux/iommu.h> /** iommu_present */
#endif
#if defined(NV_SEQ_READ_ITER_PRESENT)
@@ -212,7 +213,8 @@ nv_pci_probe
goto failed;
}
- if (pci_dev->dev.bus->iommu_ops == NULL)
+ //if (pci_dev->dev.bus->iommu_ops == NULL)
+ if(!iommu_present(pci_dev->dev.bus))
{
nv = NV_STATE_PTR(nvl);
if (rm_is_iommu_needed_for_sriov(sp, nv))