mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: fix ecc counter free
ECC counter structures are freed without removing the node from the stats_list. This can lead to invalid access due to dangling pointers. Update the ecc counter free logic to set them to NULL upon free, to remove them from stats_list and free them by validation. Also updated some of the ecc init paths where error was not propa- gated to callers and full ecc counters deallocation was not done. Now, calling unit ecc_free from any context (with counters alloc- ated or not) is harmless as requisite checks are in place. bug 3326612 bug 3345977 Change-Id: I05eb6ed226cff9197ad37776912da9dcb7e0716d Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2565264 Tested-by: Ashish Mhetre <amhetre@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
2887d06e3b
commit
40064ef1ec
@@ -430,6 +430,8 @@ static const struct gops_gr_ecc ga100_ops_gr_ecc = {
|
||||
.detect = ga10b_ecc_detect_enabled_units,
|
||||
.gpc_tpc_ecc_init = ga10b_gr_gpc_tpc_ecc_init,
|
||||
.fecs_ecc_init = gv11b_gr_fecs_ecc_init,
|
||||
.gpc_tpc_ecc_deinit = ga10b_gr_gpc_tpc_ecc_deinit,
|
||||
.fecs_ecc_deinit = gv11b_gr_fecs_ecc_deinit,
|
||||
#ifdef CONFIG_NVGPU_INJECT_HWERR
|
||||
.get_mmu_err_desc = ga10b_gr_ecc_get_mmu_err_desc,
|
||||
.get_gcc_err_desc = gv11b_gr_intr_get_gcc_err_desc,
|
||||
|
||||
@@ -394,6 +394,8 @@ static const struct gops_gr_ecc ga10b_ops_gr_ecc = {
|
||||
.detect = ga10b_ecc_detect_enabled_units,
|
||||
.gpc_tpc_ecc_init = ga10b_gr_gpc_tpc_ecc_init,
|
||||
.fecs_ecc_init = gv11b_gr_fecs_ecc_init,
|
||||
.gpc_tpc_ecc_deinit = ga10b_gr_gpc_tpc_ecc_deinit,
|
||||
.fecs_ecc_deinit = gv11b_gr_fecs_ecc_deinit,
|
||||
#ifdef CONFIG_NVGPU_INJECT_HWERR
|
||||
.get_mmu_err_desc = ga10b_gr_ecc_get_mmu_err_desc,
|
||||
.get_gcc_err_desc = gv11b_gr_intr_get_gcc_err_desc,
|
||||
|
||||
@@ -247,6 +247,7 @@ static const struct gops_ce gp10b_ops_ce = {
|
||||
static const struct gops_gr_ecc gp10b_ops_gr_ecc = {
|
||||
.detect = gp10b_ecc_detect_enabled_units,
|
||||
.gpc_tpc_ecc_init = gp10b_gr_ecc_init,
|
||||
.gpc_tpc_ecc_deinit = gp10b_gr_ecc_deinit,
|
||||
};
|
||||
|
||||
static const struct gops_gr_ctxsw_prog gp10b_ops_gr_ctxsw_prog = {
|
||||
|
||||
@@ -316,6 +316,8 @@ static const struct gops_gr_ecc gv11b_ops_gr_ecc = {
|
||||
.detect = gv11b_ecc_detect_enabled_units,
|
||||
.gpc_tpc_ecc_init = gv11b_gr_gpc_tpc_ecc_init,
|
||||
.fecs_ecc_init = gv11b_gr_fecs_ecc_init,
|
||||
.gpc_tpc_ecc_deinit = gv11b_gr_gpc_tpc_ecc_deinit,
|
||||
.fecs_ecc_deinit = gv11b_gr_fecs_ecc_deinit,
|
||||
#ifdef CONFIG_NVGPU_INJECT_HWERR
|
||||
.get_mmu_err_desc = gv11b_gr_intr_get_mmu_err_desc,
|
||||
.get_gcc_err_desc = gv11b_gr_intr_get_gcc_err_desc,
|
||||
|
||||
@@ -368,6 +368,8 @@ static const struct gops_gr_ecc tu104_ops_gr_ecc = {
|
||||
.detect = NULL,
|
||||
.gpc_tpc_ecc_init = gv11b_gr_gpc_tpc_ecc_init,
|
||||
.fecs_ecc_init = gv11b_gr_fecs_ecc_init,
|
||||
.gpc_tpc_ecc_deinit = gv11b_gr_gpc_tpc_ecc_deinit,
|
||||
.fecs_ecc_deinit = gv11b_gr_fecs_ecc_deinit,
|
||||
};
|
||||
|
||||
static const struct gops_gr_ctxsw_prog tu104_ops_gr_ctxsw_prog = {
|
||||
|
||||
Reference in New Issue
Block a user