Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp623644yba; Thu, 18 Apr 2019 07:02:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4xrOKXzIZH5ghpkQwXzJ0JjBA06mfB5twFesocC1wTfm4jnBQHqB2U3iDyxUG1Y2f39Fd X-Received: by 2002:a63:3fc3:: with SMTP id m186mr91448942pga.151.1555596153016; Thu, 18 Apr 2019 07:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555596153; cv=none; d=google.com; s=arc-20160816; b=EjeZ1/eFiORVKXPmCDm1+a5g2De89LOEL5enND21u7ucxfpZHAdipyXSozcknOd2ae ePRb+wWfjmBM8O3+6U9b4Qk912rIXZ16kbZnuohyUAtT/PJk/442pDyoTTjauhCn+Ld7 A1BkVDgj6hlPaA+uJi9lva3xZ+Gl3fNRhZ+obKdEb8VJ0pd7VR24EKt6NBs5R1oDQAZb uqOhgwXuLgSgTGiT7ucE1Tsh6gRADPQJB0vaG9wz+w6fCYYcllpx4OvQAjQzxai5Irvk tCs3wmf5yQnnchHf6vX0TLAuG1SbkW6iyHyILWazUXTtpps2YfeUUyD1J9gMjNmryrIM WkXw== 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=ONd7W8X+X4DACe10wlch8gjqcIyUFEdZPctXkpBwAeg=; b=X7I56Tyo74DSn5IgFK0CGY57DI5PTgKxTrm09lGjkxV6OxyLFsdOjIwb8GHiWtdRvc qt2Js0KQOmKCHp5VhUglWSKu17CPA8xcAN0DUP2QmkPviaP9i0u1zAKzzWbTf6B3zGXq pyX3FVSjpecDzSBjj86CWkgt3aHaiU5N19mcXvYOyILSd8yTg87TcevYS4JrLKl31VDs 1ipBY8sNgUAaeVt/UfSZNuQPal727JoIc8AojseRsrH4TvrM9ImX+y+Iy7Zt1HH60ND6 3fFWro/hQ9KkkT5cjRps5wz/xSJNP85RxbABgTifwoyHd0kJoSsvv/ldjeEPR/M03Mr4 SHgg== 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 h35si2209486plb.305.2019.04.18.07.02.11; Thu, 18 Apr 2019 07:02:33 -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 S2389069AbfDRN7F (ORCPT + 99 others); Thu, 18 Apr 2019 09:59:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729331AbfDRN7F (ORCPT ); Thu, 18 Apr 2019 09:59:05 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0345307DAB7; Thu, 18 Apr 2019 13:59:04 +0000 (UTC) Received: from treble (ovpn-124-190.rdu2.redhat.com [10.10.124.190]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A72B65C205; Thu, 18 Apr 2019 13:59:00 +0000 (UTC) Date: Thu, 18 Apr 2019 08:58:58 -0500 From: Josh Poimboeuf To: Petr Mladek Cc: Jiri Kosina , Miroslav Benes , 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 Message-ID: <20190418135858.n3lzq2oxkj52m6bi@treble> References: <20190418112936.13295-1-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190418112936.13295-1-pmladek@suse.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 18 Apr 2019 13:59:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Josh