Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5411013imu; Wed, 19 Dec 2018 10:36:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/UBAflf1D5JPyaY2EY7HLURFRBnX/I4mO5Wd510TGMd/esNhtVUyx5EdHzZZ3WSPLGv53Gd X-Received: by 2002:a62:81c1:: with SMTP id t184mr22085858pfd.40.1545244616942; Wed, 19 Dec 2018 10:36:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545244616; cv=none; d=google.com; s=arc-20160816; b=NzuMZqO+IX8TNNZ1GeA96pWzM6s1NUlAQSiqFxoERAXYOspcRIf8PCPzuG1xpT6mXT i0D1ZreHWe2wwdw9uAeT/zkc/sNwo1dkAEseU3+lkvTgmYZv73Yw7tzlxnVOKcZz5kpK XFnlq6AtUv3m8zcmDIIswtDtK1d8TwF2xSKEBDAeJRqqhLpTJbz4WO6ivu4JhUsYpKmJ 8oT6SqW4gHr0i+lVrV7dALKbQemJAaiANx9/TsQHL5y154F/UgLeORJh0roFnXe6pMyM hlZoBJGVFo9hnevgIHzknp6EJzlz8i9uLJObau7Os4f96F1zjwKVW1wm7jzCIHhrkGzl 20Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gEdOH1hhHcMuc7jN1tcptsI4Vlco2fe6qaHfh9a5KyE=; b=exNCtMAedCs6Q1mLsw4sryaybjs/F3WPF4gOV+Xc463ViItPa6UCVy8xMeoCZ3HolA Vr4Rs9JnKC7QuhIUMv8vL5SMAp98l3K1m2vFbx5eegej5cGcsHU+NoCFrHTohIdUnl1f WgsgKilNpOBzazE54R4Z5ZkOEC+PXc0Xh+QV9K+f6MStJ0EOEMfR3coDZTdEcNfvog0o 86MS/KsnBKBFPUjodtKqLilHxYZp0SVO2GAdE2p901BY0H4u6EP2b/h6zXkgI72Iv4ge CVIbvTMkJht66XNXWJhLBjwJDf/UUjmnaSCk4Bd0xWjF1Gi/Q5mM4XJKlh4J+iH980Q7 h0Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F4pS/xnZ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si16806739pfi.228.2018.12.19.10.36.40; Wed, 19 Dec 2018 10:36:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F4pS/xnZ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729764AbeLSQyt (ORCPT + 99 others); Wed, 19 Dec 2018 11:54:49 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36714 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729694AbeLSQys (ORCPT ); Wed, 19 Dec 2018 11:54:48 -0500 Received: by mail-wm1-f67.google.com with SMTP id p6so6903621wmc.1 for ; Wed, 19 Dec 2018 08:54:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gEdOH1hhHcMuc7jN1tcptsI4Vlco2fe6qaHfh9a5KyE=; b=F4pS/xnZZb3dYE7ZTc1BjiVvrUsKOMxGAIeO/Kl3xgEiqMon7qD2ejhDCZ/MxwwPIk 1OhiNKDifeNfmgxkr5C6qmgbVwWkeZD58rykWA0aFcnf9uB0fut97Vo8bG1ZF6NWrujA GGEhamddInb28tEymBTAfHoZQ6FIt3PocAO0M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=gEdOH1hhHcMuc7jN1tcptsI4Vlco2fe6qaHfh9a5KyE=; b=G9JW9gM2CG8vazh54K/VD7XoBQEziAHhu6lSslBlNZ67T64GWGX7+mjon5+VMNNWwV ET/RSrcL3hUzkMBy5gfaVHcPCaGuumNcftiDDJYuJitnOzSfLHC3kI21yIVXi1lUVhw/ bfbWkpFWUYMk7eLUwm+bduRmKRA1j3fzK1WCldrC8HNPaQJiPBa7ytzl/tnCyeRUFGpr O4AuM2m6sOzQUfzFEoo1dXW7GzbhO9glEqH1BooqqVoED3AIp4RJx2P36eFlWBUP+fJG kkfJBQo62oojp4jQq5Hq2ppyWal3uVcbMLdQLD/O0ZBn8N/8Q+OGe4k0Y1NWNULnjArl bvPw== X-Gm-Message-State: AA+aEWbdxPtCi3v1wwFBzaLqtzqGE2kow0KwVM91UX/SyKmqRz2RTd65 0n1gJgG053TtIGBI+kWQz6XBTg== X-Received: by 2002:a1c:7c0b:: with SMTP id x11mr7867792wmc.20.1545238485545; Wed, 19 Dec 2018 08:54:45 -0800 (PST) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id b12sm4584110wrt.17.2018.12.19.08.54.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Dec 2018 08:54:44 -0800 (PST) Date: Wed, 19 Dec 2018 16:54:41 +0000 From: Daniel Thompson To: Douglas Anderson Cc: Jason Wessel , Will Deacon , kgdb-bugreport@lists.sourceforge.net, Peter Zijlstra , Vineet Gupta , Russell King , Catalin Marinas , Richard Kuo , Ralf Baechle , Paul Burton , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, x86@kernel.org, Michal Hocko , linux-snps-arc@lists.infradead.org, Andrew Morton , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Huang Ying , Mike Rapoport , linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [REPOST PATCH v6 1/4] kgdb: Remove irq flags from roundup Message-ID: <20181219165441.oeed3pqiedj4q5ae@holly.lan> References: <20181205033828.6156-1-dianders@chromium.org> <20181205033828.6156-2-dianders@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181205033828.6156-2-dianders@chromium.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 04, 2018 at 07:38:25PM -0800, Douglas Anderson wrote: > The function kgdb_roundup_cpus() was passed a parameter that was > documented as: > > > the flags that will be used when restoring the interrupts. There is > > local_irq_save() call before kgdb_roundup_cpus(). > > Nobody used those flags. Anyone who wanted to temporarily turn on > interrupts just did local_irq_enable() and local_irq_disable() without > looking at them. So we can definitely remove the flags. > > Signed-off-by: Douglas Anderson > Cc: Vineet Gupta > Cc: Russell King > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Richard Kuo > Cc: Ralf Baechle > Cc: Paul Burton > Cc: James Hogan > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: Yoshinori Sato > Cc: Rich Felker > Cc: "David S. Miller" > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > Acked-by: Will Deacon I've not heard any objections from the arch/ maintainers so... Applied! Thanks. > --- > > Changes in v6: None > Changes in v5: None > Changes in v4: None > Changes in v3: None > Changes in v2: > - Removing irq flags separated from fixing lockdep splat. > > arch/arc/kernel/kgdb.c | 2 +- > arch/arm/kernel/kgdb.c | 2 +- > arch/arm64/kernel/kgdb.c | 2 +- > arch/hexagon/kernel/kgdb.c | 9 ++------- > arch/mips/kernel/kgdb.c | 2 +- > arch/powerpc/kernel/kgdb.c | 2 +- > arch/sh/kernel/kgdb.c | 2 +- > arch/sparc/kernel/smp_64.c | 2 +- > arch/x86/kernel/kgdb.c | 9 ++------- > include/linux/kgdb.h | 9 ++------- > kernel/debug/debug_core.c | 2 +- > 11 files changed, 14 insertions(+), 29 deletions(-) > > diff --git a/arch/arc/kernel/kgdb.c b/arch/arc/kernel/kgdb.c > index 9a3c34af2ae8..0932851028e0 100644 > --- a/arch/arc/kernel/kgdb.c > +++ b/arch/arc/kernel/kgdb.c > @@ -197,7 +197,7 @@ static void kgdb_call_nmi_hook(void *ignored) > kgdb_nmicallback(raw_smp_processor_id(), NULL); > } > > -void kgdb_roundup_cpus(unsigned long flags) > +void kgdb_roundup_cpus(void) > { > local_irq_enable(); > smp_call_function(kgdb_call_nmi_hook, NULL, 0); > diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c > index caa0dbe3dc61..f21077b077be 100644 > --- a/arch/arm/kernel/kgdb.c > +++ b/arch/arm/kernel/kgdb.c > @@ -175,7 +175,7 @@ static void kgdb_call_nmi_hook(void *ignored) > kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); > } > > -void kgdb_roundup_cpus(unsigned long flags) > +void kgdb_roundup_cpus(void) > { > local_irq_enable(); > smp_call_function(kgdb_call_nmi_hook, NULL, 0); > diff --git a/arch/arm64/kernel/kgdb.c b/arch/arm64/kernel/kgdb.c > index a20de58061a8..12c339ff6e75 100644 > --- a/arch/arm64/kernel/kgdb.c > +++ b/arch/arm64/kernel/kgdb.c > @@ -289,7 +289,7 @@ static void kgdb_call_nmi_hook(void *ignored) > kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); > } > > -void kgdb_roundup_cpus(unsigned long flags) > +void kgdb_roundup_cpus(void) > { > local_irq_enable(); > smp_call_function(kgdb_call_nmi_hook, NULL, 0); > diff --git a/arch/hexagon/kernel/kgdb.c b/arch/hexagon/kernel/kgdb.c > index 16c24b22d0b2..012e0e230ac2 100644 > --- a/arch/hexagon/kernel/kgdb.c > +++ b/arch/hexagon/kernel/kgdb.c > @@ -119,17 +119,12 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc) > > /** > * kgdb_roundup_cpus - Get other CPUs into a holding pattern > - * @flags: Current IRQ state > * > * On SMP systems, we need to get the attention of the other CPUs > * and get them be in a known state. This should do what is needed > * to get the other CPUs to call kgdb_wait(). Note that on some arches, > * the NMI approach is not used for rounding up all the CPUs. For example, > - * in case of MIPS, smp_call_function() is used to roundup CPUs. In > - * this case, we have to make sure that interrupts are enabled before > - * calling smp_call_function(). The argument to this function is > - * the flags that will be used when restoring the interrupts. There is > - * local_irq_save() call before kgdb_roundup_cpus(). > + * in case of MIPS, smp_call_function() is used to roundup CPUs. > * > * On non-SMP systems, this is not called. > */ > @@ -139,7 +134,7 @@ static void hexagon_kgdb_nmi_hook(void *ignored) > kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); > } > > -void kgdb_roundup_cpus(unsigned long flags) > +void kgdb_roundup_cpus(void) > { > local_irq_enable(); > smp_call_function(hexagon_kgdb_nmi_hook, NULL, 0); > diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c > index eb6c0d582626..2b05effc17b4 100644 > --- a/arch/mips/kernel/kgdb.c > +++ b/arch/mips/kernel/kgdb.c > @@ -219,7 +219,7 @@ static void kgdb_call_nmi_hook(void *ignored) > set_fs(old_fs); > } > > -void kgdb_roundup_cpus(unsigned long flags) > +void kgdb_roundup_cpus(void) > { > local_irq_enable(); > smp_call_function(kgdb_call_nmi_hook, NULL, 0); > diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c > index 59c578f865aa..b0e804844be0 100644 > --- a/arch/powerpc/kernel/kgdb.c > +++ b/arch/powerpc/kernel/kgdb.c > @@ -124,7 +124,7 @@ static int kgdb_call_nmi_hook(struct pt_regs *regs) > } > > #ifdef CONFIG_SMP > -void kgdb_roundup_cpus(unsigned long flags) > +void kgdb_roundup_cpus(void) > { > smp_send_debugger_break(); > } > diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c > index 4f04c6638a4d..cc57630f6bf2 100644 > --- a/arch/sh/kernel/kgdb.c > +++ b/arch/sh/kernel/kgdb.c > @@ -319,7 +319,7 @@ static void kgdb_call_nmi_hook(void *ignored) > kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); > } > > -void kgdb_roundup_cpus(unsigned long flags) > +void kgdb_roundup_cpus(void) > { > local_irq_enable(); > smp_call_function(kgdb_call_nmi_hook, NULL, 0); > diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c > index 4792e08ad36b..f45d876983f1 100644 > --- a/arch/sparc/kernel/smp_64.c > +++ b/arch/sparc/kernel/smp_64.c > @@ -1014,7 +1014,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) > } > > #ifdef CONFIG_KGDB > -void kgdb_roundup_cpus(unsigned long flags) > +void kgdb_roundup_cpus(void) > { > smp_cross_call(&xcall_kgdb_capture, 0, 0, 0); > } > diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c > index 8e36f249646e..ac6291a4178d 100644 > --- a/arch/x86/kernel/kgdb.c > +++ b/arch/x86/kernel/kgdb.c > @@ -422,21 +422,16 @@ static void kgdb_disable_hw_debug(struct pt_regs *regs) > #ifdef CONFIG_SMP > /** > * kgdb_roundup_cpus - Get other CPUs into a holding pattern > - * @flags: Current IRQ state > * > * On SMP systems, we need to get the attention of the other CPUs > * and get them be in a known state. This should do what is needed > * to get the other CPUs to call kgdb_wait(). Note that on some arches, > * the NMI approach is not used for rounding up all the CPUs. For example, > - * in case of MIPS, smp_call_function() is used to roundup CPUs. In > - * this case, we have to make sure that interrupts are enabled before > - * calling smp_call_function(). The argument to this function is > - * the flags that will be used when restoring the interrupts. There is > - * local_irq_save() call before kgdb_roundup_cpus(). > + * in case of MIPS, smp_call_function() is used to roundup CPUs. > * > * On non-SMP systems, this is not called. > */ > -void kgdb_roundup_cpus(unsigned long flags) > +void kgdb_roundup_cpus(void) > { > apic->send_IPI_allbutself(APIC_DM_NMI); > } > diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h > index e465bb15912d..05e5b2eb0d32 100644 > --- a/include/linux/kgdb.h > +++ b/include/linux/kgdb.h > @@ -178,21 +178,16 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code, > > /** > * kgdb_roundup_cpus - Get other CPUs into a holding pattern > - * @flags: Current IRQ state > * > * On SMP systems, we need to get the attention of the other CPUs > * and get them into a known state. This should do what is needed > * to get the other CPUs to call kgdb_wait(). Note that on some arches, > * the NMI approach is not used for rounding up all the CPUs. For example, > - * in case of MIPS, smp_call_function() is used to roundup CPUs. In > - * this case, we have to make sure that interrupts are enabled before > - * calling smp_call_function(). The argument to this function is > - * the flags that will be used when restoring the interrupts. There is > - * local_irq_save() call before kgdb_roundup_cpus(). > + * in case of MIPS, smp_call_function() is used to roundup CPUs. > * > * On non-SMP systems, this is not called. > */ > -extern void kgdb_roundup_cpus(unsigned long flags); > +extern void kgdb_roundup_cpus(void); > > /** > * kgdb_arch_set_pc - Generic call back to the program counter > diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c > index 65c0f1363788..f3cadda45f07 100644 > --- a/kernel/debug/debug_core.c > +++ b/kernel/debug/debug_core.c > @@ -593,7 +593,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, > > /* Signal the other CPUs to enter kgdb_wait() */ > else if ((!kgdb_single_step) && kgdb_do_roundup) > - kgdb_roundup_cpus(flags); > + kgdb_roundup_cpus(); > #endif > > /* > -- > 2.20.0.rc1.387.gf8505762e3-goog >