Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does linux (ARM) always switch to supervisor mode during exception handling?

Tags:

linux

arm

During exception handling, Linux always switches to supervisor mode. What is the reason for this?. Why can't it continue execution in the exception mode itself?

like image 597
user997487 Avatar asked Oct 27 '11 11:10

user997487


People also ask

What is supervisor mode in arm?

Supervisor mode is a protected mode for the operating system. Abort mode is entered after a data or instruction Prefetch Abort. System mode is a privileged user modeuser modeIn computer science, hierarchical protection domains, often called protection rings, are mechanisms to protect data and functionality from faults (by improving fault tolerance) and malicious behavior (by providing computer security).https://en.wikipedia.org › wiki › Protection_ringProtection ring - Wikipedia for the operating system.

What is exception in ARM processor?

An exception is any event that can cause the currently executing program to be suspended and cause a change in state to execute code to handle that exception. Other processor architectures might describe this as an interrupt.


1 Answers

When an exception occurs on ARM the processor switches into abort state. While in this state, the processor cannot process any interrupts. This means that screen and network updates cannot happen, nor can there be any pre-emption. For this reason, one should never perform a long running operation in the abort state.

What probably happens (I am not a linux kernel expert), is that the exception is recorded and placed only a queue and the the exception handler immediately returns. The kernel now can re-enable interrupts and process all high priority tasks. It then deals with the exception at its leisure in a way that does not disrupt other tasks.

I have not read this article but it does seem to have the kind of details you are looking for.

like image 194
doron Avatar answered Sep 23 '22 04:09

doron