What are tail-chaining and late arrival?
Short answer: Both are hardware optimisations in the Cortex-M exception model. Tail-chaining: when an interrupt handler finishes and another interrupt is already pending, the core skips the unstacking and re-stacking and goes straight into the next handler (6 cycles instead of about 24 on Cortex-M3/M4). Late arrival: if a higher-priority interrupt arrives while the core is still stacking for a lower-priority one, the core uses the same stack frame and runs the higher-priority handler first.
Tail-chaining timeline
Without: [ISR A] unstack (12) → stack (12) [ISR B]
With: [ISR A] tail-chain (6) [ISR B]
The registers saved for the interrupted thread are still on the stack, and both handlers return to the same place, so popping and re-pushing them would be wasted work.
Late arrival timeline
t0: low-priority IRQ L arrives → core starts stacking
t1: high-priority IRQ H arrives during stacking
t2: stacking completes → core fetches H's vector instead of L's and runs H
t3: H returns → tail-chains into L
The higher-priority interrupt gets almost the minimum latency, and no extra stacking is needed.
Related optimisation: pop pre-emption. If a new interrupt arrives while the core is unstacking after a handler, the unstacking is abandoned and the new handler starts (via tail-chaining).
Why it matters: these features make Cortex-M interrupt overhead low and predictable without any software effort, which is one reason ISRs can be plain C functions. They also mean a burst of interrupts is handled efficiently, and they explain why measured "exit + entry" time between two ISRs is shorter than you might calculate.
Lazy FP stacking works with these: if the handlers do not use the FPU, the FP registers are never actually saved.