Spurious Interrupts on guest OS

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Spurious Interrupts on guest OS

Kapania, Ashish

Hi All,

 

I am trying to run a RTOS as a guest on a OMAP5432 evm and am seeing a spurious interrupt problem when programming the virtual timer interrupts. My RTOS test case uses the A15 Virtual timer to create a timer instance. Once programmed, the virtual timer interrupt is injected into my guest’s virtual CPU interface as expected and the interrupt is also forwarded to my guest. At this point, my RTOS’s IRQ  service routine is invoked which among other things reads GICV_IAR register to acknowledge the interrupt and then re-enables IRQs (to support nested interrupts) before calling the timer handler which is suppose to program the CNTV_CVAL register for the next tick. I notice that as soon as interrupts are re-enabled, the ISR is interrupted and the IRQ service routine is called again. However, this time GICV_IAR register returns 1023. Once the ISR detects a spurious interrupt and returns, it gets interrupted again with another spurious interrupt. I see that the guest is flooded with these spurious interrupts and is not able to complete servicing the original virtual timer interrupt.

 

If I disable nesting (i.e. do not re-enable IRQs in my service routine), everything works as expected which makes me wonder if the spurious interrupts are related to the virtual timer. I tried adding a debug print in vgic_vcpu_inject_irq to see if xen was injecting some high priority interrupt but found that xen only injects a single virtual timer PPI.

 

Has anyone seen this behavior or has suggestions on how to debug this problem further ?

 

Thanks,

Ashish

 

My xen build info:

I am using xen 4.5-unstable and am at 8cfc8e520679e029bed51ccc2540a136fc0fbd9b commit. My RTOS image is an elf image and in order to make elf loading work, I have also applied the following 2 patches as suggested in this thread -> http://lists.freebsd.org/pipermail/freebsd-xen/2014-January/001974.html. These patches should not affect the gic behavior but thought I should mention them just in case:

https://patches.linaro.org/22228/

https://patches.linaro.org/22227/

 


_______________________________________________
Xen-users mailing list
[hidden email]
http://lists.xen.org/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: Spurious Interrupts on guest OS

Ian Campbell-10
On Fri, 2014-05-30 at 02:40 +0000, Kapania, Ashish wrote:
> Hi All,

Copying Stefano who has a series in progress which I have a feeling
includes addressing some spurious interrupt issues.

>
>  
>
> I am trying to run a RTOS as a guest on a OMAP5432 evm and am seeing a
> spurious interrupt problem when programming the virtual timer
> interrupts. My RTOS test case uses the A15 Virtual timer to create a
> timer instance. Once programmed, the virtual timer interrupt is
> injected into my guest’s virtual CPU interface as expected and the
> interrupt is also forwarded to my guest. At this point, my RTOS’s IRQ
>  service routine is invoked which among other things reads GICV_IAR
> register to acknowledge the interrupt and then re-enables IRQs (to
> support nested interrupts) before calling the timer handler which is
> suppose to program the CNTV_CVAL register for the next tick. I notice
> that as soon as interrupts are re-enabled, the ISR is interrupted and
> the IRQ service routine is called again. However, this time GICV_IAR
> register returns 1023. Once the ISR detects a spurious interrupt and
> returns, it gets interrupted again with another spurious interrupt. I
> see that the guest is flooded with these spurious interrupts and is
> not able to complete servicing the original virtual timer interrupt.
>
>  
>
> If I disable nesting (i.e. do not re-enable IRQs in my service
> routine), everything works as expected which makes me wonder if the
> spurious interrupts are related to the virtual timer. I tried adding a
> debug print in vgic_vcpu_inject_irq to see if xen was injecting some
> high priority interrupt but found that xen only injects a single
> virtual timer PPI.
>
>  
>
> Has anyone seen this behavior or has suggestions on how to debug this
> problem further ?
>
>  
>
> Thanks,
>
> Ashish
>
>  
>
> My xen build info:
>
> I am using xen 4.5-unstable and am at
> 8cfc8e520679e029bed51ccc2540a136fc0fbd9b commit. My RTOS image is an
> elf image and in order to make elf loading work, I have also applied
> the following 2 patches as suggested in this thread ->
> http://lists.freebsd.org/pipermail/freebsd-xen/2014-January/001974.html. These patches should not affect the gic behavior but thought I should mention them just in case:
>
> https://patches.linaro.org/22228/
>
> https://patches.linaro.org/22227/
>
>  
>
>
> _______________________________________________
> Xen-users mailing list
> [hidden email]
> http://lists.xen.org/xen-users



_______________________________________________
Xen-users mailing list
[hidden email]
http://lists.xen.org/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: Spurious Interrupts on guest OS

Stefano Stabellini-3
On Fri, 30 May 2014, Ian Campbell wrote:

