From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DF3CC001DE for ; Mon, 7 Aug 2023 10:27:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231240AbjHGK1J (ORCPT ); Mon, 7 Aug 2023 06:27:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbjHGK1H (ORCPT ); Mon, 7 Aug 2023 06:27:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2473110F4; Mon, 7 Aug 2023 03:27:06 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B02331FB; Mon, 7 Aug 2023 03:27:48 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.32.139]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 01C8E3F59C; Mon, 7 Aug 2023 03:27:02 -0700 (PDT) Date: Mon, 7 Aug 2023 11:27:00 +0100 From: Mark Rutland To: Douglas Anderson Cc: Catalin Marinas , Will Deacon , Sumit Garg , Daniel Thompson , Marc Zyngier , linux-perf-users@vger.kernel.org, ito-yuichi@fujitsu.com, Chen-Yu Tsai , Ard Biesheuvel , Stephen Boyd , Peter Zijlstra , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, kgdb-bugreport@lists.sourceforge.net, Masayoshi Mizuma , "Rafael J . Wysocki" , Lecopzer Chen , Jason Wessel , linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 6/7] kgdb: Provide a stub kgdb_nmicallback() if !CONFIG_KGDB Message-ID: References: <20230601213440.2488667-1-dianders@chromium.org> <20230601143109.v9.6.Ia3aeac89bb6751b682237e76e5ba594318e4b1aa@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230601143109.v9.6.Ia3aeac89bb6751b682237e76e5ba594318e4b1aa@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 01, 2023 at 02:31:50PM -0700, Douglas Anderson wrote: > To save architectures from needing to wrap the call in #ifdefs, add a > stub no-op version of kgdb_nmicallback(), which returns 1 if it didn't > handle anything. > > Reviewed-by: Daniel Thompson > Signed-off-by: Douglas Anderson > --- > In v9 this is the only kgdb dependency. I'm assuming it could go > through the arm64 tree? If that's not a good idea, we could always > change the patch ("arm64: kgdb: Roundup cpus using IPI as NMI") not to > depend on it by only calling kgdb_nmicallback() if CONFIG_KGDB is not > defined. > > Changes in v9: > - Added missing "inline" > > Changes in v8: > - "Provide a stub kgdb_nmicallback() if !CONFIG_KGDB" new for v8 > > include/linux/kgdb.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h > index 258cdde8d356..76e891ee9e37 100644 > --- a/include/linux/kgdb.h > +++ b/include/linux/kgdb.h > @@ -365,5 +365,6 @@ extern void kgdb_free_init_mem(void); > #define dbg_late_init() > static inline void kgdb_panic(const char *msg) {} > static inline void kgdb_free_init_mem(void) { } > +static inline int kgdb_nmicallback(int cpu, void *regs) { return 1; } Is '1' an error? Can we return an actual error code if so? It makes it *much* clearer to anyone looking at the code. Thanks, Mark. > #endif /* ! CONFIG_KGDB */ > #endif /* _KGDB_H_ */ > -- > 2.41.0.rc2.161.g9c6817b8e7-goog >