Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add processing of code coverage for optee core #4192

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
12 changes: 12 additions & 0 deletions core/arch/arm/plat-imx/conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -425,5 +425,17 @@ CFG_IMX_CAAM ?= y
endif
endif

ifeq ($(CFG_CORE_GCOV_SUPPORT), y)
ifneq ($(CFG_WITH_LPAE), y)
# Default:
# TEE_RAM_VA_SIZE = CORE_MMU_PGDIR_SIZE
# = BIT(CORE_MMU_PGDIR_SHIFT)
# with LPAE disabled: #define CORE_MMU_PGDIR_SHIFT 20
# = BIT(20)
# = 0x80000 (512 Ko)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be 0x100000 (1MB)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In effect, my bad

CFG_TEE_RAM_VA_SIZE := 0x200000 # 2MB
endif
endif

# Cryptographic configuration
include core/arch/arm/plat-imx/crypto_conf.mk
26 changes: 26 additions & 0 deletions mk/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -619,3 +619,29 @@ CFG_COMPAT_GP10_DES ?= y

# Defines a limit for many levels TAs may call each others.
CFG_CORE_MAX_SYSCALL_RECURSION ?= 4

# Core coverage.
# When this option is enabled, code coverage data can be obtained for the
# components in OP-TEE binary
#
# The coverage information will be outputed in gcda format to
# /core/<user_description>/<tree structure>/<source file>.gcda
# (path is defined in tee-supplicant)
CFG_CORE_GCOV_SUPPORT ?= n

ifeq ($(CFG_CORE_GCOV_SUPPORT), y)
CFG_GCOV_SUPPORT = y
endif

# TA coverage.
# When this option is enabled, code coverage data can be obtained for the
# components in TA binary
#
# The coverage information will be outputed in gcda format to
# /<user_description>/<tree structure>/<source file>.gcda
# (path is defined in tee-supplicant)
CFG_TA_GCOV_SUPPORT ?= n

ifeq ($(CFG_TA_GCOV_SUPPORT), y)
CFG_GCOV_SUPPORT = y
endif
3 changes: 3 additions & 0 deletions ta/ta.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ ta-mk-file-export-vars-$(sm) += CFG_UNWIND
ta-mk-file-export-vars-$(sm) += CFG_TA_MCOUNT
ta-mk-file-export-vars-$(sm) += CFG_CORE_TPM_EVENT_LOG
ta-mk-file-export-add-$(sm) += CFG_TEE_TA_LOG_LEVEL ?= $(CFG_TEE_TA_LOG_LEVEL)_nl_
ta-mk-file-export-vars-$(sm) += CFG_GCOV_SUPPORT
ta-mk-file-export-vars-$(sm) += CFG_CORE_GCOV_SUPPORT
ta-mk-file-export-vars-$(sm) += CFG_TA_GCOV_SUPPORT

# Expand platform flags here as $(sm) will change if we have several TA
# targets. Platform flags should not change after inclusion of ta/ta.mk.
Expand Down