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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49C32C04AB6 for ; Fri, 31 May 2019 19:28:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A13726E5B for ; Fri, 31 May 2019 19:28:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727316AbfEaT2A (ORCPT ); Fri, 31 May 2019 15:28:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59586 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727147AbfEaT17 (ORCPT ); Fri, 31 May 2019 15:27:59 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB42D307D988; Fri, 31 May 2019 19:27:57 +0000 (UTC) Received: from treble (ovpn-124-142.rdu2.redhat.com [10.10.124.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA3EB19C67; Fri, 31 May 2019 19:27:53 +0000 (UTC) Date: Fri, 31 May 2019 14:27:51 -0500 From: Josh Poimboeuf To: Miroslav Benes Cc: Petr Mladek , Jiri Kosina , Joe Lawrence , Kamalesh Babulal , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] stacktrace: Remove superfluous WARN_ONCE() from save_stack_trace_tsk_reliable() Message-ID: <20190531192751.uz2egendytx6lqwv@treble> References: <20190531074147.27616-1-pmladek@suse.com> <20190531074147.27616-2-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 31 May 2019 19:27:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 02:25:15PM +0200, Miroslav Benes wrote: > On Fri, 31 May 2019, Petr Mladek wrote: > > > WARN_ONCE() in the generic save_stack_trace_tsk_reliable() is superfluous. > > > > The information is passed also via the return value. The only current > > user klp_check_stack() writes its own warning when the reliable stack > > traces are not supported. Other eventual users might want its own error > > handling as well. > > > > Signed-off-by: Petr Mladek > > Acked-by: Miroslav Benes > > Reviewed-by: Kamalesh Babulal > > --- > > kernel/stacktrace.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c > > index 5667f1da3ede..8d088408928d 100644 > > --- a/kernel/stacktrace.c > > +++ b/kernel/stacktrace.c > > @@ -259,7 +259,6 @@ __weak int > > save_stack_trace_tsk_reliable(struct task_struct *tsk, > > struct stack_trace *trace) > > { > > - WARN_ONCE(1, KERN_INFO "save_stack_tsk_reliable() not implemented yet.\n"); > > return -ENOSYS; > > } > > Do we even need the weak function now after Thomas' changes to > kernel/stacktrace.c? > > - livepatch is the only user and it calls stack_trace_save_tsk_reliable() > - x86 defines CONFIG_ARCH_STACKWALK and CONFIG_HAVE_RELIABLE_STACKTRACE, > so it has stack_trace_save_tsk_reliable() implemented and it calls > arch_stack_walk_reliable() > - powerpc defines CONFIG_HAVE_RELIABLE_STACKTRACE and does not have > CONFIG_ARCH_STACKWALK. It also has stack_trace_save_tsk_reliable() > implemented and it calls save_stack_trace_tsk_reliable(), which is > implemented in arch/powerpc/ > - all other archs do not have CONFIG_HAVE_RELIABLE_STACKTRACE and there is > stack_trace_save_tsk_reliable() returning ENOSYS for these cases in > include/linux/stacktrace.c I think you're right. stack_trace_save_tsk_reliable() in stacktrace.h returning -ENOSYS serves the same purpose as the old weak version of save_stack_trace_tsk_reliable() which is no longer called directly. -- Josh