kprobes: trivial cleanups
cover kprobes: trivial cleanups
Hi,
Here are two trivial cleanups. Both may make no actual meaningful changes, just clarify what is needed.
- [1/2] Remove unneeded dependency of CONFIG_HAVE_KRETPROBES on arm64
- [2/2] Use hlist_for_each_entry() for non-modify loop.
Thank you,
---
Masami Hiramatsu (2):
arm64: kprobes: Remove redundant dependency in Kconfig
kprobes: x86: Use hlist_for_each_entry() for first loop
arch/arm64/Kconfig | 2 +- arch/x86/kernel/kprobes/core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
--
Masami Hiramatsu
PATCH 1/2 arm64: kprobes: Remove redundant dependency in Kconfig
Remove redundant dependency of HAVE_KRETPROBES to HAVE_KPROBES in arm64 Kconfig. Since HAVE_KPROBES always selected above line, we don't have to check it at HAVE_KRETPROBES.
--- arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/Kconfig +1 -1
@@ -96,7 +96,7 @@ config ARM64 select HAVE_RCU_TABLE_FREE select HAVE_SYSCALL_TRACEPOINTS select HAVE_KPROBES - select HAVE_KRETPROBES if HAVE_KPROBES + select HAVE_KRETPROBES select IOMMU_DMA if IOMMU_SUPPORT select IRQ_DOMAIN select IRQ_FORCED_THREADING
tip-bot for Masami Hiramatsu
merge bot[tip:perf/core] kprobes/arm64: Remove a redundant dependency from the Kconfig
kprobes/arm64: Remove a redundant dependency from the Kconfig
Commit-ID: cd1ee3b1e30b4c6c0858e0c0b4ca1b4d86020ada Gitweb: http://git.kernel.org/tip/cd1ee3b1e30b4c6c0858e0c0b4ca1b4d86020ada Author: Masami Hiramatsu <[email protected]> AuthorDate: Mon, 6 Feb 2017 18:54:33 +0900 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 6 Feb 2017 11:07:06 +0100
kprobes/arm64: Remove a redundant dependency from the Kconfig
Remove the 'HAVE_KPROBES' dependency from the HAVE_KRETPROBES line, since HAVE_KPROBES is already selected unconditionally in the Kconfig line above this one.
--- arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/Kconfig +1 -1
@@ -96,7 +96,7 @@ config ARM64 select HAVE_RCU_TABLE_FREE select HAVE_SYSCALL_TRACEPOINTS select HAVE_KPROBES - select HAVE_KRETPROBES if HAVE_KPROBES + select HAVE_KRETPROBES select IOMMU_DMA if IOMMU_SUPPORT select IRQ_DOMAIN select IRQ_FORCED_THREADING
PATCH 2/2 kprobes: x86: Use hlist_for_each_entry() for first loop
In reply to Masami HiramatsuUse hlist_for_each_entry() for first loop on kretprobe trampoline_handler because it doesn't change the hlist.
--- arch/x86/kernel/kprobes/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kprobes/core.c +1 -1
@@ -745,7 +745,7 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)* will be the real return address, and all the rest will * point to kretprobe_trampoline. */ -hlist_for_each_entry_safe (ri, tmp, head, hlist) { +hlist_for_each_entry (ri, head, hlist) {if (ri->task != current)/* another task is sharing our hash bucket */ continue ;
tip-bot for Masami Hiramatsu
merge bot[tip:perf/core] kprobes/x86: Use hlist_for_each_entry() instead of hlist_for_each_entry_safe()
kprobes/x86: Use hlist_for_each_entry() instead of hlist_for_each_entry_safe()
Commit-ID: b6263178b8dbd9fe70d55f136c2a1da39309520e Gitweb: http://git.kernel.org/tip/b6263178b8dbd9fe70d55f136c2a1da39309520e Author: Masami Hiramatsu <[email protected]> AuthorDate: Mon, 6 Feb 2017 18:55:43 +0900 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 6 Feb 2017 11:07:07 +0100
kprobes/x86: Use hlist_for_each_entry() instead of hlist_for_each_entry_safe()
Use hlist_for_each_entry() in the first loop in the kretprobe trampoline_handler() function, because it doesn't change the hlist.
--- arch/x86/kernel/kprobes/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kprobes/core.c +1 -1
@@ -745,7 +745,7 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)* will be the real return address, and all the rest will * point to kretprobe_trampoline. */ -hlist_for_each_entry_safe (ri, tmp, head, hlist) { +hlist_for_each_entry (ri, head, hlist) {if (ri->task != current)/* another task is sharing our hash bucket */ continue ;