]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPkg / Library / ArmSvcLib / AArch64 / ArmSvc.S
index 7b8e4a965b96c3ff0907868b7a19d0c3d4b0a75e..1a7c10cb793183e7158851e8b8c668658e12987e 100644 (file)
@@ -1,13 +1,7 @@
 //\r
-//  Copyright (c) 2012 - 2017, ARM Limited. All rights reserved.\r
+//  Copyright (c) 2012 - 2020, ARM Limited. All rights reserved.\r
 //\r
-//  This program and the accompanying materials\r
-//  are licensed and made available under the terms and conditions of the BSD License\r
-//  which accompanies this distribution.  The full text of the license may be found at\r
-//  http://opensource.org/licenses/bsd-license.php\r
-//\r
-//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 //\r
 //\r
 \r
@@ -31,14 +25,19 @@ ASM_PFX(ArmCallSvc):
   ldp   x0, x1, [x0, #0]\r
 \r
   svc   #0\r
+  // Prevent speculative execution beyond svc instruction\r
+  dsb   nsh\r
+  isb\r
 \r
   // Pop the ARM_SVC_ARGS structure address from the stack into x9\r
   ldr   x9, [sp, #16]\r
 \r
   // Store the SVC returned values into the ARM_SVC_ARGS structure.\r
-  // A SVC call can return up to 4 values - we do not need to store back x4-x7.\r
+  // A SVC call can return up to 8 values\r
   stp   x0, x1, [x9, #0]\r
   stp   x2, x3, [x9, #16]\r
+  stp   x4, x5, [x9, #32]\r
+  stp   x6, x7, [x9, #48]\r
 \r
   mov   x0, x9\r
 \r