OP-TEE changes to run in DomA (Android) - #11
Conversation
52cef6e to
a3b83f0
Compare
|
Updated commit message and comments in files to have max 75 characters in one line |
|
And it is better to implement a proper fix (or plan it, at least). But, for time being, we can live with this, I guess. So, please add proper markings and with that:
|
a3b83f0 to
df311f0
Compare
|
Added workaround comment about CFG_LPAE_ADDR_SPACE_BITS and Reviewed-by |
|
I can't merge it because it is in draft state. Are you going to make more changes? |
|
Yes, I've added commit to fix clang build (wrong dependencies)
|
|
@lorc and @andrew2311 FYI, probably the Thus, please add my |
OP-TEE on gen5 advertised no dynamic SHM, so the Xen OP-TEE mediator
rejected EXCHANGE_CAPABILITIES and the Linux optee driver failed probe
in dom0 and DomD ("optee: capabilities mismatch" / -22)
Three reasons, all of them are fixed here:
1) plat-rcar_gen5 never called register_ddr() (CFG_DT=n), so
phys_ddr_overall was empty, core_mmu_nsec_ddr_is_defined() was false and
tee_entry_exchange_capabilities() did not set
OPTEE_SMC_SEC_CAP_DYNAMIC_SHM. Register the board non-secure DDR.
core_mmu_set_discovered_nsec_ddr() panics if a range overlaps a
non-secure_only OP-TEE map, and the low bank (0x40000000-0xC0000000) is
full of them (TZDRAM/TEE RAM @0x8C400000, SoC reg block, ...) plus
firmware-reserved areas, so only the clean high banks (>=0x10_80000000,
per r8a78000-ironhide-common.dtsi) are registered. DomD (8 GiB) does not
fit in the low bank anyway and is placed by Xen in these high banks, so
guest SHM buffers are covered.
2) CFG_CORE_ARM64_PA_BITS is forced to 36 (64GB), so OP-TEE could neither
address nor register the high banks (core_mmu_check_end_pa() panic).
Enable CFG_AUTO_MAX_PA_BITS=y to use the runtime HW PARange (>=40 bits
here), like plat-vexpress does for virtualization.
3) Under CFG_NS_VIRTUALIZATION the per-guest MMU partition base translation
table must fit one 4KB page; with 32 cores at 36-bit VA it is 32KB and
trips a COMPILE_TIME_ASSERT in core_alloc_mmu_prtn(). Narrow the
virtualization build to a 33-bit address space (still covers every
static map; the high banks are reached via PA width and the on-demand
SHM window, not VA). Non-virtualization builds keep the 36-bit address
space.
Signed-off-by: Andrii Shtompel <andrii_shtompel@epam.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Leonid Komarianskyi <leonid_komarianskyi@epam.com>
Fix typo for python command line $(q)scripts/gen_tee_bin.py => $(q)$(PYTHON3) scripts/gen_tee_bin.py Signed-off-by: guan-gm.lin <guan-gm.lin@mediatek.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> (cherry picked from commit 0365a94)
In mk/aosp_optee.mk the signed TA (.ta) is registered as an EXECUTABLES prebuilt, so AOSP runs check_elf_file on it. A signed TA is an ELF binary wrapped in a signed header and does not start with the ELF magic. On Android 17 the build no longer passes --skip-bad-elf-magic to check_elf_file, so this is now fatal: error: File "<uuid>.ta" must have a valid ELF magic word. Set LOCAL_CHECK_ELF_FILES := false for the .ta module in mk/aosp_optee.mk to skip this check. Signed-off-by: ming-jen.chang <ming-jen.chang@mediatek.com> Signed-off-by: Leo Chen <shf.chen@mediatek.com> Acked-by: Jens Wiklander <jenswi@kernel.org> Acked-by: Tadd Kao <tadd.kao@mediatek.com> (cherry picked from commit a8ac329662c0ecf4be2a01d0af9d0182aa1eee39)
Make the exported ta_dev_kit.mk depend on tee.bin so the dev kit sub-make only starts after the core build has finished. Signed-off-by: Andrii Shtompel <andrii_shtompel@epam.com> Reviewed-by: Leonid Komarianskyi <leonid_komarianskyi@epam.com>
d43308c to
4b94284
Compare
|
@andrew2311 could you please unmark the PR as a draft and set it ready for review? Without that, Volodymyr will not be able to merge it. |
9cf0feb
into
xen-troops:renesas/rcar-gen5_4.4.0-android-xt
Changes: