Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752633AbdLHRZb (ORCPT ); Fri, 8 Dec 2017 12:25:31 -0500 Received: from mx2.suse.de ([195.135.220.15]:58289 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbdLHRZ1 (ORCPT ); Fri, 8 Dec 2017 12:25:27 -0500 From: Miroslav Benes To: jpoimboe@redhat.com, jeyu@kernel.org, jikos@kernel.org Cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, pmladek@suse.com, jbaron@akamai.com, Miroslav Benes Subject: [PATCH 2/2] livepatch: Allow loading modules on architectures without HAVE_RELIABLE_STACKTRACE Date: Fri, 8 Dec 2017 18:25:23 +0100 Message-Id: <20171208172523.12150-3-mbenes@suse.cz> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171208172523.12150-1-mbenes@suse.cz> References: <20171208172523.12150-1-mbenes@suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3491 Lines: 94 Now that immediate feature was removed, it is not possible to load livepatch modules on architectures without HAVE_RELIABLE_STACKTRACE. Fix it by removing guilty check in klp_register_patch(). The architectures without HAVE_RELIABLE_STACKTRACE will now rely only on kernelspace/userspace boundary switching, the (fake) signal and force feature. Also remove the check from all sample modules. Signed-off-by: Miroslav Benes --- kernel/livepatch/core.c | 6 ++---- samples/livepatch/livepatch-callbacks-demo.c | 3 --- samples/livepatch/livepatch-sample.c | 3 --- samples/livepatch/livepatch-shadow-fix1.c | 3 --- samples/livepatch/livepatch-shadow-fix2.c | 3 --- 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 461c0b7dc913..fa7e33aeb2a6 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -890,10 +890,8 @@ int klp_register_patch(struct klp_patch *patch) if (!klp_initialized()) return -ENODEV; - if (!klp_have_reliable_stack()) { - pr_err("This architecture doesn't have support for the livepatch consistency model.\n"); - return -ENOSYS; - } + if (!klp_have_reliable_stack()) + pr_notice("This architecture doesn't have full support for the livepatch consistency model. The transition may not finish.\n"); return klp_init_patch(patch); } diff --git a/samples/livepatch/livepatch-callbacks-demo.c b/samples/livepatch/livepatch-callbacks-demo.c index bda7f3841f3e..72f9e6d1387b 100644 --- a/samples/livepatch/livepatch-callbacks-demo.c +++ b/samples/livepatch/livepatch-callbacks-demo.c @@ -197,9 +197,6 @@ static int livepatch_callbacks_demo_init(void) { int ret; - if (!klp_have_reliable_stack()) - pr_notice("The consistency model isn't supported for your architecture. The transition may not finish.\n"); - ret = klp_register_patch(&patch); if (ret) return ret; diff --git a/samples/livepatch/livepatch-sample.c b/samples/livepatch/livepatch-sample.c index a150fca6f7cd..2d554dd930e2 100644 --- a/samples/livepatch/livepatch-sample.c +++ b/samples/livepatch/livepatch-sample.c @@ -71,9 +71,6 @@ static int livepatch_init(void) { int ret; - if (!klp_have_reliable_stack()) - pr_notice("The consistency model isn't supported for your architecture. The transition may not finish.\n"); - ret = klp_register_patch(&patch); if (ret) return ret; diff --git a/samples/livepatch/livepatch-shadow-fix1.c b/samples/livepatch/livepatch-shadow-fix1.c index 415db31aca8d..830c55514f9f 100644 --- a/samples/livepatch/livepatch-shadow-fix1.c +++ b/samples/livepatch/livepatch-shadow-fix1.c @@ -133,9 +133,6 @@ static int livepatch_shadow_fix1_init(void) { int ret; - if (!klp_have_reliable_stack()) - pr_notice("The consistency model isn't supported for your architecture. The transition may not finish.\n"); - ret = klp_register_patch(&patch); if (ret) return ret; diff --git a/samples/livepatch/livepatch-shadow-fix2.c b/samples/livepatch/livepatch-shadow-fix2.c index 04b3fe23bfd3..ff9948f0ec00 100644 --- a/samples/livepatch/livepatch-shadow-fix2.c +++ b/samples/livepatch/livepatch-shadow-fix2.c @@ -128,9 +128,6 @@ static int livepatch_shadow_fix2_init(void) { int ret; - if (!klp_have_reliable_stack()) - pr_notice("The consistency model isn't supported for your architecture. The transition may not finish.\n"); - ret = klp_register_patch(&patch); if (ret) return ret; -- 2.15.1