From patchwork Wed Feb 10 14:25:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 380230 Delivered-To: patches@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1204062jah; Wed, 10 Feb 2021 06:25:36 -0800 (PST) X-Received: by 2002:a1c:dcc4:: with SMTP id t187mr3075083wmg.107.1612967136728; Wed, 10 Feb 2021 06:25:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612967136; cv=none; d=google.com; s=arc-20160816; b=psse0gRipQzQtcsbS/lhRgC87ABbAG6MeN4I9NHvnX3zyt30S4JHLBvOlomeq3Awhl snqMzblNiAEkOlYlFH7/SsTDwKOhUHvFSO2xlyxf3wEs/N+eh032w8EQyzdR7Yq1M3Po 16fOaLj/DAp2WD7ka/G5pRoKU6Vc6fmZHNdIHQzSnHwVDfw+fFhG0RxWQGjMZl8w4iTJ gmma6sFE2OhNYDYBSsYIWXHpFm1Ff0i6xrsKUmNXapZ2HUt5MLI4k6d/XRBkiwEAiaPb OklmFwEecbI0wL1/Xbqsxq7LZzAMciIa2uTXPmhVg6gCfV1oEFGgQQiz4QMVVJKrF7Bd tQCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=9eTJkKmfzZLKUowysp2lExKyd3mTVmr/L/f8kXE31MM=; b=z/V8NCtH9GtFwzsp26DVTIKlM8xzTACfiiiRiAjXIzoGIS17ruPpASLBR/i3oodv17 7a+G+Guhrx44OkfeboAuZtLWrxnCMoNExmOmnxG97nWcSYdCverBrSvQ07Bk1kK3hs7Q lZQ6O54JrS0VUYORpIJ808T6Iy6tTEt/sx7ha8VtSSb60ytJcPkbXG/cSJRRxJVbis0y GpAnsncFbXuR2mXDnu0GnW1PiO1vzsiteVMN84js7OPrJILH3b0YWnkLxDugZiUDm3Cj qU315e+MeWdZ0SrBJO2SDNZwm3JBQPr1dYP2O90GyxKl28fPGPltkRf0IRtOoGGun0+e Nugw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gE6Ohjn9; spf=pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=daniel.thompson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id r12sor1201453wrl.12.2021.02.10.06.25.36 for (Google Transport Security); Wed, 10 Feb 2021 06:25:36 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gE6Ohjn9; spf=pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=daniel.thompson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9eTJkKmfzZLKUowysp2lExKyd3mTVmr/L/f8kXE31MM=; b=gE6Ohjn9+gt+qj4kmYHGQpNxkb/NbLmsxMzDX7s4TXgdimpg0ze5D8iRNUPzqL8M+P MGyHnWq6n+4LP2yyffDi4VnPn8K+e4D6R3FpWMw+CGFJkLTy91z11UAoqACGJZe1ZSnR fEZWLAjMX+VzNys60Lo41Tf47cpy/pkhCDOE42fRrGwYHR3VWFEXrNd/4xdSUlKkjE8W MFaNzPXggg/NcyXb1ddBQyEL5fLFfmCepX1svexMakzyrwFayM5vqCPwj9ucmCKk/lY5 A/rhcicfDA0uFGdJEmWXM6XIa+sNHkrml8g9/HIiY8+LPQJe633wcYgNRqkiT/S9Sobi MqHg== 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:mime-version :content-transfer-encoding; bh=9eTJkKmfzZLKUowysp2lExKyd3mTVmr/L/f8kXE31MM=; b=hswHCPbHgCDRRde3WkZCBmZluvCWWzrNGnV4C9nHDbuSFYzaL/AncNdkYOnv0052dY 4tT38hJsceFkfWhqRZ9PulrTZfSj4p6977KbcefDT8eKtYeye2/k2IXMZC6ri25BQ6TI D/KtD2GS8u4cDMgnCZ6UTK+2HzF+aIG9f05eYXYqygZTUFdvezyqv2swZXFDVfCBPyNg GMtAvVzdm8XQqOnskMw7ZJGS0WOnDNYH7RVPOKmw17E0jUZcI1QE8nMq3m9nHoQnWVp4 6GwcOiOLvkB3XWh1nLvg5Yot7O+cyVKMW/hYMF4n6gjI14OUJfwVYwFja6FYEX0eBShq u/jA== X-Gm-Message-State: AOAM533pzRriJSIGNBKre76gcX+xrmHWQR1xPI+Bp+9VUh5GnKraPags QVXSUYle0Xoop3mL9CAri9r038Bc X-Google-Smtp-Source: ABdhPJw9+xUG1EkKDCxCi7tzLU6RhGxv/YJR5hcuLAlBr9JtISIAHqa16xsOodwj+j2+jCMDYFcaJw== X-Received: by 2002:a5d:58e7:: with SMTP id f7mr4105000wrd.114.1612967136310; Wed, 10 Feb 2021 06:25:36 -0800 (PST) Return-Path: Received: from wychelm.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id r17sm3284581wrx.33.2021.02.10.06.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 06:25:35 -0800 (PST) From: Daniel Thompson To: Jason Wessel , Douglas Anderson Cc: Daniel Thompson , Davidlohr Bueso , Emil Renner Berthing , kgdb-bugreport@liss.sourceforge.net, linux-kernel@vger.kernel.org, patches@linaro.org Subject: [PATCH] kgdb: Remove kgdb_schedule_breakpoint() Date: Wed, 10 Feb 2021 14:25:25 +0000 Message-Id: <20210210142525.2876648-1-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 To the very best of my knowledge there has never been any in-tree code that calls this function. It exists largely to support an out-of-tree driver that provides kgdb-over-ethernet using the netpoll API. kgdboe has been out-of-tree for more than 10 years and I don't recall any serious attempt to upstream it at any point in the last five. At this stage it looks better to stop carrying this code in the kernel and integrate the code into the out-of-tree driver instead. The long term trajectory for the kernel looks likely to include effort to remove or reduce the use of tasklets (something that has also been true for the last 10 years). Thus the main real reason for this patch is to make explicit that the in-tree kgdb features do not require tasklets. Signed-off-by: Daniel Thompson --- Notes: During this cycle two developers have proposed tidying up the DECLARE_TASKLET_OLD() in the debug core. Both threads ended with a suggestion to remove kgdb_schedule_breakpoint() but I don't recall seeing a follow up patch for either thread... so I wrote it myself. include/linux/kgdb.h | 1 - kernel/debug/debug_core.c | 26 -------------------------- 2 files changed, 27 deletions(-) base-commit: 19c329f6808995b142b3966301f217c831e7cf31 prerequisite-patch-id: 6d9085a2ef51882c80a4f13264cd12a14dcceb54 prerequisite-patch-id: c0a2cb664281d00a6e32867896374a617aafb358 prerequisite-patch-id: 6bbcef7ce98747090ecb13fd3eda74a241e47249 prerequisite-patch-id: 8bf7c51993c06ff88809d49ed59cbace3d94604e -- 2.29.2 Reviewed-by: Douglas Anderson Acked-by: Davidlohr Bueso Acked-by: Jason Wessel diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 0d6cf64c8bb12..0444b44bd156d 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h @@ -325,7 +325,6 @@ extern char *kgdb_mem2hex(char *mem, char *buf, int count); extern int kgdb_hex2mem(char *buf, char *mem, int count); extern int kgdb_isremovedbreak(unsigned long addr); -extern void kgdb_schedule_breakpoint(void); extern int kgdb_has_hit_break(unsigned long addr); extern int diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 7f22c1c0ffe80..b636d517c02c4 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -119,7 +119,6 @@ static DEFINE_RAW_SPINLOCK(dbg_slave_lock); */ static atomic_t masters_in_kgdb; static atomic_t slaves_in_kgdb; -static atomic_t kgdb_break_tasklet_var; atomic_t kgdb_setting_breakpoint; struct task_struct *kgdb_usethread; @@ -1084,31 +1083,6 @@ static void kgdb_unregister_callbacks(void) } } -/* - * There are times a tasklet needs to be used vs a compiled in - * break point so as to cause an exception outside a kgdb I/O module, - * such as is the case with kgdboe, where calling a breakpoint in the - * I/O driver itself would be fatal. - */ -static void kgdb_tasklet_bpt(unsigned long ing) -{ - kgdb_breakpoint(); - atomic_set(&kgdb_break_tasklet_var, 0); -} - -static DECLARE_TASKLET_OLD(kgdb_tasklet_breakpoint, kgdb_tasklet_bpt); - -void kgdb_schedule_breakpoint(void) -{ - if (atomic_read(&kgdb_break_tasklet_var) || - atomic_read(&kgdb_active) != -1 || - atomic_read(&kgdb_setting_breakpoint)) - return; - atomic_inc(&kgdb_break_tasklet_var); - tasklet_schedule(&kgdb_tasklet_breakpoint); -} -EXPORT_SYMBOL_GPL(kgdb_schedule_breakpoint); - /** * kgdb_register_io_module - register KGDB IO module * @new_dbg_io_ops: the io ops vector