1 
2 #ifndef _G_CONF_COMPUTE_NVOC_H_
3 #define _G_CONF_COMPUTE_NVOC_H_
4 #include "nvoc/runtime.h"
5 
6 // Version of generated metadata structures
7 #ifdef NVOC_METADATA_VERSION
8 #undef NVOC_METADATA_VERSION
9 #endif
10 #define NVOC_METADATA_VERSION 0
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /*
17  * SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
18  * SPDX-License-Identifier: MIT
19  *
20  * Permission is hereby granted, free of charge, to any person obtaining a
21  * copy of this software and associated documentation files (the "Software"),
22  * to deal in the Software without restriction, including without limitation
23  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
24  * and/or sell copies of the Software, and to permit persons to whom the
25  * Software is furnished to do so, subject to the following conditions:
26  *
27  * The above copyright notice and this permission notice shall be included in
28  * all copies or substantial portions of the Software.
29  *
30  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
33  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
35  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
36  * DEALINGS IN THE SOFTWARE.
37  */
38 
39 #pragma once
40 #include "g_conf_compute_nvoc.h"
41 
42 #ifndef CONF_COMPUTE_H
43 #define CONF_COMPUTE_H
44 
45 #include "gpu/gpu.h"
46 #include "gpu/eng_state.h"
47 #include "gpu/spdm/spdm.h"
48 #include "ctrl/ctrl2080/ctrl2080spdm.h"
49 #include "ctrl/ctrl2080/ctrl2080internal.h"
50 #include "ctrl/ctrlc56f.h"
51 #include "cc_drv.h"
52 #include "conf_compute/cc_keystore.h"
53 #include "conf_compute/cc_keyrotation.h"
54 #include "kernel/gpu/fifo/kernel_channel.h"
55 #include "kernel/gpu/fifo/kernel_fifo.h"
56 #include "kernel/gpu/intr/engine_idx.h"
57 #include "kernel/gpu/conf_compute/ccsl_context.h"
58 #include "kernel/gpu/timer/objtmr.h"
59 
60 /****************************************************************************\
61  *                                                                           *
62  *      Confidential Compute module header.                                  *
63  *                                                                           *
64  ****************************************************************************/
65 
66 //
67 // Per-key info regarding encryption ops
68 typedef struct
69 {
70     NvU64 totalBytesEncrypted;
71     NvU64 totalEncryptOps;
72 } KEY_ROTATION_STATS_INFO;
73 
74 // Info needed by workitem to perform key rotation
75 typedef struct
76 {
77     NvU32 h2dKey;
78     NvU32 d2hKey;
79     KEY_ROTATION_STATUS status;
80 } KEY_ROTATION_WORKITEM_INFO;
81 
82 // Info needed by timer to setup timeouts for key rotation
83 typedef struct
84 {
85     TMR_EVENT *pTimer;
86     NvU64      timeLeftNs; // time left before hitting timeout
87 } KEY_ROTATION_TIMEOUT_INFO;
88 
89 
90 // Private field names are wrapped in PRIVATE_FIELD, which does nothing for
91 // the matching C source file, but causes diagnostics to be issued if another
92 // source file references the field.
93 #ifdef NVOC_CONF_COMPUTE_H_PRIVATE_ACCESS_ALLOWED
94 #define PRIVATE_FIELD(x) x
95 #else
96 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x)
97 #endif
98 
99 
100 struct ConfidentialCompute {
101 
102     // Metadata
103     const struct NVOC_RTTI *__nvoc_rtti;
104 
105     // Parent (i.e. superclass or base class) object pointers
106     struct OBJENGSTATE __nvoc_base_OBJENGSTATE;
107 
108     // Ancestor object pointers for `staticCast` feature
109     struct Object *__nvoc_pbase_Object;    // obj super^2
110     struct OBJENGSTATE *__nvoc_pbase_OBJENGSTATE;    // engstate super
111     struct ConfidentialCompute *__nvoc_pbase_ConfidentialCompute;    // confCompute
112 
113     // Vtable with 41 per-object function pointers
114     NV_STATUS (*__confComputeConstructEngine__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, ENGDESCRIPTOR);  // virtual override (engstate) base (engstate)
115     void (*__confComputeDestruct__)(struct ConfidentialCompute * /*this*/);  // halified (2 hals) override (engstate) base (engstate) body
116     NV_STATUS (*__confComputeStatePreInitLocked__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // virtual halified (singleton optimized) override (engstate) base (engstate) body
117     NV_STATUS (*__confComputeStateInitLocked__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // virtual override (engstate) base (engstate)
118     NV_STATUS (*__confComputeStatePostLoad__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, NvU32);  // virtual halified (2 hals) override (engstate) base (engstate) body
119     NV_STATUS (*__confComputeStatePreUnload__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, NvU32);  // virtual halified (2 hals) override (engstate) base (engstate) body
120     void (*__confComputeSetErrorState__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // halified (2 hals) body
121     NV_STATUS (*__confComputeKeyStoreRetrieveViaChannel__)(struct ConfidentialCompute * /*this*/, struct KernelChannel *, ROTATE_IV_TYPE, NvBool, CC_KMB *);  // halified (2 hals) body
122     NV_STATUS (*__confComputeKeyStoreRetrieveViaKeyId__)(struct ConfidentialCompute * /*this*/, NvU32, ROTATE_IV_TYPE, NvBool, CC_KMB *);  // halified (2 hals) body
123     NV_STATUS (*__confComputeDeriveSecrets__)(struct ConfidentialCompute * /*this*/, NvU32);  // halified (2 hals) body
124     NV_STATUS (*__confComputeUpdateSecrets__)(struct ConfidentialCompute * /*this*/, NvU32);  // halified (2 hals) body
125     NvBool (*__confComputeIsSpdmEnabled__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // halified (2 hals) body
126     RM_ENGINE_TYPE (*__confComputeGetEngineIdFromKeySpace__)(struct ConfidentialCompute * /*this*/, NvU32);  // halified (2 hals) body
127     NvBool (*__confComputeGlobalKeyIsKernelPriv__)(struct ConfidentialCompute * /*this*/, NvU32);  // halified (2 hals) body
128     NvBool (*__confComputeGlobalKeyIsUvmKey__)(struct ConfidentialCompute * /*this*/, NvU32);  // halified (2 hals) body
129     NV_STATUS (*__confComputeGetKeyPairByChannel__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, struct KernelChannel *, NvU32 *, NvU32 *);  // halified (2 hals) body
130     NV_STATUS (*__confComputeTriggerKeyRotation__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // halified (3 hals) body
131     void (*__confComputeGetKeyPairForKeySpace__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, NvU32, NvBool, NvU32 *, NvU32 *);  // halified (2 hals) body
132     NV_STATUS (*__confComputeEnableKeyRotationCallback__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, NvBool);  // halified (3 hals) body
133     NV_STATUS (*__confComputeEnableKeyRotationSupport__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // halified (3 hals) body
134     NV_STATUS (*__confComputeEnableInternalKeyRotationSupport__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // halified (3 hals) body
135     NvBool (*__confComputeIsDebugModeEnabled__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // halified (3 hals) body
136     NvBool (*__confComputeIsGpuCcCapable__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // halified (3 hals) body
137     NV_STATUS (*__confComputeEstablishSpdmSessionAndKeys__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // halified (2 hals) body
138     void (*__confComputeKeyStoreDepositIvMask__)(struct ConfidentialCompute * /*this*/, NvU32, void *);  // halified (2 hals) body
139     NV_STATUS (*__confComputeKeyStoreUpdateKey__)(struct ConfidentialCompute * /*this*/, NvU32);  // halified (2 hals) body
140     NvBool (*__confComputeKeyStoreIsValidGlobalKeyId__)(struct ConfidentialCompute * /*this*/, NvU32);  // halified (2 hals) body
141     NV_STATUS (*__confComputeKeyStoreInit__)(struct ConfidentialCompute * /*this*/);  // halified (2 hals) body
142     void (*__confComputeKeyStoreDeinit__)(struct ConfidentialCompute * /*this*/);  // halified (2 hals) body
143     void * (*__confComputeKeyStoreGetExportMasterKey__)(struct ConfidentialCompute * /*this*/);  // halified (2 hals) body
144     NV_STATUS (*__confComputeKeyStoreDeriveKey__)(struct ConfidentialCompute * /*this*/, NvU32);  // halified (2 hals) body
145     void (*__confComputeKeyStoreClearExportMasterKey__)(struct ConfidentialCompute * /*this*/);  // halified (2 hals) body
146     void (*__confComputeInitMissing__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // virtual inherited (engstate) base (engstate)
147     NV_STATUS (*__confComputeStatePreInitUnlocked__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // virtual inherited (engstate) base (engstate)
148     NV_STATUS (*__confComputeStateInitUnlocked__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // virtual inherited (engstate) base (engstate)
149     NV_STATUS (*__confComputeStatePreLoad__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, NvU32);  // virtual inherited (engstate) base (engstate)
150     NV_STATUS (*__confComputeStateLoad__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, NvU32);  // virtual inherited (engstate) base (engstate)
151     NV_STATUS (*__confComputeStateUnload__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, NvU32);  // virtual inherited (engstate) base (engstate)
152     NV_STATUS (*__confComputeStatePostUnload__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/, NvU32);  // virtual inherited (engstate) base (engstate)
153     void (*__confComputeStateDestroy__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // virtual inherited (engstate) base (engstate)
154     NvBool (*__confComputeIsPresent__)(struct OBJGPU *, struct ConfidentialCompute * /*this*/);  // virtual inherited (engstate) base (engstate)
155 
156     // 12 PDB properties
157     NvBool PDB_PROP_CONFCOMPUTE_ENABLED;
158     NvBool PDB_PROP_CONFCOMPUTE_CC_FEATURE_ENABLED;
159     NvBool PDB_PROP_CONFCOMPUTE_APM_FEATURE_ENABLED;
160     NvBool PDB_PROP_CONFCOMPUTE_DEVTOOLS_MODE_ENABLED;
161     NvBool PDB_PROP_CONFCOMPUTE_ENABLE_EARLY_INIT;
162     NvBool PDB_PROP_CONFCOMPUTE_GPUS_READY_CHECK_ENABLED;
163     NvBool PDB_PROP_CONFCOMPUTE_SPDM_ENABLED;
164     NvBool PDB_PROP_CONFCOMPUTE_MULTI_GPU_PROTECTED_PCIE_MODE_ENABLED;
165     NvBool PDB_PROP_CONFCOMPUTE_KEY_ROTATION_SUPPORTED;
166     NvBool PDB_PROP_CONFCOMPUTE_KEY_ROTATION_ENABLED;
167     NvBool PDB_PROP_CONFCOMPUTE_INTERNAL_KEY_ROTATION_ENABLED;
168 
169     // Data members
170     NvU32 gspProxyRegkeys;
171     struct Spdm *pSpdm;
172     NV2080_CTRL_INTERNAL_CONF_COMPUTE_GET_STATIC_INFO_PARAMS ccStaticInfo;
173     struct ccslContext_t *pRpcCcslCtx;
174     struct ccslContext_t *pDmaCcslCtx;
175     struct ccslContext_t *pNonReplayableFaultCcslCtx;
176     struct ccslContext_t *pReplayableFaultCcslCtx;
177     struct ccslContext_t *pGspSec2RpcCcslCtx;
178     NvU32 keyRotationCallbackCount[64];
179     NvBool bAcceptClientRequest;
180     struct TMR_EVENT *pGspHeartbeatTimer;
181     NvU32 heartbeatPeriodSec;
182     NvU32 keyRotationEnableMask;
183     NvU64 keyRotationInternalThreshold;
184     NvU64 attackerAdvantage;
185     KEY_ROTATION_STATS_INFO aggregateStats[64];
186     NvU8 PRIVATE_FIELD(m_exportMasterKey)[32];
187     void *PRIVATE_FIELD(m_keySlot);
188     KEY_ROTATION_STATUS PRIVATE_FIELD(keyRotationState)[64];
189     KEY_ROTATION_STATS_INFO PRIVATE_FIELD(freedChannelAggregateStats)[64];
190     KEY_ROTATION_TIMEOUT_INFO PRIVATE_FIELD(keyRotationTimeoutInfo)[64];
191     NvU32 PRIVATE_FIELD(keyRotationCount)[64];
192     NvU32 PRIVATE_FIELD(keyRotationTimeout);
193     NvU64 PRIVATE_FIELD(keyRotationThresholdDelta);
194     NvU64 PRIVATE_FIELD(keyRotationUpperThreshold);
195     NvU64 PRIVATE_FIELD(keyRotationLowerThreshold);
196 };
197 
198 #ifndef __NVOC_CLASS_ConfidentialCompute_TYPEDEF__
199 #define __NVOC_CLASS_ConfidentialCompute_TYPEDEF__
200 typedef struct ConfidentialCompute ConfidentialCompute;
201 #endif /* __NVOC_CLASS_ConfidentialCompute_TYPEDEF__ */
202 
203 #ifndef __nvoc_class_id_ConfidentialCompute
204 #define __nvoc_class_id_ConfidentialCompute 0x9798cc
205 #endif /* __nvoc_class_id_ConfidentialCompute */
206 
207 // Casting support
208 extern const struct NVOC_CLASS_DEF __nvoc_class_def_ConfidentialCompute;
209 
210 #define __staticCast_ConfidentialCompute(pThis) \
211     ((pThis)->__nvoc_pbase_ConfidentialCompute)
212 
213 #ifdef __nvoc_conf_compute_h_disabled
214 #define __dynamicCast_ConfidentialCompute(pThis) ((ConfidentialCompute*)NULL)
215 #else //__nvoc_conf_compute_h_disabled
216 #define __dynamicCast_ConfidentialCompute(pThis) \
217     ((ConfidentialCompute*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(ConfidentialCompute)))
218 #endif //__nvoc_conf_compute_h_disabled
219 
220 // Property macros
221 #define PDB_PROP_CONFCOMPUTE_KEY_ROTATION_SUPPORTED_BASE_CAST
222 #define PDB_PROP_CONFCOMPUTE_KEY_ROTATION_SUPPORTED_BASE_NAME PDB_PROP_CONFCOMPUTE_KEY_ROTATION_SUPPORTED
223 #define PDB_PROP_CONFCOMPUTE_INTERNAL_KEY_ROTATION_ENABLED_BASE_CAST
224 #define PDB_PROP_CONFCOMPUTE_INTERNAL_KEY_ROTATION_ENABLED_BASE_NAME PDB_PROP_CONFCOMPUTE_INTERNAL_KEY_ROTATION_ENABLED
225 #define PDB_PROP_CONFCOMPUTE_KEY_ROTATION_ENABLED_BASE_CAST
226 #define PDB_PROP_CONFCOMPUTE_KEY_ROTATION_ENABLED_BASE_NAME PDB_PROP_CONFCOMPUTE_KEY_ROTATION_ENABLED
227 #define PDB_PROP_CONFCOMPUTE_APM_FEATURE_ENABLED_BASE_CAST
228 #define PDB_PROP_CONFCOMPUTE_APM_FEATURE_ENABLED_BASE_NAME PDB_PROP_CONFCOMPUTE_APM_FEATURE_ENABLED
229 #define PDB_PROP_CONFCOMPUTE_IS_MISSING_BASE_CAST __nvoc_base_OBJENGSTATE.
230 #define PDB_PROP_CONFCOMPUTE_IS_MISSING_BASE_NAME PDB_PROP_ENGSTATE_IS_MISSING
231 #define PDB_PROP_CONFCOMPUTE_ENABLE_EARLY_INIT_BASE_CAST
232 #define PDB_PROP_CONFCOMPUTE_ENABLE_EARLY_INIT_BASE_NAME PDB_PROP_CONFCOMPUTE_ENABLE_EARLY_INIT
233 #define PDB_PROP_CONFCOMPUTE_GPUS_READY_CHECK_ENABLED_BASE_CAST
234 #define PDB_PROP_CONFCOMPUTE_GPUS_READY_CHECK_ENABLED_BASE_NAME PDB_PROP_CONFCOMPUTE_GPUS_READY_CHECK_ENABLED
235 #define PDB_PROP_CONFCOMPUTE_ENABLED_BASE_CAST
236 #define PDB_PROP_CONFCOMPUTE_ENABLED_BASE_NAME PDB_PROP_CONFCOMPUTE_ENABLED
237 #define PDB_PROP_CONFCOMPUTE_CC_FEATURE_ENABLED_BASE_CAST
238 #define PDB_PROP_CONFCOMPUTE_CC_FEATURE_ENABLED_BASE_NAME PDB_PROP_CONFCOMPUTE_CC_FEATURE_ENABLED
239 #define PDB_PROP_CONFCOMPUTE_MULTI_GPU_PROTECTED_PCIE_MODE_ENABLED_BASE_CAST
240 #define PDB_PROP_CONFCOMPUTE_MULTI_GPU_PROTECTED_PCIE_MODE_ENABLED_BASE_NAME PDB_PROP_CONFCOMPUTE_MULTI_GPU_PROTECTED_PCIE_MODE_ENABLED
241 #define PDB_PROP_CONFCOMPUTE_DEVTOOLS_MODE_ENABLED_BASE_CAST
242 #define PDB_PROP_CONFCOMPUTE_DEVTOOLS_MODE_ENABLED_BASE_NAME PDB_PROP_CONFCOMPUTE_DEVTOOLS_MODE_ENABLED
243 #define PDB_PROP_CONFCOMPUTE_SPDM_ENABLED_BASE_CAST
244 #define PDB_PROP_CONFCOMPUTE_SPDM_ENABLED_BASE_NAME PDB_PROP_CONFCOMPUTE_SPDM_ENABLED
245 
246 NV_STATUS __nvoc_objCreateDynamic_ConfidentialCompute(ConfidentialCompute**, Dynamic*, NvU32, va_list);
247 
248 NV_STATUS __nvoc_objCreate_ConfidentialCompute(ConfidentialCompute**, Dynamic*, NvU32);
249 #define __objCreate_ConfidentialCompute(ppNewObj, pParent, createFlags) \
250     __nvoc_objCreate_ConfidentialCompute((ppNewObj), staticCast((pParent), Dynamic), (createFlags))
251 
252 
253 // Wrapper macros
254 #define confComputeConstructEngine_FNPTR(pConfCompute) pConfCompute->__confComputeConstructEngine__
255 #define confComputeConstructEngine(pGpu, pConfCompute, engDesc) confComputeConstructEngine_DISPATCH(pGpu, pConfCompute, engDesc)
256 #define confComputeDestruct_FNPTR(pConfCompute) pConfCompute->__confComputeDestruct__
257 #define __nvoc_confComputeDestruct(pConfCompute) confComputeDestruct_DISPATCH(pConfCompute)
258 #define confComputeStatePreInitLocked_FNPTR(pConfCompute) pConfCompute->__confComputeStatePreInitLocked__
259 #define confComputeStatePreInitLocked(pGpu, pConfCompute) confComputeStatePreInitLocked_DISPATCH(pGpu, pConfCompute)
260 #define confComputeStatePreInitLocked_HAL(pGpu, pConfCompute) confComputeStatePreInitLocked_DISPATCH(pGpu, pConfCompute)
261 #define confComputeStateInitLocked_FNPTR(pConfCompute) pConfCompute->__confComputeStateInitLocked__
262 #define confComputeStateInitLocked(pGpu, pConfCompute) confComputeStateInitLocked_DISPATCH(pGpu, pConfCompute)
263 #define confComputeStatePostLoad_FNPTR(pConfCompute) pConfCompute->__confComputeStatePostLoad__
264 #define confComputeStatePostLoad(pGpu, pConfCompute, flags) confComputeStatePostLoad_DISPATCH(pGpu, pConfCompute, flags)
265 #define confComputeStatePostLoad_HAL(pGpu, pConfCompute, flags) confComputeStatePostLoad_DISPATCH(pGpu, pConfCompute, flags)
266 #define confComputeStatePreUnload_FNPTR(pConfCompute) pConfCompute->__confComputeStatePreUnload__
267 #define confComputeStatePreUnload(pGpu, pConfCompute, flags) confComputeStatePreUnload_DISPATCH(pGpu, pConfCompute, flags)
268 #define confComputeStatePreUnload_HAL(pGpu, pConfCompute, flags) confComputeStatePreUnload_DISPATCH(pGpu, pConfCompute, flags)
269 #define confComputeSetErrorState_FNPTR(pConfCompute) pConfCompute->__confComputeSetErrorState__
270 #define confComputeSetErrorState(pGpu, pConfCompute) confComputeSetErrorState_DISPATCH(pGpu, pConfCompute)
271 #define confComputeSetErrorState_HAL(pGpu, pConfCompute) confComputeSetErrorState_DISPATCH(pGpu, pConfCompute)
272 #define confComputeKeyStoreRetrieveViaChannel_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreRetrieveViaChannel__
273 #define confComputeKeyStoreRetrieveViaChannel(pConfCompute, pKernelChannel, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle) confComputeKeyStoreRetrieveViaChannel_DISPATCH(pConfCompute, pKernelChannel, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle)
274 #define confComputeKeyStoreRetrieveViaChannel_HAL(pConfCompute, pKernelChannel, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle) confComputeKeyStoreRetrieveViaChannel_DISPATCH(pConfCompute, pKernelChannel, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle)
275 #define confComputeKeyStoreRetrieveViaKeyId_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreRetrieveViaKeyId__
276 #define confComputeKeyStoreRetrieveViaKeyId(pConfCompute, globalKeyId, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle) confComputeKeyStoreRetrieveViaKeyId_DISPATCH(pConfCompute, globalKeyId, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle)
277 #define confComputeKeyStoreRetrieveViaKeyId_HAL(pConfCompute, globalKeyId, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle) confComputeKeyStoreRetrieveViaKeyId_DISPATCH(pConfCompute, globalKeyId, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle)
278 #define confComputeDeriveSecrets_FNPTR(pConfCompute) pConfCompute->__confComputeDeriveSecrets__
279 #define confComputeDeriveSecrets(pConfCompute, engine) confComputeDeriveSecrets_DISPATCH(pConfCompute, engine)
280 #define confComputeDeriveSecrets_HAL(pConfCompute, engine) confComputeDeriveSecrets_DISPATCH(pConfCompute, engine)
281 #define confComputeUpdateSecrets_FNPTR(pConfCompute) pConfCompute->__confComputeUpdateSecrets__
282 #define confComputeUpdateSecrets(pConfCompute, globalKeyId) confComputeUpdateSecrets_DISPATCH(pConfCompute, globalKeyId)
283 #define confComputeUpdateSecrets_HAL(pConfCompute, globalKeyId) confComputeUpdateSecrets_DISPATCH(pConfCompute, globalKeyId)
284 #define confComputeIsSpdmEnabled_FNPTR(pConfCompute) pConfCompute->__confComputeIsSpdmEnabled__
285 #define confComputeIsSpdmEnabled(pGpu, pConfCompute) confComputeIsSpdmEnabled_DISPATCH(pGpu, pConfCompute)
286 #define confComputeIsSpdmEnabled_HAL(pGpu, pConfCompute) confComputeIsSpdmEnabled_DISPATCH(pGpu, pConfCompute)
287 #define confComputeGetEngineIdFromKeySpace_FNPTR(pConfCompute) pConfCompute->__confComputeGetEngineIdFromKeySpace__
288 #define confComputeGetEngineIdFromKeySpace(pConfCompute, keySpace) confComputeGetEngineIdFromKeySpace_DISPATCH(pConfCompute, keySpace)
289 #define confComputeGetEngineIdFromKeySpace_HAL(pConfCompute, keySpace) confComputeGetEngineIdFromKeySpace_DISPATCH(pConfCompute, keySpace)
290 #define confComputeGlobalKeyIsKernelPriv_FNPTR(pConfCompute) pConfCompute->__confComputeGlobalKeyIsKernelPriv__
291 #define confComputeGlobalKeyIsKernelPriv(pConfCompute, keyId) confComputeGlobalKeyIsKernelPriv_DISPATCH(pConfCompute, keyId)
292 #define confComputeGlobalKeyIsKernelPriv_HAL(pConfCompute, keyId) confComputeGlobalKeyIsKernelPriv_DISPATCH(pConfCompute, keyId)
293 #define confComputeGlobalKeyIsUvmKey_FNPTR(pConfCompute) pConfCompute->__confComputeGlobalKeyIsUvmKey__
294 #define confComputeGlobalKeyIsUvmKey(pConfCompute, keyId) confComputeGlobalKeyIsUvmKey_DISPATCH(pConfCompute, keyId)
295 #define confComputeGlobalKeyIsUvmKey_HAL(pConfCompute, keyId) confComputeGlobalKeyIsUvmKey_DISPATCH(pConfCompute, keyId)
296 #define confComputeGetKeyPairByChannel_FNPTR(pConfCompute) pConfCompute->__confComputeGetKeyPairByChannel__
297 #define confComputeGetKeyPairByChannel(pGpu, pConfCompute, pKernelChannel, pH2DKey, pD2HKey) confComputeGetKeyPairByChannel_DISPATCH(pGpu, pConfCompute, pKernelChannel, pH2DKey, pD2HKey)
298 #define confComputeGetKeyPairByChannel_HAL(pGpu, pConfCompute, pKernelChannel, pH2DKey, pD2HKey) confComputeGetKeyPairByChannel_DISPATCH(pGpu, pConfCompute, pKernelChannel, pH2DKey, pD2HKey)
299 #define confComputeTriggerKeyRotation_FNPTR(pConfCompute) pConfCompute->__confComputeTriggerKeyRotation__
300 #define confComputeTriggerKeyRotation(pGpu, pConfCompute) confComputeTriggerKeyRotation_DISPATCH(pGpu, pConfCompute)
301 #define confComputeTriggerKeyRotation_HAL(pGpu, pConfCompute) confComputeTriggerKeyRotation_DISPATCH(pGpu, pConfCompute)
302 #define confComputeGetKeyPairForKeySpace_FNPTR(pConfCompute) pConfCompute->__confComputeGetKeyPairForKeySpace__
303 #define confComputeGetKeyPairForKeySpace(pGpu, pConfCompute, arg3, arg4, arg5, arg6) confComputeGetKeyPairForKeySpace_DISPATCH(pGpu, pConfCompute, arg3, arg4, arg5, arg6)
304 #define confComputeGetKeyPairForKeySpace_HAL(pGpu, pConfCompute, arg3, arg4, arg5, arg6) confComputeGetKeyPairForKeySpace_DISPATCH(pGpu, pConfCompute, arg3, arg4, arg5, arg6)
305 #define confComputeEnableKeyRotationCallback_FNPTR(pConfCompute) pConfCompute->__confComputeEnableKeyRotationCallback__
306 #define confComputeEnableKeyRotationCallback(pGpu, pConfCompute, bEnable) confComputeEnableKeyRotationCallback_DISPATCH(pGpu, pConfCompute, bEnable)
307 #define confComputeEnableKeyRotationCallback_HAL(pGpu, pConfCompute, bEnable) confComputeEnableKeyRotationCallback_DISPATCH(pGpu, pConfCompute, bEnable)
308 #define confComputeEnableKeyRotationSupport_FNPTR(pConfCompute) pConfCompute->__confComputeEnableKeyRotationSupport__
309 #define confComputeEnableKeyRotationSupport(pGpu, pConfCompute) confComputeEnableKeyRotationSupport_DISPATCH(pGpu, pConfCompute)
310 #define confComputeEnableKeyRotationSupport_HAL(pGpu, pConfCompute) confComputeEnableKeyRotationSupport_DISPATCH(pGpu, pConfCompute)
311 #define confComputeEnableInternalKeyRotationSupport_FNPTR(pConfCompute) pConfCompute->__confComputeEnableInternalKeyRotationSupport__
312 #define confComputeEnableInternalKeyRotationSupport(pGpu, pConfCompute) confComputeEnableInternalKeyRotationSupport_DISPATCH(pGpu, pConfCompute)
313 #define confComputeEnableInternalKeyRotationSupport_HAL(pGpu, pConfCompute) confComputeEnableInternalKeyRotationSupport_DISPATCH(pGpu, pConfCompute)
314 #define confComputeIsDebugModeEnabled_FNPTR(pConfCompute) pConfCompute->__confComputeIsDebugModeEnabled__
315 #define confComputeIsDebugModeEnabled(pGpu, pConfCompute) confComputeIsDebugModeEnabled_DISPATCH(pGpu, pConfCompute)
316 #define confComputeIsDebugModeEnabled_HAL(pGpu, pConfCompute) confComputeIsDebugModeEnabled_DISPATCH(pGpu, pConfCompute)
317 #define confComputeIsGpuCcCapable_FNPTR(pConfCompute) pConfCompute->__confComputeIsGpuCcCapable__
318 #define confComputeIsGpuCcCapable(pGpu, pConfCompute) confComputeIsGpuCcCapable_DISPATCH(pGpu, pConfCompute)
319 #define confComputeIsGpuCcCapable_HAL(pGpu, pConfCompute) confComputeIsGpuCcCapable_DISPATCH(pGpu, pConfCompute)
320 #define confComputeEstablishSpdmSessionAndKeys_FNPTR(pConfCompute) pConfCompute->__confComputeEstablishSpdmSessionAndKeys__
321 #define confComputeEstablishSpdmSessionAndKeys(pGpu, pConfCompute) confComputeEstablishSpdmSessionAndKeys_DISPATCH(pGpu, pConfCompute)
322 #define confComputeEstablishSpdmSessionAndKeys_HAL(pGpu, pConfCompute) confComputeEstablishSpdmSessionAndKeys_DISPATCH(pGpu, pConfCompute)
323 #define confComputeKeyStoreDepositIvMask_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreDepositIvMask__
324 #define confComputeKeyStoreDepositIvMask(pConfCompute, globalKeyId, ivMask) confComputeKeyStoreDepositIvMask_DISPATCH(pConfCompute, globalKeyId, ivMask)
325 #define confComputeKeyStoreDepositIvMask_HAL(pConfCompute, globalKeyId, ivMask) confComputeKeyStoreDepositIvMask_DISPATCH(pConfCompute, globalKeyId, ivMask)
326 #define confComputeKeyStoreUpdateKey_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreUpdateKey__
327 #define confComputeKeyStoreUpdateKey(pConfCompute, globalKeyId) confComputeKeyStoreUpdateKey_DISPATCH(pConfCompute, globalKeyId)
328 #define confComputeKeyStoreUpdateKey_HAL(pConfCompute, globalKeyId) confComputeKeyStoreUpdateKey_DISPATCH(pConfCompute, globalKeyId)
329 #define confComputeKeyStoreIsValidGlobalKeyId_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreIsValidGlobalKeyId__
330 #define confComputeKeyStoreIsValidGlobalKeyId(pConfCompute, globalKeyId) confComputeKeyStoreIsValidGlobalKeyId_DISPATCH(pConfCompute, globalKeyId)
331 #define confComputeKeyStoreIsValidGlobalKeyId_HAL(pConfCompute, globalKeyId) confComputeKeyStoreIsValidGlobalKeyId_DISPATCH(pConfCompute, globalKeyId)
332 #define confComputeKeyStoreInit_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreInit__
333 #define confComputeKeyStoreInit(pConfCompute) confComputeKeyStoreInit_DISPATCH(pConfCompute)
334 #define confComputeKeyStoreInit_HAL(pConfCompute) confComputeKeyStoreInit_DISPATCH(pConfCompute)
335 #define confComputeKeyStoreDeinit_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreDeinit__
336 #define confComputeKeyStoreDeinit(pConfCompute) confComputeKeyStoreDeinit_DISPATCH(pConfCompute)
337 #define confComputeKeyStoreDeinit_HAL(pConfCompute) confComputeKeyStoreDeinit_DISPATCH(pConfCompute)
338 #define confComputeKeyStoreGetExportMasterKey_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreGetExportMasterKey__
339 #define confComputeKeyStoreGetExportMasterKey(pConfCompute) confComputeKeyStoreGetExportMasterKey_DISPATCH(pConfCompute)
340 #define confComputeKeyStoreGetExportMasterKey_HAL(pConfCompute) confComputeKeyStoreGetExportMasterKey_DISPATCH(pConfCompute)
341 #define confComputeKeyStoreDeriveKey_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreDeriveKey__
342 #define confComputeKeyStoreDeriveKey(pConfCompute, globalKeyId) confComputeKeyStoreDeriveKey_DISPATCH(pConfCompute, globalKeyId)
343 #define confComputeKeyStoreDeriveKey_HAL(pConfCompute, globalKeyId) confComputeKeyStoreDeriveKey_DISPATCH(pConfCompute, globalKeyId)
344 #define confComputeKeyStoreClearExportMasterKey_FNPTR(pConfCompute) pConfCompute->__confComputeKeyStoreClearExportMasterKey__
345 #define confComputeKeyStoreClearExportMasterKey(pConfCompute) confComputeKeyStoreClearExportMasterKey_DISPATCH(pConfCompute)
346 #define confComputeKeyStoreClearExportMasterKey_HAL(pConfCompute) confComputeKeyStoreClearExportMasterKey_DISPATCH(pConfCompute)
347 #define confComputeInitMissing_FNPTR(pEngstate) pEngstate->__nvoc_base_OBJENGSTATE.__engstateInitMissing__
348 #define confComputeInitMissing(pGpu, pEngstate) confComputeInitMissing_DISPATCH(pGpu, pEngstate)
349 #define confComputeStatePreInitUnlocked_FNPTR(pEngstate) pEngstate->__nvoc_base_OBJENGSTATE.__engstateStatePreInitUnlocked__
350 #define confComputeStatePreInitUnlocked(pGpu, pEngstate) confComputeStatePreInitUnlocked_DISPATCH(pGpu, pEngstate)
351 #define confComputeStateInitUnlocked_FNPTR(pEngstate) pEngstate->__nvoc_base_OBJENGSTATE.__engstateStateInitUnlocked__
352 #define confComputeStateInitUnlocked(pGpu, pEngstate) confComputeStateInitUnlocked_DISPATCH(pGpu, pEngstate)
353 #define confComputeStatePreLoad_FNPTR(pEngstate) pEngstate->__nvoc_base_OBJENGSTATE.__engstateStatePreLoad__
354 #define confComputeStatePreLoad(pGpu, pEngstate, arg3) confComputeStatePreLoad_DISPATCH(pGpu, pEngstate, arg3)
355 #define confComputeStateLoad_FNPTR(pEngstate) pEngstate->__nvoc_base_OBJENGSTATE.__engstateStateLoad__
356 #define confComputeStateLoad(pGpu, pEngstate, arg3) confComputeStateLoad_DISPATCH(pGpu, pEngstate, arg3)
357 #define confComputeStateUnload_FNPTR(pEngstate) pEngstate->__nvoc_base_OBJENGSTATE.__engstateStateUnload__
358 #define confComputeStateUnload(pGpu, pEngstate, arg3) confComputeStateUnload_DISPATCH(pGpu, pEngstate, arg3)
359 #define confComputeStatePostUnload_FNPTR(pEngstate) pEngstate->__nvoc_base_OBJENGSTATE.__engstateStatePostUnload__
360 #define confComputeStatePostUnload(pGpu, pEngstate, arg3) confComputeStatePostUnload_DISPATCH(pGpu, pEngstate, arg3)
361 #define confComputeStateDestroy_FNPTR(pEngstate) pEngstate->__nvoc_base_OBJENGSTATE.__engstateStateDestroy__
362 #define confComputeStateDestroy(pGpu, pEngstate) confComputeStateDestroy_DISPATCH(pGpu, pEngstate)
363 #define confComputeIsPresent_FNPTR(pEngstate) pEngstate->__nvoc_base_OBJENGSTATE.__engstateIsPresent__
364 #define confComputeIsPresent(pGpu, pEngstate) confComputeIsPresent_DISPATCH(pGpu, pEngstate)
365 
366 // Dispatch functions
confComputeConstructEngine_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,ENGDESCRIPTOR engDesc)367 static inline NV_STATUS confComputeConstructEngine_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, ENGDESCRIPTOR engDesc) {
368     return pConfCompute->__confComputeConstructEngine__(pGpu, pConfCompute, engDesc);
369 }
370 
confComputeDestruct_DISPATCH(struct ConfidentialCompute * pConfCompute)371 static inline void confComputeDestruct_DISPATCH(struct ConfidentialCompute *pConfCompute) {
372     pConfCompute->__confComputeDestruct__(pConfCompute);
373 }
374 
confComputeStatePreInitLocked_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)375 static inline NV_STATUS confComputeStatePreInitLocked_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
376     return pConfCompute->__confComputeStatePreInitLocked__(pGpu, pConfCompute);
377 }
378 
confComputeStateInitLocked_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)379 static inline NV_STATUS confComputeStateInitLocked_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
380     return pConfCompute->__confComputeStateInitLocked__(pGpu, pConfCompute);
381 }
382 
confComputeStatePostLoad_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 flags)383 static inline NV_STATUS confComputeStatePostLoad_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 flags) {
384     return pConfCompute->__confComputeStatePostLoad__(pGpu, pConfCompute, flags);
385 }
386 
confComputeStatePreUnload_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 flags)387 static inline NV_STATUS confComputeStatePreUnload_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 flags) {
388     return pConfCompute->__confComputeStatePreUnload__(pGpu, pConfCompute, flags);
389 }
390 
confComputeSetErrorState_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)391 static inline void confComputeSetErrorState_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
392     pConfCompute->__confComputeSetErrorState__(pGpu, pConfCompute);
393 }
394 
confComputeKeyStoreRetrieveViaChannel_DISPATCH(struct ConfidentialCompute * pConfCompute,struct KernelChannel * pKernelChannel,ROTATE_IV_TYPE rotateOperation,NvBool bIncludeIvOrNonce,CC_KMB * keyMaterialBundle)395 static inline NV_STATUS confComputeKeyStoreRetrieveViaChannel_DISPATCH(struct ConfidentialCompute *pConfCompute, struct KernelChannel *pKernelChannel, ROTATE_IV_TYPE rotateOperation, NvBool bIncludeIvOrNonce, CC_KMB *keyMaterialBundle) {
396     return pConfCompute->__confComputeKeyStoreRetrieveViaChannel__(pConfCompute, pKernelChannel, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle);
397 }
398 
confComputeKeyStoreRetrieveViaKeyId_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId,ROTATE_IV_TYPE rotateOperation,NvBool bIncludeIvOrNonce,CC_KMB * keyMaterialBundle)399 static inline NV_STATUS confComputeKeyStoreRetrieveViaKeyId_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId, ROTATE_IV_TYPE rotateOperation, NvBool bIncludeIvOrNonce, CC_KMB *keyMaterialBundle) {
400     return pConfCompute->__confComputeKeyStoreRetrieveViaKeyId__(pConfCompute, globalKeyId, rotateOperation, bIncludeIvOrNonce, keyMaterialBundle);
401 }
402 
confComputeDeriveSecrets_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 engine)403 static inline NV_STATUS confComputeDeriveSecrets_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 engine) {
404     return pConfCompute->__confComputeDeriveSecrets__(pConfCompute, engine);
405 }
406 
confComputeUpdateSecrets_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId)407 static inline NV_STATUS confComputeUpdateSecrets_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId) {
408     return pConfCompute->__confComputeUpdateSecrets__(pConfCompute, globalKeyId);
409 }
410 
confComputeIsSpdmEnabled_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)411 static inline NvBool confComputeIsSpdmEnabled_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
412     return pConfCompute->__confComputeIsSpdmEnabled__(pGpu, pConfCompute);
413 }
414 
confComputeGetEngineIdFromKeySpace_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 keySpace)415 static inline RM_ENGINE_TYPE confComputeGetEngineIdFromKeySpace_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 keySpace) {
416     return pConfCompute->__confComputeGetEngineIdFromKeySpace__(pConfCompute, keySpace);
417 }
418 
confComputeGlobalKeyIsKernelPriv_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 keyId)419 static inline NvBool confComputeGlobalKeyIsKernelPriv_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 keyId) {
420     return pConfCompute->__confComputeGlobalKeyIsKernelPriv__(pConfCompute, keyId);
421 }
422 
confComputeGlobalKeyIsUvmKey_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 keyId)423 static inline NvBool confComputeGlobalKeyIsUvmKey_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 keyId) {
424     return pConfCompute->__confComputeGlobalKeyIsUvmKey__(pConfCompute, keyId);
425 }
426 
confComputeGetKeyPairByChannel_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,struct KernelChannel * pKernelChannel,NvU32 * pH2DKey,NvU32 * pD2HKey)427 static inline NV_STATUS confComputeGetKeyPairByChannel_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, struct KernelChannel *pKernelChannel, NvU32 *pH2DKey, NvU32 *pD2HKey) {
428     return pConfCompute->__confComputeGetKeyPairByChannel__(pGpu, pConfCompute, pKernelChannel, pH2DKey, pD2HKey);
429 }
430 
confComputeTriggerKeyRotation_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)431 static inline NV_STATUS confComputeTriggerKeyRotation_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
432     return pConfCompute->__confComputeTriggerKeyRotation__(pGpu, pConfCompute);
433 }
434 
confComputeGetKeyPairForKeySpace_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 arg3,NvBool arg4,NvU32 * arg5,NvU32 * arg6)435 static inline void confComputeGetKeyPairForKeySpace_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 arg3, NvBool arg4, NvU32 *arg5, NvU32 *arg6) {
436     pConfCompute->__confComputeGetKeyPairForKeySpace__(pGpu, pConfCompute, arg3, arg4, arg5, arg6);
437 }
438 
confComputeEnableKeyRotationCallback_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvBool bEnable)439 static inline NV_STATUS confComputeEnableKeyRotationCallback_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvBool bEnable) {
440     return pConfCompute->__confComputeEnableKeyRotationCallback__(pGpu, pConfCompute, bEnable);
441 }
442 
confComputeEnableKeyRotationSupport_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)443 static inline NV_STATUS confComputeEnableKeyRotationSupport_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
444     return pConfCompute->__confComputeEnableKeyRotationSupport__(pGpu, pConfCompute);
445 }
446 
confComputeEnableInternalKeyRotationSupport_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)447 static inline NV_STATUS confComputeEnableInternalKeyRotationSupport_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
448     return pConfCompute->__confComputeEnableInternalKeyRotationSupport__(pGpu, pConfCompute);
449 }
450 
confComputeIsDebugModeEnabled_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)451 static inline NvBool confComputeIsDebugModeEnabled_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
452     return pConfCompute->__confComputeIsDebugModeEnabled__(pGpu, pConfCompute);
453 }
454 
confComputeIsGpuCcCapable_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)455 static inline NvBool confComputeIsGpuCcCapable_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
456     return pConfCompute->__confComputeIsGpuCcCapable__(pGpu, pConfCompute);
457 }
458 
confComputeEstablishSpdmSessionAndKeys_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)459 static inline NV_STATUS confComputeEstablishSpdmSessionAndKeys_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
460     return pConfCompute->__confComputeEstablishSpdmSessionAndKeys__(pGpu, pConfCompute);
461 }
462 
confComputeKeyStoreDepositIvMask_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId,void * ivMask)463 static inline void confComputeKeyStoreDepositIvMask_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId, void *ivMask) {
464     pConfCompute->__confComputeKeyStoreDepositIvMask__(pConfCompute, globalKeyId, ivMask);
465 }
466 
confComputeKeyStoreUpdateKey_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId)467 static inline NV_STATUS confComputeKeyStoreUpdateKey_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId) {
468     return pConfCompute->__confComputeKeyStoreUpdateKey__(pConfCompute, globalKeyId);
469 }
470 
confComputeKeyStoreIsValidGlobalKeyId_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId)471 static inline NvBool confComputeKeyStoreIsValidGlobalKeyId_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId) {
472     return pConfCompute->__confComputeKeyStoreIsValidGlobalKeyId__(pConfCompute, globalKeyId);
473 }
474 
confComputeKeyStoreInit_DISPATCH(struct ConfidentialCompute * pConfCompute)475 static inline NV_STATUS confComputeKeyStoreInit_DISPATCH(struct ConfidentialCompute *pConfCompute) {
476     return pConfCompute->__confComputeKeyStoreInit__(pConfCompute);
477 }
478 
confComputeKeyStoreDeinit_DISPATCH(struct ConfidentialCompute * pConfCompute)479 static inline void confComputeKeyStoreDeinit_DISPATCH(struct ConfidentialCompute *pConfCompute) {
480     pConfCompute->__confComputeKeyStoreDeinit__(pConfCompute);
481 }
482 
confComputeKeyStoreGetExportMasterKey_DISPATCH(struct ConfidentialCompute * pConfCompute)483 static inline void * confComputeKeyStoreGetExportMasterKey_DISPATCH(struct ConfidentialCompute *pConfCompute) {
484     return pConfCompute->__confComputeKeyStoreGetExportMasterKey__(pConfCompute);
485 }
486 
confComputeKeyStoreDeriveKey_DISPATCH(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId)487 static inline NV_STATUS confComputeKeyStoreDeriveKey_DISPATCH(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId) {
488     return pConfCompute->__confComputeKeyStoreDeriveKey__(pConfCompute, globalKeyId);
489 }
490 
confComputeKeyStoreClearExportMasterKey_DISPATCH(struct ConfidentialCompute * pConfCompute)491 static inline void confComputeKeyStoreClearExportMasterKey_DISPATCH(struct ConfidentialCompute *pConfCompute) {
492     pConfCompute->__confComputeKeyStoreClearExportMasterKey__(pConfCompute);
493 }
494 
confComputeInitMissing_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pEngstate)495 static inline void confComputeInitMissing_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pEngstate) {
496     pEngstate->__confComputeInitMissing__(pGpu, pEngstate);
497 }
498 
confComputeStatePreInitUnlocked_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pEngstate)499 static inline NV_STATUS confComputeStatePreInitUnlocked_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pEngstate) {
500     return pEngstate->__confComputeStatePreInitUnlocked__(pGpu, pEngstate);
501 }
502 
confComputeStateInitUnlocked_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pEngstate)503 static inline NV_STATUS confComputeStateInitUnlocked_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pEngstate) {
504     return pEngstate->__confComputeStateInitUnlocked__(pGpu, pEngstate);
505 }
506 
confComputeStatePreLoad_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pEngstate,NvU32 arg3)507 static inline NV_STATUS confComputeStatePreLoad_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pEngstate, NvU32 arg3) {
508     return pEngstate->__confComputeStatePreLoad__(pGpu, pEngstate, arg3);
509 }
510 
confComputeStateLoad_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pEngstate,NvU32 arg3)511 static inline NV_STATUS confComputeStateLoad_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pEngstate, NvU32 arg3) {
512     return pEngstate->__confComputeStateLoad__(pGpu, pEngstate, arg3);
513 }
514 
confComputeStateUnload_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pEngstate,NvU32 arg3)515 static inline NV_STATUS confComputeStateUnload_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pEngstate, NvU32 arg3) {
516     return pEngstate->__confComputeStateUnload__(pGpu, pEngstate, arg3);
517 }
518 
confComputeStatePostUnload_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pEngstate,NvU32 arg3)519 static inline NV_STATUS confComputeStatePostUnload_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pEngstate, NvU32 arg3) {
520     return pEngstate->__confComputeStatePostUnload__(pGpu, pEngstate, arg3);
521 }
522 
confComputeStateDestroy_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pEngstate)523 static inline void confComputeStateDestroy_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pEngstate) {
524     pEngstate->__confComputeStateDestroy__(pGpu, pEngstate);
525 }
526 
confComputeIsPresent_DISPATCH(struct OBJGPU * pGpu,struct ConfidentialCompute * pEngstate)527 static inline NvBool confComputeIsPresent_DISPATCH(struct OBJGPU *pGpu, struct ConfidentialCompute *pEngstate) {
528     return pEngstate->__confComputeIsPresent__(pGpu, pEngstate);
529 }
530 
531 NV_STATUS confComputeConstructEngine_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, ENGDESCRIPTOR engDesc);
532 
533 void confComputeDestruct_KERNEL(struct ConfidentialCompute *pConfCompute);
534 
confComputeDestruct_b3696a(struct ConfidentialCompute * pConfCompute)535 static inline void confComputeDestruct_b3696a(struct ConfidentialCompute *pConfCompute) {
536     return;
537 }
538 
confComputeStatePreInitLocked_56cd7a(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)539 static inline NV_STATUS confComputeStatePreInitLocked_56cd7a(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
540     return NV_OK;
541 }
542 
543 NV_STATUS confComputeStateInitLocked_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
544 
545 NV_STATUS confComputeStatePostLoad_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 flags);
546 
confComputeStatePostLoad_56cd7a(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 flags)547 static inline NV_STATUS confComputeStatePostLoad_56cd7a(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 flags) {
548     return NV_OK;
549 }
550 
551 NV_STATUS confComputeStatePreUnload_KERNEL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 flags);
552 
confComputeStatePreUnload_56cd7a(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 flags)553 static inline NV_STATUS confComputeStatePreUnload_56cd7a(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 flags) {
554     return NV_OK;
555 }
556 
557 void confComputeSetErrorState_KERNEL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
558 
confComputeSetErrorState_b3696a(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)559 static inline void confComputeSetErrorState_b3696a(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
560     return;
561 }
562 
563 NV_STATUS confComputeKeyStoreRetrieveViaChannel_GH100(struct ConfidentialCompute *pConfCompute, struct KernelChannel *pKernelChannel, ROTATE_IV_TYPE rotateOperation, NvBool bIncludeIvOrNonce, CC_KMB *keyMaterialBundle);
564 
confComputeKeyStoreRetrieveViaChannel_46f6a7(struct ConfidentialCompute * pConfCompute,struct KernelChannel * pKernelChannel,ROTATE_IV_TYPE rotateOperation,NvBool bIncludeIvOrNonce,CC_KMB * keyMaterialBundle)565 static inline NV_STATUS confComputeKeyStoreRetrieveViaChannel_46f6a7(struct ConfidentialCompute *pConfCompute, struct KernelChannel *pKernelChannel, ROTATE_IV_TYPE rotateOperation, NvBool bIncludeIvOrNonce, CC_KMB *keyMaterialBundle) {
566     return NV_ERR_NOT_SUPPORTED;
567 }
568 
569 NV_STATUS confComputeKeyStoreRetrieveViaKeyId_GH100(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId, ROTATE_IV_TYPE rotateOperation, NvBool bIncludeIvOrNonce, CC_KMB *keyMaterialBundle);
570 
confComputeKeyStoreRetrieveViaKeyId_46f6a7(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId,ROTATE_IV_TYPE rotateOperation,NvBool bIncludeIvOrNonce,CC_KMB * keyMaterialBundle)571 static inline NV_STATUS confComputeKeyStoreRetrieveViaKeyId_46f6a7(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId, ROTATE_IV_TYPE rotateOperation, NvBool bIncludeIvOrNonce, CC_KMB *keyMaterialBundle) {
572     return NV_ERR_NOT_SUPPORTED;
573 }
574 
575 NV_STATUS confComputeDeriveSecrets_GH100(struct ConfidentialCompute *pConfCompute, NvU32 engine);
576 
confComputeDeriveSecrets_46f6a7(struct ConfidentialCompute * pConfCompute,NvU32 engine)577 static inline NV_STATUS confComputeDeriveSecrets_46f6a7(struct ConfidentialCompute *pConfCompute, NvU32 engine) {
578     return NV_ERR_NOT_SUPPORTED;
579 }
580 
581 NV_STATUS confComputeUpdateSecrets_GH100(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId);
582 
confComputeUpdateSecrets_46f6a7(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId)583 static inline NV_STATUS confComputeUpdateSecrets_46f6a7(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId) {
584     return NV_ERR_NOT_SUPPORTED;
585 }
586 
confComputeIsSpdmEnabled_cbe027(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)587 static inline NvBool confComputeIsSpdmEnabled_cbe027(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
588     return ((NvBool)(0 == 0));
589 }
590 
confComputeIsSpdmEnabled_491d52(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)591 static inline NvBool confComputeIsSpdmEnabled_491d52(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
592     return ((NvBool)(0 != 0));
593 }
594 
595 RM_ENGINE_TYPE confComputeGetEngineIdFromKeySpace_GH100(struct ConfidentialCompute *pConfCompute, NvU32 keySpace);
596 
confComputeGetEngineIdFromKeySpace_78ac8b(struct ConfidentialCompute * pConfCompute,NvU32 keySpace)597 static inline RM_ENGINE_TYPE confComputeGetEngineIdFromKeySpace_78ac8b(struct ConfidentialCompute *pConfCompute, NvU32 keySpace) {
598     return RM_ENGINE_TYPE_NULL;
599 }
600 
601 NvBool confComputeGlobalKeyIsKernelPriv_GH100(struct ConfidentialCompute *pConfCompute, NvU32 keyId);
602 
confComputeGlobalKeyIsKernelPriv_491d52(struct ConfidentialCompute * pConfCompute,NvU32 keyId)603 static inline NvBool confComputeGlobalKeyIsKernelPriv_491d52(struct ConfidentialCompute *pConfCompute, NvU32 keyId) {
604     return ((NvBool)(0 != 0));
605 }
606 
607 NvBool confComputeGlobalKeyIsUvmKey_GH100(struct ConfidentialCompute *pConfCompute, NvU32 keyId);
608 
confComputeGlobalKeyIsUvmKey_491d52(struct ConfidentialCompute * pConfCompute,NvU32 keyId)609 static inline NvBool confComputeGlobalKeyIsUvmKey_491d52(struct ConfidentialCompute *pConfCompute, NvU32 keyId) {
610     return ((NvBool)(0 != 0));
611 }
612 
613 NV_STATUS confComputeGetKeyPairByChannel_GH100(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, struct KernelChannel *pKernelChannel, NvU32 *pH2DKey, NvU32 *pD2HKey);
614 
confComputeGetKeyPairByChannel_46f6a7(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,struct KernelChannel * pKernelChannel,NvU32 * pH2DKey,NvU32 * pD2HKey)615 static inline NV_STATUS confComputeGetKeyPairByChannel_46f6a7(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, struct KernelChannel *pKernelChannel, NvU32 *pH2DKey, NvU32 *pD2HKey) {
616     return NV_ERR_NOT_SUPPORTED;
617 }
618 
619 NV_STATUS confComputeTriggerKeyRotation_GH100(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
620 
confComputeTriggerKeyRotation_56cd7a(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)621 static inline NV_STATUS confComputeTriggerKeyRotation_56cd7a(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
622     return NV_OK;
623 }
624 
confComputeTriggerKeyRotation_46f6a7(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)625 static inline NV_STATUS confComputeTriggerKeyRotation_46f6a7(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
626     return NV_ERR_NOT_SUPPORTED;
627 }
628 
629 void confComputeGetKeyPairForKeySpace_GH100(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 arg3, NvBool arg4, NvU32 *arg5, NvU32 *arg6);
630 
confComputeGetKeyPairForKeySpace_b3696a(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 arg3,NvBool arg4,NvU32 * arg5,NvU32 * arg6)631 static inline void confComputeGetKeyPairForKeySpace_b3696a(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 arg3, NvBool arg4, NvU32 *arg5, NvU32 *arg6) {
632     return;
633 }
634 
635 NV_STATUS confComputeEnableKeyRotationCallback_GH100(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvBool bEnable);
636 
confComputeEnableKeyRotationCallback_56cd7a(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvBool bEnable)637 static inline NV_STATUS confComputeEnableKeyRotationCallback_56cd7a(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvBool bEnable) {
638     return NV_OK;
639 }
640 
641 NV_STATUS confComputeEnableKeyRotationSupport_GH100(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
642 
confComputeEnableKeyRotationSupport_56cd7a(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)643 static inline NV_STATUS confComputeEnableKeyRotationSupport_56cd7a(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
644     return NV_OK;
645 }
646 
647 NV_STATUS confComputeEnableInternalKeyRotationSupport_GH100(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
648 
confComputeEnableInternalKeyRotationSupport_56cd7a(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)649 static inline NV_STATUS confComputeEnableInternalKeyRotationSupport_56cd7a(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
650     return NV_OK;
651 }
652 
653 NvBool confComputeIsDebugModeEnabled_GH100(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
654 
confComputeIsDebugModeEnabled_cbe027(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)655 static inline NvBool confComputeIsDebugModeEnabled_cbe027(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
656     return ((NvBool)(0 == 0));
657 }
658 
confComputeIsDebugModeEnabled_491d52(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)659 static inline NvBool confComputeIsDebugModeEnabled_491d52(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
660     return ((NvBool)(0 != 0));
661 }
662 
663 NvBool confComputeIsGpuCcCapable_GH100(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
664 
confComputeIsGpuCcCapable_cbe027(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)665 static inline NvBool confComputeIsGpuCcCapable_cbe027(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
666     return ((NvBool)(0 == 0));
667 }
668 
confComputeIsGpuCcCapable_491d52(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)669 static inline NvBool confComputeIsGpuCcCapable_491d52(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
670     return ((NvBool)(0 != 0));
671 }
672 
673 NV_STATUS confComputeEstablishSpdmSessionAndKeys_KERNEL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
674 
confComputeEstablishSpdmSessionAndKeys_46f6a7(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)675 static inline NV_STATUS confComputeEstablishSpdmSessionAndKeys_46f6a7(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
676     return NV_ERR_NOT_SUPPORTED;
677 }
678 
679 void confComputeKeyStoreDepositIvMask_GH100(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId, void *ivMask);
680 
confComputeKeyStoreDepositIvMask_b3696a(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId,void * ivMask)681 static inline void confComputeKeyStoreDepositIvMask_b3696a(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId, void *ivMask) {
682     return;
683 }
684 
685 NV_STATUS confComputeKeyStoreUpdateKey_GH100(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId);
686 
confComputeKeyStoreUpdateKey_46f6a7(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId)687 static inline NV_STATUS confComputeKeyStoreUpdateKey_46f6a7(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId) {
688     return NV_ERR_NOT_SUPPORTED;
689 }
690 
691 NvBool confComputeKeyStoreIsValidGlobalKeyId_GH100(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId);
692 
confComputeKeyStoreIsValidGlobalKeyId_491d52(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId)693 static inline NvBool confComputeKeyStoreIsValidGlobalKeyId_491d52(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId) {
694     return ((NvBool)(0 != 0));
695 }
696 
697 NV_STATUS confComputeKeyStoreInit_GH100(struct ConfidentialCompute *pConfCompute);
698 
confComputeKeyStoreInit_46f6a7(struct ConfidentialCompute * pConfCompute)699 static inline NV_STATUS confComputeKeyStoreInit_46f6a7(struct ConfidentialCompute *pConfCompute) {
700     return NV_ERR_NOT_SUPPORTED;
701 }
702 
703 void confComputeKeyStoreDeinit_GH100(struct ConfidentialCompute *pConfCompute);
704 
confComputeKeyStoreDeinit_b3696a(struct ConfidentialCompute * pConfCompute)705 static inline void confComputeKeyStoreDeinit_b3696a(struct ConfidentialCompute *pConfCompute) {
706     return;
707 }
708 
709 void *confComputeKeyStoreGetExportMasterKey_GH100(struct ConfidentialCompute *pConfCompute);
710 
confComputeKeyStoreGetExportMasterKey_fa6e19(struct ConfidentialCompute * pConfCompute)711 static inline void *confComputeKeyStoreGetExportMasterKey_fa6e19(struct ConfidentialCompute *pConfCompute) {
712     return ((void *)0);
713 }
714 
715 NV_STATUS confComputeKeyStoreDeriveKey_GH100(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId);
716 
confComputeKeyStoreDeriveKey_46f6a7(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId)717 static inline NV_STATUS confComputeKeyStoreDeriveKey_46f6a7(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId) {
718     return NV_ERR_NOT_SUPPORTED;
719 }
720 
721 void confComputeKeyStoreClearExportMasterKey_GH100(struct ConfidentialCompute *pConfCompute);
722 
confComputeKeyStoreClearExportMasterKey_b3696a(struct ConfidentialCompute * pConfCompute)723 static inline void confComputeKeyStoreClearExportMasterKey_b3696a(struct ConfidentialCompute *pConfCompute) {
724     return;
725 }
726 
727 NvBool confComputeAcceptClientRequest_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
728 
729 #ifdef __nvoc_conf_compute_h_disabled
confComputeAcceptClientRequest(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)730 static inline NvBool confComputeAcceptClientRequest(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
731     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
732     return NV_FALSE;
733 }
734 #else //__nvoc_conf_compute_h_disabled
735 #define confComputeAcceptClientRequest(pGpu, pConfCompute) confComputeAcceptClientRequest_IMPL(pGpu, pConfCompute)
736 #endif //__nvoc_conf_compute_h_disabled
737 
738 NV_STATUS confComputeInitChannelIterForKey_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 globalKey, CHANNEL_ITERATOR *pIter);
739 
740 #ifdef __nvoc_conf_compute_h_disabled
confComputeInitChannelIterForKey(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 globalKey,CHANNEL_ITERATOR * pIter)741 static inline NV_STATUS confComputeInitChannelIterForKey(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 globalKey, CHANNEL_ITERATOR *pIter) {
742     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
743     return NV_ERR_NOT_SUPPORTED;
744 }
745 #else //__nvoc_conf_compute_h_disabled
746 #define confComputeInitChannelIterForKey(pGpu, pConfCompute, globalKey, pIter) confComputeInitChannelIterForKey_IMPL(pGpu, pConfCompute, globalKey, pIter)
747 #endif //__nvoc_conf_compute_h_disabled
748 
749 NV_STATUS confComputeGetNextChannelForKey_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, CHANNEL_ITERATOR *pIt, NvU32 globalKey, struct KernelChannel **ppKernelChannel);
750 
751 #ifdef __nvoc_conf_compute_h_disabled
confComputeGetNextChannelForKey(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,CHANNEL_ITERATOR * pIt,NvU32 globalKey,struct KernelChannel ** ppKernelChannel)752 static inline NV_STATUS confComputeGetNextChannelForKey(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, CHANNEL_ITERATOR *pIt, NvU32 globalKey, struct KernelChannel **ppKernelChannel) {
753     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
754     return NV_ERR_NOT_SUPPORTED;
755 }
756 #else //__nvoc_conf_compute_h_disabled
757 #define confComputeGetNextChannelForKey(pGpu, pConfCompute, pIt, globalKey, ppKernelChannel) confComputeGetNextChannelForKey_IMPL(pGpu, pConfCompute, pIt, globalKey, ppKernelChannel)
758 #endif //__nvoc_conf_compute_h_disabled
759 
760 NV_STATUS confComputeGetKeySlotFromGlobalKeyId_IMPL(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId, NvU32 *pSlot);
761 
762 #ifdef __nvoc_conf_compute_h_disabled
confComputeGetKeySlotFromGlobalKeyId(struct ConfidentialCompute * pConfCompute,NvU32 globalKeyId,NvU32 * pSlot)763 static inline NV_STATUS confComputeGetKeySlotFromGlobalKeyId(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId, NvU32 *pSlot) {
764     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
765     return NV_ERR_NOT_SUPPORTED;
766 }
767 #else //__nvoc_conf_compute_h_disabled
768 #define confComputeGetKeySlotFromGlobalKeyId(pConfCompute, globalKeyId, pSlot) confComputeGetKeySlotFromGlobalKeyId_IMPL(pConfCompute, globalKeyId, pSlot)
769 #endif //__nvoc_conf_compute_h_disabled
770 
771 NV_STATUS confComputeCheckAndPerformKeyRotation_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey, NvU32 d2hKey);
772 
773 #ifdef __nvoc_conf_compute_h_disabled
confComputeCheckAndPerformKeyRotation(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 h2dKey,NvU32 d2hKey)774 static inline NV_STATUS confComputeCheckAndPerformKeyRotation(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey, NvU32 d2hKey) {
775     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
776     return NV_ERR_NOT_SUPPORTED;
777 }
778 #else //__nvoc_conf_compute_h_disabled
779 #define confComputeCheckAndPerformKeyRotation(pGpu, pConfCompute, h2dKey, d2hKey) confComputeCheckAndPerformKeyRotation_IMPL(pGpu, pConfCompute, h2dKey, d2hKey)
780 #endif //__nvoc_conf_compute_h_disabled
781 
782 NV_STATUS confComputePerformKeyRotation_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey, NvU32 d2hKey, NvBool bWorkItem);
783 
784 #ifdef __nvoc_conf_compute_h_disabled
confComputePerformKeyRotation(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 h2dKey,NvU32 d2hKey,NvBool bWorkItem)785 static inline NV_STATUS confComputePerformKeyRotation(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey, NvU32 d2hKey, NvBool bWorkItem) {
786     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
787     return NV_ERR_NOT_SUPPORTED;
788 }
789 #else //__nvoc_conf_compute_h_disabled
790 #define confComputePerformKeyRotation(pGpu, pConfCompute, h2dKey, d2hKey, bWorkItem) confComputePerformKeyRotation_IMPL(pGpu, pConfCompute, h2dKey, d2hKey, bWorkItem)
791 #endif //__nvoc_conf_compute_h_disabled
792 
793 NV_STATUS confComputeForceKeyRotation_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey, NvU32 d2hKey);
794 
795 #ifdef __nvoc_conf_compute_h_disabled
confComputeForceKeyRotation(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 h2dKey,NvU32 d2hKey)796 static inline NV_STATUS confComputeForceKeyRotation(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey, NvU32 d2hKey) {
797     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
798     return NV_ERR_NOT_SUPPORTED;
799 }
800 #else //__nvoc_conf_compute_h_disabled
801 #define confComputeForceKeyRotation(pGpu, pConfCompute, h2dKey, d2hKey) confComputeForceKeyRotation_IMPL(pGpu, pConfCompute, h2dKey, d2hKey)
802 #endif //__nvoc_conf_compute_h_disabled
803 
804 NV_STATUS confComputeSetKeyRotationStatus_IMPL(struct ConfidentialCompute *pConfCompute, NvU32 globalKey, KEY_ROTATION_STATUS status);
805 
806 #ifdef __nvoc_conf_compute_h_disabled
confComputeSetKeyRotationStatus(struct ConfidentialCompute * pConfCompute,NvU32 globalKey,KEY_ROTATION_STATUS status)807 static inline NV_STATUS confComputeSetKeyRotationStatus(struct ConfidentialCompute *pConfCompute, NvU32 globalKey, KEY_ROTATION_STATUS status) {
808     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
809     return NV_ERR_NOT_SUPPORTED;
810 }
811 #else //__nvoc_conf_compute_h_disabled
812 #define confComputeSetKeyRotationStatus(pConfCompute, globalKey, status) confComputeSetKeyRotationStatus_IMPL(pConfCompute, globalKey, status)
813 #endif //__nvoc_conf_compute_h_disabled
814 
815 NV_STATUS confComputeGetKeyRotationStatus_IMPL(struct ConfidentialCompute *pConfCompute, NvU32 globalKey, KEY_ROTATION_STATUS *pStatus);
816 
817 #ifdef __nvoc_conf_compute_h_disabled
confComputeGetKeyRotationStatus(struct ConfidentialCompute * pConfCompute,NvU32 globalKey,KEY_ROTATION_STATUS * pStatus)818 static inline NV_STATUS confComputeGetKeyRotationStatus(struct ConfidentialCompute *pConfCompute, NvU32 globalKey, KEY_ROTATION_STATUS *pStatus) {
819     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
820     return NV_ERR_NOT_SUPPORTED;
821 }
822 #else //__nvoc_conf_compute_h_disabled
823 #define confComputeGetKeyRotationStatus(pConfCompute, globalKey, pStatus) confComputeGetKeyRotationStatus_IMPL(pConfCompute, globalKey, pStatus)
824 #endif //__nvoc_conf_compute_h_disabled
825 
826 void confComputeGetKeyPairByKey_IMPL(struct ConfidentialCompute *pConfCompute, NvU32 globalKey, NvU32 *pH2DKey, NvU32 *pD2HKey);
827 
828 #ifdef __nvoc_conf_compute_h_disabled
confComputeGetKeyPairByKey(struct ConfidentialCompute * pConfCompute,NvU32 globalKey,NvU32 * pH2DKey,NvU32 * pD2HKey)829 static inline void confComputeGetKeyPairByKey(struct ConfidentialCompute *pConfCompute, NvU32 globalKey, NvU32 *pH2DKey, NvU32 *pD2HKey) {
830     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
831 }
832 #else //__nvoc_conf_compute_h_disabled
833 #define confComputeGetKeyPairByKey(pConfCompute, globalKey, pH2DKey, pD2HKey) confComputeGetKeyPairByKey_IMPL(pConfCompute, globalKey, pH2DKey, pD2HKey)
834 #endif //__nvoc_conf_compute_h_disabled
835 
836 NV_STATUS confComputeUpdateFreedChannelStats_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, struct KernelChannel *pKernelChannel);
837 
838 #ifdef __nvoc_conf_compute_h_disabled
confComputeUpdateFreedChannelStats(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,struct KernelChannel * pKernelChannel)839 static inline NV_STATUS confComputeUpdateFreedChannelStats(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, struct KernelChannel *pKernelChannel) {
840     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
841     return NV_ERR_NOT_SUPPORTED;
842 }
843 #else //__nvoc_conf_compute_h_disabled
844 #define confComputeUpdateFreedChannelStats(pGpu, pConfCompute, pKernelChannel) confComputeUpdateFreedChannelStats_IMPL(pGpu, pConfCompute, pKernelChannel)
845 #endif //__nvoc_conf_compute_h_disabled
846 
847 NV_STATUS confComputeStartKeyRotationTimer_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey);
848 
849 #ifdef __nvoc_conf_compute_h_disabled
confComputeStartKeyRotationTimer(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 h2dKey)850 static inline NV_STATUS confComputeStartKeyRotationTimer(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey) {
851     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
852     return NV_ERR_NOT_SUPPORTED;
853 }
854 #else //__nvoc_conf_compute_h_disabled
855 #define confComputeStartKeyRotationTimer(pGpu, pConfCompute, h2dKey) confComputeStartKeyRotationTimer_IMPL(pGpu, pConfCompute, h2dKey)
856 #endif //__nvoc_conf_compute_h_disabled
857 
858 NV_STATUS confComputeStopKeyRotationTimer_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey);
859 
860 #ifdef __nvoc_conf_compute_h_disabled
confComputeStopKeyRotationTimer(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute,NvU32 h2dKey)861 static inline NV_STATUS confComputeStopKeyRotationTimer(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute, NvU32 h2dKey) {
862     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
863     return NV_ERR_NOT_SUPPORTED;
864 }
865 #else //__nvoc_conf_compute_h_disabled
866 #define confComputeStopKeyRotationTimer(pGpu, pConfCompute, h2dKey) confComputeStopKeyRotationTimer_IMPL(pGpu, pConfCompute, h2dKey)
867 #endif //__nvoc_conf_compute_h_disabled
868 
869 NvBool confComputeIsUvmKeyRotationPending_IMPL(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute);
870 
871 #ifdef __nvoc_conf_compute_h_disabled
confComputeIsUvmKeyRotationPending(struct OBJGPU * pGpu,struct ConfidentialCompute * pConfCompute)872 static inline NvBool confComputeIsUvmKeyRotationPending(struct OBJGPU *pGpu, struct ConfidentialCompute *pConfCompute) {
873     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
874     return NV_FALSE;
875 }
876 #else //__nvoc_conf_compute_h_disabled
877 #define confComputeIsUvmKeyRotationPending(pGpu, pConfCompute) confComputeIsUvmKeyRotationPending_IMPL(pGpu, pConfCompute)
878 #endif //__nvoc_conf_compute_h_disabled
879 
880 NV_STATUS confComputeSetKeyRotationThreshold_IMPL(struct ConfidentialCompute *pConfCompute, NvU64 attackerAdvantage);
881 
882 #ifdef __nvoc_conf_compute_h_disabled
confComputeSetKeyRotationThreshold(struct ConfidentialCompute * pConfCompute,NvU64 attackerAdvantage)883 static inline NV_STATUS confComputeSetKeyRotationThreshold(struct ConfidentialCompute *pConfCompute, NvU64 attackerAdvantage) {
884     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
885     return NV_ERR_NOT_SUPPORTED;
886 }
887 #else //__nvoc_conf_compute_h_disabled
888 #define confComputeSetKeyRotationThreshold(pConfCompute, attackerAdvantage) confComputeSetKeyRotationThreshold_IMPL(pConfCompute, attackerAdvantage)
889 #endif //__nvoc_conf_compute_h_disabled
890 
891 NvBool confComputeIsUpperThresholdCrossed_IMPL(struct ConfidentialCompute *pConfCompute, const KEY_ROTATION_STATS_INFO *pStatsInfo);
892 
893 #ifdef __nvoc_conf_compute_h_disabled
confComputeIsUpperThresholdCrossed(struct ConfidentialCompute * pConfCompute,const KEY_ROTATION_STATS_INFO * pStatsInfo)894 static inline NvBool confComputeIsUpperThresholdCrossed(struct ConfidentialCompute *pConfCompute, const KEY_ROTATION_STATS_INFO *pStatsInfo) {
895     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
896     return NV_FALSE;
897 }
898 #else //__nvoc_conf_compute_h_disabled
899 #define confComputeIsUpperThresholdCrossed(pConfCompute, pStatsInfo) confComputeIsUpperThresholdCrossed_IMPL(pConfCompute, pStatsInfo)
900 #endif //__nvoc_conf_compute_h_disabled
901 
902 NvBool confComputeIsLowerThresholdCrossed_IMPL(struct ConfidentialCompute *pConfCompute, const KEY_ROTATION_STATS_INFO *pStatsInfo);
903 
904 #ifdef __nvoc_conf_compute_h_disabled
confComputeIsLowerThresholdCrossed(struct ConfidentialCompute * pConfCompute,const KEY_ROTATION_STATS_INFO * pStatsInfo)905 static inline NvBool confComputeIsLowerThresholdCrossed(struct ConfidentialCompute *pConfCompute, const KEY_ROTATION_STATS_INFO *pStatsInfo) {
906     NV_ASSERT_FAILED_PRECOMP("ConfidentialCompute was disabled!");
907     return NV_FALSE;
908 }
909 #else //__nvoc_conf_compute_h_disabled
910 #define confComputeIsLowerThresholdCrossed(pConfCompute, pStatsInfo) confComputeIsLowerThresholdCrossed_IMPL(pConfCompute, pStatsInfo)
911 #endif //__nvoc_conf_compute_h_disabled
912 
913 NvBool confComputeIsGivenThresholdCrossed_IMPL(const CC_CRYPTOBUNDLE_STATS *pStatsInfo, NvU64 threshold, NvBool bEncrypt);
914 
915 #define confComputeIsGivenThresholdCrossed(pStatsInfo, threshold, bEncrypt) confComputeIsGivenThresholdCrossed_IMPL(pStatsInfo, threshold, bEncrypt)
916 #undef PRIVATE_FIELD
917 
918 #ifndef NVOC_CONF_COMPUTE_H_PRIVATE_ACCESS_ALLOWED
919 #undef confComputeKeyStoreInit
920 NV_STATUS NVOC_PRIVATE_FUNCTION(confComputeKeyStoreInit)(struct ConfidentialCompute *pConfCompute);
921 
922 #undef confComputeKeyStoreInit_HAL
923 NV_STATUS NVOC_PRIVATE_FUNCTION(confComputeKeyStoreInit_HAL)(struct ConfidentialCompute *pConfCompute);
924 
925 #undef confComputeKeyStoreDeinit
926 void NVOC_PRIVATE_FUNCTION(confComputeKeyStoreDeinit)(struct ConfidentialCompute *pConfCompute);
927 
928 #undef confComputeKeyStoreDeinit_HAL
929 void NVOC_PRIVATE_FUNCTION(confComputeKeyStoreDeinit_HAL)(struct ConfidentialCompute *pConfCompute);
930 
931 #undef confComputeKeyStoreGetExportMasterKey
932 void *NVOC_PRIVATE_FUNCTION(confComputeKeyStoreGetExportMasterKey)(struct ConfidentialCompute *pConfCompute);
933 
934 #undef confComputeKeyStoreGetExportMasterKey_HAL
935 void *NVOC_PRIVATE_FUNCTION(confComputeKeyStoreGetExportMasterKey_HAL)(struct ConfidentialCompute *pConfCompute);
936 
937 #undef confComputeKeyStoreDeriveKey
938 NV_STATUS NVOC_PRIVATE_FUNCTION(confComputeKeyStoreDeriveKey)(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId);
939 
940 #undef confComputeKeyStoreDeriveKey_HAL
941 NV_STATUS NVOC_PRIVATE_FUNCTION(confComputeKeyStoreDeriveKey_HAL)(struct ConfidentialCompute *pConfCompute, NvU32 globalKeyId);
942 
943 #undef confComputeKeyStoreClearExportMasterKey
944 void NVOC_PRIVATE_FUNCTION(confComputeKeyStoreClearExportMasterKey)(struct ConfidentialCompute *pConfCompute);
945 
946 #undef confComputeKeyStoreClearExportMasterKey_HAL
947 void NVOC_PRIVATE_FUNCTION(confComputeKeyStoreClearExportMasterKey_HAL)(struct ConfidentialCompute *pConfCompute);
948 
949 #endif // NVOC_CONF_COMPUTE_H_PRIVATE_ACCESS_ALLOWED
950 
951 
952 // Refactor spdmCtrlSpdmPartition into SPDM module.
953 
954 /*!
955  * @brief spdmCtrlSpdmPartition
956  *        Common function used to call gspCommandPostBlocking based on the platform on which it runs (i.e. vGPU, GSP-RM, Monolithic).
957  *
958  * @param[in]     pGpu                     : OBJGPU Pointer
959  * @param[in]     pSpdmPartitionParams     : SPDM RPC structure pointer
960  */
961 NV_STATUS spdmCtrlSpdmPartition(struct OBJGPU *pGpu, NV2080_CTRL_INTERNAL_SPDM_PARTITION_PARAMS *pSpdmPartitionParams);
962 
963 /*!
964  * @brief 1Hz callback function to perform key rotation
965  *
966  * @param[in]     pGpu                     : OBJGPU Pointer
967  * @param[in]     data                     : void Pointer
968  */
969 void confComputeKeyRotationCallback(struct OBJGPU *pGpu, void *data);
970 
971 // spdmCtrlWriteSharedMemory is a common function called from both Physical-RM and Kernel-RM.
972 // However, SPDM module is disabled on Phyiscal-RM and hence declared in conf_compute.h.
973 
974 #endif // CONF_COMPUTE_H
975 
976 #ifdef __cplusplus
977 } // extern "C"
978 #endif
979 
980 #endif // _G_CONF_COMPUTE_NVOC_H_
981