mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-01-30 13:09:47 +00:00
535.43.09
This commit is contained in:
@@ -50,22 +50,6 @@
|
||||
|
||||
using namespace DisplayPort;
|
||||
|
||||
// These wrappers are specifically for DSC PPS library malloc and free callbacks
|
||||
// Pointer to these functions are populated to dscMalloc/dscFree in DSC_InitializeCallBack and it is initialized from both DPLib and HDMiPacketLib.
|
||||
// In HDMI case, callback function for malloc/free needs client handle so to match function prototype, in DP case, adding these wrappers.
|
||||
extern "C" void * dpMallocCb(const void *clientHandle, NvLength size);
|
||||
extern "C" void dpFreeCb(const void *clientHandle, void *pMemPtr);
|
||||
|
||||
extern "C" void * dpMallocCb(const void *clientHandle, NvLength size)
|
||||
{
|
||||
return dpMalloc(size);
|
||||
}
|
||||
|
||||
extern "C" void dpFreeCb(const void *clientHandle, void *pMemPtr)
|
||||
{
|
||||
dpFree(pMemPtr);
|
||||
}
|
||||
|
||||
ConnectorImpl::ConnectorImpl(MainLink * main, AuxBus * auxBus, Timer * timer, Connector::EventSink * sink)
|
||||
: main(main),
|
||||
auxBus(auxBus),
|
||||
@@ -158,14 +142,6 @@ ConnectorImpl::ConnectorImpl(MainLink * main, AuxBus * auxBus, Timer * timer, Co
|
||||
hal->applyRegkeyOverrides(dpRegkeyDatabase);
|
||||
|
||||
highestAssessedLC = getMaxLinkConfig();
|
||||
|
||||
// Initialize DSC callbacks
|
||||
DSC_CALLBACK callback;
|
||||
callback.clientHandle = NULL;
|
||||
callback.dscPrint = NULL;
|
||||
callback.dscMalloc = dpMallocCb;
|
||||
callback.dscFree = dpFreeCb;
|
||||
DSC_InitializeCallback(callback);
|
||||
}
|
||||
|
||||
void ConnectorImpl::applyRegkeyOverrides(const DP_REGKEY_DATABASE& dpRegkeyDatabase)
|
||||
@@ -1309,10 +1285,13 @@ bool ConnectorImpl::compoundQueryAttach(Group * target,
|
||||
warData.dpData.hBlank = modesetParams.modesetInfo.rasterWidth - modesetParams.modesetInfo.surfaceWidth;
|
||||
warData.connectorType = DSC_DP;
|
||||
|
||||
DSC_GENERATE_PPS_OPAQUE_WORKAREA *pScratchBuffer = nullptr;
|
||||
pScratchBuffer = (DSC_GENERATE_PPS_OPAQUE_WORKAREA*) dpMalloc(sizeof(DSC_GENERATE_PPS_OPAQUE_WORKAREA));
|
||||
|
||||
result = DSC_GeneratePPS(&dscInfo, &modesetInfoDSC,
|
||||
&warData, availableBandwidthBitsPerSecond,
|
||||
(NvU32*)(PPS),
|
||||
(NvU32*)(&bitsPerPixelX16));
|
||||
(NvU32*)(&bitsPerPixelX16), pScratchBuffer);
|
||||
|
||||
// Try max dsc compression bpp = 8 once to check if that can support that mode.
|
||||
if (result != NVT_STATUS_SUCCESS && !bDscBppForced)
|
||||
@@ -1324,7 +1303,13 @@ bool ConnectorImpl::compoundQueryAttach(Group * target,
|
||||
result = DSC_GeneratePPS(&dscInfo, &modesetInfoDSC,
|
||||
&warData, availableBandwidthBitsPerSecond,
|
||||
(NvU32*)(PPS),
|
||||
(NvU32*)(&bitsPerPixelX16));
|
||||
(NvU32*)(&bitsPerPixelX16), pScratchBuffer);
|
||||
}
|
||||
|
||||
if (pScratchBuffer)
|
||||
{
|
||||
dpFree(pScratchBuffer);
|
||||
pScratchBuffer = nullptr;
|
||||
}
|
||||
|
||||
if (result != NVT_STATUS_SUCCESS)
|
||||
@@ -1614,10 +1599,21 @@ nonDscDpIMP:
|
||||
warData.dpData.dpMode = DSC_DP_SST;
|
||||
warData.connectorType = DSC_DP;
|
||||
|
||||
if ((DSC_GeneratePPS(&dscInfo, &modesetInfoDSC,
|
||||
&warData, availableBandwidthBitsPerSecond,
|
||||
(NvU32*)(PPS),
|
||||
(NvU32*)(&bitsPerPixelX16))) != NVT_STATUS_SUCCESS)
|
||||
DSC_GENERATE_PPS_OPAQUE_WORKAREA *pScratchBuffer = nullptr;
|
||||
pScratchBuffer = (DSC_GENERATE_PPS_OPAQUE_WORKAREA*)dpMalloc(sizeof(DSC_GENERATE_PPS_OPAQUE_WORKAREA));
|
||||
|
||||
bool bPpsFailure = ((DSC_GeneratePPS(&dscInfo, &modesetInfoDSC,
|
||||
&warData, availableBandwidthBitsPerSecond,
|
||||
(NvU32*)(PPS),
|
||||
(NvU32*)(&bitsPerPixelX16),
|
||||
pScratchBuffer)) != NVT_STATUS_SUCCESS);
|
||||
if (pScratchBuffer)
|
||||
{
|
||||
dpFree(pScratchBuffer);
|
||||
pScratchBuffer = nullptr;
|
||||
}
|
||||
|
||||
if (bPpsFailure)
|
||||
{
|
||||
compoundQueryResult = false;
|
||||
pDscParams->bEnableDsc = false;
|
||||
|
||||
@@ -43,18 +43,18 @@
|
||||
#endif
|
||||
|
||||
#if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS)
|
||||
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r535/VK535_87-128"
|
||||
#define NV_BUILD_CHANGELIST_NUM (33195052)
|
||||
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r535/VK535_87-129"
|
||||
#define NV_BUILD_CHANGELIST_NUM (33257513)
|
||||
#define NV_BUILD_TYPE "Official"
|
||||
#define NV_BUILD_NAME "rel/gpu_drv/r535/VK535_87-128"
|
||||
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (33195052)
|
||||
#define NV_BUILD_NAME "rel/gpu_drv/r535/VK535_87-129"
|
||||
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (33257513)
|
||||
|
||||
#else /* Windows builds */
|
||||
#define NV_BUILD_BRANCH_VERSION "VK535_87-8"
|
||||
#define NV_BUILD_CHANGELIST_NUM (33190458)
|
||||
#define NV_BUILD_BRANCH_VERSION "VK535_87-9"
|
||||
#define NV_BUILD_CHANGELIST_NUM (33257513)
|
||||
#define NV_BUILD_TYPE "Official"
|
||||
#define NV_BUILD_NAME "537.16"
|
||||
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (33190458)
|
||||
#define NV_BUILD_NAME "537.35"
|
||||
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (33257513)
|
||||
#define NV_BUILD_BRANCH_BASE_VERSION R535
|
||||
#endif
|
||||
// End buildmeister python edited section
|
||||
|
||||
@@ -158,6 +158,7 @@ static const PNPVendorId PNPVendorIds[] =
|
||||
{ "CSE", _VENDOR_NAME_ENTRY("Compu Shack") },
|
||||
{ "CSI", _VENDOR_NAME_ENTRY("Cabletron") },
|
||||
{ "CSS", _VENDOR_NAME_ENTRY("CSS Laboratories") },
|
||||
{ "CSW", _VENDOR_NAME_ENTRY("China Star Optoelectronics Technology Co., Ltd") },
|
||||
{ "CTN", _VENDOR_NAME_ENTRY("Computone") },
|
||||
{ "CTX", _VENDOR_NAME_ENTRY("Chuntex/CTX") },
|
||||
{ "CUB", _VENDOR_NAME_ENTRY("Cubix") },
|
||||
|
||||
@@ -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 "535.43.08"
|
||||
#define NV_VERSION_STRING "535.43.09"
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -110,7 +110,18 @@
|
||||
#define NV_PFALCON_FALCON_DMEMC_AINCW 24:24 /* RWIVF */
|
||||
#define NV_PFALCON_FALCON_DMEMC_AINCW_TRUE 0x00000001 /* RW--V */
|
||||
#define NV_PFALCON_FALCON_DMEMC_AINCW_FALSE 0x00000000 /* RW--V */
|
||||
#define NV_PFALCON_FALCON_DMEMC_AINCR 25:25 /* RWIVF */
|
||||
#define NV_PFALCON_FALCON_DMEMC_AINCR_TRUE 0x00000001 /* RW--V */
|
||||
#define NV_PFALCON_FALCON_DMEMC_AINCR_FALSE 0x00000000 /* RW--V */
|
||||
#define NV_PFALCON_FALCON_DMEMD(i) (0x000001c4+(i)*8) /* RW-4A */
|
||||
#define NV_PFALCON_FALCON_DMEMD_DATA 31:0 /* RW-VF */
|
||||
#define NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_0(i) (0x00000300+(i)*4) /* RW-4A */
|
||||
#define NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_0__SIZE_1 4 /* */
|
||||
#define NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_1(i) (0x00000310+(i)*4) /* RW-4A */
|
||||
#define NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_1__SIZE_1 4 /* */
|
||||
#define NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_2(i) (0x00000320+(i)*4) /* RW-4A */
|
||||
#define NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_2__SIZE_1 4 /* */
|
||||
#define NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_3(i) (0x00000330+(i)*4) /* RW-4A */
|
||||
#define NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_3__SIZE_1 4 /* */
|
||||
|
||||
#endif // __tu102_dev_falcon_v4_h__
|
||||
|
||||
@@ -181,24 +181,6 @@ static const NVHDMIPKT_CLASS_HIERARCHY hierarchy[] =
|
||||
},
|
||||
};
|
||||
|
||||
#if defined(DSC_CALLBACK_MODIFIED)
|
||||
// Callbacks for DSC PPS library
|
||||
void *hdmipktMallocCb(const void *clientHandle, NvLength size);
|
||||
void hdmipktFreeCb(const void *clientHandle, void *pMemPtr);
|
||||
|
||||
void *hdmipktMallocCb(const void *clientHandle, NvLength size)
|
||||
{
|
||||
const NVHDMIPKT_CLASS *pClass = (const NVHDMIPKT_CLASS*)(clientHandle);
|
||||
return pClass->callback.malloc(pClass->cbHandle, size);
|
||||
}
|
||||
|
||||
void hdmipktFreeCb(const void *clientHandle, void *pMemPtr)
|
||||
{
|
||||
const NVHDMIPKT_CLASS *pClass = (const NVHDMIPKT_CLASS*)(clientHandle);
|
||||
pClass->callback.free(pClass->cbHandle, pMemPtr);
|
||||
}
|
||||
#endif // DSC_CALLBACK_MODIFIED
|
||||
|
||||
/********************************** HDMI Library interfaces *************************************/
|
||||
/*
|
||||
* NvHdmiPkt_PacketCtrl
|
||||
@@ -581,15 +563,6 @@ NvHdmiPkt_InitializeLibrary(NvU32 const hwClass,
|
||||
// 2. Constructor calls
|
||||
result = NvHdmiPkt_CallConstructors(thisClassId, pClass);
|
||||
|
||||
#if defined(DSC_CALLBACK_MODIFIED)
|
||||
DSC_CALLBACK callbacks;
|
||||
NVMISC_MEMSET(&callbacks, 0, sizeof(DSC_CALLBACK));
|
||||
callbacks.clientHandle = pClass;
|
||||
callbacks.dscMalloc = hdmipktMallocCb;
|
||||
callbacks.dscFree = hdmipktFreeCb;
|
||||
DSC_InitializeCallback(callbacks);
|
||||
#endif // DSC_CALLBACK_MODIFIED
|
||||
|
||||
NvHdmiPkt_InitializeLibrary_exit:
|
||||
if (result)
|
||||
{
|
||||
|
||||
@@ -1168,18 +1168,29 @@ frlQuery_Success:
|
||||
NvU64 availableLinkBw = (NvU64)(frlBitRateGbps) * (NvU64)(numLanes) * MULTIPLIER_1G;
|
||||
warData.connectorType = DSC_HDMI;
|
||||
|
||||
DSC_GENERATE_PPS_OPAQUE_WORKAREA *pDscScratchBuffer = NULL;
|
||||
pDscScratchBuffer = (DSC_GENERATE_PPS_OPAQUE_WORKAREA*)pThis->callback.malloc(pThis->cbHandle,
|
||||
sizeof(DSC_GENERATE_PPS_OPAQUE_WORKAREA));
|
||||
|
||||
if ((DSC_GeneratePPS(&dscInfo,
|
||||
&dscModesetInfo,
|
||||
&warData,
|
||||
availableLinkBw,
|
||||
pFRLConfig->dscInfo.pps,
|
||||
&bitsPerPixelX16)) != NVT_STATUS_SUCCESS)
|
||||
&bitsPerPixelX16,
|
||||
pDscScratchBuffer)) != NVT_STATUS_SUCCESS)
|
||||
{
|
||||
NvHdmiPkt_Print(pThis, "ERROR - DSC PPS calculation failed.");
|
||||
NvHdmiPkt_Assert(0);
|
||||
result = NVHDMIPKT_FAIL;
|
||||
}
|
||||
|
||||
if (pDscScratchBuffer != NULL)
|
||||
{
|
||||
pThis->callback.free(pThis->cbHandle, pDscScratchBuffer);
|
||||
pDscScratchBuffer = NULL;
|
||||
}
|
||||
|
||||
// DSC lib should honor the bpp setting passed from client, assert here just in case
|
||||
NvHdmiPkt_Assert(bitsPerPixelX16 == pFRLConfig->dscInfo.bitsPerPixelX16);
|
||||
}
|
||||
|
||||
@@ -33,20 +33,19 @@
|
||||
#include "nvt_dsc_pps.h"
|
||||
#include "nvmisc.h"
|
||||
#include "displayport/displayport.h"
|
||||
#include "nvctassert.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/* ------------------------ Macros ----------------------------------------- */
|
||||
|
||||
#if defined (DEBUG)
|
||||
#define DSC_Print(...) \
|
||||
do { \
|
||||
if (callbacks.dscPrint) { \
|
||||
callbacks.dscPrint("DSC: " __VA_ARGS__); \
|
||||
} \
|
||||
} while(0)
|
||||
#else
|
||||
//
|
||||
// DSC_Print macro was for debugging purposes in early development of
|
||||
// DSC PPS library. The print statements no longer get logged
|
||||
// inside any client logger. But the lines of print in this file are useful
|
||||
// for browsing code, hence this DSC_Print is left as a stub
|
||||
// definition intentionally to help reader understand the PPS code.
|
||||
//
|
||||
#define DSC_Print(...) do { } while(0)
|
||||
#endif
|
||||
|
||||
#define MIN_CHECK(s,a,b) { if((a)<(b)) { DSC_Print("%s (=%u) needs to be larger than %u",s,a,b); return (NVT_STATUS_ERR);} }
|
||||
#define RANGE_CHECK(s,a,b,c) { if((((NvS32)(a))<(NvS32)(b))||(((NvS32)(a))>(NvS32)(c))) { DSC_Print("%s (=%u) needs to be between %u and %u",s,a,b,c); return (NVT_STATUS_ERR);} }
|
||||
@@ -171,9 +170,21 @@ typedef struct
|
||||
NvU32 flatness_det_thresh;
|
||||
} DSC_OUTPUT_PARAMS;
|
||||
|
||||
/* ------------------------ Global Variables ------------------------------- */
|
||||
//
|
||||
// Opaque scratch space is passed by client for DSC calculation usage.
|
||||
// Use an internal struct to cast the input buffer
|
||||
// into in/out params for DSC PPS calculation functions to work with
|
||||
//
|
||||
typedef struct _DSC_GENERATE_PPS_WORKAREA
|
||||
{
|
||||
DSC_INPUT_PARAMS in;
|
||||
DSC_OUTPUT_PARAMS out;
|
||||
} DSC_GENERATE_PPS_WORKAREA;
|
||||
|
||||
DSC_CALLBACK callbacks;
|
||||
// Compile time check to ensure Opaque workarea buffer size always covers required work area.
|
||||
ct_assert(sizeof(DSC_GENERATE_PPS_OPAQUE_WORKAREA) >= sizeof(DSC_GENERATE_PPS_WORKAREA));
|
||||
|
||||
/* ------------------------ Global Variables ------------------------------- */
|
||||
|
||||
static const NvU8 minqp444_8b[15][37]={
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
@@ -396,8 +407,6 @@ static const NvU32 rcBufThresh[] = { 896, 1792, 2688, 3584, 4480, 5376, 6272, 67
|
||||
/* ------------------------ Static Variables ------------------------------- */
|
||||
/* ------------------------ Private Functions Prototype--------------------- */
|
||||
|
||||
static void * DSC_Malloc(NvLength size);
|
||||
static void DSC_Free(void * ptr);
|
||||
static NvU32
|
||||
DSC_GetHigherSliceCount
|
||||
(
|
||||
@@ -1586,19 +1595,11 @@ static NVT_STATUS
|
||||
DSC_PpsDataGen
|
||||
(
|
||||
const DSC_INPUT_PARAMS *in,
|
||||
NvU32 out[DSC_MAX_PPS_SIZE_DWORD]
|
||||
DSC_OUTPUT_PARAMS *pPpsOut,
|
||||
NvU32 out[DSC_MAX_PPS_SIZE_DWORD]
|
||||
)
|
||||
{
|
||||
NVT_STATUS ret;
|
||||
DSC_OUTPUT_PARAMS *pPpsOut;
|
||||
|
||||
pPpsOut = (DSC_OUTPUT_PARAMS *)DSC_Malloc(sizeof(DSC_OUTPUT_PARAMS));
|
||||
if (pPpsOut == NULL)
|
||||
{
|
||||
DSC_Print("ERROR - Memory allocation error.");
|
||||
ret = NVT_STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
NVMISC_MEMSET(pPpsOut, 0, sizeof(DSC_OUTPUT_PARAMS));
|
||||
ret = DSC_PpsCalc(in, pPpsOut);
|
||||
@@ -1612,44 +1613,9 @@ DSC_PpsDataGen
|
||||
|
||||
/* fall through */
|
||||
done:
|
||||
DSC_Free(pPpsOut);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Allocates memory for requested size
|
||||
*
|
||||
* @param[in] size Size to be allocated
|
||||
*
|
||||
* @returns Pointer to allocated memory
|
||||
*/
|
||||
static void *
|
||||
DSC_Malloc(NvLength size)
|
||||
{
|
||||
#if defined(DSC_CALLBACK_MODIFIED)
|
||||
return (callbacks.dscMalloc)(callbacks.clientHandle, size);
|
||||
#else
|
||||
return (callbacks.dscMalloc)(size);
|
||||
#endif // DSC_CALLBACK_MODIFIED
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Frees dynamically allocated memory
|
||||
*
|
||||
* @param[in] ptr Pointer to a memory to be deallocated
|
||||
*
|
||||
*/
|
||||
static void
|
||||
DSC_Free(void * ptr)
|
||||
{
|
||||
#if defined(DSC_CALLBACK_MODIFIED)
|
||||
(callbacks.dscFree)(callbacks.clientHandle, ptr);
|
||||
#else
|
||||
(callbacks.dscFree)(ptr);
|
||||
#endif // DSC_CALLBACK_MODIFIED
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Validate input parameter we got from caller of this function
|
||||
*
|
||||
@@ -1992,19 +1958,26 @@ DSC_GeneratePPS
|
||||
const WAR_DATA *pWARData,
|
||||
NvU64 availableBandwidthBitsPerSecond,
|
||||
NvU32 pps[DSC_MAX_PPS_SIZE_DWORD],
|
||||
NvU32 *pBitsPerPixelX16
|
||||
NvU32 *pBitsPerPixelX16,
|
||||
DSC_GENERATE_PPS_OPAQUE_WORKAREA *pOpaqueWorkarea
|
||||
)
|
||||
{
|
||||
DSC_INPUT_PARAMS *in = NULL;
|
||||
DSC_INPUT_PARAMS *in = NULL;
|
||||
DSC_OUTPUT_PARAMS *out = NULL;
|
||||
DSC_GENERATE_PPS_WORKAREA *pWorkarea = NULL;
|
||||
NVT_STATUS ret = NVT_STATUS_ERR;
|
||||
|
||||
if ((!pDscInfo) || (!pModesetInfo) || (!pBitsPerPixelX16))
|
||||
if ((!pDscInfo) || (!pModesetInfo) || (!pBitsPerPixelX16) || (!pOpaqueWorkarea))
|
||||
{
|
||||
DSC_Print("ERROR - Invalid parameter.");
|
||||
ret = NVT_STATUS_INVALID_PARAMETER;
|
||||
goto done;
|
||||
}
|
||||
|
||||
pWorkarea = (DSC_GENERATE_PPS_WORKAREA*)(pOpaqueWorkarea);
|
||||
in = &pWorkarea->in;
|
||||
out = &pWorkarea->out;
|
||||
|
||||
ret = _validateInput(pDscInfo, pModesetInfo, pWARData, availableBandwidthBitsPerSecond);
|
||||
if (ret != NVT_STATUS_SUCCESS)
|
||||
{
|
||||
@@ -2013,14 +1986,6 @@ DSC_GeneratePPS
|
||||
goto done;
|
||||
}
|
||||
|
||||
in = (DSC_INPUT_PARAMS *)DSC_Malloc(sizeof(DSC_INPUT_PARAMS));
|
||||
if (in == NULL)
|
||||
{
|
||||
DSC_Print("ERROR - Memory allocation error.");
|
||||
ret = NVT_STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
NVMISC_MEMSET(in, 0, sizeof(DSC_INPUT_PARAMS));
|
||||
|
||||
in->bits_per_component = pModesetInfo->bitsPerComponent;
|
||||
@@ -2277,42 +2242,11 @@ DSC_GeneratePPS
|
||||
}
|
||||
}
|
||||
|
||||
ret = DSC_PpsDataGen(in, pps);
|
||||
ret = DSC_PpsDataGen(in, out, pps);
|
||||
|
||||
*pBitsPerPixelX16 = in->bits_per_pixel;
|
||||
|
||||
/* fall through */
|
||||
done:
|
||||
DSC_Free(in);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Initializes callbacks for print and assert
|
||||
*
|
||||
* @param[in] callback DSC callbacks
|
||||
*
|
||||
* @returns NVT_STATUS_SUCCESS if successful;
|
||||
* NVT_STATUS_ERR if unsuccessful;
|
||||
*/
|
||||
NVT_STATUS DSC_InitializeCallback(DSC_CALLBACK callback)
|
||||
{
|
||||
// if callbacks are initialized already, return nothing to do
|
||||
if (callbacks.dscMalloc && callbacks.dscFree)
|
||||
{
|
||||
return NVT_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#if defined(DSC_CALLBACK_MODIFIED)
|
||||
callbacks.clientHandle = callback.clientHandle;
|
||||
#endif // DSC_CALLBACK_MODIFIED
|
||||
callbacks.dscPrint = NULL;
|
||||
callbacks.dscMalloc = callback.dscMalloc;
|
||||
callbacks.dscFree = callback.dscFree;
|
||||
#if defined (DEBUG)
|
||||
callbacks.dscPrint = callback.dscPrint;
|
||||
#endif
|
||||
|
||||
return NVT_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -43,27 +43,6 @@
|
||||
|
||||
/* ------------------------ Datatypes -------------------------------------- */
|
||||
|
||||
#define DSC_CALLBACK_MODIFIED 1
|
||||
|
||||
#if defined(DSC_CALLBACK_MODIFIED)
|
||||
typedef struct
|
||||
{
|
||||
// DSC - Callbacks
|
||||
const void* clientHandle; // ClientHandle is only used when calling into HDMI lib's mallocCb/freeCb
|
||||
void (*dscPrint) (const char* fmtstring, ...);
|
||||
void *(*dscMalloc)(const void *clientHandle, NvLength size);
|
||||
void (*dscFree) (const void *clientHandle, void * ptr);
|
||||
} DSC_CALLBACK;
|
||||
#else
|
||||
typedef struct
|
||||
{
|
||||
// DSC - Callbacks
|
||||
void (*dscPrint) (const char* fmtstring, ...);
|
||||
void *(*dscMalloc)(NvLength size);
|
||||
void (*dscFree) (void * ptr);
|
||||
} DSC_CALLBACK;
|
||||
#endif // DSC_CALLBACK_MODIFIED
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 versionMajor;
|
||||
@@ -278,6 +257,16 @@ typedef struct
|
||||
}dpData;
|
||||
} WAR_DATA;
|
||||
|
||||
//
|
||||
// DSC PPS calculations need large scratch buffer to work with, which can be too
|
||||
// big for some platforms. These buffers need to be allocated on heap rather
|
||||
// than local stack variable. Clients are expected to pre-allocate
|
||||
// this buffer and pass it in to DSC PPS interface
|
||||
//
|
||||
typedef struct {
|
||||
NvU8 data[512U]; // an upper bound of total size of DSC_IN/OUTPUT_PARAMS
|
||||
} DSC_GENERATE_PPS_OPAQUE_WORKAREA;
|
||||
|
||||
/*
|
||||
* Windows testbed compiles are done with warnings as errors
|
||||
* with the maximum warning level. Here we turn off some
|
||||
@@ -292,16 +281,6 @@ typedef struct
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* @brief Initializes callbacks for print and assert
|
||||
*
|
||||
* @param[in] callback DSC callbacks
|
||||
*
|
||||
* @returns NVT_STATUS_SUCCESS if successful;
|
||||
* NVT_STATUS_ERR if unsuccessful;
|
||||
*/
|
||||
NVT_STATUS DSC_InitializeCallback(DSC_CALLBACK callback);
|
||||
|
||||
/*
|
||||
* @brief Calculate PPS parameters based on passed down Sink,
|
||||
* GPU capability and modeset info
|
||||
@@ -323,7 +302,8 @@ NVT_STATUS DSC_GeneratePPS(const DSC_INFO *pDscInfo,
|
||||
const WAR_DATA *pWARData,
|
||||
NvU64 availableBandwidthBitsPerSecond,
|
||||
NvU32 pps[DSC_MAX_PPS_SIZE_DWORD],
|
||||
NvU32 *pBitsPerPixelX16);
|
||||
NvU32 *pBitsPerPixelX16,
|
||||
DSC_GENERATE_PPS_OPAQUE_WORKAREA *pOpaqueWorkarea);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -136,6 +136,15 @@ typedef volatile struct _clcba2_tag0 {
|
||||
#define NVCBA2_ERROR_OS_APPLICATION (0x0000000D)
|
||||
#define NVCBA2_ERROR_INVALID_CTXSW_REQUEST (0x0000000E)
|
||||
#define NVCBA2_ERROR_BUFFER_OVERFLOW (0x0000000F)
|
||||
#define NVCBA2_ERROR_IV_OVERFLOW (0x00000010)
|
||||
#define NVCBA2_ERROR_INTERNAL_SETUP_FAILURE (0x00000011)
|
||||
#define NVCBA2_ERROR_DECRYPT_COPY_INTERNAL_DMA_FAILURE (0x00000012)
|
||||
#define NVCBA2_ERROR_METHOD_STREAM_AUTH_TAG_ADDR_INTERNAL_DMA_FAILURE (0x00000013)
|
||||
#define NVCBA2_ERROR_METHOD_STREAM_AUTH_TAG_HMAC_CALC_FAILURE (0x00000014)
|
||||
#define NVCBA2_ERROR_NONCE_OVERFLOW (0x00000015)
|
||||
#define NVCBA2_ERROR_AES_GCM_DECRYPTION_FAILURE (0x00000016)
|
||||
#define NVCBA2_ERROR_SEMAPHORE_RELEASE_INTERNAL_DMA_FAILURE (0x00000017)
|
||||
#define NVCBA2_ERROR_KEY_DERIVATION_FAILURE (0x00000018)
|
||||
#define NVCBA2_ERROR_SCRUBBER_FAILURE (0x00000019)
|
||||
#define NVCBA2_ERROR_SCRUBBER_INVALD_ADDRESS (0x0000001a)
|
||||
#define NVCBA2_ERROR_SCRUBBER_INSUFFICIENT_PERMISSIONS (0x0000001b)
|
||||
|
||||
@@ -793,6 +793,37 @@ typedef struct NV2080_CTRL_INTERNAL_GET_CONSTRUCTED_FALCON_INFO_PARAMS {
|
||||
NV2080_CTRL_INTERNAL_CONSTRUCTED_FALCON_INFO constructedFalconsTable[NV2080_CTRL_CMD_INTERNAL_MAX_CONSTRUCTED_FALCONS];
|
||||
} NV2080_CTRL_INTERNAL_GET_CONSTRUCTED_FALCON_INFO_PARAMS;
|
||||
|
||||
typedef struct NV2080_CTRL_INTERNAL_NV_RANGE {
|
||||
NV_DECLARE_ALIGNED(NvU64 lo, 8);
|
||||
NV_DECLARE_ALIGNED(NvU64 hi, 8);
|
||||
} NV2080_CTRL_INTERNAL_NV_RANGE;
|
||||
|
||||
/*!
|
||||
* NV2080_CTRL_INTERNAL_MIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE_PARAMS
|
||||
*
|
||||
* This structure specifies a target swizz-id and mem_range to update
|
||||
*
|
||||
* swizzId[IN]
|
||||
* - Targeted swizz-id for which the memRange is being set
|
||||
*
|
||||
* memAddrRange[IN]
|
||||
* - Memory Range for given GPU instance
|
||||
*/
|
||||
#define NV2080_CTRL_INTERNAL_MIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE_PARAMS_MESSAGE_ID (0x43U)
|
||||
|
||||
typedef struct NV2080_CTRL_INTERNAL_MIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE_PARAMS {
|
||||
NvU32 swizzId;
|
||||
NV_DECLARE_ALIGNED(NV2080_CTRL_INTERNAL_NV_RANGE memAddrRange, 8);
|
||||
} NV2080_CTRL_INTERNAL_MIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE_PARAMS;
|
||||
|
||||
#define NV2080_CTRL_CMD_INTERNAL_KMIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE (0x20800a44) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_INTERNAL_INTERFACE_ID << 8) | NV2080_CTRL_INTERNAL_KMIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE_PARAMS_MESSAGE_ID" */
|
||||
|
||||
#define NV2080_CTRL_INTERNAL_KMIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE_PARAMS_MESSAGE_ID (0x44U)
|
||||
|
||||
typedef NV2080_CTRL_INTERNAL_MIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE_PARAMS NV2080_CTRL_INTERNAL_KMIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE_PARAMS;
|
||||
|
||||
#define NV2080_CTRL_CMD_INTERNAL_MIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE (0x20800a43) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_INTERNAL_INTERFACE_ID << 8) | NV2080_CTRL_INTERNAL_MIGMGR_PROMOTE_GPU_INSTANCE_MEM_RANGE_PARAMS_MESSAGE_ID" */
|
||||
|
||||
/**
|
||||
* Get GR PDB properties synchronized between Kernel and Physical
|
||||
*
|
||||
@@ -1512,11 +1543,6 @@ typedef struct NV2080_CTRL_INTERNAL_DISPLAY_GET_ACTIVE_DISPLAY_DEVICES_PARAMS {
|
||||
|
||||
#define NV2080_CTRL_INTERNAL_MAX_SWIZZ_ID 15
|
||||
|
||||
typedef struct NV2080_CTRL_INTERNAL_NV_RANGE {
|
||||
NV_DECLARE_ALIGNED(NvU64 lo, 8);
|
||||
NV_DECLARE_ALIGNED(NvU64 hi, 8);
|
||||
} NV2080_CTRL_INTERNAL_NV_RANGE;
|
||||
|
||||
#define NV2080_CTRL_INTERNAL_STATIC_MIGMGR_GET_SWIZZ_ID_FB_MEM_PAGE_RANGES_PARAMS_MESSAGE_ID (0x60U)
|
||||
|
||||
typedef struct NV2080_CTRL_INTERNAL_STATIC_MIGMGR_GET_SWIZZ_ID_FB_MEM_PAGE_RANGES_PARAMS {
|
||||
|
||||
@@ -60,9 +60,6 @@ typedef struct RM_GSP_SPDM_CC_INIT_CTX {
|
||||
|
||||
|
||||
NvU64_ALIGN32 dmaAddr; // The address RM allocate in SYS memory or FB memory.
|
||||
|
||||
NvU32 rmBufferSizeInByte; // The memort size allocated by RM(exclude NV_SPDM_DESC_HEADER)
|
||||
|
||||
} RM_GSP_SPDM_CC_INIT_CTX;
|
||||
typedef struct RM_GSP_SPDM_CC_INIT_CTX *PRM_GSP_SPDM_CC_INIT_CTX;
|
||||
|
||||
|
||||
@@ -120,7 +120,8 @@
|
||||
#define ALI_TRAINING_FAIL (136)
|
||||
#define NVLINK_FLA_PRIV_ERR (137)
|
||||
#define ROBUST_CHANNEL_DLA_ERROR (138)
|
||||
#define ROBUST_CHANNEL_LAST_ERROR (ROBUST_CHANNEL_DLA_ERROR)
|
||||
#define ROBUST_CHANNEL_FAST_PATH_ERROR (139)
|
||||
#define ROBUST_CHANNEL_LAST_ERROR (ROBUST_CHANNEL_FAST_PATH_ERROR)
|
||||
|
||||
|
||||
// Indexed CE reference
|
||||
|
||||
@@ -14,7 +14,10 @@ static inline void _get_chip_id_for_alias_pgpu(NvU32 *dev_id, NvU32 *subdev_id)
|
||||
} vgpu_aliases[] = {
|
||||
{ 0x20B5, 0x1642, 0x20B5, 0x1533 },
|
||||
{ 0x20B8, 0x1581, 0x20B5, 0x1533 },
|
||||
{ 0x20B7, 0x1804, 0x20B7, 0x1532 },
|
||||
{ 0x20B7, 0x1852, 0x20B7, 0x1532 },
|
||||
{ 0x20B9, 0x157F, 0x20B7, 0x1532 },
|
||||
{ 0x20FD, 0x17F8, 0x20F5, 0x0 },
|
||||
{ 0x2330, 0x16C0, 0x2330, 0x16C1 },
|
||||
};
|
||||
|
||||
|
||||
147
src/common/uproc/os/common/include/libos_v2_crashcat.h
Normal file
147
src/common/uproc/os/common/include/libos_v2_crashcat.h
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef LIBOS_V2_CRASHCAT_H
|
||||
#define LIBOS_V2_CRASHCAT_H
|
||||
|
||||
#include "nv-crashcat.h"
|
||||
#include "nv-crashcat-decoder.h"
|
||||
|
||||
// libosv2 implements the CrashCat V1 protocol with the following implementation-defined bits
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LibosPanicReasonUnspecified = 0x00,
|
||||
LibosPanicReasonUnrecoverableTaskCrash = 0x01,
|
||||
LibosPanicReasonUnhandledState = 0x02,
|
||||
LibosPanicReasonInvalidConfiguration = 0x03,
|
||||
LibosPanicReasonFatalHardwareError = 0x04,
|
||||
LibosPanicReasonInsufficientResources = 0x05,
|
||||
LibosPanicReasonTimeout = 0x06,
|
||||
LibosPanicReasonEnvCallFailed = 0x07,
|
||||
LibosPanicReasonSspStackCheckFailed = 0x08,
|
||||
LibosPanicReasonAsanMemoryError = 0x09,
|
||||
LibosPanicReasonTest = 0x0a,
|
||||
LibosPanicReasonProgrammingError = 0x0b,
|
||||
LibosPanicReasonDebugAssertionFailed = 0x0c,
|
||||
LibosPanicReasonCount
|
||||
} LibosPanicReason;
|
||||
|
||||
// NV_CRASHCAT_REPORT_IMPLEMENTER_SIGNATURE (bits 63:0) - "LIBOS2.0"
|
||||
#define NV_CRASHCAT_REPORT_IMPLEMENTER_SIGNATURE_LIBOS2 (0x4C49424F53322E30ull)
|
||||
|
||||
// NV_CRASHCAT_REPORT_V1_REPORTER_ID_IMPL_DEF (bits 63:24)
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_LIBOS2_TASK_ID 31:24
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_LIBOS2_TASK_ID_UNSPECIFIED 0xFF
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_LIBOS2_RESERVED 63:32
|
||||
|
||||
static NV_INLINE
|
||||
void crashcatReportV1SetReporterLibos2TaskId(NvCrashCatReport_V1 *pReport, NvU8 task_id)
|
||||
{
|
||||
pReport->reporterId = FLD_SET_DRF_NUM64(_CRASHCAT, _REPORT_V1_REPORTER_ID, _LIBOS2_TASK_ID,
|
||||
task_id, pReport->reporterId);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvU8 crashcatReportV1ReporterLibos2TaskId(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvU8)DRF_VAL64(_CRASHCAT, _REPORT_V1_REPORTER_ID, _LIBOS2_TASK_ID, pReport->reporterId);
|
||||
}
|
||||
|
||||
// NV_CRASHCAT_REPORT_V1_REPORTER_DATA_VERSION (bits 31:0)
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_DATA_VERSION_LIBOS2_CL 23:0
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_DATA_VERSION_LIBOS2_MINOR 27:24
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_DATA_VERSION_LIBOS2_MAJOR 31:28
|
||||
|
||||
static NV_INLINE
|
||||
void crashcatReportV1SetReporterVersionLibos2(NvCrashCatReport_V1 *pReport, NvU32 cl)
|
||||
{
|
||||
pReport->reporterData = FLD_SET_DRF_NUM64(_CRASHCAT, _REPORT_V1_REPORTER_DATA,
|
||||
_VERSION_LIBOS2_MAJOR, 2, pReport->reporterData);
|
||||
pReport->reporterData = FLD_SET_DRF_NUM64(_CRASHCAT, _REPORT_V1_REPORTER_DATA,
|
||||
_VERSION_LIBOS2_MINOR, 0, pReport->reporterData);
|
||||
pReport->reporterData = FLD_SET_DRF_NUM64(_CRASHCAT, _REPORT_V1_REPORTER_DATA,
|
||||
_VERSION_LIBOS2_CL, cl, pReport->reporterData);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvU32 crashcatReportV1ReporterVersionLibos2Cl(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return DRF_VAL(_CRASHCAT, _REPORT_V1_REPORTER_DATA_VERSION, _LIBOS2_CL,
|
||||
crashcatReportV1ReporterVersion(pReport));
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvU8 crashcatReportV1ReporterVersionLibos2Minor(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvU8)DRF_VAL(_CRASHCAT, _REPORT_V1_REPORTER_DATA_VERSION, _LIBOS2_MINOR,
|
||||
crashcatReportV1ReporterVersion(pReport));
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvU8 crashcatReportV1ReporterVersionLibos2Major(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvU8)DRF_VAL(_CRASHCAT, _REPORT_V1_REPORTER_DATA_VERSION, _LIBOS2_MAJOR,
|
||||
crashcatReportV1ReporterVersion(pReport));
|
||||
}
|
||||
|
||||
// NV_CRASHCAT_REPORT_V1_SOURCE_ID_IMPL_DEF (63:24)
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_LIBOS2_TASK_ID 31:24
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_LIBOS2_TASK_ID_UNSPECIFIED 0xFF
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_LIBOS2_RESERVED 63:32
|
||||
|
||||
static NV_INLINE
|
||||
void crashcatReportV1SetSourceLibos2TaskId(NvCrashCatReport_V1 *pReport, NvU8 task_id)
|
||||
{
|
||||
pReport->sourceId = FLD_SET_DRF_NUM64(_CRASHCAT, _REPORT_V1_SOURCE_ID, _LIBOS2_TASK_ID, task_id,
|
||||
pReport->sourceId);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvU8 crashcatReportV1SourceLibos2TaskId(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvU8)DRF_VAL64(_CRASHCAT, _REPORT_V1_SOURCE_ID, _LIBOS2_TASK_ID, pReport->sourceId);
|
||||
}
|
||||
|
||||
// NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_IMPL_DEF (63:32)
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_LIBOS2_REASON 39:32
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_LIBOS2_RESERVED 63:40
|
||||
|
||||
ct_assert(LibosPanicReasonCount <=
|
||||
NVBIT(DRF_SIZE(NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_LIBOS2_REASON)));
|
||||
|
||||
static NV_INLINE
|
||||
void crashcatReportV1SetSourceCauseLibos2Reason(NvCrashCatReport_V1 *pReport,
|
||||
LibosPanicReason reason)
|
||||
{
|
||||
pReport->sourceCause = FLD_SET_DRF_NUM64(_CRASHCAT, _REPORT_V1_SOURCE_CAUSE, _LIBOS2_REASON,
|
||||
reason, pReport->sourceCause);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
LibosPanicReason crashcatReportV1SourceCauseLibos2Reason(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (LibosPanicReason)DRF_VAL64(_CRASHCAT, _REPORT_V1_SOURCE_CAUSE, _LIBOS2_REASON,
|
||||
pReport->sourceCause);
|
||||
}
|
||||
|
||||
#endif // LIBOS_V2_CRASHCAT_H
|
||||
244
src/common/uproc/os/common/include/nv-crashcat-decoder.h
Normal file
244
src/common/uproc/os/common/include/nv-crashcat-decoder.h
Normal file
@@ -0,0 +1,244 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef NV_CRASHCAT_DECODER_H
|
||||
#define NV_CRASHCAT_DECODER_H
|
||||
|
||||
#include "nv-crashcat.h"
|
||||
|
||||
// This header defines decoder/consumer-side implementation helpers for the CrashCat protocol
|
||||
|
||||
//
|
||||
// Wayfinder L0 Bitfield Accessors
|
||||
//
|
||||
static NV_INLINE
|
||||
NvBool crashcatWayfinderL0Valid(NvCrashCatWayfinderL0_V1 wfl0)
|
||||
{
|
||||
return FLD_TEST_DRF(_CRASHCAT, _WAYFINDER_L0, _SIGNATURE, _VALID, wfl0);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_WAYFINDER_VERSION crashcatWayfinderL0Version(NvCrashCatWayfinderL0_V1 wfl0)
|
||||
{
|
||||
return (NV_CRASHCAT_WAYFINDER_VERSION)DRF_VAL(_CRASHCAT, _WAYFINDER_L0, _VERSION, wfl0);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID crashcatWayfinderL0V1Wfl1Location(NvCrashCatWayfinderL0_V1 wfl0)
|
||||
{
|
||||
return (NV_CRASHCAT_SCRATCH_GROUP_ID)DRF_VAL(_CRASHCAT, _WAYFINDER_L0_V1, _WFL1_LOCATION, wfl0);
|
||||
}
|
||||
|
||||
//
|
||||
// Wayfinder L1 Bitfield Accessors
|
||||
//
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_MEM_APERTURE crashcatWayfinderL1V1QueueAperture(NvCrashCatWayfinderL1_V1 wfl1)
|
||||
{
|
||||
return (NV_CRASHCAT_MEM_APERTURE)DRF_VAL64(_CRASHCAT, _WAYFINDER_L1_V1, _QUEUE_APERTURE, wfl1);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvLength crashcatWayfinderL1V1QueueSize(NvCrashCatWayfinderL1_V1 wfl1)
|
||||
{
|
||||
NvU8 unitShift;
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE unitSize =
|
||||
(NV_CRASHCAT_MEM_UNIT_SIZE)DRF_VAL64(_CRASHCAT, _WAYFINDER_L1_V1, _QUEUE_UNIT_SIZE, wfl1);
|
||||
switch (unitSize)
|
||||
{
|
||||
case NV_CRASHCAT_MEM_UNIT_SIZE_1KB: unitShift = 10; break;
|
||||
case NV_CRASHCAT_MEM_UNIT_SIZE_4KB: unitShift = 12; break;
|
||||
case NV_CRASHCAT_MEM_UNIT_SIZE_64KB: unitShift = 16; break;
|
||||
default: return 0;
|
||||
}
|
||||
|
||||
// Increment size, since the size in the header is size - 1 (queue of 0 size is not encodable)
|
||||
return (NvLength)((DRF_VAL64(_CRASHCAT, _WAYFINDER_L1_V1, _QUEUE_SIZE, wfl1) + 1) << unitShift);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvU64 crashcatWayfinderL1V1QueueOffset(NvCrashCatWayfinderL1_V1 wfl1)
|
||||
{
|
||||
return DRF_VAL64(_CRASHCAT, _WAYFINDER_L1_V1, _QUEUE_OFFSET_1KB, wfl1) << 10;
|
||||
}
|
||||
|
||||
//
|
||||
// CrashCat Packet Header (Unversioned) Bitfield Accessors
|
||||
//
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_PACKET_FORMAT_VERSION crashcatPacketHeaderFormatVersion(NvCrashCatPacketHeader hdr)
|
||||
{
|
||||
return (NV_CRASHCAT_PACKET_FORMAT_VERSION)DRF_VAL64(_CRASHCAT, _PACKET_HEADER, _FORMAT_VERSION,
|
||||
hdr);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvLength crashcatPacketHeaderPayloadSize(NvCrashCatPacketHeader hdr)
|
||||
{
|
||||
NvU8 unitShift;
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE unitSize =
|
||||
(NV_CRASHCAT_MEM_UNIT_SIZE)DRF_VAL64(_CRASHCAT, _PACKET_HEADER, _PAYLOAD_UNIT_SIZE, hdr);
|
||||
switch (unitSize)
|
||||
{
|
||||
case NV_CRASHCAT_MEM_UNIT_SIZE_8B: unitShift = 3; break;
|
||||
case NV_CRASHCAT_MEM_UNIT_SIZE_1KB: unitShift = 10; break;
|
||||
case NV_CRASHCAT_MEM_UNIT_SIZE_4KB: unitShift = 12; break;
|
||||
case NV_CRASHCAT_MEM_UNIT_SIZE_64KB: unitShift = 16; break;
|
||||
default: return 0;
|
||||
}
|
||||
|
||||
// Increment size, since the size in the header is size - 1 (payload of 0 size is not encodable)
|
||||
return (NvLength)((DRF_VAL64(_CRASHCAT, _PACKET_HEADER, _PAYLOAD_SIZE, hdr) + 1) << unitShift);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvBool crashcatPacketHeaderValid(NvCrashCatPacketHeader hdr)
|
||||
{
|
||||
return (FLD_TEST_DRF64(_CRASHCAT, _PACKET_HEADER, _SIGNATURE, _VALID, hdr) &&
|
||||
(crashcatPacketHeaderFormatVersion(hdr) > 0) &&
|
||||
(crashcatPacketHeaderFormatVersion(hdr) <= NV_CRASHCAT_PACKET_FORMAT_VERSION_LAST) &&
|
||||
(crashcatPacketHeaderPayloadSize(hdr) > 0));
|
||||
}
|
||||
|
||||
//
|
||||
// CrashCat Packet Header (V1) Bitfield Accessors
|
||||
//
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_PACKET_TYPE crashcatPacketHeaderV1Type(NvCrashCatPacketHeader_V1 hdr)
|
||||
{
|
||||
return (NV_CRASHCAT_PACKET_TYPE)DRF_VAL64(_CRASHCAT, _PACKET_HEADER, _V1_TYPE, hdr);
|
||||
}
|
||||
|
||||
//
|
||||
// CrashCat Report V1 Bitfield Accessors
|
||||
//
|
||||
static NV_INLINE
|
||||
NvCrashCatNvriscvPartition crashcatReportV1ReporterPartition(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvCrashCatNvriscvPartition)DRF_VAL64(_CRASHCAT, _REPORT_V1_REPORTER_ID,
|
||||
_NVRISCV_PARTITION, pReport->reporterId);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvCrashCatNvriscvUcodeId crashcatReportV1ReporterUcodeId(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvCrashCatNvriscvUcodeId)DRF_VAL64(_CRASHCAT, _REPORT_V1_REPORTER_ID, _NVRISCV_UCODE_ID,
|
||||
pReport->reporterId);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_RISCV_MODE crashcatReportV1ReporterMode(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NV_CRASHCAT_RISCV_MODE)DRF_VAL64(_CRASHCAT, _REPORT_V1_REPORTER_ID, _RISCV_MODE,
|
||||
pReport->reporterId);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvU32 crashcatReportV1ReporterVersion(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvU32)DRF_VAL64(_CRASHCAT, _REPORT_V1_REPORTER_DATA, _VERSION, pReport->reporterData);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvU32 crashcatReportV1ReporterTimestamp(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvU32)DRF_VAL64(_CRASHCAT, _REPORT_V1_REPORTER_DATA, _TIMESTAMP, pReport->reporterData);
|
||||
}
|
||||
|
||||
|
||||
static NV_INLINE
|
||||
NvCrashCatNvriscvPartition crashcatReportV1SourcePartition(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvCrashCatNvriscvPartition)DRF_VAL64(_CRASHCAT, _REPORT_V1_SOURCE_ID,
|
||||
_NVRISCV_PARTITION, pReport->sourceId);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NvCrashCatNvriscvUcodeId crashcatReportV1SourceUcodeId(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NvCrashCatNvriscvUcodeId)DRF_VAL64(_CRASHCAT, _REPORT_V1_SOURCE_ID, _NVRISCV_UCODE_ID,
|
||||
pReport->sourceId);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_RISCV_MODE crashcatReportV1SourceMode(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NV_CRASHCAT_RISCV_MODE)DRF_VAL64(_CRASHCAT, _REPORT_V1_SOURCE_ID, _RISCV_MODE,
|
||||
pReport->sourceId);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_CAUSE_TYPE crashcatReportV1SourceCauseType(NvCrashCatReport_V1 *pReport)
|
||||
{
|
||||
return (NV_CRASHCAT_CAUSE_TYPE)DRF_VAL64(_CRASHCAT, _REPORT_V1_SOURCE_CAUSE, _TYPE,
|
||||
pReport->sourceCause);
|
||||
}
|
||||
|
||||
//
|
||||
// CrashCat RISC-V 64-bit CSR State V1 Bitfield Accessors
|
||||
//
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_RISCV_MODE crashcatRiscv64CsrStateV1Mode(NvCrashCatRiscv64CsrState_V1 *pRiscv64CsrState)
|
||||
{
|
||||
return (NV_CRASHCAT_RISCV_MODE)DRF_VAL64(_CRASHCAT, _RISCV64_CSR_STATE_V1_HEADER, _RISCV_MODE,
|
||||
pRiscv64CsrState->header);
|
||||
}
|
||||
|
||||
//
|
||||
// CrashCat RISC-V 64-bit GPR State V1 Bitfield Accessors
|
||||
//
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_RISCV_MODE crashcatRiscv64GprStateV1Mode(NvCrashCatRiscv64GprState_V1 *pRiscv64GprState)
|
||||
{
|
||||
return (NV_CRASHCAT_RISCV_MODE)DRF_VAL64(_CRASHCAT, _RISCV64_GPR_STATE_V1_HEADER, _RISCV_MODE,
|
||||
pRiscv64GprState->header);
|
||||
}
|
||||
|
||||
//
|
||||
// CrashCat RISC-V 64-bit Trace V1 Bitfield Accessors
|
||||
//
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_RISCV_MODE crashcatRiscv64TraceV1Mode(NvCrashCatRiscv64Trace_V1 *pRiscv64Trace)
|
||||
{
|
||||
return (NV_CRASHCAT_RISCV_MODE)DRF_VAL64(_CRASHCAT, _RISCV64_TRACE_V1_HEADER, _RISCV_MODE,
|
||||
pRiscv64Trace->header);
|
||||
}
|
||||
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_TRACE_TYPE crashcatRiscv64TraceV1Type(NvCrashCatRiscv64Trace_V1 *pRiscv64Trace)
|
||||
{
|
||||
return (NV_CRASHCAT_TRACE_TYPE)DRF_VAL64(_CRASHCAT, _RISCV64_TRACE_V1_HEADER, _TRACE_TYPE,
|
||||
pRiscv64Trace->header);
|
||||
}
|
||||
|
||||
//
|
||||
// CrashCat 32-bit I/O State V1 Bitfield Accessors
|
||||
//
|
||||
static NV_INLINE
|
||||
NV_CRASHCAT_IO_APERTURE crashcatIo32StateV1Aperture(NvCrashCatIo32State_V1 *pIo32State)
|
||||
{
|
||||
return (NV_CRASHCAT_IO_APERTURE)DRF_VAL64(_CRASHCAT, _IO32_STATE_V1_HEADER, _APERTURE,
|
||||
pIo32State->header);
|
||||
}
|
||||
|
||||
#endif // NV_CRASHCAT_DECODER_H
|
||||
861
src/common/uproc/os/common/include/nv-crashcat.h
Normal file
861
src/common/uproc/os/common/include/nv-crashcat.h
Normal file
@@ -0,0 +1,861 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef NV_CRASHCAT_H
|
||||
#define NV_CRASHCAT_H
|
||||
|
||||
#include "nvtypes.h"
|
||||
#include "nvmisc.h"
|
||||
#include "nvctassert.h"
|
||||
|
||||
//
|
||||
// NVIDIA CrashCat - Crash Reporting And Signaling Helpers for Peregrine
|
||||
//
|
||||
// When a crash occurs on a Peregrine core, NVIDIA firmware may report additional data for post-
|
||||
// mortem analysis of the crash. The protocol is described in greater detail elsewhere, but in
|
||||
// general is defined to be a multi-producer/single-consumer flow as follows:
|
||||
//
|
||||
// 1. Peregrine writes a wayfinder to a set of predefined registers to indicate a crash report is
|
||||
// in progress, and its general location (first crash only)
|
||||
// 2. Peregrine writes crash report data in a tagged format to a circular queue accessible to both
|
||||
// reporter and consumer of the crash reports.
|
||||
// 3. Peregrine completes the wayfinder by updating a put pointer to indicate the crash report is
|
||||
// complete.
|
||||
// 4. Peregrine raises a beacon interrupt to the consumer to signal the presence of a crash report.
|
||||
//
|
||||
// This header contains the shared type and bitfield definitions that are common to both producer
|
||||
// and consumer sides of the CrashCat protocol.
|
||||
//
|
||||
|
||||
#define NV_CRASHCAT_SIGNATURE 0xdead
|
||||
|
||||
//
|
||||
// CrashCat Wayfinder Protocol Versions
|
||||
// A new version is created when backward-incompatible changes are made (the wayfinders and queue
|
||||
// control cannot be handled by software written for a prior version).
|
||||
//
|
||||
// This version indicates the handling sequence and format of the wayfinder registers, except for
|
||||
// the 16-bit signature and (this) 4-bit version number in the L0 wayfinder.
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_WAYFINDER_VERSION_1 = 0x01,
|
||||
NV_CRASHCAT_WAYFINDER_VERSION_LAST = 0x01,
|
||||
} NV_CRASHCAT_WAYFINDER_VERSION;
|
||||
|
||||
//
|
||||
// CrashCat Packet Format Versions
|
||||
// A new version is created when backward-incompatible changes are made (packets cannot be handled
|
||||
// by software written for a prior version).
|
||||
//
|
||||
// This version indicates the format of the upper 32 bits of the packet header, and, along with the
|
||||
// NV_CRASHCAT_PACKET_TYPE, the format of the payload.
|
||||
//
|
||||
// The lower 32 bits of the packet header, which include the 16-bit signature, (this) 4-bit
|
||||
// version number, and 2-bit payload size unit and 10-bit payload size, are not covered by this
|
||||
// version number and their format must not change.
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_PACKET_FORMAT_VERSION_1 = 0x01,
|
||||
NV_CRASHCAT_PACKET_FORMAT_VERSION_LAST = 0x01
|
||||
} NV_CRASHCAT_PACKET_FORMAT_VERSION;
|
||||
|
||||
// Utility macro for ensuring the maximum enum value will fit in a DRF bitfield
|
||||
#define STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(e, bf) \
|
||||
ct_assert(e ## _LAST < NVBIT(DRF_SIZE(bf)))
|
||||
|
||||
//
|
||||
// The below enum definitions are generally unversioned, and so new values must only be added to
|
||||
// the end, and existing values cannot be changed or removed (except for the _LAST values).
|
||||
// Note that adding a new value may require a new version of the wayfinder protocol or packet
|
||||
// formats that use the enum to accommodate a new maximum value.
|
||||
//
|
||||
|
||||
//
|
||||
// CrashCat Scratch Group Identifier
|
||||
// Each enum value represents an ordered set of one or more scratch registers in the Peregrine IP.
|
||||
// See NV_CRASHCAT_DEF_SCRATCH_GROUP_V1_REGMAP_TABLE for the canonical list of registers in each
|
||||
// scratch group for version 1 of the wayfinder protocol.
|
||||
//
|
||||
// This enum is used by the wayfinder protocol (version 1).
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID_NONE = 0x0,
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID_A = 0x1,
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID_B = 0x2,
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID_C = 0x3,
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID_D = 0x4,
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID_E = 0x5,
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID_F = 0x6,
|
||||
|
||||
//
|
||||
// Note: NV_CRASHCAT_SCRATCH_GROUP_ID_IMPL_DEF represents a set of registers which are defined
|
||||
// by the implementer instead of the protocol specification - producer and consumer must
|
||||
// agree on this set definition.
|
||||
//
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID_IMPL_DEF = 0x7,
|
||||
NV_CRASHCAT_SCRATCH_GROUP_ID_LAST = 0x7
|
||||
} NV_CRASHCAT_SCRATCH_GROUP_ID;
|
||||
|
||||
//
|
||||
// Canonical CrashCat Scratch Group Register Mappings (V1)
|
||||
// This macro defines a designated-initializer table mapping NV_CRASHCAT_SCRATCH_GROUP_ID values to
|
||||
// 0-terminated arrays of register offsets (relative to the NV_PFALCON register space base offset).
|
||||
// This mapping is defined for version 1 of the wayfinder protocol; future versions may use a
|
||||
// different mapping.
|
||||
//
|
||||
// This header does not define, or include any header that defines, the register offset macros used
|
||||
// in the table entries. The caller should include the appropriate header defining these register
|
||||
// offsets before invoking this macro.
|
||||
//
|
||||
// If the implementation intends to use the NV_CRASCHCAT_SCRATCH_GROUP_ID_IMPL_DEF group, it can
|
||||
// invoke NV_CRASHCAT_DEF_SCRATCH_GROUP_V1_REGMAP_TABLE_WITH_IMPL_DEF() macro with the list of
|
||||
// registers to be used for the IMPL_DEF group (up to 4). Example:
|
||||
//
|
||||
// NV_CRASHCAT_DEF_SCRATCH_GROUP_V1_REGMAP_TABLE_WITH_IMPL_DEF(scratchOffsetTable,
|
||||
// NV_PUNIT_REG0, NV_PUNIT_REG1, NV_PUNIT_REG2, NV_PUNIT_REG3);
|
||||
//
|
||||
|
||||
// Maximum number of registers in a scratch group for now
|
||||
#define NV_CRASHCAT_SCRATCH_GROUP_V1_MAX_NUM_REGISTERS 4
|
||||
|
||||
#define NV_CRASHCAT_DEF_SCRATCH_GROUP_V1_REGMAP_TABLE(tblName) \
|
||||
NV_CRASHCAT_DEF_SCRATCH_GROUP_V1_REGMAP_TABLE_WITH_IMPL_DEF(tblName, 0)
|
||||
|
||||
#define NV_CRASHCAT_DEF_SCRATCH_GROUP_V1_REGMAP_TABLE_WITH_IMPL_DEF(tblName, ...) \
|
||||
static const NvU32 tblName[][NV_CRASHCAT_SCRATCH_GROUP_V1_MAX_NUM_REGISTERS + 1] = { \
|
||||
[NV_CRASHCAT_SCRATCH_GROUP_ID_NONE] = {0}, \
|
||||
[NV_CRASHCAT_SCRATCH_GROUP_ID_A] = { \
|
||||
NV_PFALCON_FALCON_MAILBOX0, NV_PFALCON_FALCON_MAILBOX1, 0 }, \
|
||||
[NV_CRASHCAT_SCRATCH_GROUP_ID_B] = { \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_0(0), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_0(1), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_0(2), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_0(3), 0}, \
|
||||
[NV_CRASHCAT_SCRATCH_GROUP_ID_C] = { \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_1(0), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_1(1), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_1(2), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_1(3), 0}, \
|
||||
[NV_CRASHCAT_SCRATCH_GROUP_ID_D] = { \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_2(0), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_2(1), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_2(2), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_2(3), 0}, \
|
||||
[NV_CRASHCAT_SCRATCH_GROUP_ID_E] = { \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_3(0), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_3(1), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_3(2), \
|
||||
NV_PFALCON_FALCON_COMMON_SCRATCH_GROUP_3(3), 0}, \
|
||||
[NV_CRASHCAT_SCRATCH_GROUP_ID_F] = {0}, \
|
||||
[NV_CRASHCAT_SCRATCH_GROUP_ID_IMPL_DEF] = { __VA_ARGS__, 0 } \
|
||||
}
|
||||
|
||||
//
|
||||
// CrashCat Memory Aperture Identifier
|
||||
// Each enum value represents a target aperture through which a CrashCat memory buffer can be
|
||||
// accessed.
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_MEM_APERTURE_SYSGPA = 0x0,
|
||||
NV_CRASHCAT_MEM_APERTURE_FBGPA = 0x1,
|
||||
NV_CRASHCAT_MEM_APERTURE_DMEM = 0x2,
|
||||
NV_CRASHCAT_MEM_APERTURE_EMEM = 0x3,
|
||||
NV_CRASHCAT_MEM_APERTURE_LAST = 0x3,
|
||||
NV_CRASHCAT_MEM_APERTURE_UNKNOWN = 0xFF, // Used for error checking/translation failures
|
||||
} NV_CRASHCAT_MEM_APERTURE;
|
||||
|
||||
//
|
||||
// CrashCat Memory Unit Size
|
||||
// Each enum value represents a fixed unit size for a corresponding size field. This is used to
|
||||
// encode buffer sizes in compact register space.
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE_8B = 0, // 8-byte units
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE_1KB = 1, // 1-kilobyte units
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE_4KB = 2, // 4-kilobyte units
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE_64KB = 3, // 64-kilobyte units
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE_LAST = 3,
|
||||
} NV_CRASHCAT_MEM_UNIT_SIZE;
|
||||
|
||||
//
|
||||
// CrashCat Packet Type
|
||||
// Encoded in the CrashCat packet header to indicate the format of the data.
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_PACKET_TYPE_REPORT = 0x00, // Base CrashCat report packet (required)
|
||||
NV_CRASHCAT_PACKET_TYPE_RISCV64_CSR_STATE = 0x01, // Each 8-byte value is a RISC-V 64-bit CSR
|
||||
NV_CRASHCAT_PACKET_TYPE_RISCV64_GPR_STATE = 0x02, // Each 8-byte value is a RISC-V 64-bit GPR
|
||||
NV_CRASHCAT_PACKET_TYPE_RISCV64_TRACE = 0x03, // Each 8-byte value is a program counter/
|
||||
// virtual address from a RISC-V 64-bit trace
|
||||
NV_CRASHCAT_PACKET_TYPE_IO32_STATE = 0x04, // Each 8-byte value is a 32-bit register
|
||||
// address in the upper bytes combined with
|
||||
// a 32-bit value in the lower bytes
|
||||
NV_CRASHCAT_PACKET_TYPE_LAST = 0x04
|
||||
} NV_CRASHCAT_PACKET_TYPE;
|
||||
|
||||
//
|
||||
// CrashCat RISC-V Mode
|
||||
// Indicates the execution mode of the Peregrine core.
|
||||
// Note: this does not include all RISC-V standard modes, only the ones supported by NVRISC-V.
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_RISCV_MODE_UNSPECIFIED = 0x0,
|
||||
NV_CRASHCAT_RISCV_MODE_M = 0x1, // Machine Mode
|
||||
NV_CRASHCAT_RISCV_MODE_S = 0x2, // Supervisor Mode
|
||||
NV_CRASHCAT_RISCV_MODE_U = 0x3, // User Mode
|
||||
NV_CRASHCAT_RISCV_MODE_LAST = 0x3,
|
||||
} NV_CRASHCAT_RISCV_MODE;
|
||||
|
||||
//
|
||||
// CrashCat Partition
|
||||
// Represents a NVRISC-V microcode partition index
|
||||
//
|
||||
typedef NvU8 NvCrashCatNvriscvPartition;
|
||||
#define NV_CRASHCAT_NVRISCV_PARTITION_UNSPECIFIED NV_U8_MAX
|
||||
|
||||
//
|
||||
// CrashCat Ucode ID
|
||||
// Represents an NVRISC-V microcode ID
|
||||
//
|
||||
typedef NvU8 NvCrashCatNvriscvUcodeId;
|
||||
#define NV_CRASHCAT_NVRISCV_UCODE_ID_UNSPECIFIED NV_U8_MAX
|
||||
|
||||
//
|
||||
// CrashCat Crash Cause Type
|
||||
// Indicates the general nature of the crash cause.
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_CAUSE_TYPE_EXCEPTION = 0x0, // Crash observed via Peregrine trap (exception or
|
||||
// unhandled interrupt)
|
||||
NV_CRASHCAT_CAUSE_TYPE_TIMEOUT = 0x1, // Crash observed via timeout or hang condition
|
||||
NV_CRASHCAT_CAUSE_TYPE_PANIC = 0x2, // Crash observed via direct panic condition
|
||||
NV_CRASHCAT_CAUSE_TYPE_LAST = 0x2
|
||||
} NV_CRASHCAT_CAUSE_TYPE;
|
||||
|
||||
//
|
||||
// CrashCat I/O Aperture Identifier
|
||||
// Indicates the Peregrine MMIO aperture through which register offsets are accessed.
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_IO_APERTURE_NONE = 0x00, // Register offsets are not relative
|
||||
NV_CRASHCAT_IO_APERTURE_INTIO = 0x01, // Register offsets are relative to local I/O base
|
||||
NV_CRASHCAT_IO_APERTURE_EXTIO = 0x02, // Register offsets are relative to external I/O base
|
||||
NV_CRASHCAT_IO_APERTURE_LAST = 0x02
|
||||
} NV_CRASHCAT_IO_APERTURE;
|
||||
|
||||
//
|
||||
// CrashCat Trace Type
|
||||
// Indicates the source of trace data (PC values)
|
||||
//
|
||||
typedef enum {
|
||||
NV_CRASHCAT_TRACE_TYPE_STACK = 0x00, // The PC values are return addresses on a stack, walked
|
||||
// by CrashCat implementation
|
||||
NV_CRASHCAT_TRACE_TYPE_NVRVTB = 0x01, // The PC values are entries from the NVRISC-V PC trace
|
||||
// buffer
|
||||
NV_CRASHCAT_TRACE_TYPE_LAST = 0x01
|
||||
} NV_CRASHCAT_TRACE_TYPE;
|
||||
|
||||
//
|
||||
// CrashCat Wayfinder Protocol is a mechanism for locating crash-reports in a programmatic way,
|
||||
// since available memory for reports may vary across different Peregrines. In V1, the wayfinder
|
||||
// protocol uses a single common scratch register (level 0, A.K.A. WFL0) to point to a secondary
|
||||
// group of scratch registers (level 1, A.K.A. WFL1), which point to the full crash report queue.
|
||||
// The queue is implemented as a circular buffer with classic put/get semantics, controlled through
|
||||
// the wayfinder L1 registers.
|
||||
//
|
||||
// Crash Report Wayfinder Level 0 (NV_CRASHCAT_WAYFINDER_L0)
|
||||
// _SIGNATURE : Initialized to NV_CRASHCAT_SIGNATURE after the level 1 wayfinder is
|
||||
// initialized.
|
||||
// _VERSION : NV_CRASHCAT_WAYFINDER_VERSION value of the protocol implemented for the
|
||||
// crash report wayfinder on this Peregrine (must be consistent with all
|
||||
// implementers on a Peregrine).
|
||||
//
|
||||
// Version 1 Fields:
|
||||
// _V1_WFL1_LOCATION : Contains an NV_CRASHCAT_SCRATCH_GROUP_ID identifying the registers
|
||||
// containing the level 1 wayfinder
|
||||
// _V1_RESERVED : Reserved for future use (currently 0).
|
||||
//
|
||||
typedef NvU32 NvCrashCatWayfinderL0_V1;
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_SIGNATURE 15:0
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_SIGNATURE_VALID NV_CRASHCAT_SIGNATURE
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_VERSION 19:16
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_VERSION_1 NV_CRASHCAT_WAYFINDER_VERSION_1
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION 22:20
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION_NONE NV_CRASHCAT_SCRATCH_GROUP_ID_NONE
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION_A NV_CRASHCAT_SCRATCH_GROUP_ID_A
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION_B NV_CRASHCAT_SCRATCH_GROUP_ID_B
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION_C NV_CRASHCAT_SCRATCH_GROUP_ID_C
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION_D NV_CRASHCAT_SCRATCH_GROUP_ID_D
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION_E NV_CRASHCAT_SCRATCH_GROUP_ID_E
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION_F NV_CRASHCAT_SCRATCH_GROUP_ID_F
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION_IMPL_DEF NV_CRASHCAT_SCRATCH_GROUP_ID_IMPL_DEF
|
||||
#define NV_CRASHCAT_WAYFINDER_L0_V1_RESERVED 31:23
|
||||
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_WAYFINDER_VERSION,
|
||||
NV_CRASHCAT_WAYFINDER_L0_VERSION);
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_SCRATCH_GROUP_ID,
|
||||
NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION);
|
||||
|
||||
//
|
||||
// Crash Report Wayfinder Level 1 and Queue Control Notes
|
||||
// Depending on how many scratch registers are in the set specified by the level 0 wayfinder, the
|
||||
// registers used for the level 1 wayfinder may need to be reused for the queue control registers.
|
||||
//
|
||||
// The first two scratch registers in the set are used to compose the NvCrashCatWayfinderL1_V1
|
||||
// value, with the register with the lower address providing the bottom 32 bits and the register
|
||||
// with the higher address providing the upper 32 bits.
|
||||
//
|
||||
// If four scratch registers are available, the last two are used for the queue put and get
|
||||
// control, respectively. The producer implementation should ensure these are initialized to zero,
|
||||
// and may update the put pointer without any synchronization with the consumer.
|
||||
//
|
||||
// If only two scratch registers are available, the WFL1 registers are reclaimed after they are
|
||||
// decoded by the consumer and used for the queue put and get points. The producer must wait for
|
||||
// the consumer to set the NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION bits of the level 0 wayfinder
|
||||
// to _NONE before writing the put pointer. It is the responsibility of the consumer to clear the
|
||||
// WFL1 registers before updating the level 0 wayfinder - after the producer sees the
|
||||
// NV_CRASHCAT_WAYFINDER_L0_V1_WFL1_LOCATION change to _NONE, it may update the put pointer.
|
||||
//
|
||||
// CrashCat Wayfinder Locking Notes for Implementers
|
||||
// Due to the multi-producer nature of the crash report buffer, accesses to the following registers
|
||||
// must be synchronized when writing to avoid stomping other crash reports or otherwise corrupting
|
||||
// the queue:
|
||||
// - NV_CRASHCAT_WAYFINDER_L0
|
||||
// If the signature is already present when the reporter initializes, the reporter should panic
|
||||
// if the wayfinder protocol version is not the same as what the reporter implements.
|
||||
// Where possible, it is recommended to compile-time assert reporter version consistency.
|
||||
// - NV_CRASHCAT_WAYFINDER_L1
|
||||
// Writes to these registers must be synchronized during initialization by the reporter, to
|
||||
// ensure that only one chooses the value and writes it. If they are already initialized, the
|
||||
// reporter should not need to update them, and should instead queue its crash reports in the
|
||||
// buffer pointed to by these registers.
|
||||
// - NV_CRASHCAT_QUEUE_PUT
|
||||
// This register must be synchronized on during initialization and update by the reporter. The
|
||||
// interface should be locked before the start of writing the crash report and released after
|
||||
// this register is updated.
|
||||
// - NV_CRASHCAT_QUEUE_GET
|
||||
// The (single) consumer controls this register, so no explicit synchronization is needed.
|
||||
// The implementation should initialize to 0 when the level 0 wayfinder is initialized, and not
|
||||
// touch it afterward.
|
||||
//
|
||||
// If no preemption is possible, then it is sufficient for a producer to push packets into the
|
||||
// queue one by one, and only update the put pointer once all packets from the report have been
|
||||
// queued. If the producer can be preempted while queuing report packets, it must hold a lock
|
||||
// synchronizing access to the CrashCat queue while it it pushes all report packets in the queue,
|
||||
// to prevent potential interleaving with packets from other reports.
|
||||
//
|
||||
// It may be advantageous for the Peregrine FMC to receive the report queue location as a boot
|
||||
// argument and initialize the wayfinders accordingly during boot, rather than when a crash is
|
||||
// observed.
|
||||
//
|
||||
|
||||
//
|
||||
// Crash Report Wayfinder Level 1 (NV_CRASHCAT_WAYFINDER_L1) V1
|
||||
// _QUEUE_APERTURE : NV_CRASHCAT_MEM_APERTURE value of the aperture through which the queue can
|
||||
// be accessed
|
||||
// _QUEUE_UNIT_SIZE : NV_CRASHCAT_MEM_UNIT_SIZE value indicating the units of the _SIZE field
|
||||
// (1KB or greater)
|
||||
// _RESERVED : Reserved for future use (currently 0)
|
||||
// _QUEUE_SIZE : Size of the queue in _UNIT_SIZE minus 1 (_SIZE = 0 -> queue size is 1 unit)
|
||||
// _QUEUE_OFFSET_1KB : 1KB-aligned offset of the start of the queue in _QUEUE_APERTURE
|
||||
//
|
||||
typedef NvU64 NvCrashCatWayfinderL1_V1;
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_APERTURE 2:0
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_APERTURE_SYSGPA NV_CRASHCAT_MEM_APERTURE_SYSGPA
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_APERTURE_FBGPA NV_CRASHCAT_MEM_APERTURE_FBGPA
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_APERTURE_DMEM NV_CRASHCAT_MEM_APERTURE_DMEM
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_APERTURE_EMEM NV_CRASHCAT_MEM_APERTURE_EMEM
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_UNIT_SIZE 4:3
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_UNIT_SIZE_1KB NV_CRASHCAT_MEM_UNIT_SIZE_1KB
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_UNIT_SIZE_4KB NV_CRASHCAT_MEM_UNIT_SIZE_4KB
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_UNIT_SIZE_64KB NV_CRASHCAT_MEM_UNIT_SIZE_64KB
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_RESERVED 5:5
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_SIZE 9:6
|
||||
#define NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_OFFSET_1KB 63:10
|
||||
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_MEM_APERTURE,
|
||||
NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_APERTURE);
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_MEM_UNIT_SIZE,
|
||||
NV_CRASHCAT_WAYFINDER_L1_V1_QUEUE_UNIT_SIZE);
|
||||
|
||||
//
|
||||
// CrashCat Queue Put Pointer
|
||||
// Offset in bytes into the CrashCat circular queue at which the next crash report will be written.
|
||||
// Reports may wrap around the end of the buffer to the start.
|
||||
//
|
||||
// The implementation should only update the put pointer once all packets from the report have been
|
||||
// queued. This simplifies the consumer implementation, as it can assume that the report is
|
||||
// complete once the put pointer is updated.
|
||||
//
|
||||
|
||||
//
|
||||
// CrashCat Queue Get Pointer
|
||||
// Offset in bytes into the CrashCat circular queue at which the next crash report will be read by
|
||||
// the consumer (when get is behind put). The consumer advances this pointer to allow queue memory
|
||||
// to be reused by subsequent reports.
|
||||
//
|
||||
|
||||
static NV_INLINE NvU32 crashcatQueueFreeBytes(NvU32 put, NvU32 get, NvU32 size)
|
||||
{
|
||||
return (put >= get) ? (size - (put - get)) : (get - put);
|
||||
}
|
||||
|
||||
static NV_INLINE NvU32 crashcatQueueBytesToRead(NvU32 put, NvU32 get, NvU32 size)
|
||||
{
|
||||
return (put >= get) ? (put - get) : (size - (get - put));
|
||||
}
|
||||
|
||||
//
|
||||
// CrashCat Packet Header (NV_CRASHCAT_PACKET_HEADER)
|
||||
// _SIGNATURE : NV_CRASHCAT_SIGNATURE value to indicate the start of a new data value
|
||||
// _FORMAT_VERSION : NV_CRASHCAT_PACKET_FORMAT_VERSION value
|
||||
// _PAYLOAD_UNIT_SIZE : NV_CRASHCAT_MEM_UNIT_SIZE value indicating the units of the
|
||||
// _PAYLOAD_SIZE field
|
||||
// _PAYLOAD_SIZE : Size of the packet payload (excluding header) in _PAYLOAD_UNIT_SIZE
|
||||
// minus 1 (_PAYLOAD_SIZE = 0 -> payload size is 1 unit)
|
||||
// _V1_TYPE : NV_CRASHCAT_PACKET_TYPE value
|
||||
// _V1_META : Additional packet metadata bits specific to the packet type
|
||||
//
|
||||
typedef NvU64 NvCrashCatPacketHeader;
|
||||
typedef NvU64 NvCrashCatPacketHeader_V1;
|
||||
#define NV_CRASHCAT_PACKET_HEADER_SIGNATURE 15:0
|
||||
#define NV_CRASHCAT_PACKET_HEADER_SIGNATURE_VALID NV_CRASHCAT_SIGNATURE
|
||||
#define NV_CRASHCAT_PACKET_HEADER_FORMAT_VERSION 19:16
|
||||
#define NV_CRASHCAT_PACKET_HEADER_FORMAT_VERSION_1 NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
#define NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE 21:20
|
||||
#define NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE_8B NV_CRASHCAT_MEM_UNIT_SIZE_8B
|
||||
#define NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE_1KB NV_CRASHCAT_MEM_UNIT_SIZE_1KB
|
||||
#define NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE_4KB NV_CRASHCAT_MEM_UNIT_SIZE_4KB
|
||||
#define NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE_64PKB NV_CRASHCAT_MEM_UNIT_SIZE_64KB
|
||||
#define NV_CRASHCAT_PACKET_HEADER_PAYLOAD_SIZE 31:22
|
||||
#define NV_CRASHCAT_PACKET_HEADER_V1_TYPE 39:32
|
||||
#define NV_CRASHCAT_PACKET_HEADER_V1_TYPE_REPORT NV_CRASHCAT_PACKET_TYPE_REPORT
|
||||
#define NV_CRASHCAT_PACKET_HEADER_V1_TYPE_RISCV64_CSR_STATE \
|
||||
NV_CRASHCAT_PACKET_TYPE_RISCV64_CSR_STATE
|
||||
#define NV_CRASHCAT_PACKET_HEADER_V1_TYPE_RISCV64_GPR_STATE \
|
||||
NV_CRASHCAT_PACKET_TYPE_RISCV64_GPR_STATE
|
||||
#define NV_CRASHCAT_PACKET_HEADER_V1_TYPE_IO32_STATE NV_CRASHCAT_PACKET_TYPE_IO32_STATE
|
||||
#define NV_CRASHCAT_PACKET_HEADER_V1_TYPE_RISCV64_TRACE NV_CRASHCAT_PACKET_TYPE_RISCV64_TRACE
|
||||
#define NV_CRASHCAT_PACKET_HEADER_V1_META 63:40
|
||||
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_PACKET_FORMAT_VERSION,
|
||||
NV_CRASHCAT_PACKET_HEADER_FORMAT_VERSION);
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_MEM_UNIT_SIZE,
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE);
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_PACKET_TYPE,
|
||||
NV_CRASHCAT_PACKET_HEADER_V1_TYPE);
|
||||
|
||||
//
|
||||
// CrashCat Report (NV_CRASHCAT_PACKET_TYPE_REPORT) V1
|
||||
// A fixed-size packet including
|
||||
// 8 bytes: packet header (see NV_CRASHCAT_PACKET_HEADER)
|
||||
// 8 bytes: implementer signature
|
||||
// 16 bytes: reporter information
|
||||
// 32 bytes: crash source information
|
||||
//
|
||||
// A report packet sets the context for the remaining packets that come after it (until the next
|
||||
// NV_CRASHCAT_PACKET_TYPE_REPORT packet).
|
||||
//
|
||||
typedef struct NvCrashCatReport_V1 {
|
||||
//
|
||||
// CrashCat Report V1 Header (NV_CRASHCAT_REPORT_V1_HEADER)
|
||||
// _SIGNATURE : NV_CRASHCAT_SIGNATURE value to indicate the start of a new packet
|
||||
// _FORMAT_VERSION : NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
// _PAYLOAD_UNIT_SIZE : NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE_8B
|
||||
// _PAYLOAD_SIZE : 6 (56 bytes)
|
||||
// _TYPE : NV_CRASHCAT_PACKET_TYPE_REPORT value
|
||||
// _RESERVED : Reserved for future use (currently 0)
|
||||
//
|
||||
NvCrashCatPacketHeader_V1 header;
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_SIGNATURE \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_SIGNATURE_VALID \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE_VALID
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_FORMAT_VERSION \
|
||||
NV_CRASHCAT_PACKET_HEADER_FORMAT_VERSION
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_FORMAT_VERSION_VALID \
|
||||
NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_PAYLOAD_UNIT_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_PAYLOAD_UNIT_SIZE_VALID \
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE_8B
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_PAYLOAD_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_SIZE
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_PAYLOAD_SIZE_VALID \
|
||||
(((sizeof(NvCrashCatReport_V1) - sizeof(NvCrashCatPacketHeader_V1)) >> 3) - 1)
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_PACKET_TYPE \
|
||||
NV_CRASHCAT_PACKET_HEADER_V1_TYPE
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_PACKET_TYPE_VALID \
|
||||
NV_CRASHCAT_PACKET_TYPE_REPORT
|
||||
#define NV_CRASHCAT_REPORT_V1_HEADER_RESERVED 63:40
|
||||
|
||||
//
|
||||
// CrashCat Report V1 Implementer Signature
|
||||
// Provides a unique 64-bit identifier for the decoder to use to interpret the
|
||||
// implementation-defined bits
|
||||
//
|
||||
NvU64 implementerSignature;
|
||||
|
||||
//
|
||||
// CrashCat Report V1 Reporter ID (NV_CRASHCAT_REPORT_V1_REPORTER_ID)
|
||||
// _NVRISCV_PARTITION : Partition index of the crash reporter (depends on FMC configuration)
|
||||
// _NVRISCV_UCODE_ID : Ucode ID of the crash reporter (read from the relevant curruid
|
||||
// CSR/field)
|
||||
// _RISCV_MODE : Current RISC-V mode of the crash reporter
|
||||
// _IMPL_DEF : Implementation-defined identifier
|
||||
//
|
||||
NvU64 reporterId;
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_NVRISCV_PARTITION 7:0
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_NVRISCV_PARTITION_UNSPECIFIED \
|
||||
NV_CRASHCAT_NVRISCV_PARTITION_UNSPECIFIED
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_NVRISCV_UCODE_ID 15:8
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_NVRISCV_UCODE_ID_UNSPECIFIED \
|
||||
NV_CRASHCAT_NVRISCV_UCODE_ID_UNSPECIFIED
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_RISCV_MODE 18:16
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_RISCV_MODE_M \
|
||||
NV_CRASHCAT_RISCV_MODE_M
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_RISCV_MODE_S \
|
||||
NV_CRASHCAT_RISCV_MODE_S
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_RISCV_MODE_U \
|
||||
NV_CRASHCAT_RISCV_MODE_U
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_RISCV_MODE_UNSPECIFIED \
|
||||
NV_CRASHCAT_RISCV_MODE_UNSPECIFIED
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_RESERVED 23:19
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_ID_IMPL_DEF 63:24
|
||||
|
||||
//
|
||||
// CrashCat Report V1 Reporter Data (NV_CRASHCAT_REPORT_V1_REPORTER_DATA)
|
||||
// _VERSION : Implementation-defined version identifier (recommend CL number)
|
||||
// _TIMESTAMP : Seconds since epoch (Jan 1, 1970) or cold reset of when the crash report was
|
||||
// generated. Since this value is read from a local clock source, the consumer
|
||||
// is responsible for adjusting this value to a relevant reference point.
|
||||
//
|
||||
NvU64 reporterData;
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_DATA_VERSION 31:0
|
||||
#define NV_CRASHCAT_REPORT_V1_REPORTER_DATA_TIMESTAMP 63:32
|
||||
|
||||
//
|
||||
// CrashCat Report V1 Source ID (NV_CRASHCAT_REPORT_V1_SOURCE_ID)
|
||||
// _NVRISCV_PARTITION : Partition ID of the crashing code (depends on FMC configuration)
|
||||
// _NVRISCV_UCODE_ID : Ucode ID of the crashing code (read from the relevant curruid
|
||||
// CSR/field)
|
||||
// _RISCV_MODE : RISC-V mode of the crashing code
|
||||
// _IMPL_DEF : Implementation-defined identifier
|
||||
//
|
||||
NvU64 sourceId;
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_NVRISCV_PARTITION 7:0
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_NVRISCV_PARTITION_UNSPECIFIED \
|
||||
NV_CRASHCAT_NVRISCV_PARTITION_UNSPECIFIED
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_NVRISCV_UCODE_ID 15:8
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_NVRISCV_UCODE_ID_UNSPECIFIED \
|
||||
NV_CRASHCAT_NVRISCV_UCODE_ID_UNSPECIFIED
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_RISCV_MODE 18:16
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_RISCV_MODE_M NV_CRASHCAT_RISCV_MODE_M
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_RISCV_MODE_S NV_CRASHCAT_RISCV_MODE_S
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_RISCV_MODE_U NV_CRASHCAT_RISCV_MODE_U
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_RISCV_MODE_UNSPECIFIED \
|
||||
NV_CRASHCAT_RISCV_MODE_UNSPECIFIED
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_RESERVED 23:19
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_ID_IMPL_DEF 63:24
|
||||
|
||||
//
|
||||
// CrashCat Report V1 Source Cause (NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE)
|
||||
// _TYPE : CrashCat general failure type for the crash (i.e., how the crash was observed)
|
||||
// _RESERVED: Reserved for future use (currently 0)
|
||||
// _IMPL_DEF: Implementation-defined reason code for the crash
|
||||
//
|
||||
NvU64 sourceCause;
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_TYPE 3:0
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_TYPE_EXCEPTION NV_CRASHCAT_CAUSE_TYPE_EXCEPTION
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_TYPE_TIMEOUT NV_CRASHCAT_CAUSE_TYPE_TIMEOUT
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_TYPE_PANIC NV_CRASHCAT_CAUSE_TYPE_PANIC
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_RESERVED 31:4
|
||||
#define NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_IMPL_DEF 63:32
|
||||
|
||||
//
|
||||
// CrashCat Report V1 Source PC
|
||||
// Program counter of the instruction where the crash occurred
|
||||
//
|
||||
NvU64 sourcePc;
|
||||
|
||||
//
|
||||
// CrashCat Report V1 Source Data
|
||||
// Additional crash source data (implementation-defined)
|
||||
//
|
||||
NvU64 sourceData;
|
||||
} NvCrashCatReport_V1;
|
||||
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_RISCV_MODE,
|
||||
NV_CRASHCAT_REPORT_V1_REPORTER_ID_RISCV_MODE);
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_RISCV_MODE,
|
||||
NV_CRASHCAT_REPORT_V1_SOURCE_ID_RISCV_MODE);
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_CAUSE_TYPE,
|
||||
NV_CRASHCAT_REPORT_V1_SOURCE_CAUSE_TYPE);
|
||||
|
||||
//
|
||||
// CrashCat RISC-V CSR State (NV_CRASHCAT_PACKET_TYPE_RISCV64_CSR_STATE) V1
|
||||
// A fixed-size packet containing values for RISC-V Control and Status Registers (CSRs) that are
|
||||
// commonly relevant in debugging crashes.
|
||||
//
|
||||
// Note: all CSRs in this structure must be defined in the standard RISC-V specification.
|
||||
// Do not add NVRISC-V-specific CSRs to this packet.
|
||||
//
|
||||
typedef struct NvCrashCatRiscv64CsrState_V1 {
|
||||
//
|
||||
// CrashCat RISC-V CSR State Header (NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER)
|
||||
// _SIGNATURE : NV_CRASHCAT_SIGNATURE value to indicate the start of a new packet
|
||||
// _FORMAT_VERSION : NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
// _PAYLOAD_UNIT_SIZE : NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE_8B
|
||||
// _PAYLOAD_SIZE : 6 (56 bytes)
|
||||
// _TYPE : NV_CRASHCAT_PACKET_TYPE_RISCV64_CSR_STATE
|
||||
// _RISCV_MODE : NV_CRASHCAT_RISCV_MODE that indicates the RISC-V mode in which the
|
||||
// CSR values are captured from
|
||||
// _RESERVED : Reserved for future use (currently 0)
|
||||
//
|
||||
NvCrashCatPacketHeader_V1 header;
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_SIGNATURE \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_SIGNATURE_VALID \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE_VALID
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_FORMAT_VERSION \
|
||||
NV_CRASHCAT_PACKET_HEADER_FORMAT_VERSION
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_FORMAT_VERSION_VALID \
|
||||
NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_PAYLOAD_UNIT_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_PAYLOAD_UNIT_SIZE_VALID \
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE_8B
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_PAYLOAD_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_SIZE
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_PAYLOAD_SIZE_VALID \
|
||||
(((sizeof(NvCrashCatRiscv64CsrState_V1) - sizeof(NvCrashCatPacketHeader_V1)) >> 3) \
|
||||
- 1)
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_PACKET_TYPE \
|
||||
NV_CRASHCAT_PACKET_HEADER_V1_TYPE
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_PACKET_TYPE_VALID \
|
||||
NV_CRASHCAT_PACKET_TYPE_RISCV64_CSR_STATE
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_RISCV_MODE 42:40
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_RISCV_MODE_M NV_CRASHCAT_RISCV_MODE_M
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_RISCV_MODE_S NV_CRASHCAT_RISCV_MODE_S
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_RISCV_MODE_U NV_CRASHCAT_RISCV_MODE_U
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_RISCV_MODE_UNSPECIFIED \
|
||||
NV_CRASHCAT_RISCV_MODE_UNSPECIFIED
|
||||
#define NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_RESERVED 63:43
|
||||
|
||||
NvU64 xstatus; // mstatus or sstatus
|
||||
NvU64 xie; // mie or sie
|
||||
NvU64 xip; // mip or sip
|
||||
NvU64 xepc; // mepc or sepc
|
||||
NvU64 xtval; // mbadaddr, mtval or stval
|
||||
NvU64 xcause; // mcause or scause
|
||||
NvU64 xscratch; // mscratch or sscratch
|
||||
} NvCrashCatRiscv64CsrState_V1;
|
||||
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_RISCV_MODE,
|
||||
NV_CRASHCAT_RISCV64_CSR_STATE_V1_HEADER_RISCV_MODE);
|
||||
|
||||
//
|
||||
// CrashCat RISC-V GPR State (NV_CRASHCAT_PACKET_TYPE_RISCV64_GPR_STATE) V1
|
||||
// A fixed-size packet containing values for RISC-V general purpose registers (GPRs).
|
||||
//
|
||||
// These are defined to match the RISC-V standard calling convention for x1-x31.
|
||||
// x0 is hardwired to 0, so we don't include it in dumps, and the packet header takes its place.
|
||||
//
|
||||
typedef struct NvCrashCatRiscv64GprState_V1 {
|
||||
//
|
||||
// CrashCat RISC-V GPR State Header (NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER)
|
||||
// _SIGNATURE : NV_CRASHCAT_SIGNATURE value to indicate the start of a new packet
|
||||
// _FORMAT_VERSION : NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
// _PAYLOAD_UNIT_SIZE : NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE_8B
|
||||
// _PAYLOAD_SIZE : 30 (188 bytes)
|
||||
// _TYPE : NV_CRASHCAT_PACKET_TYPE_RISCV64_GPR_STATE
|
||||
// _RESERVED : Reserved for future use (currently 0)
|
||||
//
|
||||
NvCrashCatPacketHeader_V1 header;
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_SIGNATURE \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_SIGNATURE_VALID \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE_VALID
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_FORMAT_VERSION \
|
||||
NV_CRASHCAT_PACKET_HEADER_FORMAT_VERSION
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_FORMAT_VERSION_VALID \
|
||||
NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_PAYLOAD_UNIT_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_PAYLOAD_UNIT_SIZE_VALID \
|
||||
NV_CRASHCAT_MEM_UNIT_SIZE_8B
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_PAYLOAD_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_SIZE
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_PAYLOAD_SIZE_VALID \
|
||||
(((sizeof(NvCrashCatRiscv64GprState_V1) - sizeof(NvCrashCatPacketHeader_V1)) >> 3) \
|
||||
- 1)
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_PACKET_TYPE \
|
||||
NV_CRASHCAT_PACKET_HEADER_V1_TYPE
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_PACKET_TYPE_VALID \
|
||||
NV_CRASHCAT_PACKET_TYPE_RISCV64_GPR_STATE
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_RISCV_MODE 42:40
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_RISCV_MODE_M NV_CRASHCAT_RISCV_MODE_M
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_RISCV_MODE_S NV_CRASHCAT_RISCV_MODE_S
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_RISCV_MODE_U NV_CRASHCAT_RISCV_MODE_U
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_RISCV_MODE_UNSPECIFIED \
|
||||
NV_CRASHCAT_RISCV_MODE_UNSPECIFIED
|
||||
#define NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_RESERVED 63:40
|
||||
|
||||
NvU64 ra; // Return address
|
||||
NvU64 sp; // Stack pointer
|
||||
NvU64 gp; // Global pointer
|
||||
NvU64 tp; // Thread pointer
|
||||
NvU64 t0; // Temporary register 0
|
||||
NvU64 t1; // Temporary register 1
|
||||
NvU64 t2; // Temporary register 2
|
||||
NvU64 s0; // Saved register 0
|
||||
NvU64 s1; // Saved register 1
|
||||
NvU64 a0; // Argument/return value register 0
|
||||
NvU64 a1; // Argument/return value register 1
|
||||
NvU64 a2; // Argument register 2
|
||||
NvU64 a3; // Argument register 3
|
||||
NvU64 a4; // Argument register 4
|
||||
NvU64 a5; // Argument register 5
|
||||
NvU64 a6; // Argument register 6
|
||||
NvU64 a7; // Argument register 7
|
||||
NvU64 s2; // Saved register 2
|
||||
NvU64 s3; // Saved register 3
|
||||
NvU64 s4; // Saved register 4
|
||||
NvU64 s5; // Saved register 5
|
||||
NvU64 s6; // Saved register 6
|
||||
NvU64 s7; // Saved register 7
|
||||
NvU64 s8; // Saved register 8
|
||||
NvU64 s9; // Saved register 9
|
||||
NvU64 s10; // Saved register 10
|
||||
NvU64 s11; // Saved register 11
|
||||
NvU64 t3; // Temporary register 3
|
||||
NvU64 t4; // Temporary register 4
|
||||
NvU64 t5; // Temporary register 5
|
||||
NvU64 t6; // Temporary register 6
|
||||
} NvCrashCatRiscv64GprState_V1;
|
||||
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_RISCV_MODE,
|
||||
NV_CRASHCAT_RISCV64_GPR_STATE_V1_HEADER_RISCV_MODE);
|
||||
|
||||
//
|
||||
// CrashCat Trace (NV_CRASHCAT_PACKET_TYPE_RISCV64_TRACE) V1
|
||||
// A variable-size packet in which each 64-bit payload value is a virtual address from a trace
|
||||
// (such as from a stack or PC trace buffer). The packet header metadata includes details to help
|
||||
// differentiate types of traces.
|
||||
//
|
||||
typedef struct NvCrashCatRiscv64Trace_V1 {
|
||||
//
|
||||
// CrashCat Stack Trace Header (NV_CRASHCAT_RISCV64_TRACE_V1_HEADER)
|
||||
// _SIGNATURE : NV_CRASHCAT_SIGNATURE value to indicate the start of a new packet
|
||||
// _FORMAT_VERSION : NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
// _PAYLOAD_UNIT_SIZE : NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE_8B
|
||||
// _PAYLOAD_SIZE : Variable
|
||||
// _TYPE : NV_CRASHCAT_PACKET_TYPE_RISCV64_TRACE
|
||||
// _RISCV_MODE : The NV_CRASHCAT_RISCV_MODE context of the trace (e.g., the RISC-V
|
||||
// mode in which the trace addresses are relevant in)
|
||||
// _RESERVED : Reserved for future use (currently 0)
|
||||
//
|
||||
NvCrashCatPacketHeader_V1 header;
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_SIGNATURE \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_SIGNATURE_VALID \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE_VALID
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_FORMAT_VERSION \
|
||||
NV_CRASHCAT_PACKET_HEADER_FORMAT_VERSION
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_FORMAT_VERSION_VALID \
|
||||
NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_PAYLOAD_UNIT_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_PAYLOAD_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_SIZE
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_PACKET_TYPE \
|
||||
NV_CRASHCAT_PACKET_HEADER_V1_TYPE
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_PACKET_TYPE_VALID \
|
||||
NV_CRASHCAT_PACKET_TYPE_RISCV64_TRACE
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_RISCV_MODE 42:40
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_RISCV_MODE_M NV_CRASHCAT_RISCV_MODE_M
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_RISCV_MODE_S NV_CRASHCAT_RISCV_MODE_S
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_RISCV_MODE_U NV_CRASHCAT_RISCV_MODE_U
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_RISCV_MODE_UNSPECIFIED \
|
||||
NV_CRASHCAT_RISCV_MODE_UNSPECIFIED
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_TRACE_TYPE 43:43
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_TRACE_TYPE_STACK NV_CRASHCAT_TRACE_TYPE_STACK
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_TRACE_TYPE_NVRVTB NV_CRASHCAT_TRACE_TYPE_NVRVTB
|
||||
#define NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_RESERVED 63:44
|
||||
|
||||
NvU64 addr[];
|
||||
} NvCrashCatRiscv64Trace_V1;
|
||||
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_RISCV_MODE,
|
||||
NV_CRASHCAT_RISCV64_TRACE_V1_HEADER_RISCV_MODE);
|
||||
|
||||
//
|
||||
// CrashCat 32-bit I/O State (NV_CRASHCAT_PACKET_TYPE_IO32_STATE) V1
|
||||
// A variable-size packet in which a 32-bit address and a 32-bit value are encoded into each 64-bit
|
||||
// payload value.
|
||||
//
|
||||
typedef struct NvCrashCatIo32State_V1 {
|
||||
//
|
||||
// CrashCat 32-bit I/O Trace Header (NV_CRASHCAT_IO32_STATE_V1_HEADER)
|
||||
// _SIGNATURE : NV_CRASHCAT_SIGNATURE value to indicate the start of a new packet
|
||||
// _FORMAT_VERSION : NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
// _PAYLOAD_UNIT_SIZE : NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE_8B
|
||||
// _PAYLOAD_SIZE : Variable
|
||||
// _TYPE : NV_CRASHCAT_PACKET_TYPE_IO32_STATE
|
||||
// _APERTURE : NV_CRASHCAT_IO_APERTURE value identifying the aperture that the
|
||||
// offset is relative to
|
||||
// _RESERVED : Reserved for future use (currently 0)
|
||||
//
|
||||
NvCrashCatPacketHeader_V1 header;
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_SIGNATURE \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_SIGNATURE_VALID \
|
||||
NV_CRASHCAT_PACKET_HEADER_SIGNATURE_VALID
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_FORMAT_VERSION \
|
||||
NV_CRASHCAT_PACKET_HEADER_FORMAT_VERSION
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_FORMAT_VERSION_VALID \
|
||||
NV_CRASHCAT_PACKET_FORMAT_VERSION_1
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_PAYLOAD_UNIT_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_UNIT_SIZE
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_PAYLOAD_SIZE \
|
||||
NV_CRASHCAT_PACKET_HEADER_PAYLOAD_SIZE
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_PACKET_TYPE \
|
||||
NV_CRASHCAT_PACKET_HEADER_V1_TYPE
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_PACKET_TYPE_VALID \
|
||||
NV_CRASHCAT_PACKET_TYPE_IO32_STATE
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_APERTURE 41:40
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_APERTURE_NONE NV_CRASHCAT_IO_APERTURE_NONE
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_APERTURE_INTIO NV_CRASHCAT_IO_APERTURE_INTIO
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_APERTURE_EXTIO NV_CRASHCAT_IO_APERTURE_EXTIO
|
||||
#define NV_CRASHCAT_IO32_STATE_V1_HEADER_RESERVED 63:42
|
||||
|
||||
struct {
|
||||
NvU32 value;
|
||||
NvU32 offset;
|
||||
} regs[];
|
||||
} NvCrashCatIo32State_V1;
|
||||
|
||||
STATIC_ASSERT_ENUM_FITS_IN_BITFIELD(NV_CRASHCAT_IO_APERTURE,
|
||||
NV_CRASHCAT_IO32_STATE_V1_HEADER_APERTURE);
|
||||
|
||||
#endif // NV_CRASHCAT_H
|
||||
Reference in New Issue
Block a user