Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5299222imd; Tue, 30 Oct 2018 15:22:16 -0700 (PDT) X-Google-Smtp-Source: AJdET5eM7fbKfPQeS3zyX6rOkb/P+JzwRYnYwZ9CutcJcGw9dMsr0Cs074q5kQWvTQdqJQJE0T2e X-Received: by 2002:a63:8c4:: with SMTP id 187-v6mr535523pgi.396.1540938136922; Tue, 30 Oct 2018 15:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540938136; cv=none; d=google.com; s=arc-20160816; b=Q+TfH2W+ptVadTgXZPyb1i3K5aLXXDpQWGjCpBMmpvgts1aFhTsK1oJba3PM4H690x PUp84zOtmPsJmZrhcLDhUZQgpDVhC7V6jv0gZe+6gKGqpGFSdCJB17gQNhuQ4F6Utk4J AX80CBxnWDgqsYySvtAYC8uxfbXN/OZue8Y7zsF3uACR6/2EKyO38ORyvYWF1jDq8pil 5hIME4ND/MdYV58AgGLj7u3tgmOW49EeFnwaGi8wUYQHFViSP5t63UHODZi2SXGeOKA+ lgK5mwnaLj1b1kvUhHyk93GVIJ0+PJSdPNQv/hAIdVnXLmw+FEF/O3xaMtlAmCMHyA4B hmlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2NS1b32dry8FBqsbwDYcAdWFDtBND6KS5TkJqBVyebo=; b=GaE5IMnzAkDTc5S+g2AqrlT9531XCduGOVwMPjg+2lLqGv7PG5diV5Vtst7Z2qDCo4 V6uGqNGP6TJBNkEQoJGKKn+aTOTsE2gvimXxxdGjRCvyj6khtqdz2y7kY+yWevzIxRWX bCjrzpLCYGBbtqugsnuRg5lVPnP44XNL20V/KUVfRt7MzdYRWjGAQdafPnHaedwLYU/M K230/LZzL8O4gnpCYRoubw8pZi6x/nL9+Z/AE05dUImGgjfEv88TvY92S5hnXJ3BURfx DpK0Ko5SAcbQhkOvkvu7XNXlYHGe9jCKz09OZC2ia1gmIjLcLxh89MZpMr9H+teNFSMt 0Z1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SzLosIbS; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2-v6si25310920plh.63.2018.10.30.15.22.01; Tue, 30 Oct 2018 15:22:16 -0700 (PDT) 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=@chromium.org header.s=google header.b=SzLosIbS; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728590AbeJaHOY (ORCPT + 99 others); Wed, 31 Oct 2018 03:14:24 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42892 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728575AbeJaHOW (ORCPT ); Wed, 31 Oct 2018 03:14:22 -0400 Received: by mail-pf1-f196.google.com with SMTP id f26-v6so6557730pfn.9 for ; Tue, 30 Oct 2018 15:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2NS1b32dry8FBqsbwDYcAdWFDtBND6KS5TkJqBVyebo=; b=SzLosIbSFm8dO/V9QXWTWcjH2x0nuoG2myAK9vJPjqH1h1m+ZQgz+0WGi1Iqcjibfc HyVaCpXHmqFXd2mJRyp98PZknM79AbKznKF5tU7O/6thgpU/p18TfElN4C/AKB2aBuhH ytEhXQjosGOsm2YlRbq80AU1ma8Bozj6iyFWc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2NS1b32dry8FBqsbwDYcAdWFDtBND6KS5TkJqBVyebo=; b=qDHcj/6HYGD4bo/XCTaqX3iMMVh+7V4jl9mIzWgQ+ebJiIW6AygwMLDj8lXRBoaMRl jCEbUdhl4f8FOP0hHO2ZvEmy0NnGxjTwacNVH7KPK1t9Yxm/kF6xhLsP9Lm7peDqjV+U /r/KMalfZtR7+Fj9OG1/EQupTODX9oMWgVhqt7uKZqGlSxG+oMkTCDq1dogpLC8K7kZP 9EUBPiAzbkI8Q72fArM4DQundv3dhNkwXQo/H81Dz3bgrIH7E/xyc3Fccy955Gg5cFo8 WlQIIaMwd5Wi/TXsEfe/BItqiLorGhKGL+CbVHm15It8gX0CkdpndCZM7PRibuLG09KB Cepg== X-Gm-Message-State: AGRZ1gKGbthxvqYOvV/995JdlwISslU/Ydg9dABJ18FK2P9xRiv7Eik3 95eLWBx6iSCizP0C5f6mIHF4/w== X-Received: by 2002:a63:6bc1:: with SMTP id g184mr529714pgc.25.1540937945185; Tue, 30 Oct 2018 15:19:05 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:c8e0:70d7:4be7:a36]) by smtp.gmail.com with ESMTPSA id c70-v6sm2889774pfe.93.2018.10.30.15.19.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 15:19:04 -0700 (PDT) From: Douglas Anderson To: Jason Wessel , Daniel Thompson Cc: kgdb-bugreport@lists.sourceforge.net, Peter Zijlstra , Douglas Anderson , linux-mips@linux-mips.org, linux-sh@vger.kernel.org, Borislav Petkov , Paul Burton , sparclinux@vger.kernel.org, Catalin Marinas , James Hogan , linux-hexagon@vger.kernel.org, x86@kernel.org, Vineet Gupta , Thomas Gleixner , Philippe Ombredanne , Kate Stewart , Will Deacon , Ralf Baechle , linux-snps-arc@lists.infradead.org, Andrew Morton , "H. Peter Anvin" , Yoshinori Sato , Benjamin Herrenschmidt , Greg Kroah-Hartman , Paul Mackerras , Ingo Molnar , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Huang Ying , "David S. Miller" , Rich Felker , Michael Ellerman , linux-kernel@vger.kernel.org, Richard Kuo , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 1/2] kgdb: Remove irq flags from roundup Date: Tue, 30 Oct 2018 15:18:42 -0700 Message-Id: <20181030221843.121254-2-dianders@chromium.org> X-Mailer: git-send-email 2.19.1.568.g152ad8e336-goog In-Reply-To: <20181030221843.121254-1-dianders@chromium.org> References: <20181030221843.121254-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 d3ea1f3c06a0..68098bbf3705 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.19.1.568.g152ad8e336-goog