Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aarch64: properly handle unexpected synchronous exceptions
Per the code in arch/aarch64/entry.S that sets up exception vector table, OSv handles only exceptions in current EL with SPx. In other words it implemements proper handlers only for exceptions raised in the exception level EL1. All other exceptions should never really happen and if the do they would be caught by the entry_invalid routine that in essence makes OSv guest hang. The synchronous exception handler for EL1 - entry_sync - is intended to handle page faults caused by at attempt to read, write or execute against page of memory that has not been been filled in yet. To accomplish it the assembly code determines the class of the exception (EC) based on the value of ESR register (Exception Syndrome Register). If the EC is different from Data Abort or Instruction Abort it branches to the same entry_invalid handler. This is unfortunate as it makes debugging crashes/problems like #1100 way more laborious and requires connecting with gdb jus to see what the issue is. So this patch changes the the entry_sync to make it branch to the new unexpected_sync_exception instead of entry_invalid in order to print state of all registers and backtrace to the console and finally abort the guest. Signed-off-by: Waldemar Kozaczuk <jwkozaczuk@gmail.com> Message-Id: <20201215051218.98340-1-jwkozaczuk@gmail.com>
- Loading branch information