525.78.01

This commit is contained in:
Andy Ritger
2023-01-05 10:40:27 -08:00
parent 9594cc0169
commit dac2350c7f
180 changed files with 9465 additions and 4853 deletions

View File

@@ -81,7 +81,9 @@ typedef struct THREAD_STATE_NODE THREAD_STATE_NODE; // FW declare thread state
#define NV_ROUNDUP(a,b) ((NV_CEIL(a,b))*(b))
#define NV_ROUND_TO_QUANTA(a, quanta) (((quanta) == 0) ? (a): ((((a) + ((quanta) >> 1)) / (quanta)) * (quanta)))
#define NV_FLOOR_TO_QUANTA(a, quanta) (((a) / (quanta)) * (quanta))
#ifndef NV_SIZEOF32
#define NV_SIZEOF32(x) (sizeof(x))
#endif
#define NV_ARRAY_ELEMENTS(x) ((sizeof(x)/sizeof((x)[0])))
#define NV_ARRAY_ELEMENTS32(x) ((NV_SIZEOF32(x)/NV_SIZEOF32((x)[0])))
#define NV_BYTESWAP16(a) ((((a) & 0xff00)>>8) | \

View File

@@ -128,12 +128,12 @@ void pmaAddrtreeSetEvictingFrames(void *pMap, NvU64 frameEvictionsInProcess);
NV_STATUS pmaAddrtreeScanContiguous(
void *pMap, NvU64 addrBase, NvU64 rangeStart, NvU64 rangeEnd,
NvU64 numPages, NvU64 *freelist, NvU32 pageSize, NvU64 alignment,
NvU64 *pagesAllocated, NvBool bSkipEvict);
NvU64 *pagesAllocated, NvBool bSkipEvict, NvBool bReverseAlloc);
NV_STATUS pmaAddrtreeScanDiscontiguous(
void *pMap, NvU64 addrBase, NvU64 rangeStart, NvU64 rangeEnd,
NvU64 numPages, NvU64 *freelist, NvU32 pageSize, NvU64 alignment,
NvU64 *pagesAllocated, NvBool bSkipEvict);
NvU64 *pagesAllocated, NvBool bSkipEvict, NvBool bReverseAlloc);
void pmaAddrtreePrintTree(void *pMap, const char* str);

View File

