apache / incubator-teaclave-trustzone-sdk

Teaclave TrustZone SDK enables safe, functional, and ergonomic development of trustlets.
https://teaclave.apache.org
Apache License 2.0
216 stars 61 forks source link

Error: System ran out of resources. (error code 0xffff000c) #132

Closed hallowsman closed 4 months ago

hallowsman commented 4 months ago

执行examples/tls_client-rs和examples/tls_server-rs的时候会直接提示如下错误:

Error: System ran out of resources. (error code 0xffff000c)

DemesneGH commented 4 months ago

Please refer to https://github.com/apache/incubator-teaclave-trustzone-sdk/blob/master/docs/expanding-ta-secure-memory-on-qemuv8.md

yongboy commented 4 months ago

Good idea!

yongboy commented 4 months ago

@DemesneGH Thank you for your response! Some parts of the documentation you provided are not quite compatible with OPTEE 4.2.0. Could you tell me where I can find the latest patches or documentation compatible with OPTEE 4.2.0? Thank you!

DemesneGH commented 4 months ago

Hi @yongboy

Some parts of the documentation you provided are not quite compatible with OPTEE 4.2.0.

Could you list the incompatible parts, or the issue you've encountered? Then I can fix them, thanks!

yongboy commented 4 months ago

The docs below:

3. Add configurations in optee-repo/optee_os:

diff --git a/mk/config.mk b/mk/config.mk
index f2822df..8148cc5 100644
--- a/mk/config.mk
+++ b/mk/config.mk

@@ -904,3 +904,7 @@ CFG_DRIVERS_TPM2_MMIO ?= n
 ifeq ($(CFG_CORE_TPM_EVENT_LOG),y)
 CFG_CORE_TCG_PROVIDER ?= $(CFG_DRIVERS_TPM2)
 endif
+
+# expand TA secure memory
+CFG_TZDRAM_START = 0x0e100000
+CFG_TZDRAM_SIZE = 0x01f00000

I can't find the CFG_CORE_TCG_PROVIDER words in then optee_os/mk/config.mk now.

$ grep -c 'CFG_CORE_TCG_PROVIDER' /optee/optee_os/mk/config.mk 
0

:))

DemesneGH commented 4 months ago

@yongboy just add these two lines of code at the end of optee_os/mk/config.mk file:

CFG_TZDRAM_START = 0x0e100000
CFG_TZDRAM_SIZE = 0x01f00000

I will update this doc for removing unnecessary information.

yongboy commented 4 months ago

Tks!

DemesneGH commented 4 months ago

Closing this issue, if you have any questions please feel free to reopen it, thanks!