From 035c6da4afd2d91d468f6b82885ab8fc816aaae0 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 21 Aug 2023 21:43:27 +0200 Subject: [PATCH 1/2] refactor(qemu): keep AArch64 cpu flags in one section There is no need to have two "if" checks for same thing one after another. FGT, RNG, SVE, SME are aarch64 only flags. Change-Id: I6e5850211c859dc7a4ccf6bc8dc6a8d600ffe692 Signed-off-by: Marcin Juszkiewicz --- plat/qemu/common/common.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/plat/qemu/common/common.mk b/plat/qemu/common/common.mk index 9d5e6476a..fca512b59 100644 --- a/plat/qemu/common/common.mk +++ b/plat/qemu/common/common.mk @@ -85,7 +85,6 @@ else ENABLE_SVE_FOR_NS := 2 ENABLE_SME_FOR_NS := 2 endif -endif # QEMU will use the RNDR instruction for the stack protector canary. ENABLE_FEAT_RNG := 2 @@ -93,7 +92,6 @@ ENABLE_FEAT_RNG := 2 # QEMU 7.2+ has support for FGT and Linux needs it enabled to boot on max ENABLE_FEAT_FGT := 2 -ifeq (${ARCH},aarch64) # Treating this as a memory-constrained port for now USE_COHERENT_MEM := 0 From 4a2e7547b3705ffcb31165f966ecea4fd39517f0 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 24 Jul 2023 22:22:42 +0200 Subject: [PATCH 2/2] refactor(qemu): move options to start of file There are some variables to enable/disable options. Let keep them at top of file. Change-Id: I108dd814557b6c713aba0d73a52148c766079c8b Signed-off-by: Marcin Juszkiewicz --- plat/qemu/qemu/platform.mk | 6 +++--- plat/qemu/qemu_sbsa/platform.mk | 20 +++++++++----------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/plat/qemu/qemu/platform.mk b/plat/qemu/qemu/platform.mk index 05ab1f9a0..d941f8174 100644 --- a/plat/qemu/qemu/platform.mk +++ b/plat/qemu/qemu/platform.mk @@ -7,6 +7,9 @@ PLAT_QEMU_PATH := plat/qemu/qemu PLAT_QEMU_COMMON_PATH := plat/qemu/common +SEPARATE_CODE_AND_RODATA := 1 +ENABLE_STACK_PROTECTOR := 0 + include plat/qemu/common/common.mk # Use the GICv2 driver on QEMU by default @@ -200,9 +203,6 @@ QEMU_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${QEMU_TOS_FW_CONFI $(eval $(call TOOL_ADD_PAYLOAD,${QEMU_TOS_FW_CONFIG},--tos-fw-config,${QEMU_TOS_FW_CONFIG})) endif -SEPARATE_CODE_AND_RODATA := 1 -ENABLE_STACK_PROTECTOR := 0 - BL32_RAM_LOCATION := tdram ifeq (${BL32_RAM_LOCATION}, tsram) BL32_RAM_LOCATION_ID = SEC_SRAM_ID diff --git a/plat/qemu/qemu_sbsa/platform.mk b/plat/qemu/qemu_sbsa/platform.mk index b4d913828..4a8df46fc 100644 --- a/plat/qemu/qemu_sbsa/platform.mk +++ b/plat/qemu/qemu_sbsa/platform.mk @@ -7,6 +7,15 @@ PLAT_QEMU_PATH := plat/qemu/qemu_sbsa PLAT_QEMU_COMMON_PATH := plat/qemu/common +MULTI_CONSOLE_API := 1 +CRASH_REPORTING := 1 + +# Disable the PSCI platform compatibility layer +ENABLE_PLAT_COMPAT := 0 + +SEPARATE_CODE_AND_RODATA := 1 +ENABLE_STACK_PROTECTOR := 0 + ifeq (${SPM_MM},1) NEED_BL32 := yes EL3_EXCEPTION_HANDLING := 1 @@ -15,9 +24,6 @@ endif include plat/qemu/common/common.mk -CRASH_REPORTING := 1 - - # Enable new version of image loading on QEMU platforms LOAD_IMAGE_V2 := 1 @@ -44,14 +50,6 @@ ifeq (${SPM_MM},1) BL31_SOURCES += ${PLAT_QEMU_COMMON_PATH}/qemu_spm.c endif -SEPARATE_CODE_AND_RODATA := 1 -ENABLE_STACK_PROTECTOR := 0 - -MULTI_CONSOLE_API := 1 - -# Disable the PSCI platform compatibility layer -ENABLE_PLAT_COMPAT := 0 - # Use known base for UEFI if not given from command line # By default BL33 is at FLASH1 base PRELOADED_BL33_BASE ?= 0x10000000