Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2794731rwb; Mon, 7 Aug 2023 03:46:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+loVfeyxGAfPSyZp+AL5NCHvobFDRrFBX65mguq5njOh2wIho2+QKWgdunv4KN3ONZlmp X-Received: by 2002:a05:6358:c23:b0:130:f1e5:acc6 with SMTP id f35-20020a0563580c2300b00130f1e5acc6mr9482259rwj.8.1691405201990; Mon, 07 Aug 2023 03:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691405201; cv=none; d=google.com; s=arc-20160816; b=Z2SvDZ2S5cT6dqqmyJgVcIXAzoWk5YqgivRjxUsNk5Qh7ni4EnQavS1Dt/zHdhLJF4 96vnctfKt6Hvr0UHi5tqZ625uZkLTrK7s8xvg/h+mZ6gczHB3Vhq105EuO8m43HEYzm5 ISDgicyi8lzycs7BvPTh56S5AgmO1pjkWOaq/IBv72y4XM/S1itpiPvJ/X5OVpaPrH7r pePpaM2NL3y8h6xn6gmAF//4nlT/fa30A1cUNouc5zSDXayfLtRuuUE1u5TEdv4TLtj1 YgbLyPD1J/en16XjgLdbMEd2Iv0NrxFFoKNrnn5mwnnb3zXgKc0Ofwj+RpwUoGkAauUr icPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=KwuNlwA4UwnFmM36MbtkZoeG9AYBBrabnAI2z95mypc=; fh=Zuf0k36yk+cCu8AJxuN4e/Y1Jc2kkcKkCq6bW25ycWg=; b=tIEugepkXv+4QqPZPAj8yygTMbwEr9xgQwCGtSjB4Tu9FXvrDSmoAQmMdjyv5PptzW 5NSV3CXwcKOxAV0sfQSnBin5tISUYXIXmCN68TMW+LONCQTmFUyJkdDBMvSCLI7/z8jl goz1UxYZmxBvmwwB7OfM4yc69q9goPisY6wM7IjUSAqYrIwZLpyBvaV5WF40rWYu8LRN fgvI73OSMdIj4AuUTyiBaPuXDXFCezR7b7m5CfJ8Rpk60p+z3wrfTe+CbtUXwp7CNLMT 3vq4B7KuMAnOHqteHyRtlGrshbnUb80PdxUO6B4BGrTFDYsMWm1/MdaJTorlk5RbqtFO 0kUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t23-20020a656097000000b005579d6bdf7esi5064920pgu.856.2023.08.07.03.46.30; Mon, 07 Aug 2023 03:46:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231549AbjHGK1I (ORCPT + 99 others); Mon, 7 Aug 2023 06:27:08 -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> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 >