gpu: nvgpu: fix CERT INT30-C in common.gr.falcon

Fixed CERT C error by using nvgpu_gr_checksum_u32:
segments->boot_signature += bootimage[i]; -->
	segments->boot_signature = nvgpu_gr_checksum_u32(
				segments->boot_signature, bootimage[i]);

JIRA NVGPU-3622

Change-Id: I01de116ba2a8afacb8a93be7b88e356a48122c5a
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2132547
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Seshendra Gadagottu
2019-06-07 12:29:07 -07:00
committed by mobile promotions
parent 2d66c2c928
commit 7ed189de44

View File

@@ -30,6 +30,7 @@
#include <nvgpu/sizes.h>
#include <nvgpu/mm.h>
#include <nvgpu/acr.h>
#include <nvgpu/gr/gr_utils.h>
#ifdef CONFIG_NVGPU_LS_PMU
#include <nvgpu/pmu/lsfm.h>
#include <nvgpu/pmu/pmu_pg.h>
@@ -273,7 +274,8 @@ static int nvgpu_gr_falcon_copy_ctxsw_ucode_segments(
/* compute a "checksum" for the boot binary to detect its version */
segments->boot_signature = 0;
for (i = 0; i < segments->boot.size / sizeof(u32); i++) {
segments->boot_signature += bootimage[i];
segments->boot_signature = nvgpu_gr_checksum_u32(
segments->boot_signature, bootimage[i]);
}
return 0;