Home > Software design >  AArch64 exception prioritization
AArch64 exception prioritization

Time:02-20

When Studying exception handing in AArch64, I find that there is no information about the exception prioritization comparing between synchronous and asynchronous.

So when synchronous and asynchronous exceptions occur at the same time, what will processer do? Whether the detecting or asynchronous exception(Interrupt) do after executing an instruction? If yes, it it impossible to recive two kinds of exception at the same time. Is that right?

CodePudding user response:

The specification handles this in a way that doesn't really allow for concurrency.

From section D1.13.4 of the manual, "Prioritization and recognition of interrupts":

Any interrupt that is pending before a Context synchronization event in the following list, is taken before the first instruction after the context synchronizing event, provided that the pending interrupt is not masked:

  • Execution of an ISB instruction.
  • Exception entry, if FEAT_ExS is not implemented, or if FEAT_ExS is implemented and the appropriate SCTLR_ELx.EIS bit is set.
  • [...]

So it essentially asks the question "is there a pending interrupt by the time exception entry happens?", to which the answer is either yes or no, which implicitly gives rise to a sequential order.

There is one exception to that though:

  • If the first instruction after the context synchronizing event generates a synchronous exception, then the architecture does not define whether the PE takes the interrupt or the synchronous exception first.

And it further has to say this:

In the absence of a specific requirement to take an interrupt, the architecture only requires that unmasked pending interrupts are taken in finite time.

Apart from the above, implementations are free to do whatever.

  • Related