Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2647098imj; Mon, 11 Feb 2019 06:25:41 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia5jtteMGwgKsGmhlcBDi9eAPYuIejly5Xrr6bSZHHy4YXHUDqu3B/JsXBSN7AnE82bPJ6s X-Received: by 2002:a17:902:b494:: with SMTP id y20mr38520181plr.178.1549895141675; Mon, 11 Feb 2019 06:25:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895141; cv=none; d=google.com; s=arc-20160816; b=lHIzecntCd95Ol+ZtUjp/ORvsGxlXn34nl8h/kXLW4u3UsiyCR10rQXVKx3o3nTqy+ a9ctrDA9aGEaV+EjfJANBahAR3C4dkVrE6dE9GrIvdUhwBAH9i3haA5LZFbXX3faq1qX 35Uh4F0GACSUuN4uD3+/tRlZBERWSOofdHE/I0D3dl6Ee9CKAswaD7qL8y8pCm1x4sJQ LMiYhKjejeISkO6Gmp7KYPEv5eAUEdwirtOuvTq2u+aB6ep9sk/Sf/SUkU+HokPd6vAD ozQjaMoLu/rUxcskGP8oALPrXZKsozGYCpaBxiTb2jF9YkMPRML+QfbTzmDnqwJwoeRI fyFA== 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=CPYH8pn29gzxjsBD+qbyi4VW7fYbuIx3jtoc2L3DPck=; b=TQ7saPU11ilP3kvUay0dCdRkI3Nu0a2QcjD2tk1Cl4lkfFHAQbB8AkdZjR/LudmemG yUXnMBD3Plv0V/4Zk8x2qbeG5afwoHKpaPnGwk71AAM8MCHLbWj3dzFIBKtvaBLhN7Sk meHtF06+BjV4FS5gUioR4lQguyvctkuNjQ6u635JqtQurY9RtxWfpmYy/+hzAK3zZkGo 4IHi4CkcmGcyt7IULqQid5zaSI2JX5XXOyvb4rQ5KX6PwO1eIXFSVwS8Q5nlJ4D0WVOl 41Y9W7MvEjZLc5a2BCwwak/yg9wD90DjSwWAkBGPkWJLTKp/6Iid4SJGXQWvnw722GtX lybw== 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 f17si435716pff.171.2019.02.11.06.25.25; Mon, 11 Feb 2019 06:25:41 -0800 (PST) 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 S1727411AbfBKOIS (ORCPT + 99 others); Mon, 11 Feb 2019 09:08:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46742 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727327AbfBKOIQ (ORCPT ); Mon, 11 Feb 2019 09:08:16 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 71187811D6; Mon, 11 Feb 2019 14:08:16 +0000 (UTC) Received: from treble (ovpn-121-194.rdu2.redhat.com [10.10.121.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F60163BAF; Mon, 11 Feb 2019 14:08:15 +0000 (UTC) Date: Mon, 11 Feb 2019 08:08:13 -0600 From: Josh Poimboeuf To: Kamalesh Babulal Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes , Petr Mladek , Jiri Kosina Subject: Re: [PATCH] livepatch: Enforce reliable stack trace as config dependency Message-ID: <20190211140813.z7kap634gz3gp6a4@treble> References: <20190209091728.23046-1-kamalesh@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190209091728.23046-1-kamalesh@linux.vnet.ibm.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 11 Feb 2019 14:08:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 09, 2019 at 02:47:28PM +0530, Kamalesh Babulal wrote: > While the consistency model was introduced, architectures without the > reliable stack trace implementation could use the immediate flag for > livepatching but with its own limitations. > > After removal of the immediate flag by commit d0807da78e11 > ("livepatch: Remove immediate feature"), reliable stack trace became > enforcing dependency for livepatch support on any architecture. In > the current code, we ensure that the dependency is met when > enabling the patch during the module load. > > This dependency check can be improved by moving it to the Kconfig, > which disables the support for livepatching in the kernel for unmet > dependencies. This patch moves both HAVE_RELIABLE_STACKTRACE and > STACKTRACE under config LIVEPATCH, it also removes the > klp_have_reliable_stack() function. > > Loading a livepatching module on an architecture where reliable > stack trace is yet to be implemented, the user should see: > > insmod: ERROR: could not insert module ./livepatch-sample.ko: Invalid module format > > ... > [ 286.453463] livepatch_sample: module is marked as livepatch module, but livepatch support is disabled Wouldn't the module fail to build in the first place, since CONFIG_LIVEPATCH is disabled? Anyway, I'm not sure about this approach. This patch makes the s390 livepatch code no longer compilable, turning it into completely dead code. So if something changes in the s390 code which causes it to stop compiling, nobody will notice. I think I'd rather go in the opposite direction: allow the patches to be loaded. Then they can be forced, if needed. That enables both compile and runtime testing. That way we don't make any backward progress, until such arches get reliable stacktraces. -- Josh