Re: [RFC Patch v1 2/4] irqchip/gic-v3: Add support to handle SGI as pseudo NMI
From: Sumit Garg
Date: Tue May 05 2020 - 07:33:41 EST
On Tue, 5 May 2020 at 15:38, Marc Zyngier <maz@xxxxxxxxxx> wrote:
>
> On 2020-05-05 05:09, Sumit Garg wrote:
> > On Fri, 1 May 2020 at 18:33, Sumit Garg <sumit.garg@xxxxxxxxxx> wrote:
>
> [...]
>
> > In case there are no major objections to this approach, I will post
> > complete v2 patch-set (alongwith Marc's patches) for detailed review.
>
> As this is still a work in progress (I'm currently wrestling with
> the stupid RPi driver), whatever you have is unlikely to apply on
> top of the final series.
>
> I'm not going to stop you from posting the patches, it is just that
> they will be obsolete by the end of the week...
Thanks for the heads up. Will wait for your final series.
But while working on an NMI request, I noticed a hack in common gic
code [1] which basically enables all SGIs for every CPU by default.
This hack is quite similar to mine initial hack to set priority for a
particular SGI by default to act as pseudo NMI.
Due to this hack I got following error message while configuring SGI as NMI:
[ 0.000000] GICv3: Cannot set NMI property of enabled IRQ 8
[ 0.000000] genirq: Failed to setup NMI delivery: irq 8
I think chained IRQs worked for you due to this hack only as it
doesn't seem to enable SGIs per CPU.
IMO, as we shift to SGIs being standard interrupts, we should also
rely on standard interrupt framework to enable SGIs. So it seems the
correct way would be to use "request_percpu_irq()" and
"enable_percpu_irq()" for configuring SGIs as demonstrated in updated
commit here [2].
Also, we should get rid of this hack as demonstrated via commit [3].
Apart from above changes, there was a minor update needed for commit
"irqchip/gic-v3: Describe the SGI range" [4].
I hope these updates are useful for you while preparing the final series.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/irqchip/irq-gic-common.c#n155
[2] https://git.linaro.org/people/sumit.garg/linux.git/commit/?h=kgdb-nmi&id=e208979b5165d753d144db57e0cb8646fdedc495
[3] https://git.linaro.org/people/sumit.garg/linux.git/commit/?h=kgdb-nmi&id=cd6d0d7cea14ac16156f0dbd297940df382f8cea
[4] https://git.linaro.org/people/sumit.garg/linux.git/commit/?h=kgdb-nmi&id=1180e9c54547ec05d96cc6b36c26005059c90d9a
-Sumit
>
> Thanks,
>
> M.
> --
> Jazz is not dead. It just smells funny...