refactor(qemu): handle SPM_MM builds
SPM_MM is not compatible with ENABLE_SVE_FOR_NS and breaks build early:
> Including SPM Management Mode (MM) makefile
> services/std_svc/spm/spm_mm/spm_mm.mk:14: *** "Error: SPM_MM is not compatible with ENABLE_SVE_FOR_NS". Stop.
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Change-Id: Iabe181647fce00a432ae11dc4599b71619364c24
diff --git a/plat/qemu/common/common.mk b/plat/qemu/common/common.mk
index 947c05c..9d5e647 100644
--- a/plat/qemu/common/common.mk
+++ b/plat/qemu/common/common.mk
@@ -74,12 +74,18 @@
${QEMU_GIC_SOURCES}
# CPU flag enablement
+ifeq (${ARCH},aarch64)
# Later QEMU versions support SME and SVE.
-ifeq (${ARCH},aarch64)
+# SPM_MM is not compatible with ENABLE_SVE_FOR_NS (build breaks)
+ifeq (${SPM_MM},1)
+ ENABLE_SVE_FOR_NS := 0
+ ENABLE_SME_FOR_NS := 0
+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
diff --git a/plat/qemu/qemu_sbsa/platform.mk b/plat/qemu/qemu_sbsa/platform.mk
index 876826a..b4d9138 100644
--- a/plat/qemu/qemu_sbsa/platform.mk
+++ b/plat/qemu/qemu_sbsa/platform.mk
@@ -7,16 +7,17 @@
PLAT_QEMU_PATH := plat/qemu/qemu_sbsa
PLAT_QEMU_COMMON_PATH := plat/qemu/common
-include plat/qemu/common/common.mk
-
-CRASH_REPORTING := 1
-
ifeq (${SPM_MM},1)
NEED_BL32 := yes
EL3_EXCEPTION_HANDLING := 1
GICV2_G0_FOR_EL3 := 1
endif
+include plat/qemu/common/common.mk
+
+CRASH_REPORTING := 1
+
+
# Enable new version of image loading on QEMU platforms
LOAD_IMAGE_V2 := 1