From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793021863; b=VUPgWGbnlGooVuGY+K4t95JParblb36QPYW55CHhSWz74wth8Ner+J23hLaNTdb1vVEh 4wKEutPyO/4vLmNGk54oatMy/v+IWiL+mkIV1mvN2W1s1Yzq1LncNEZ52DBmxGpsSduzX miWrUF7fsulW5T1ny6hGJLgJZRSIaZtq3CvaPqMYH9Zwax0Q4hM3t0US/br1mAl+6urPh taxVYZmKn9/nFPEny0TtbJowgL8YqI+cb7i6XU7xe+RTCzhcnSAMyfESjDq01KyMxpKS5 eR/9uX6tsBheOU4cjIGamzf6jCunVe+bF5D2d1w72U9Jy4BszgXcy1hBZkNKYophiwQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793021863; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=Zj/SBhcU/0vQOmGdEfKAA4zUgU2LezMwuTeWXZs3f3g=; b=XKvfuGWr6M5f4WXutLGht7NbQ7vY3fh+qG7cvWJTSXTxhBNNKdqGWwEH3MzLPjfKiRB9 FadnYfoRK3sdUHkC1fxEuCqIGquBzU71Sn14EXgtfDKo4MN82qi1fQfLeJwdlIaQW+4o0 6JT+AOF5qcpv9aRqTNdxR+t6qGQcfwVXBocn/EN9GSRIxacHoJCyCZOf+JOhoqHbRwhKm GBgYyOdKCh+nEmw67IyI1u3Ktdou154vPyWFYaLnJNi42Ij30ZmA+LgAPbFiEWW584dXZ Ez37VC9Kh2ISQqUBTZmjzstcSdwumEys/06Fy5S41fjLrhsfKVa9HZITOVszUD4wfBg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=T4sUtB9k; arc=none smtp.remote-ip=209.85.214.175 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D4886072CF2 for ; Mon, 26 Oct 2026 13:37:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6D4886072CF2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=T4sUtB9k Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2e9f6a16aedso20229065ad.2 for ; Mon, 26 Oct 2026 06:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1793021863; x=1793626663; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Zj/SBhcU/0vQOmGdEfKAA4zUgU2LezMwuTeWXZs3f3g=; b=T4sUtB9kLzkCZ15+d9BcQMFQ72oayD3YrxwYB5DvTqMOkgURlyiatbwjaa2q33NP0y d3aWlFPdZ+7mqB/D7K3i46mAVHFH90QaP9WgCtBoJ1HiedD8jlp780Z2uhQcZq7CJkqV tYUzr9KRQkaTUJPeI6DCKe8cjOj2mtQs7cg91Ey1WTLmsfr9LMS8cLUStbyVeO6Ha+eR nA1X9mmdL/xgi/v8XtjPlSK+vuwDgatxWQCYeRlFBhy+xxxlqy4tXpeRzY5SA65zX4jI KGp7oDyFB4pdJhrxKIC5m9/jzIJ8Vmq0j3jjDGWZUkG17eb4PYknYiLmOeR1Wd6Pp/Cv HCAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793021863; x=1793626663; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Zj/SBhcU/0vQOmGdEfKAA4zUgU2LezMwuTeWXZs3f3g=; b=SbcT9mgdeVleTK1vaq+GPCsDNLVU1S4nyk+ZVuFb0N3D9FzClt+O1fvaiBk7gYuZUG WDjzZKSz6fsjJe3C3y8C2KJo25mM2Bvmn1tYP72ISSSnuqvKVBT7efWH8QPk4hWxQ9gd jXaESRENspkze+iLTVMzueKBejhu6QUBUJQxXgpak4oRiATI7qfIRcLXranU+aQ5F1cD CKTwJvu6MW7/JxHOKUzWG6dsSqXt7b8bLG0OcDb4yoIvcbyuNVqWzOvF9RE23CVJNW9k Ha1QGlu4LSdbeElncoQbNoUFhSSAM5I/2RFvUeozwBlyh1oEXeOqdQaCea7q9b+roZli uu4A== X-Forwarded-Encrypted: i=1; AKwUvByYbg+fEmDT6DvGxpPEWDXohyKzeDP5hJ7wGZBWvo43pGVDzXIXMLtxbbx5YxezBXY/K3rb4ewnvF75uIc=@vger.kernel.org X-Gm-Message-State: AFq9FYKdG2zJ6FF6VtNT6C1079c3DmIrZe1GlmT1GKjQXl87n9+dg16E RugErd9u8M2nYLDg6DsbnuR+zjTcvVoPsCdhHd9uuyB/OJZGJU1HqFKL X-Gm-Gg: AYBFou138oBybgI4dYDfSamWtrei6jrWHPBHkyfSxqxR09Kh95HFiVYHK4N8xsXI3cN K8Q4YciRhAB6xickyFR95vNzu8Qxkk0tqFX4ck/Wm1ymQDBarADlIYz9Cd2Pb7E8a9chRCPP1X0 AkrqXZgZbq9ibg1l+jtQpZm8WcTSygkhAInihSVAJ0Qm6LwyNfTC10JN8+a6t8HGmKie5CESJiA W20Z0y0uHpafC/NG3+ebp8SuIQ9ZfmYdVSdHoYYDuGBXPS8DIYyeKS17SDbQaSIlsGXKuKOe3D7 pDnRQaUrIdvOfrZdjthnedb0oAFY9jEvdwBU+qmAA3MxZpHWWs242SELl/6HFQLJWjgdrO0PtWa K8clroFn4qT+P1jKR5DDL2Q7ShRkt0YRU8O32UpsQgmyCmJ+OOyRoKfvwUQ1IfEHEkZ29cF5zkD GNw7Ak63u79TWmo6KJJgwwk1WxrMQMap/c0idPJqsN0DRIZ+8a36FNS1yFXs6YiClfBnZr6fi/M 9ukQ6MmHoKqSJwl3TVdqYaztWf4ctmKQw/vC0v7VblEpyoJcIkpnicK0wpxWYKZ/+FHTxnfVSTn iL6izMYRsLHdPyfwve9Svh+PYxHnrW7L8BqtUw== X-Received: by 2002:a17:902:d551:b0:2e9:4b32:fc6c with SMTP id d9443c01a7336-2ea9c69f27dmr59088565ad.26.1793021862714; Mon, 26 Oct 2026 06:37:42 -0700 (PDT) Received: from yafangs-Air ([240e:46d:2600:484d:51ee:4f49:b5a8:aabd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ea9b1a5cf0sm17447055ad.52.2026.10.26.06.37.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Oct 2026 06:37:42 -0700 (PDT) From: Yafang Shao To: jpoimboe@kernel.org, mbenes@suse.cz, pmladek@suse.com, joe.lawrence@redhat.com, song@kernel.org Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao , Wardenjohn Subject: [PATCH v13 6/9] livepatch: Deprecate stack_order Date: Mon, 26 Oct 2026 21:36:48 +0800 Message-ID: <20261026133651.40061-7-laoar.shao@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20261026133651.40061-1-laoar.shao@gmail.com> References: <20261026133651.40061-1-laoar.shao@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The stack_order sysfs attribute was added to determine which active livepatch is used for a given function. It is no longer needed because recent changes refuse loading another livepatch which would modify an already livepatched function unless the new livepatch would replace the conflicting one. [Commit message authored by Petr.] Signed-off-by: Yafang Shao Acked-by: Song Liu Acked-by: Miroslav Benes Reviewed-by: Petr Mladek Tested-by: Petr Mladek Cc: Wardenjohn --- Documentation/ABI/removed/sysfs-kernel-livepatch | 9 +++++++++ Documentation/ABI/testing/sysfs-kernel-livepatch | 9 --------- kernel/livepatch/core.c | 24 ------------------------ 3 files changed, 9 insertions(+), 33 deletions(-) diff --git a/Documentation/ABI/removed/sysfs-kernel-livepatch b/Documentation/ABI/removed/sysfs-kernel-livepatch index 87d57ba..f094bd1 100644 --- a/Documentation/ABI/removed/sysfs-kernel-livepatch +++ b/Documentation/ABI/removed/sysfs-kernel-livepatch @@ -5,3 +5,12 @@ Contact: live-patching@vger.kernel.org Description: An attribute which indicates whether the patch supports atomic-replace. + +What: /sys/kernel/livepatch//stack_order +Date: Jan 2025 +KernelVersion: 6.14.0 +Description: + This attribute specifies the sequence in which live patch modules + are applied to the system. If multiple live patches modify the same + function, the implementation with the biggest 'stack_order' number + is used, unless a transition is currently in progress. diff --git a/Documentation/ABI/testing/sysfs-kernel-livepatch b/Documentation/ABI/testing/sysfs-kernel-livepatch index a9d4893..b8cf1977 100644 --- a/Documentation/ABI/testing/sysfs-kernel-livepatch +++ b/Documentation/ABI/testing/sysfs-kernel-livepatch @@ -66,15 +66,6 @@ Description: loaded, any existing livepatch whose provides id matches an id in the obsoletes list will be atomically replaced. -What: /sys/kernel/livepatch//stack_order -Date: Jan 2025 -KernelVersion: 6.14.0 -Description: - This attribute specifies the sequence in which live patch modules - are applied to the system. If multiple live patches modify the same - function, the implementation with the biggest 'stack_order' number - is used, unless a transition is currently in progress. - What: /sys/kernel/livepatch// Date: Nov 2014 KernelVersion: 3.19.0 diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 62fc215..e31d011 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -352,7 +352,6 @@ int klp_apply_section_relocs(struct module *pmod, Elf_Shdr *sechdrs, * /sys/kernel/livepatch//force * /sys/kernel/livepatch//provides * /sys/kernel/livepatch//obsoletes - * /sys/kernel/livepatch//stack_order * /sys/kernel/livepatch// * /sys/kernel/livepatch///patched * /sys/kernel/livepatch/// @@ -477,40 +476,17 @@ static ssize_t obsoletes_show(struct kobject *kobj, return len; } -static ssize_t stack_order_show(struct kobject *kobj, - struct kobj_attribute *attr, char *buf) -{ - struct klp_patch *patch, *this_patch; - int stack_order = 0; - - this_patch = container_of(kobj, struct klp_patch, kobj); - - mutex_lock(&klp_mutex); - - klp_for_each_patch(patch) { - stack_order++; - if (patch == this_patch) - break; - } - - mutex_unlock(&klp_mutex); - - return sysfs_emit(buf, "%d\n", stack_order); -} - static struct kobj_attribute enabled_kobj_attr = __ATTR_RW(enabled); static struct kobj_attribute transition_kobj_attr = __ATTR_RO(transition); static struct kobj_attribute force_kobj_attr = __ATTR_WO(force); static struct kobj_attribute provides_kobj_attr = __ATTR_RO(provides); static struct kobj_attribute obsoletes_kobj_attr = __ATTR_RO(obsoletes); -static struct kobj_attribute stack_order_kobj_attr = __ATTR_RO(stack_order); static struct attribute *klp_patch_attrs[] = { &enabled_kobj_attr.attr, &transition_kobj_attr.attr, &force_kobj_attr.attr, &provides_kobj_attr.attr, &obsoletes_kobj_attr.attr, - &stack_order_kobj_attr.attr, NULL }; ATTRIBUTE_GROUPS(klp_patch); -- 1.8.3.1