From: Yafang Shao <laoar.shao@gmail.com>
To: jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz,
pmladek@suse.com, joe.lawrence@redhat.com, song@kernel.org
Cc: live-patching@vger.kernel.org, Yafang Shao <laoar.shao@gmail.com>,
Wardenjohn <zhangwarden@gmail.com>
Subject: [PATCH v7 for-next 4/8] livepatch: Deprecate stack_order
Date: Tue, 25 Aug 2026 19:46:37 +0800 [thread overview]
Message-ID: <20260825114641.80452-5-laoar.shao@gmail.com> (raw)
In-Reply-To: <20260825114641.80452-1-laoar.shao@gmail.com>
stack_order is no longer needed for atomic-replace livepatches, as a
single function can only be modified by a unique replace_set.
Since this livepatch sysfs interface is mainly intended for kernel
developers, backward compatibility does not need to be maintained.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Cc: Wardenjohn <zhangwarden@gmail.com>
Acked-by: Song Liu <song@kernel.org>
---
.../ABI/removed/sysfs-kernel-livepatch | 16 +++++++++++++
.../ABI/testing/sysfs-kernel-livepatch | 9 -------
kernel/livepatch/core.c | 24 -------------------
3 files changed, 16 insertions(+), 33 deletions(-)
create mode 100644 Documentation/ABI/removed/sysfs-kernel-livepatch
diff --git a/Documentation/ABI/removed/sysfs-kernel-livepatch b/Documentation/ABI/removed/sysfs-kernel-livepatch
new file mode 100644
index 000000000000..fb6ff9c3b43e
--- /dev/null
+++ b/Documentation/ABI/removed/sysfs-kernel-livepatch
@@ -0,0 +1,16 @@
+What: /sys/kernel/livepatch/<patch>/replace
+Date: Jun 2024
+KernelVersion: 6.11.0
+Contact: live-patching@vger.kernel.org
+Description:
+ An attribute which indicates whether the patch supports
+ atomic-replace.
+
+What: /sys/kernel/livepatch/<patch>/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 2588f676deb1..3564b3e4385f 100644
--- a/Documentation/ABI/testing/sysfs-kernel-livepatch
+++ b/Documentation/ABI/testing/sysfs-kernel-livepatch
@@ -67,15 +67,6 @@ Description:
either this patch's provides id or any id in the obsoletes
list will be atomically replaced.
-What: /sys/kernel/livepatch/<patch>/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/<patch>/<object>
Date: Nov 2014
KernelVersion: 3.19.0
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index 81e9d7aa1de7..27f3891176dd 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/<patch>/force
* /sys/kernel/livepatch/<patch>/provides
* /sys/kernel/livepatch/<patch>/obsoletes
- * /sys/kernel/livepatch/<patch>/stack_order
* /sys/kernel/livepatch/<patch>/<object>
* /sys/kernel/livepatch/<patch>/<object>/patched
* /sys/kernel/livepatch/<patch>/<object>/<function,sympos>
@@ -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);
--
2.52.0
next prev parent reply other threads:[~2026-08-25 11:47 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 11:46 [PATCH v7 for-next 0/8] livepatch: Introduce replace set support Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 1/8] livepatch: Make klp_find_func() non static Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 2/8] livepatch: Call klp_init_patch_early() earlier Yafang Shao
2026-08-25 12:06 ` sashiko-bot
2026-08-25 12:11 ` Yafang Shao
2026-08-27 23:57 ` Josh Poimboeuf
2026-08-28 2:24 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 3/8] livepatch: Implement replace set for scoped atomic replace Yafang Shao
2026-08-25 11:59 ` sashiko-bot
2026-08-25 12:10 ` Yafang Shao
2026-08-28 0:26 ` Josh Poimboeuf
2026-08-28 3:03 ` Yafang Shao
2026-08-28 3:39 ` Josh Poimboeuf
2026-08-28 5:42 ` Yafang Shao
2026-09-02 7:31 ` Replace rules: was: " Petr Mladek
2026-09-02 9:40 ` Yafang Shao
2026-09-02 11:50 ` Yafang Shao
2026-09-03 10:01 ` Petr Mladek
2026-09-06 2:58 ` Yafang Shao
2026-09-03 9:27 ` Petr Mladek
2026-09-03 21:18 ` Song Liu
2026-09-06 8:34 ` Yafang Shao
2026-09-02 7:34 ` documentation: " Petr Mladek
2026-09-02 9:50 ` Yafang Shao
2026-09-03 7:30 ` Petr Mladek
2026-09-02 7:37 ` code cleanup: " Petr Mladek
2026-09-02 9:52 ` Yafang Shao
2026-08-25 11:46 ` Yafang Shao [this message]
2026-08-28 0:29 ` [PATCH v7 for-next 4/8] livepatch: Deprecate stack_order Josh Poimboeuf
2026-08-28 3:14 ` Yafang Shao
2026-09-02 12:01 ` Petr Mladek
2026-09-02 12:20 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 5/8] selftests/livepatch: Adapt atomic replace tests to provides/obsoletes Yafang Shao
2026-08-28 0:31 ` Josh Poimboeuf
2026-08-28 3:56 ` Yafang Shao
2026-09-02 13:45 ` Petr Mladek
2026-09-03 3:23 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 6/8] selftests/livepatch: Add provides/obsoletes test scenarios Yafang Shao
2026-09-02 15:15 ` Petr Mladek
2026-09-03 5:43 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 7/8] selftests/livepatch: Add test for state ID conflict across provides Yafang Shao
2026-09-02 15:25 ` Petr Mladek
2026-09-03 5:44 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 8/8] selftests/livepatch: Add test for function " Yafang Shao
2026-09-02 15:51 ` Petr Mladek
2026-09-03 5:48 ` Yafang Shao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260825114641.80452-5-laoar.shao@gmail.com \
--to=laoar.shao@gmail.com \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=pmladek@suse.com \
--cc=song@kernel.org \
--cc=zhangwarden@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox