Skip to content

Commit

Permalink
benchmark: fix core data-abort at address 0x0
Browse files Browse the repository at this point in the history
Issue reproduces with enabled CFG_TEE_BENCHMARK and in case when
registration of benchmark timestamp buffer failes or isn't performed
(in case if any CA is invoked directly, without using benchmark CA)

Signed-off-by: Igor Opaniuk <[email protected]>
  • Loading branch information
Igor Opaniuk committed Jul 4, 2017
1 parent ac3cc6c commit 9ca68a7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/arch/arm/pta/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,15 @@ static TEE_Result get_benchmark_memref(uint32_t type,

DMSG("Sending back timestamp buffer paddr = %p\n",
(void *)virt_to_phys(bench_ts_global));
p[0].value.a = virt_to_phys(bench_ts_global);
p[0].value.b = sizeof(struct tee_ts_global) +

if (bench_ts_global) {
p[0].value.a = virt_to_phys(bench_ts_global);
p[0].value.b = sizeof(struct tee_ts_global) +
sizeof(struct tee_ts_cpu_buf) * bench_ts_global->cores;
} else {
p[0].value.a = 0;
p[0].value.b = 0;
}

mutex_unlock(&bench_reg_mu);

Expand Down

0 comments on commit 9ca68a7

Please sign in to comment.