Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp538383ybi; Fri, 31 May 2019 05:27:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqx07xgzZ45zj7POAPZGtvivkd6lusHkW+kTAU1I1idGBM0CZYTzRPhUiFMvU1lZhoHv2Wwb X-Received: by 2002:a17:902:f20b:: with SMTP id gn11mr9062879plb.126.1559305675432; Fri, 31 May 2019 05:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559305675; cv=none; d=google.com; s=arc-20160816; b=AvhL4mxqqMyEExB+ktRRrDwb7a2umXExWE52onpx+ESBsZjF3dQBXcPb1GQ604UFSm hOTelmCkWIuLUWrkqkcoAHDWCNNfnZCeVczPKgIC/Zk8Wn1d2uh9Hp2WSjEC/8bMvUWB Kz8LR8/HZEJVbrrjwNHeH8SvRCxVtQo8w0AVVDrMjlO50O70qu/NpczIfRiaG034raYp haDrvpO9/WzBHzActJjuCGN6flE1AKQQmrFAAUy0xRro+DF0P9JY/5d1KslP8UOdgDAL zF07HEFGTwbRJhS/98GEDU37kQ6DNyc37EczxmVBuQTuc7Dsq8qrcsC8kX4cwAhdr2xB x39w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=tghE4i6NJ2j3XghH+b9Dex94FfLzA+3jZKxDpUWuBCU=; b=o+kp4lyiZUvWDzuz9o58SXM1tRim2F2mgWTEbuwUc/gBW/ByAecDtczM/GafxiZnT4 i4d5cwClPB6Nb5D/Cw9VLN9d2eUe5vYtxfyYEiNV5/0t4SXdKMulmkdDygiaMJd5vabK 7GfKoOIYry4fzeQ0D6oIb1hzjRHz1yh6pLUaXJJ/cOxmespvZa0ejptuIZ4naBFNn1ae 0HDYQT9hU0sRsgGPK0kf2PG7O0tm4qQg8XdL2vLhlnb5D91aD4gnwDEH24WJijYbD5VY tWtx3+WVWgtHF5mJRk932zepfsd/uUtOXFned6iUUvkXWp3xxKRNzHV2bQUd56r7qf/4 x1rg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si5921840pgq.187.2019.05.31.05.27.38; Fri, 31 May 2019 05:27:55 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727339AbfEaMZR (ORCPT + 99 others); Fri, 31 May 2019 08:25:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:33508 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726330AbfEaMZR (ORCPT ); Fri, 31 May 2019 08:25:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 42AA4AD76; Fri, 31 May 2019 12:25:16 +0000 (UTC) Date: Fri, 31 May 2019 14:25:15 +0200 (CEST) From: Miroslav Benes To: Petr Mladek cc: Jiri Kosina , Josh Poimboeuf , 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() In-Reply-To: <20190531074147.27616-2-pmladek@suse.com> Message-ID: References: <20190531074147.27616-1-pmladek@suse.com> <20190531074147.27616-2-pmladek@suse.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Miroslav