[U-Boot] Question re HYP mode and IRQ/FIQ stack setting

Albert ARIBAUD
2013-11-12T21:29:18Z

Hi Christoffer,

On Tue, 12 Nov 2013 09:09:23 -0800, Christoffer Dall
<christoffer.dall@linaro.org> wrote:

> I suspect that if you are in Hyp mode, you should not worry about
> FIQ/IRQ mode, but just make sure to configure Hyp mode properly to
> handle interrupts. (it's a separate entry in the exception vector and
> you probably need to look at the HSR register whn you've taken an
> interrupt). So, as Andre suggests below, it depends on your use case.

Ok, so les me try to sum that up from my perspective (IRQ and FIQ
stacks in U-Boot):

Some ARM U-Boot targets run in SVC32 mode, and some in HYP mode.

For targets which run in SVC32 mode: aborts execute in abort mode, IRQs
in IRQ mode, FIQs in FIQ mode, etc., each mode having its own stack.

For targets which run in HYP mode: aborts, FIQ and IRQs all run in HYP
mode, using always the same stack.

In both types of targers: prefetch and data aborts, FIQs and IRQs
execute through the usual vectors; in SVC32 mode, because there's no
other way; in HYP mode, because exceptions occurring while in HYP
mode use the normal vector, not the HYP vector.

Correct?

If so, then U-Boot stack requirements for SVC32 and HYP mode are
as follows: in SVC32, we need separate IRQ and FIQ stacks, and the main
(SVC32) stack does not have to accommodate for interrupt handler
context storage. In HYP mode, the only stack is the HYP one and
exception handlers will use it too, so it has to accommodate for
their context storage.

Still correct?

Amicalement,
--
Albert.