Skip to content

Commit

Permalink
560.35.03
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravjuvekar committed Aug 19, 2024
1 parent 315fd96 commit ed4be64
Show file tree
Hide file tree
Showing 25 changed files with 156 additions and 51 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NVIDIA Linux Open GPU Kernel Module Source

This is the source release of the NVIDIA Linux open GPU kernel modules,
version 560.31.02.
version 560.35.03.


## How to Build
Expand All @@ -17,7 +17,7 @@ as root:

Note that the kernel modules built here must be used with GSP
firmware and user-space NVIDIA GPU driver components from a corresponding
560.31.02 driver release. This can be achieved by installing
560.35.03 driver release. This can be achieved by installing
the NVIDIA GPU driver from the .run file using the `--no-kernel-modules`
option. E.g.,

Expand Down Expand Up @@ -185,7 +185,7 @@ table below).
For details on feature support and limitations, see the NVIDIA GPU driver
end user README here:

https://us.download.nvidia.com/XFree86/Linux-x86_64/560.31.02/README/kernel_open.html
https://us.download.nvidia.com/XFree86/Linux-x86_64/560.35.03/README/kernel_open.html

For vGPU support, please refer to the README.vgpu packaged in the vGPU Host
Package for more details.
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
EXTRA_CFLAGS += -I$(src)
EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"560.31.02\"
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"560.35.03\"

ifneq ($(SYSSRCHOST1X),)
EXTRA_CFLAGS += -I$(SYSSRCHOST1X)
Expand Down
8 changes: 4 additions & 4 deletions kernel-open/common/inc/nvkms-kapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ struct NvKmsKapiFunctionsTable {
);

