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

tee.bin partitioning #1621

Merged
merged 4 commits into from
Jun 20, 2017
Merged

tee.bin partitioning #1621

merged 4 commits into from
Jun 20, 2017

Conversation

jenswi-linaro
Copy link
Contributor

No description provided.

@jforissier
Copy link
Contributor

jforissier commented Jun 19, 2017

It looks like this breaks the 64-bit pager on HiKey (32 bits is OK though).
Edit: only the last commit is a problem since HEAD^ works.

# HEAD = this PR [f2f628b]: panic

INFO:    TEE-CORE: No NSEC DDR memory area defined
INFO:    TEE-CORE:
INFO:    TEE-CORE: Pager is enabled. Hashes: 1728 bytes
ERROR:   [0x0] TEE-CORE:init_runtime:263: Hash failed for page 0 at 0x3b600000: res 0xffff000f
ERROR:   [0x0] TEE-CORE: Panic at core/arch/arm/kernel/generic_boot.c:264 <init_runtime>
ERROR:   [0x0] TEE-CORE: pc  0x000000003f0067e8

# HEAD^: OK

INFO:    TEE-CORE: No NSEC DDR memory area defined
INFO:    TEE-CORE:
INFO:    TEE-CORE: Pager is enabled. Hashes: 1696 bytes
INFO:    TEE-CORE: OP-TEE version: 2.4.0-170-g0d6624c #2 Mon Jun 19 13:53:16 UTC 2017 aarch64
INFO:    TEE-CORE: Shared memory address range: 3dc00000, 3f000000
INFO:    TEE-CORE: Initialized
...

I'll take a closer look.

@jenswi-linaro
Copy link
Contributor Author

Found the problem, a fix is added in this PR.

@jforissier
Copy link
Contributor

jforissier commented Jun 20, 2017

Good catch, problem fixed indeed.

Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 32/64)

@jforissier
Copy link
Contributor

In "core: reduce init size", I suggest s/LTC/LibTomCrypt/, because it's not obvious why __wq_rpc() would call into that library, so it's better to avoid any doubt.
Anyway:
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>

Makes functions that need to be excluded from unpaged and init parts of
the TEE binary weak. When building the dependency graph for init and
unpaged parts an empty version of those functions (from
core/arch/arm/kernel/link_dummies.c) are used instead.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reduces unpaged size by excluding __thread_std_smc_entry() from the
unpaged graph.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Dramatically reduces init size by excluding __wq_rpc() from the init
graph. Without __wq_rpc() in the init grapth, the entire LibTomCrypt is
removed for the init graph.

Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU v8 pager)
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
The entire range of memory touched during init need to be invalidated in
the caches before enabling the caches.

Prior to this patch with CFG_WITH_PAGER=y the caches where only
invalidated until __init_end which isn't enough, memory up to
__tmp_hashes_end is actually touched. With this patch the range is
increased to __tmp_hashes_end which is the same as is used in the arm32
code.

Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 32/64)
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Hikey 64-bit pager)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
@jenswi-linaro
Copy link
Contributor Author

Tags applied, commit message updated as suggested.

@jforissier jforissier merged commit abdd645 into OP-TEE:master Jun 20, 2017
@jenswi-linaro jenswi-linaro deleted the sizes branch June 20, 2017 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants