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]
Date:   Fri, 22 Oct 2021 14:35:05 +0800
From:   Greentime Hu <green.hu@...il.com>
To:     Mark Rutland <mark.rutland@....com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Albert Ou <aou@...s.berkeley.edu>,
        Catalin Marinas <catalin.marinas@....com>,
        Vincent Chen <deanbo422@...il.com>,
        Guo Ren <guoren@...nel.org>, Jonas Bonn <jonas@...thpole.se>,
        kernelfans@...il.com, linux-arm-kernel@...ts.infradead.org,
        Russell King <linux@...linux.org.uk>, maz@...nel.org,
        Nickhu <nickhu@...estech.com>,
        Palmer Dabbelt <palmer@...belt.com>, paulmck@...nel.org,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Stafford Horne <shorne@...il.com>,
        Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
        Thomas Gleixner <tglx@...utronix.de>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        vgupta@...nel.org, Will Deacon <will@...nel.org>,
        Alan Kao <alankao@...estech.com>,
        K.C. Kuen-Chern Lin(林坤成) 
        <kclin@...estech.com>
Subject: Re: [PATCH 07/15] irq: nds32: avoid CONFIG_HANDLE_DOMAIN_IRQ

Mark Rutland <mark.rutland@....com> 於 2021年10月22日 週五 上午2:03寫道:
>
> In preparation for removing HANDLE_DOMAIN_IRQ, have arch/nds32 perform
> all the necessary IRQ entry accounting in its entry code.
>
> Currently arch/nds32 is tightly coupled with the ativic32 irqchip, and
> while the entry code should logically live under arch/nds32/, moving the
> entry logic there makes things more convoluted. So for now, place the
> entry logic in the ativic32 irqchip, but separated into a separate
> function to make the split of responsibility clear.
>
> In future this should probably use GENERIC_IRQ_MULTI_HANDLER to cleanly
> decouple this.
>
> There should be no functional change as a result of this patch.
>
> Signed-off-by: Mark Rutland <mark.rutland@....com>
> Cc: Greentime Hu <green.hu@...il.com>
> Cc: Marc Zyngier <maz@...nel.org>
> Cc: Nick Hu <nickhu@...estech.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Vincent Chen <deanbo422@...il.com>
> ---
>  arch/nds32/Kconfig             |  1 -
>  drivers/irqchip/irq-ativic32.c | 22 ++++++++++++++++++++--
>  2 files changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/arch/nds32/Kconfig b/arch/nds32/Kconfig
> index aea26e739543..4d1421b18734 100644
> --- a/arch/nds32/Kconfig
> +++ b/arch/nds32/Kconfig
> @@ -27,7 +27,6 @@ config NDS32
>         select GENERIC_LIB_MULDI3
>         select GENERIC_LIB_UCMPDI2
>         select GENERIC_TIME_VSYSCALL
> -       select HANDLE_DOMAIN_IRQ
>         select HAVE_ARCH_TRACEHOOK
>         select HAVE_DEBUG_KMEMLEAK
>         select HAVE_EXIT_THREAD
> diff --git a/drivers/irqchip/irq-ativic32.c b/drivers/irqchip/irq-ativic32.c
> index 476d6024aaf2..223dd2f97d28 100644
> --- a/drivers/irqchip/irq-ativic32.c
> +++ b/drivers/irqchip/irq-ativic32.c
> @@ -5,11 +5,14 @@
>  #include <linux/of.h>
>  #include <linux/of_irq.h>
>  #include <linux/of_address.h>
> +#include <linux/hardirq.h>
>  #include <linux/interrupt.h>
>  #include <linux/irqdomain.h>
>  #include <linux/irqchip.h>
>  #include <nds32_intrinsic.h>
>
> +#include <asm/irq_regs.h>
> +
>  unsigned long wake_mask;
>
>  static void ativic32_ack_irq(struct irq_data *data)
> @@ -103,10 +106,25 @@ static irq_hw_number_t get_intr_src(void)
>                 - NDS32_VECTOR_offINTERRUPT;
>  }
>
> -asmlinkage void asm_do_IRQ(struct pt_regs *regs)
> +static void ativic32_handle_irq(struct pt_regs *regs)
>  {
>         irq_hw_number_t hwirq = get_intr_src();
> -       handle_domain_irq(root_domain, hwirq, regs);
> +       generic_handle_domain_irq(root_domain, hwirq);
> +}
> +
> +/*
> + * TODO: convert nds32 to GENERIC_IRQ_MULTI_HANDLER so that this entry logic
> + * can live in arch code.
> + */
> +asmlinkage void asm_do_IRQ(struct pt_regs *regs)
> +{
> +       struct pt_regs *old_regs;
> +
> +       irq_enter();
> +       old_regs = set_irq_regs(regs);
> +       ativic32_handle_irq(regs);
> +       set_irq_regs(old_regs);
> +       irq_exit();
>  }
>
>  int __init ativic32_init_irq(struct device_node *node, struct device_node *parent)
> --
> 2.11.0
>

Loop in Alan and KC.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