]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/CpuDxe: unmask SErrors in DEBUG builds
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 1 Jul 2016 10:49:12 +0000 (12:49 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 1 Jul 2016 11:24:50 +0000 (13:24 +0200)
SErrors (formerly called asynchronous aborts) are a distinct class of
exceptions that are not closely tied to the currently executing
instruction. Since execution may be able to proceed in such a condition,
this class of exception is masked by default, and software needs to unmask
it explicitly if it is prepared to handle such exceptions.

On DEBUG builds, we are well equipped to report the CPU context to the user
and it makes sense to report an SError as soon as it occurs rather than to
wait for the OS to take it when it unmasks them, especially since the current
arm64/Linux implementation simply panics in that case. So unmask them when
ArmCpuDxe loads.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/Drivers/CpuDxe/Exception.c

index c3107cd4a6bc05ce26afee4665554f474a302123..d806a5fdf910e8e80606835c7b6c753a678604ef 100644 (file)
@@ -62,6 +62,15 @@ InitializeExceptions (
     Status = Cpu->EnableInterrupt (Cpu);\r
   }\r
 \r
+  //\r
+  // On a DEBUG build, unmask SErrors so they are delivered right away rather\r
+  // than when the OS unmasks them. This gives us a better chance of figuring\r
+  // out the cause.\r
+  //\r
+  DEBUG_CODE (\r
+    ArmEnableAsynchronousAbort ();\r
+  );\r
+\r
   return Status;\r
 }\r
 \r