From 9bff7ce37545162d417953ac36c6878216815b94 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Wed, 16 Nov 2022 14:47:51 +0100 Subject: [PATCH] fix(qemu-sbsa): enable SVE and SME Commit 337ff4f1dd6604738d79fd3fa275ae74d74256b2 enabled SVE/SME for qemu platform. Let do the same for qemu-sbsa one too. With this change I can boot Debian 'bookworm' installed using Max cpu. Info from referenced commit: Starting with QEMU v3.1.0 (Dec 2018), QEMU's TCG emulation engine supports the SVE architecture extension. In QEMU v7.1.0 (Aug 2022) it also gained SME support. As it stands today, running TF-A under QEMU with "-cpu max" makes Linux hang, because SME and SVE accesses trap to EL3, but are never handled there. This is because the Linux kernel sees the SVE or SME feature bits, and assumes firmware has enabled the feature for lower exception levels. This requirement is described in the Linux kernel booting protocol. Enable those features in the TF-A build, so that BL31 does the proper EL3 setup to make the feature usable in non-secure world. We check the actual feature bits before accessing SVE or SME registers, so this is safe even for older QEMU version or when not running with -cpu max. As SVE and SME are AArch64 features only, do not enable them when building for AArch32. Signed-off-by: Marcin Juszkiewicz Change-Id: I9ea1f91e6b801218d944e8a7d798d5ae568ed59a --- plat/qemu/qemu_sbsa/platform.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plat/qemu/qemu_sbsa/platform.mk b/plat/qemu/qemu_sbsa/platform.mk index 5a6b1e11e..2393b397d 100644 --- a/plat/qemu/qemu_sbsa/platform.mk +++ b/plat/qemu/qemu_sbsa/platform.mk @@ -123,5 +123,6 @@ $(eval $(call add_define,ARM_LINUX_KERNEL_AS_BL33)) ARM_PRELOADED_DTB_BASE := PLAT_QEMU_DT_BASE $(eval $(call add_define,ARM_PRELOADED_DTB_BASE)) -# Do not enable SVE -ENABLE_SVE_FOR_NS := 0 +# Later QEMU versions support SME and SVE. +ENABLE_SVE_FOR_NS := 1 +ENABLE_SME_FOR_NS := 1 -- 2.39.5