> On Fri, 2014-05-30 at 02:40 +0000, Kapania, Ashish wrote:
> > Hi All,
>
> Copying Stefano who has a series in progress which I have a feeling
> includes addressing some spurious interrupt issues.
>
> >
> >  
> >
> > I am trying to run a RTOS as a guest on a OMAP5432 evm and am seeing a
> > spurious interrupt problem when programming the virtual timer
> > interrupts. My RTOS test case uses the A15 Virtual timer to create a
> > timer instance. Once programmed, the virtual timer interrupt is
> > injected into my guest’s virtual CPU interface as expected and the
> > interrupt is also forwarded to my guest. At this point, my RTOS’s IRQ
> >  service routine is invoked which among other things reads GICV_IAR
> > register to acknowledge the interrupt and then re-enables IRQs (to
> > support nested interrupts) before calling the timer handler which is
> > suppose to program the CNTV_CVAL register for the next tick. I notice
> > that as soon as interrupts are re-enabled, the ISR is interrupted and
> > the IRQ service routine is called again. However, this time GICV_IAR
> > register returns 1023. Once the ISR detects a spurious interrupt and
> > returns, it gets interrupted again with another spurious interrupt. I
> > see that the guest is flooded with these spurious interrupts and is
> > not able to complete servicing the original virtual timer interrupt.
> >
> >  
> >
> > If I disable nesting (i.e. do not re-enable IRQs in my service
> > routine), everything works as expected which makes me wonder if the
> > spurious interrupts are related to the virtual timer. I tried adding a
> > debug print in vgic_vcpu_inject_irq to see if xen was injecting some
> > high priority interrupt but found that xen only injects a single
> > virtual timer PPI.
> >
> >  
> >
> > Has anyone seen this behavior or has suggestions on how to debug this
> > problem further ?
Hi Ashish,
yes, I have seen this behaviour with a FreeRTOS guest. This patch series
should fix the issue:

http://marc.info/?l=xen-devel&m=140076202414100

A git url is available at the bottom of the email.
_______________________________________________
Xen-users mailing list
[hidden email]
http://lists.xen.org/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: Spurious Interrupts on guest OS

Kapania, Ashish
Thanks Stefano. I will try the fix.

Best,
Ashish

> -----Original Message-----
> From: Stefano Stabellini [mailto:[hidden email]]
> Sent: Monday, June 02, 2014 7:46 AM
> To: Ian Campbell
> Cc: Kapania, Ashish; Stefano Stabellini; [hidden email]
> Subject: Re: [Xen-users] Spurious Interrupts on guest OS
>
> On Fri, 30 May 2014, Ian Campbell wrote:
> > On Fri, 2014-05-30 at 02:40 +0000, Kapania, Ashish wrote:
> > > Hi All,
> >
> > Copying Stefano who has a series in progress which I have a feeling
> > includes addressing some spurious interrupt issues.
> >
> > >
> > >
> > >
> > > I am trying to run a RTOS as a guest on a OMAP5432 evm and am
> seeing
> > > a spurious interrupt problem when programming the virtual timer
> > > interrupts. My RTOS test case uses the A15 Virtual timer to create
> a
> > > timer instance. Once programmed, the virtual timer interrupt is
> > > injected into my guest’s virtual CPU interface as expected and the
> > > interrupt is also forwarded to my guest. At this point, my RTOS’s
> > > IRQ  service routine is invoked which among other things reads
> > > GICV_IAR register to acknowledge the interrupt and then re-enables
> > > IRQs (to support nested interrupts) before calling the timer
> handler
> > > which is suppose to program the CNTV_CVAL register for the next
> > > tick. I notice that as soon as interrupts are re-enabled, the ISR
> is
> > > interrupted and the IRQ service routine is called again. However,
> > > this time GICV_IAR register returns 1023. Once the ISR detects a
> > > spurious interrupt and returns, it gets interrupted again with
> > > another spurious interrupt. I see that the guest is flooded with
> > > these spurious interrupts and is not able to complete servicing the
> original virtual timer interrupt.
> > >
> > >
> > >
> > > If I disable nesting (i.e. do not re-enable IRQs in my service
> > > routine), everything works as expected which makes me wonder if the
> > > spurious interrupts are related to the virtual timer. I tried
> adding
> > > a debug print in vgic_vcpu_inject_irq to see if xen was injecting
> > > some high priority interrupt but found that xen only injects a
> > > single virtual timer PPI.
> > >
> > >
> > >
> > > Has anyone seen this behavior or has suggestions on how to debug
> > > this problem further ?
>
> Hi Ashish,
> yes, I have seen this behaviour with a FreeRTOS guest. This patch
> series should fix the issue:
>
> http://marc.info/?l=xen-devel&m=140076202414100
>
> A git url is available at the bottom of the email.
_______________________________________________
Xen-users mailing list
[hidden email]
http://lists.xen.org/xen-users