Hi Jens,
Thanks for the feedback.
-----Original Message----- From: Jens Wiklander jens.wiklander@linaro.org Sent: 20 February 2023 10:02 To: Shiju Jose shiju.jose@huawei.com Cc: linaro-open-discussions@op-lists.linaro.org; Olivier.Deprez@arm.com; Linuxarm linuxarm@huawei.com; Jonathan Cameron jonathan.cameron@huawei.com; Zengtao (B) prime.zeng@hisilicon.com; zhouguangwei (C) zhouguangwei5@huawei.com Subject: Re: [RFC PATCH 1/1] qemu_v8: add changes to run 2 SPs
Hi Shiju,
This is an interesting experiment. Normally I'd expect that the two OP-TEE compilations differ in more than just their load address. More comments below.
On Sat, Feb 18, 2023 at 10:50 PM shiju.jose@huawei.com wrote:
From: Shiju Jose shiju.jose@huawei.com
Add changes to run 2 SPs at S-EL1 for SPMC_AT_EL=2, where Hafnium is loaded at S-EL2.
This is an experimental version to test loading and booting of more than one SP.
Notes and Observations:
- Secondary SP is built from the optee-os code with different CFG_TZDRAM parameters.
- optee-os to be build after building the secondary-optee-os, otherwise getting Stage-2 page fault when booting the primary SP.
- When build together with optee-os the secondary-optee-os is build only when the corresponding target(secondary-optee-os-common) in the common.mk is used.
This could be taken care of by specifying a different out directory with O=... when doing the secondary OP-TEE build.
I will check this and make changes.
Signed-off-by: Shiju Jose shiju.jose@huawei.com
common.mk | 7 ++++ qemu_v8.mk | 36 ++++++++++++++++--- qemu_v8/secondary_optee_sp_manifest.dts | 46
+++++++++++++++++++++++++
qemu_v8/sp_layout.json | 4 +++ qemu_v8/spmc_el2_manifest.dts | 10 +++++- qemu_v8/tb_fw_config.dts | 4 +++ 6 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 qemu_v8/secondary_optee_sp_manifest.dts
diff --git a/common.mk b/common.mk index e5f2333..1de5426 100644 --- a/common.mk +++ b/common.mk @@ -542,6 +542,13 @@ optee-os-common: optee-os-clean-common: $(MAKE) -C $(OPTEE_OS_PATH) $(OPTEE_OS_COMMON_FLAGS) clean
+.PHONY: secondary-optee-os-common +secondary-optee-os-common:
$(MAKE) -C $(OPTEE_OS_PATH) $(OPTEE_OS_COMMON_FLAGS)
+.PHONY: secondary-optee-os-clean-common +secondary-optee-os-clean-common:
$(MAKE) -C $(OPTEE_OS_PATH) $(OPTEE_OS_COMMON_FLAGS) clean
################################################################# #####
########## # OP-TEE Rust
################################################################# #####
########## diff --git a/qemu_v8.mk b/qemu_v8.mk index d6bf9a7..20b5b8b 100644 --- a/qemu_v8.mk +++ b/qemu_v8.mk @@ -100,7 +100,7 @@ ROOTFS_ENTRY ?= 0x44000000 ROOTFS_LOADADDR ?= 0x44000000
ifeq ($(SPMC_AT_EL),2) -BL32_DEPS ?= hafnium optee-os +BL32_DEPS ?= hafnium secondary-optee-os optee-os else BL32_DEPS ?= optee-os endif @@ -130,7 +130,7 @@ endif # Targets
################################################################# #####
########## TARGET_DEPS := arm-tf buildroot linux optee-os qemu -TARGET_CLEAN := arm-tf-clean buildroot-clean linux-clean optee-os-clean \ +TARGET_CLEAN := arm-tf-clean buildroot-clean linux-clean +optee-os-clean secondary-optee-os-clean \ qemu-clean check-clean
TARGET_DEPS += $(BL33_DEPS) @@ -246,6 +246,7 @@ endif rm -f $(BINARIES_PATH)/bl32_extra2.bin rm -f $(BINARIES_PATH)/tos_fw_config.dtb rm -f $(BINARIES_PATH)/op-tee.pkg
rm -f $(BINARIES_PATH)/sec-op-tee.pkg
ifeq ($(SPMC_AT_EL),1) ln -sf $(TF_A_OUT)/fdts/spmc_el1_manifest.dtb \ $(BINARIES_PATH)/tos_fw_config.dtb @@ -259,6 +260,7 @@ else ifeq ($(SPMC_AT_EL),2) $(BINARIES_PATH)/tb_fw_config.dtb ln -sf $(HAFNIUM_BIN) $(BINARIES_PATH)/bl32.bin ln -sf $(TF_A_OUT)/op-tee.pkg $(BINARIES_PATH)/op-tee.pkg
ln -sf $(TF_A_OUT)/sec-op-tee.pkg
- $(BINARIES_PATH)/sec-op-tee.pkg
else ifeq ($(SPMC_AT_EL),3) ln -sf $(TF_A_OUT)/fdts/spmc_el3_manifest.dtb \ $(BINARIES_PATH)/tos_fw_config.dtb @@ -373,13 +375,17 @@ OPTEE_OS_COMMON_FLAGS_SPMC_AT_EL_2 = CFG_CORE_SEL2_SPMC=y OPTEE_OS_COMMON_FLAGS_SPMC_AT_EL_2 += CFG_ARM_GICV3=n CFG_CORE_HAFNIUM_INTC=y # [0e00.0000 0e2f.ffff] is reserved to early boot and SPMC # [0e30.0000 0e33.ffff] is reserved manifest etc (op-tee.pkg) -OPTEE_OS_COMMON_FLAGS_SPMC_AT_EL_2 +=
CFG_TZDRAM_START=0x0e304000
-OPTEE_OS_COMMON_FLAGS_SPMC_AT_EL_2 +=
CFG_TZDRAM_SIZE=0x00cfc000
OPTEE_OS_COMMON_FLAGS_SPMC_AT_EL_2 += CFG_CORE_WORKAROUND_NSITR_CACHE_PRIME=n OPTEE_OS_COMMON_FLAGS_SPMC_AT_EL_3 = CFG_CORE_EL3_SPMC=y OPTEE_OS_COMMON_FLAGS_SPMC_AT_EL_3 +=
CFG_DT_ADDR=0x40000000
OPTEE_OS_COMMON_FLAGS_SPMC_AT_EL_3 +=
CFG_CORE_RESERVED_SHM=n
+OPTEE_OS_TZDRAM_FLAGS_SPMC_AT_EL_2 =
CFG_TZDRAM_START=0x0e304000
+OPTEE_OS_TZDRAM_FLAGS_SPMC_AT_EL_2 +=
CFG_TZDRAM_SIZE=0x006fc000
This becomes a bit much. Perhaps better to keep the two configurations completely disjoint. So the primary OP-TEE is kept unchanged while the secondary which only makes sense with SPMC_AT_EL=2 has its own separate flags (and build directory with O=xxx).
I will check this and will make modifications.
Cheers, Jens
[...]
2.25.1
Thanks, Shiju