]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PrePeiCore: enable VFP at startup
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 6 Jan 2020 11:38:29 +0000 (12:38 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 14 Jan 2020 22:12:17 +0000 (22:12 +0000)
While the alternative PEI-less SEC implementation in PrePi already
takes the EnableVFP PCD into account, the PrePeiCore code does not,
and so we may end up triggering synchronous exception when code
attempts to use FP or SIMD registers, which is permitted on AARCH64
by the spec.

So enable the VFP as early as feasible if the associated PCD is set.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPlatformPkg/PrePeiCore/PrePeiCore.c
ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf

index 4911f67577a2b599534a01d5120a98019666eb9d..4f691d62cf3bce415f052f4e694813f2e562f26f 100644 (file)
@@ -77,6 +77,11 @@ CEntryPoint (
   ASSERT (((UINTN)PeiVectorTable & ARM_VECTOR_TABLE_ALIGNMENT) == 0);\r
   ArmWriteVBar ((UINTN)PeiVectorTable);\r
 \r
+  // Enable Floating Point\r
+  if (FixedPcdGet32 (PcdVFPEnabled)) {\r
+    ArmEnableVFP ();\r
+  }\r
+\r
   //Note: The MMU will be enabled by MemoryPeim. Only the primary core will have the MMU on.\r
 \r
   // If not primary Jump to Secondary Main\r
index f2ac45d171bcda2adfdb8dd23ecf1d90fa625821..104c7da53317b80042398f98c86203bb9ce00a98 100644 (file)
@@ -62,6 +62,7 @@
 [FixedPcd]\r
   gArmTokenSpaceGuid.PcdFvBaseAddress\r
   gArmTokenSpaceGuid.PcdFvSize\r
+  gArmTokenSpaceGuid.PcdVFPEnabled\r
 \r
   gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase\r
   gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize\r
index 84c319c3679bb61b15ebcae755b331727d76f087..ceb173d34f5dff0f4f17c12bed3e819b76cf349a 100644 (file)
@@ -60,6 +60,7 @@
 [FixedPcd]\r
   gArmTokenSpaceGuid.PcdFvBaseAddress\r
   gArmTokenSpaceGuid.PcdFvSize\r
+  gArmTokenSpaceGuid.PcdVFPEnabled\r
 \r
   gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase\r
   gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize\r