summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Drivers/CpuDxe
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-07-01 12:49:12 +0200
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-07-01 13:24:50 +0200
commit3b3593b567761d2568ea70c117c7111fd85e79b9 (patch)
tree6e883808d05b15421c742ae229d20b59dee3fa1c /ArmPkg/Drivers/CpuDxe
parentf9ebccec096742465c0dfbbbb123d2c39f554d40 (diff)
downloadedk2-3b3593b567761d2568ea70c117c7111fd85e79b9.tar.gz
edk2-3b3593b567761d2568ea70c117c7111fd85e79b9.tar.bz2
edk2-3b3593b567761d2568ea70c117c7111fd85e79b9.zip
ArmPkg/CpuDxe: unmask SErrors in DEBUG builds
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>
Diffstat (limited to 'ArmPkg/Drivers/CpuDxe')
-rw-r--r--ArmPkg/Drivers/CpuDxe/Exception.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ArmPkg/Drivers/CpuDxe/Exception.c b/ArmPkg/Drivers/CpuDxe/Exception.c
index c3107cd4a6..d806a5fdf9 100644
--- a/ArmPkg/Drivers/CpuDxe/Exception.c
+++ b/ArmPkg/Drivers/CpuDxe/Exception.c
@@ -62,6 +62,15 @@ InitializeExceptions (
Status = Cpu->EnableInterrupt (Cpu);
}
+ //
+ // On a DEBUG build, unmask SErrors so they are delivered right away rather
+ // than when the OS unmasks them. This gives us a better chance of figuring
+ // out the cause.
+ //
+ DEBUG_CODE (
+ ArmEnableAsynchronousAbort ();
+ );
+
return Status;
}