Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3331013yba; Tue, 23 Apr 2019 01:44:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzl+gc+43sSE2TmlS6WA2uQ5sxbN0GiF+vVJ13sz49LTAJPS0bjxs0pUHIxo5kVjrfmLnWq X-Received: by 2002:a17:902:505:: with SMTP id 5mr12146247plf.323.1556009047425; Tue, 23 Apr 2019 01:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556009047; cv=none; d=google.com; s=arc-20160816; b=ya6K+FUzv0sob0RFO3asBRVV4qUMAG+HU32UZKGoKp12Qq2NIiIDX+dl+YeEoSSc0k RCgbvolPWfLuvxvFtBBObNkLhkoOE1CU2P5s66b52n4B2znhl/KbrlDh2jeyZAol4cHM jeKo7/SvHcdwfONlwB7c3z6d+CGsLjlqRrUML4waNsS7Pa9xaGDENK/aCQybYo5uOpcr UI2Mv9WYbK4lirUYrdaQ28yhzYl+x7gi69iLfUDPicxCzDIrtEkCZM6dDG5qJqQ78SDt xtoO4Ez5k65HfnYu4tuN9Nl3lnEIIlqAohIlduK9u94Q5eqn8pDFYzdHEdhKzl3yMl7c RZeQ== 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=sfunMmRd24m/wGzaZDo+Kn3Cr0JG1J+lauIAAH0CZmE=; b=g0GoaeHUQaLA9uzxX94qd8P64bmT5uy3WOX1NS9tVA4te3A+ZfIwQj+I8L7m+daFdi Y/UwSvS/qWcNBCzME97AfaLk9pcMxtgCu1AvRarsRBEPbjFEezauWnLVvbV7TBFVquIn ShLYqmSqP0SIAHIPav+r3PtMWCuNxHiAfevx9ym/40c1f9sv0Qsy6v2BWN+SBifKNmv2 qTVtIjibAidnou/J4tqaekEnqi9NeQ0HM0n9PcFp/diVvAhui9WHg0DANVPcBBGrWzPy 2DMkKJB05faI4rThSYihREVHIQAJrvtvf4TRMc3CMDW1JLleghIGgX5hyh+bKE09BZGc MLTA== 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 j70si10254254pgd.365.2019.04.23.01.43.52; Tue, 23 Apr 2019 01:44:07 -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 S1726754AbfDWIma (ORCPT + 99 others); Tue, 23 Apr 2019 04:42:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:49580 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725946AbfDWIma (ORCPT ); Tue, 23 Apr 2019 04:42:30 -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 2AE73ACAC; Tue, 23 Apr 2019 08:42:29 +0000 (UTC) Date: Tue, 23 Apr 2019 10:42:28 +0200 (CEST) From: Miroslav Benes To: Josh Poimboeuf cc: Petr Mladek , Jiri Kosina , Kamalesh Babulal , Joe Lawrence , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] livepatch: Convert error about unsupported reliable stacktrace into a warning In-Reply-To: <20190418135858.n3lzq2oxkj52m6bi@treble> Message-ID: References: <20190418112936.13295-1-pmladek@suse.com> <20190418135858.n3lzq2oxkj52m6bi@treble> 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 Thu, 18 Apr 2019, Josh Poimboeuf wrote: > On Thu, Apr 18, 2019 at 01:29:36PM +0200, Petr Mladek wrote: > > The commit d0807da78e11d46f ("livepatch: Remove immediate feature") caused > > that any livepatch was refused when reliable stacktraces were not supported > > on the given architecture. > > > > The limitation is too strong. User space processes are safely migrated > > even when entering or leaving the kernel. Kthreads transition would > > need to get forced. But it is safe when: > > > > + The livepatch does not change the semantic of the code. > > + Callbacks do not depend on a safely finished transition. > > > > Suggested-by: Josh Poimboeuf > > Signed-off-by: Petr Mladek > > --- > > kernel/livepatch/core.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > > index eb0ee10a1981..14f33ab6c583 100644 > > --- a/kernel/livepatch/core.c > > +++ b/kernel/livepatch/core.c > > @@ -1003,11 +1003,10 @@ int klp_enable_patch(struct klp_patch *patch) > > return -ENODEV; > > > > if (!klp_have_reliable_stack()) { > > - pr_err("This architecture doesn't have support for the livepatch consistency model.\n"); > > - return -EOPNOTSUPP; > > + pr_warn("This architecture doesn't have support for the livepatch consistency model.\n"); > > + pr_warn("The livepatch transition may never complete.\n"); > > } > > > > - > > mutex_lock(&klp_mutex); > > > > ret = klp_init_patch_early(patch); > > Thanks Petr. I would also suggest that we remove the WARN_ONCE() from > the weak version of save_stack_trace_tsk_reliable(), since we expect it > to be used in this case. Moreover, we have WARN_ON_ONCE(ret == -ENOSYS) in klp_check_stack() where save_stack_trace_tsk_reliable() is called. Miroslav