lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABEDWGzeTLk7POWUkU1vJfyxGwjzOzWK-1_RAq7rR1wRh5hTFg@mail.gmail.com>
Date:   Wed, 23 Oct 2019 14:34:41 -0700
From:   Alan Mikhak <alan.mikhak@...ive.com>
To:     Paul Walmsley <paul.walmsley@...ive.com>
Cc:     linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
        tglx@...utronix.de, jason@...edaemon.net, maz@...nel.org,
        Palmer Dabbelt <palmer@...ive.com>,
        Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH] irqchip: Skip contexts other supervisor in plic_init()

On Wed, Oct 23, 2019 at 11:54 AM Paul Walmsley <paul.walmsley@...ive.com> wrote:
>
> + hch
>
> On Wed, 23 Oct 2019, Alan Mikhak wrote:
>
> > From: Alan Mikhak <alan.mikhak@...ive.com>
> >
> > Modify plic_init() to skip .dts interrupt contexts other
> > than supervisor external interrupt.
>
> Might be good to explain the motivation here.

The .dts entry for plic may specify multiple interrupt contexts. For example,
it may assign two entries IRQ_M_EXT and IRQ_S_EXT, in that order, to
the same interrupt controller. This patch modifies plic_init() to skip the
IRQ_M_EXT context since IRQ_S_EXT is currently the only supported
context.

If IRQ_M_EXT is not skipped, plic_init() will report "handler already
present for context" when it comes across the IRQ_S_EXT context
in the next iteration of its loop.

Without this patch, .dts would have to be edited to replace the
value of IRQ_M_EXT with -1 for it to be skipped.

I will add the above explanation in a v2 patch description, if it
sounds reasonable.

>
> >
> > Signed-off-by: Alan Mikhak <alan.mikhak@...ive.com>
> > ---
> >  drivers/irqchip/irq-sifive-plic.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
> > index c72c036aea76..5f2a773d5669 100644
> > --- a/drivers/irqchip/irq-sifive-plic.c
> > +++ b/drivers/irqchip/irq-sifive-plic.c
> > @@ -251,8 +251,8 @@ static int __init plic_init(struct device_node *node,
> >                       continue;
> >               }
> >
> > -             /* skip context holes */
> > -             if (parent.args[0] == -1)
> > +             /* skip contexts other than supervisor external interrupt */
> > +             if (parent.args[0] != IRQ_S_EXT)
> >                       continue;
>
> Will this need to change for RISC-V M-mode Linux support?
>
> https://lore.kernel.org/linux-riscv/20191017173743.5430-1-hch@lst.de/
>
>
> - Paul
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