]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmPlatformLibQemu: Ensure that VFP is on before running C code
authorArd Biesheuvel <ardb@kernel.org>
Thu, 5 Jan 2023 13:43:14 +0000 (14:43 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 10 Jan 2023 17:37:39 +0000 (17:37 +0000)
Now that we build the early code without strict alignment and without
suppressing the use of SIMD registers, ensure that the VFP unit is on
before entering C code.

While at it, simplyify the mov_i macro, which is only used for 32-bit
quantities.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: dann frazier <dann.frazier@canonical.com>
ArmVirtPkg/Library/ArmPlatformLibQemu/AArch64/ArmPlatformHelper.S

index 05ccc7f9f043be3b8efaf4bb025fe3b5a9f07449..1787d52fbf518f9143d11eae99480ad29cf68d09 100644 (file)
@@ -8,9 +8,7 @@
 #include <AsmMacroIoLibV8.h>\r
 \r
   .macro mov_i, reg:req, imm:req\r
-  movz   \reg, :abs_g3:\imm\r
-  movk   \reg, :abs_g2_nc:\imm\r
-  movk   \reg, :abs_g1_nc:\imm\r
+  movz   \reg, :abs_g1:\imm\r
   movk   \reg, :abs_g0_nc:\imm\r
   .endm\r
 \r
 \r
 ASM_FUNC(ArmPlatformPeiBootAction)\r
   mrs    x0, CurrentEL           // check current exception level\r
-  tbz    x0, #3, 0f              // bail if above EL1\r
-  ret\r
+  tbnz   x0, #3, 0f              // omit early ID map if above EL1\r
 \r
-0:mov_i  x0, mairval\r
+  mov_i  x0, mairval\r
   mov_i  x1, tcrval\r
   adrp   x2, idmap\r
   orr    x2, x2, #0xff << 48     // set non-zero ASID\r
@@ -87,7 +84,8 @@ ASM_FUNC(ArmPlatformPeiBootAction)
 \r
   msr    sctlr_el1, x3           // enable MMU and caches\r
   isb\r
-  ret\r
+\r
+0:b      ArmEnableVFP            // enable SIMD before entering C code\r
 \r
 //UINTN\r
 //ArmPlatformGetCorePosition (\r