gpu: nvgpu: local flag for golden context verification

Defined local flag CONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION for
safety only builds. Global flag NV_BUILD_CONFIGURATION_IS_SAFETY
is replaced with local flag CONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION
for golden context verification code.

JIRA NVGPU-3558

Change-Id: Ic67c7eeec7d9b075c2ae1f9b9d74ad5a3859a2d9
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2171271
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Seshendra Gadagottu
2019-08-08 11:17:16 -07:00
committed by mobile promotions
parent 6baf9fce31
commit a69647340d
9 changed files with 23 additions and 16 deletions

View File

@@ -423,7 +423,7 @@ int nvgpu_gr_obj_ctx_alloc_golden_ctx_image(struct gk20a *g,
struct netlist_av_list *sw_method_init =
nvgpu_netlist_get_sw_method_init_av_list(g);
u32 data;
#ifdef NV_BUILD_CONFIGURATION_IS_SAFETY
#ifdef CONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION
struct netlist_av_list *sw_bundle_init =
nvgpu_netlist_get_sw_bundle_init_av_list(g);
struct nvgpu_gr_global_ctx_local_golden_image *local_golden_image2 =
@@ -525,7 +525,7 @@ restore_fe_go_idle:
/* load method init */
g->ops.gr.init.load_method_init(g, sw_method_init);
#ifdef NV_BUILD_CONFIGURATION_IS_SAFETY
#ifdef CONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION
/* restore stats bundle data through mme shadow methods */
if (g->ops.gr.init.restore_stats_counter_bundle_data != 0) {
g->ops.gr.init.restore_stats_counter_bundle_data(g,
@@ -545,7 +545,7 @@ restore_fe_go_idle:
}
#endif
#ifdef NV_BUILD_CONFIGURATION_IS_SAFETY
#ifdef CONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION
/*
* Save ctx data before first golden context save. Restore same data
* before second golden context save. This temporary copy is
@@ -578,7 +578,7 @@ restore_fe_go_idle:
goto clean_up;
}
#ifdef NV_BUILD_CONFIGURATION_IS_SAFETY
#ifdef CONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION
/* Before second golden context save restore to before known state */
nvgpu_gr_global_ctx_load_local_golden_image(g,
local_golden_image2, gr_mem);
@@ -621,7 +621,7 @@ restore_fe_go_idle:
g->ops.gr.falcon.set_current_ctx_invalid(g);
clean_up:
#ifdef NV_BUILD_CONFIGURATION_IS_SAFETY
#ifdef CONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION
if (local_golden_image2 != NULL) {
nvgpu_gr_global_ctx_deinit_local_golden_image(g,
local_golden_image2);