Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1024415ybi; Fri, 31 May 2019 12:30:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyg3l6TVQxKL2hOoY1859bFySBawjTO0itmxl83o9LvnzfPg/eWiFk8ls7MnBmQiVueyr4P X-Received: by 2002:a17:902:7891:: with SMTP id q17mr11876575pll.236.1559331016452; Fri, 31 May 2019 12:30:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559331016; cv=none; d=google.com; s=arc-20160816; b=P/x8b7oEV6MeMQM0nGfRaYJSmcnswhQ/xF/YMr/7UEOwuu/9knhdGYBUhO6x8CTl4c kA1OYwefoTigdz0vKEASKgjphLwi9dAQ+uj91vqzWNR/dVtclhAMigxQ5J/3V4GNZoBQ /2lzPzxM4shya1qHrtWRa60SYWL+FddpY7COGFL2oK8g9EMIiccD2GeQaDgHsucN8fpv mA6vHIsKQ5BC+PJAbis3rgmws7wuADdJu88Gy6ByXRquMLaORXpKW9VD/8scxIvkfum3 A18aQp4rYOykVCzt7rFmmcNNpZHWttKsGtaYwtjhMRUFIsDmVXaWPrdid6pIhy+H02lj 0P9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TjZppD0LiIcyqpU+BowYjPZjiVQ29xP11Oa2Hra+9cs=; b=ZvKiuLZzmiWPQcdojMK14kdQePmvMhYDGQwqCo3wGXts15jyhwAB1q+84miUzXDB10 aUtQI6g8AkJaxEMJV2EATFIhU0Um0QN1DDeOTUDZN4ZJKmEzZLw8VVdrInqLnGGnJHJN rc49FjNek/fYjgMPHyOjskQBI1KfSM1HsHU41KF75fWkmNa26Db2xis82nRhwwTWySc4 YVifm29q4Uctgq55UdL6lGJKNOmRejL3cTNQ4s7LE+191JvF/awoKtHS574Rbibr9s2U mJlNxsL6YwRxed3sKuFiVTyLMR7vBLR3FDhCl0w6xJ/FVZzyBWYZm82TB3bOV2+MmDc7 Dtdw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h96si7500843pjb.43.2019.05.31.12.30.00; Fri, 31 May 2019 12:30: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727303AbfEaT2A (ORCPT + 99 others); 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