@@ -98,6 +98,7 @@ typedef struct SCRUB_NODE SCRUB_NODE;
#define PMA_ALLOCATE_NO_ZERO NVBIT(10)
#define PMA_ALLOCATE_TURN_BLACKLIST_OFF NVBIT(11)
#define PMA_ALLOCATE_ALLOW_PARTIAL NVBIT(12)
#define PMA_ALLOCATE_REVERSE_ALLOC NVBIT(13)
// Output flags
#define PMA_ALLOCATE_RESULT_IS_ZERO NVBIT(0)
@@ -183,10 +184,10 @@ typedef void (*pmaMapChangePageStateAttrib_t)(void *pMap, NvU64 startFrame, NvU
typedef PMA_PAGESTATUS (*pmaMapRead_t)(void *pMap, NvU64 frameNum, NvBool readAttrib);
typedef NV_STATUS (*pmaMapScanContiguous_t)(void *pMap, NvU64 addrBase, NvU64 rangeStart, NvU64 rangeEnd,
NvU64 numPages, NvU64 *freelist, NvU32 pageSize, NvU64 alignment,
NvU64 *pagesAllocated, NvBool bSkipEvict);
NvU64 *pagesAllocated, NvBool bSkipEvict, NvBool bReverseAlloc);
typedef NV_STATUS (*pmaMapScanDiscontiguous_t)(void *pMap, NvU64 addrBase, NvU64 rangeStart, NvU64 rangeEnd,
NvU64 numPages, NvU64 *freelist, NvU32 pageSize, NvU64 alignment,
NvU64 *pagesAllocated, NvBool bSkipEvict);
NvU64 *pagesAllocated, NvBool bSkipEvict, NvBool bReverseAlloc);
typedef void (*pmaMapGetSize_t)(void *pMap, NvU64 *pBytesTotal);
typedef void (*pmaMapGetLargestFree_t)(void *pMap, NvU64 *pLargestFree);
typedef NV_STATUS (*pmaMapScanContiguousNumaEviction_t)(void *pMap, NvU64 addrBase, NvLength actualSize,

View File

@@ -189,7 +189,7 @@ PMA_PAGESTATUS pmaRegmapRead(void *pMap, NvU64 frameNum, NvBool readAttrib);
NV_STATUS pmaRegmapScanContiguous(
void *pMap, NvU64 addrBase, NvU64 rangeStart, NvU64 rangeEnd,
NvU64 numPages, NvU64 *freelist, NvU32 pageSize, NvU64 alignment,
NvU64 *pagesAllocated, NvBool bSkipEvict);
NvU64 *pagesAllocated, NvBool bSkipEvict, NvBool bReverseAlloc);
/*!
* @brief Scan the list for any space
@@ -216,7 +216,7 @@ NV_STATUS pmaRegmapScanContiguous(
NV_STATUS pmaRegmapScanDiscontiguous(
void *pMap, NvU64 addrBase, NvU64 rangeStart, NvU64 rangeEnd,
NvU64 numPages, NvU64 *freelist, NvU32 pageSize, NvU64 alignment,
NvU64 *pagesAllocated, NvBool bSkipEvict);
NvU64 *pagesAllocated, NvBool bSkipEvict, NvBool bReverseAlloc);
/*!
* @brief Gets the total size of specified PMA managed region.

View File

@@ -70,6 +70,13 @@
* @{
*/
/**
* @brief Initialization function for port atomics
*
* This function is only needed for Libos
*/
PORT_ATOMIC_INLINE void portAtomicInit(void);
/**
* @brief Atomic addition on a signed 32b integer
*

View File

@@ -68,6 +68,12 @@ portAtomicTimerBarrier(void)
#if PORT_COMPILER_HAS_INTRINSIC_ATOMICS && !defined(NV_MODS) && !NVOS_IS_LIBOS
PORT_ATOMIC_INLINE void
portAtomicInit(void)
{
}
PORT_ATOMIC_INLINE NvS32
portAtomicAddS32
(

View File

@@ -93,6 +93,12 @@ portAtomicTimerBarrier(void)
#if PORT_COMPILER_HAS_INTRINSIC_ATOMICS && !defined(NV_MODS) && !NVOS_IS_LIBOS
PORT_ATOMIC_INLINE void
portAtomicInit(void)
{
}
PORT_ATOMIC_INLINE NvS32
portAtomicAddS32
(

View File

@@ -43,6 +43,10 @@ void *_portMemAllocatorAlloc(PORT_MEM_ALLOCATOR *pAlloc, NvLength length);
/** @brief Wrapper around pAlloc->_portFree() that tracks the allocation */
void _portMemAllocatorFree(PORT_MEM_ALLOCATOR *pAlloc, void *pMem);
#if PORT_MEM_TRACK_USE_LIMIT
/** @brief Initialize per VF tracking limit **/
void portMemInitializeAllocatorTrackingLimit(NvU32 pid, NvU64 heapSize, NvBool bLimitEnabled);
#endif
typedef struct PORT_MEM_COUNTER
{
@@ -146,7 +150,7 @@ PORT_MEM_ALLOCATOR *portMemExAllocatorCreateLockedOnExistingBlock_CallerInfo(voi
#endif // CALLERINFO
#if PORT_MEM_TRACK_USE_FENCEPOSTS || PORT_MEM_TRACK_USE_ALLOCLIST || PORT_MEM_TRACK_USE_CALLERINFO
#if PORT_MEM_TRACK_USE_FENCEPOSTS || PORT_MEM_TRACK_USE_ALLOCLIST || PORT_MEM_TRACK_USE_CALLERINFO || PORT_MEM_TRACK_USE_LIMIT
typedef struct PORT_MEM_HEADER
{
#if PORT_MEM_TRACK_USE_CALLERINFO
@@ -158,6 +162,10 @@ typedef struct PORT_MEM_HEADER
#if PORT_MEM_TRACK_USE_FENCEPOSTS
PORT_MEM_FENCE_HEAD fence;
#endif
#if PORT_MEM_TRACK_USE_LIMIT
NvU64 blockSize;
NvU32 pid;
#endif
} PORT_MEM_HEADER;
typedef struct PORT_MEM_FOOTER

View File

@@ -904,6 +904,19 @@ void portMemExUnmapIOSpace(void *addr, NvU64 byteSize);
*/
#define PORT_MEM_TRACK_USE_LOGGING 0
#endif
#if !defined(PORT_MEM_TRACK_USE_LIMIT)
/**
* @brief Track and enforce a heap memory usage limit on processes
* running in GSP-RM.
*
* Default is on in GSP-RM only.
*/
#ifndef GSP_PLUGIN_BUILD
#define PORT_MEM_TRACK_USE_LIMIT (NVOS_IS_LIBOS)
#else
#define PORT_MEM_TRACK_USE_LIMIT 0
#endif
#endif // !defined(PORT_MEM_TRACK_USE_LIMIT)
/** @brief Nothing is printed unless @ref portMemPrintTrackingInfo is called */
#define PORT_MEM_TRACK_PRINT_LEVEL_SILENT 0

View File

@@ -139,6 +139,12 @@ typedef void *PUID_TOKEN;
/// Internal Client handles start at this base value
#define RS_CLIENT_INTERNAL_HANDLE_BASE 0xC1E00000
/// VF Client handles start at this base value
#define RS_CLIENT_VF_HANDLE_BASE 0xE0000000
/// Get the VF client handle range for gfid
#define RS_CLIENT_GET_VF_HANDLE_BASE(gfid) (RS_CLIENT_VF_HANDLE_BASE + ((gfid) - 1) * RS_CLIENT_HANDLE_MAX)
//
// Print a warning if any client's resource count exceeds this
// threshold. Unless this was intentional, this is likely a client bug.

View File

@@ -354,6 +354,15 @@ NvBool serverShareIterNext(RS_SHARE_ITERATOR*);
NV_STATUS serverSetClientHandleBase(RsServer *pServer, NvU32 clientHandleBase);
/**
* Return an available client handle for new client allocation
*
* @param[in] pServer This server instance
* @param[in] bInternalHandle Client is an RM internal client
* @param[in] pSecInfo Security context of this client allocation
*/
extern NvU32 serverAllocClientHandleBase(RsServer *pServer, NvBool bInternalHandle, API_SECURITY_INFO *pSecInfo);
/**
* Allocate a resource. Assumes top-level lock has been taken.
*