public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 1/2] ArmVirtPkg/ArmPlatformLibQemu: Ensure that VFP is on before running C code
@ 2023-01-05 16:25 Ard Biesheuvel
  2023-01-05 16:25 ` [PATCH v2 2/2] ArmVirtPkg/ArmVirtQemu: Avoid early ID map on ThunderX Ard Biesheuvel
  0 siblings, 1 reply; 37+ messages in thread
From: Ard Biesheuvel @ 2023-01-05 16:25 UTC (permalink / raw)
  To: devel; +Cc: dann.frazier, Ard Biesheuvel

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>
---
 ArmVirtPkg/Library/ArmPlatformLibQemu/AArch64/ArmPlatformHelper.S | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

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


^ permalink raw reply related	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2023-05-20  9:20 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05 16:25 [PATCH v2 1/2] ArmVirtPkg/ArmPlatformLibQemu: Ensure that VFP is on before running C code Ard Biesheuvel
2023-01-05 16:25 ` [PATCH v2 2/2] ArmVirtPkg/ArmVirtQemu: Avoid early ID map on ThunderX Ard Biesheuvel
2023-01-10  0:08   ` dann frazier
2023-01-17 12:47     ` [edk2-devel] " Oliver Steffen
2023-01-17 14:53       ` Ard Biesheuvel
2023-01-18  6:36         ` Oliver Steffen
2023-01-18  7:34           ` Ard Biesheuvel
2023-01-18  8:27             ` Oliver Steffen
2023-01-18  8:48               ` Ard Biesheuvel
2023-01-18  9:22                 ` Ard Biesheuvel
2023-01-19 11:03                   ` Oliver Steffen
2023-01-19 11:11                     ` Ard Biesheuvel
2023-01-19 11:25                       ` Oliver Steffen
2023-01-19 11:55                       ` Marc Zyngier
2023-01-19 12:21                         ` Ard Biesheuvel
2023-01-19 12:00                       ` Gerd Hoffmann
2023-01-19 12:55                         ` Oliver Steffen
2023-01-19 13:21                           ` Ard Biesheuvel
2023-01-26 12:01                             ` Gerd Hoffmann
2023-01-26 13:48                               ` Marc Zyngier
2023-01-26 14:46                                 ` Gerd Hoffmann
2023-01-26 15:08                                   ` Marc Zyngier
2023-02-01  9:13                             ` Oliver Steffen
2023-02-01 11:51                               ` Ard Biesheuvel
2023-02-01 12:58                                 ` Oliver Steffen
2023-02-01 13:29                                   ` Ard Biesheuvel
2023-02-02 11:09                                     ` Oliver Steffen
     [not found]                                     ` <173FFD60429C89C3.3213@groups.io>
2023-02-07 10:51                                       ` Oliver Steffen
2023-02-07 11:56                                         ` Ard Biesheuvel
2023-02-07 12:58                                           ` Oliver Steffen
2023-02-09 15:15                                             ` Ard Biesheuvel
2023-03-02 10:50                                               ` Ard Biesheuvel
2023-03-02 13:29                                                 ` Oliver Steffen
     [not found]                                                 ` <17489D498A098DB9.9697@groups.io>
2023-05-19 16:32                                                   ` Oliver Steffen
2023-05-19 21:36                                                     ` Ard Biesheuvel
2023-05-20  8:37                                                       ` Oliver Steffen
2023-05-20  9:20                                                         ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox