[cfe-dev] Preserve SSE state in interrupt handler

David Chisnall via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 14 02:16:30 PDT 2017


On 13 Sep 2017, at 23:10, Anatol Pomozov <anatol.pomozov at gmail.com> wrote:
> 
> On Wed, Sep 13, 2017 at 2:16 PM, David Chisnall
> <David.Chisnall at cl.cam.ac.uk> wrote:
>> On 13 Sep 2017, at 21:16, Anatol Pomozov via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>> I don’t believe the interrupt attribute is intended for this purpose: certainly no mainstream operating systems use it.  It is intended for people writing embedded systems that use x86, not for x86 systems using full-blown operating systems, which typically need much more control over how context switches happen as a result of interrupts.
> 
> w.r.t. interrupt handling requirements there is not much difference
> between embedded systems and full-blown OS. Both types of project
> require correct, fast and easy-to-use interruption handling.

Not really.  In an embedded system, interrupt handlers are usually in a way similar to signals in userspace code.  In an operating system, interrupts are a lot more complex and have deep interactions with the scheduler and the driver model.  The exception frame must have a fixed layout that is specified by the kernel in question so that it can be context switched and the scheduler can handle preemption in the presence of lower-priority interrupts already on the stack.

This attribute was added at the request of Intel for their (now mostly cancelled) IoT parts, to make it easier to port code from microcontrollers.  It was never intended for operating system use.  Even on platforms where the interrupt attribute has been supported for 20 years, it is almost never used by complex operating systems for precisely the reasons outlined above.

David




More information about the cfe-dev mailing list