/*!
* Immediately reset the specified display semaphore to the pending state.
* Immediately initialize the specified display semaphore to the pending state.
*
* Must be called prior to applying a mode set that utilizes the specified
* display semaphore for synchronization.
Expand All @@ -1438,7 +1438,7 @@ struct NvKmsKapiFunctionsTable {
* for the specified device.
*/
NvBool
(*resetDisplaySemaphore)
(*tryInitDisplaySemaphore)
(
struct NvKmsKapiDevice *device,
NvU32 semaphoreIndex
Expand All @@ -1447,7 +1447,7 @@ struct NvKmsKapiFunctionsTable {
/*!
* Immediately set the specified display semaphore to the displayable state.
*
* Must be called after \ref resetDisplaySemaphore to indicate a mode
* Must be called after \ref tryInitDisplaySemaphore to indicate a mode
* configuration change that utilizes the specified display semaphore for
* synchronization may proceed.
*
Expand All @@ -1471,7 +1471,7 @@ struct NvKmsKapiFunctionsTable {
*
* This can be used by clients to restore a semaphore to a consistent state
* when they have prepared it for use by previously calling
* \ref resetDisplaySemaphore() on it, but are then prevented from
* \ref tryInitDisplaySemaphore() on it, but are then prevented from
* submitting the associated hardware operations to consume it due to the
* subsequent failure of some software or hardware operation.
*
Expand Down
10 changes: 8 additions & 2 deletions kernel-open/nvidia-drm/nvidia-drm-modeset.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ static int __nv_drm_convert_in_fences(
&to_nv_crtc_state(crtc_state)->req_config;
struct nv_drm_plane_fence_cb_data *fence_data;
uint32_t semaphore_index;
uint32_t idx_count;
int ret, i;

if (!crtc_state->active) {
Expand Down Expand Up @@ -244,9 +245,14 @@ static int __nv_drm_convert_in_fences(
return -EINVAL;
}

semaphore_index = nv_drm_next_display_semaphore(nv_dev);
for (idx_count = 0; idx_count < nv_dev->display_semaphores.count; idx_count++) {
semaphore_index = nv_drm_next_display_semaphore(nv_dev);
if (nvKms->tryInitDisplaySemaphore(nv_dev->pDevice, semaphore_index)) {
break;
}
}

if (!nvKms->resetDisplaySemaphore(nv_dev->pDevice, semaphore_index)) {
if (idx_count == nv_dev->display_semaphores.count) {
NV_DRM_DEV_LOG_ERR(
nv_dev,
"Failed to initialize semaphore for plane fence");
Expand Down
6 changes: 4 additions & 2 deletions kernel-open/nvidia-uvm/uvm_common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
Copyright (c) 2013-2023 NVIDIA Corporation
Copyright (c) 2013-2024 NVIDIA Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -423,7 +423,9 @@ static void uvm_get_unaddressable_range(NvU32 num_va_bits, NvU64 *first, NvU64 *
UVM_ASSERT(first);
UVM_ASSERT(outer);

if (uvm_platform_uses_canonical_form_address()) {
// Maxwell GPUs (num_va_bits == 40b) do not support canonical form address
// even when plugged into platforms using it.
if (uvm_platform_uses_canonical_form_address() && num_va_bits > 40) {
*first = 1ULL << (num_va_bits - 1);
*outer = (NvU64)((NvS64)(1ULL << 63) >> (64 - num_va_bits));
}
Expand Down
9 changes: 9 additions & 0 deletions kernel-open/nvidia-uvm/uvm_populate_pageable.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ NV_STATUS uvm_populate_pageable_vma(struct vm_area_struct *vma,
if (status != NV_OK)
goto out;

// Kernel v6.6 introduced a bug in set_pte_range() around the handling of AF
// bit. Instead of setting the AF bit, the bit is incorrectly being cleared
// in set_pte_range() during first-touch fault handling. Calling
// handle_mm_fault() again takes a different code path which correctly sets
// the AF bit.
status = handle_fault(vma, start, vma_num_pages, !!(gup_flags & FOLL_WRITE));
if (status != NV_OK)
goto out;

if (touch)
ret = NV_PIN_USER_PAGES_REMOTE(mm, start, vma_num_pages, gup_flags, pages, NULL);
else
Expand Down
20 changes: 10 additions & 10 deletions src/common/inc/nvBldVer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@
// and then checked back in. You cannot make changes to these sections without
// corresponding changes to the buildmeister script
#ifndef NV_BUILD_BRANCH
#define NV_BUILD_BRANCH r560_78
#define NV_BUILD_BRANCH r560_88
#endif
#ifndef NV_PUBLIC_BRANCH
#define NV_PUBLIC_BRANCH r560_78
#define NV_PUBLIC_BRANCH r560_88
#endif

#if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r560/r560_78-120"
#define NV_BUILD_CHANGELIST_NUM (34643855)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r560/r560_88-137"
#define NV_BUILD_CHANGELIST_NUM (34725486)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "rel/gpu_drv/r560/r560_78-120"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (34643855)
#define NV_BUILD_NAME "rel/gpu_drv/r560/r560_88-137"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (34725486)

#else /* Windows builds */
#define NV_BUILD_BRANCH_VERSION "r560_78-2"
#define NV_BUILD_CHANGELIST_NUM (34643068)
#define NV_BUILD_BRANCH_VERSION "r560_88-4"
#define NV_BUILD_CHANGELIST_NUM (34711266)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "560.81"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (34643068)
#define NV_BUILD_NAME "560.94"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (34711266)
#define NV_BUILD_BRANCH_BASE_VERSION R560
#endif
// End buildmeister python edited section
Expand Down
2 changes: 1 addition & 1 deletion src/common/inc/nvUnixVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS) || defined(NV_VMWARE) || defined(NV_QNX) || defined(NV_INTEGRITY) || \
(defined(RMCFG_FEATURE_PLATFORM_GSP) && RMCFG_FEATURE_PLATFORM_GSP == 1)

#define NV_VERSION_STRING "560.31.02"
#define NV_VERSION_STRING "560.35.03"

#else

Expand Down
2 changes: 2 additions & 0 deletions src/common/sdk/nvidia/inc/nvfixedtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ typedef NvUFXP32 NvUFXP25_7;
typedef NvUFXP32 NvUFXP26_6;
typedef NvUFXP32 NvUFXP28_4;

typedef NvUFXP64 NvUFXP37_27;
typedef NvUFXP64 NvUFXP40_24;
typedef NvUFXP64 NvUFXP48_16;
typedef NvUFXP64 NvUFXP52_12;
typedef NvUFXP64 NvUFXP54_10;
typedef NvUFXP64 NvUFXP60_4;

/*!
Expand Down
4 changes: 2 additions & 2 deletions src/nvidia-modeset/kapi/include/nvkms-kapi-notifiers.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ NvBool nvKmsKapiIsNotifierFinish(const struct NvKmsKapiDevice *device,
void nvKmsKapiNotifierSetNotBegun(struct NvKmsKapiDevice *device,
NvU32 head, NvU32 layer, NvU32 index);

NvBool nvKmsKapiResetDisplaySemaphore(struct NvKmsKapiDevice *device,
NvU32 index);
NvBool nvKmsKapiTryInitDisplaySemaphore(struct NvKmsKapiDevice *device,
NvU32 index);

void nvKmsKapiSignalDisplaySemaphore(struct NvKmsKapiDevice *device,
NvU32 index);
Expand Down
8 changes: 4 additions & 4 deletions src/nvidia-modeset/kapi/interface/nvkms-kapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ struct NvKmsKapiFunctionsTable {
);

/*!
* Immediately reset the specified display semaphore to the pending state.
* Immediately initialize the specified display semaphore to the pending state.
*
* Must be called prior to applying a mode set that utilizes the specified
* display semaphore for synchronization.
Expand All @@ -1438,7 +1438,7 @@ struct NvKmsKapiFunctionsTable {
* for the specified device.
*/
NvBool
(*resetDisplaySemaphore)
(*tryInitDisplaySemaphore)
(
struct NvKmsKapiDevice *device,
NvU32 semaphoreIndex
Expand All @@ -1447,7 +1447,7 @@ struct NvKmsKapiFunctionsTable {
/*!
* Immediately set the specified display semaphore to the displayable state.
*
* Must be called after \ref resetDisplaySemaphore to indicate a mode
* Must be called after \ref tryInitDisplaySemaphore to indicate a mode
* configuration change that utilizes the specified display semaphore for
* synchronization may proceed.
*
Expand All @@ -1471,7 +1471,7 @@ struct NvKmsKapiFunctionsTable {
*
* This can be used by clients to restore a semaphore to a consistent state
* when they have prepared it for use by previously calling
* \ref resetDisplaySemaphore() on it, but are then prevented from
* \ref tryInitDisplaySemaphore() on it, but are then prevented from
* submitting the associated hardware operations to consume it due to the
* subsequent failure of some software or hardware operation.
*
Expand Down
10 changes: 2 additions & 8 deletions src/nvidia-modeset/kapi/src/nvkms-kapi-notifiers.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ NvBool nvKmsKapiAllocateSemaphores(struct NvKmsKapiDevice *device,
return NV_TRUE;
}

NvBool nvKmsKapiResetDisplaySemaphore(struct NvKmsKapiDevice *device,
NvU32 index)
NvBool nvKmsKapiTryInitDisplaySemaphore(struct NvKmsKapiDevice *device,
NvU32 index)
{
struct nvKmsParsedSemaphore semParsed;

Expand All @@ -297,12 +297,6 @@ NvBool nvKmsKapiResetDisplaySemaphore(struct NvKmsKapiDevice *device,
&semParsed);

if (semParsed.payload != NVKMS_KAPI_SEMAPHORE_VALUE_DONE) {
nvKmsKapiLogDeviceDebug(
device,
"Attempt to reuse semaphore at index %u with pending status 0x%08x",
index,
semParsed.payload);

return NV_FALSE;
}

Expand Down
2 changes: 1 addition & 1 deletion src/nvidia-modeset/kapi/src/nvkms-kapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3607,7 +3607,7 @@ NvBool nvKmsKapiGetFunctionsTableInternal
nvKmsKapiSetSemaphoreSurfaceValue;
funcsTable->setSuspendResumeCallback = nvKmsKapiSetSuspendResumeCallback;

funcsTable->resetDisplaySemaphore = nvKmsKapiResetDisplaySemaphore;
funcsTable->tryInitDisplaySemaphore = nvKmsKapiTryInitDisplaySemaphore;
funcsTable->signalDisplaySemaphore = nvKmsKapiSignalDisplaySemaphore;
funcsTable->cancelDisplaySemaphore = nvKmsKapiCancelDisplaySemaphore;
funcsTable->signalVrrSemaphore = SignalVrrSemaphore;
Expand Down
26 changes: 21 additions & 5 deletions src/nvidia-modeset/src/nvkms-evo.c
Original file line number Diff line number Diff line change
Expand Up @@ -6716,7 +6716,8 @@ static NvBool GetDfpHdmiProtocol(const NVDpyEvoRec *pDpyEvo,
nvDpyGetOutputColorFormatInfo(pDpyEvo);
const NvBool forceHdmiFrlIsSupported = FALSE;

nvAssert(rmProtocol == NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_A ||
nvAssert(rmProtocol == NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_DUAL_TMDS ||
rmProtocol == NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_A ||
rmProtocol == NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_B);

/* Override protocol if this mode requires HDMI FRL. */
Expand All @@ -6743,10 +6744,25 @@ static NvBool GetDfpHdmiProtocol(const NVDpyEvoRec *pDpyEvo,
if (nvHdmiGetEffectivePixelClockKHz(pDpyEvo, pTimings, pDpyColor) <=
pDpyEvo->maxSingleLinkPixelClockKHz) {

*pTimingsProtocol = (rmProtocol ==
NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_A) ?
NVKMS_PROTOCOL_SOR_SINGLE_TMDS_A :
NVKMS_PROTOCOL_SOR_SINGLE_TMDS_B;
switch (rmProtocol) {
case NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_DUAL_TMDS:
/*
* Force single link TMDS protocol. HDMI does not support
* physically support dual link TMDS.
*
* TMDS_A: "use A side of the link"
*/
*pTimingsProtocol = NVKMS_PROTOCOL_SOR_SINGLE_TMDS_A;
break;
case NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_A:
*pTimingsProtocol = NVKMS_PROTOCOL_SOR_SINGLE_TMDS_A;
break;
case NV0073_CTRL_SPECIFIC_OR_PROTOCOL_SOR_SINGLE_TMDS_B:
*pTimingsProtocol = NVKMS_PROTOCOL_SOR_SINGLE_TMDS_B;
break;
default:
return FALSE;
}
return TRUE;
}
} while (nvDowngradeColorSpaceAndBpc(&colorFormatsInfo,
Expand Down
4 changes: 2 additions & 2 deletions src/nvidia-modeset/src/nvkms-headsurface-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ NvBool nvHsIoctlMoveCursor(
{
NVHsChannelEvoRec *pHsChannel;

if (apiHead > ARRAY_LEN(pDispEvo->pHsChannel)) {
if (apiHead >= ARRAY_LEN(pDispEvo->pHsChannel)) {
return FALSE;
}

Expand Down Expand Up @@ -206,7 +206,7 @@ NvBool nvHsIoctlSetCursorImage(
NVHsChannelEvoRec *pHsChannel;
NVSurfaceEvoRec *pSurfaceEvo = NULL;

if (apiHead > ARRAY_LEN(pDispEvo->pHsChannel)) {
if (apiHead >= ARRAY_LEN(pDispEvo->pHsChannel)) {
return FALSE;
}

Expand Down
6 changes: 5 additions & 1 deletion src/nvidia/arch/nvalloc/common/inc/gsp/gsp_proxy_reg.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
Expand Down Expand Up @@ -40,4 +40,8 @@
#define NVGSP_PROXY_REG_CONF_COMPUTE_MULTI_GPU_MODE_NONE 0x00000000
#define NVGSP_PROXY_REG_CONF_COMPUTE_MULTI_GPU_MODE_PROTECTED_PCIE 0x00000001

#define NVGSP_PROXY_REG_NVLINK_ENCRYPTION 5:5
#define NVGSP_PROXY_REG_NVLINK_ENCRYPTION_DISABLE 0x00000000
#define NVGSP_PROXY_REG_NVLINK_ENCRYPTION_ENABLE 0x00000001

#endif // NVGSP_PROXY_REG_H
1 change: 1 addition & 0 deletions src/nvidia/generated/g_gpu_mgr_nvoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ typedef struct CONF_COMPUTE_CAPS
NvBool bAcceptClientRequest;
NvBool bMultiGpuProtectedPcieModeEnabled;
NvBool bFatalFailure;
NvBool bNvlEncryptionEnabled;
} CONF_COMPUTE_CAPS;

//
Expand Down
2 changes: 2 additions & 0 deletions src/nvidia/generated/g_kernel_nvlink_nvoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ struct KernelNvlink {
NvBool PDB_PROP_KNVLINK_ENCRYPTION_ENABLED;

// Data members
NvU32 gspProxyRegkeys;
struct KernelIoctrl *PRIVATE_FIELD(pKernelIoctrl)[3];
NvU32 PRIVATE_FIELD(ioctrlMask);
NvU32 PRIVATE_FIELD(ipVerNvlink);
Expand Down Expand Up @@ -444,6 +445,7 @@ struct KernelNvlink_PRIVATE {
NvBool PDB_PROP_KNVLINK_ENCRYPTION_ENABLED;

// Data members
NvU32 gspProxyRegkeys;
struct KernelIoctrl *pKernelIoctrl[3];
NvU32 ioctrlMask;
NvU32 ipVerNvlink;
Expand Down
8 changes: 8 additions & 0 deletions src/nvidia/src/kernel/gpu/gsp/arch/hopper/kernel_gsp_gh100.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include "published/hopper/gh100/dev_riscv_pri.h"
#include "published/hopper/gh100/dev_vm.h"

#include "gpu/nvlink/kernel_nvlink.h"

#define RISCV_BR_ADDR_ALIGNMENT (8)

const char*
Expand Down Expand Up @@ -409,6 +411,12 @@ kgspSetupGspFmcArgs_GH100
pGspFmcBootParams->initParams.regkeys = pCC->gspProxyRegkeys;
}

KernelNvlink *pKernelNvlink = GPU_GET_KERNEL_NVLINK(pGpu);
if (pKernelNvlink != NULL)
{
pGspFmcBootParams->initParams.regkeys |= pKernelNvlink->gspProxyRegkeys;
}

pGspFmcBootParams->bootGspRmParams.gspRmDescOffset = memdescGetPhysAddr(pKernelGsp->pWprMetaDescriptor, AT_GPU, 0);
pGspFmcBootParams->bootGspRmParams.gspRmDescSize = sizeof(*pKernelGsp->pWprMeta);
pGspFmcBootParams->bootGspRmParams.target = _kgspMemdescToDmaTarget(pKernelGsp->pWprMetaDescriptor);
Expand Down
Loading

0 comments on commit ed4be64

Please sign in to comment.