On 30 June 2015 at 20:21, Peter Crosthwaite
<peter.crosthwa...@xilinx.com> wrote:
> Change all the interrupt groups to 1 to enable interrupts from the NS
> world. This gives a Linux guest full control of the interrupts when
> booting directly with -kernel.
>
> Signed-off-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com>
> ---
> Needs to be rebased on Peter's work
> ---
> ---
>  hw/intc/arm_gic.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
> index 454bfd7..9374145 100644
> --- a/hw/intc/arm_gic.c
> +++ b/hw/intc/arm_gic.c
> @@ -22,6 +22,8 @@
>  #include "gic_internal.h"
>  #include "qom/cpu.h"
>
> +#include "hw/guest/linux.h"
> +
>  //#define DEBUG_GIC
>
>  #ifdef DEBUG_GIC
> @@ -1135,13 +1137,28 @@ static void arm_gic_realize(DeviceState *dev, Error 
> **errp)
>      }
>  }
>
> +static void arm_gic_linux_init(LinuxDevice *obj)
> +{
> +    /* FIXME: rebase - this is based on Xilinx tree code */
> +#if 0
> +    GICState *s = ARM_GIC(obj);
> +    int i;
> +
> +    for (i = 0 ; i < s->num_irq; ++i) {
> +        s->irq_state[i].group = 1;
> +    }
> +#endif
> +}

Implementing this as a hook like this means it will get
called for any Linux boot, but we only want to call it
if we're going to boot the kernel nonsecure (if we boot
the kernel secure then it will expect its irqs to be
in group 0 as usual).

You also need to change the cpu priority register.

thanks
-- PMM

Reply via email to