* [PATCH 0/2] Clean up uprobes for MIPS
@ 2023-04-11 7:17 Tiezhu Yang
2023-04-11 7:17 ` [PATCH 1/2] MIPS: Use def_bool y for ARCH_SUPPORTS_UPROBES Tiezhu Yang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tiezhu Yang @ 2023-04-11 7:17 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel, loongson-kernel
When I read uprobes code of all archs, I found that some code for MIPS
is useless, so do some cleanups.
Tiezhu Yang (2):
MIPS: Use def_bool y for ARCH_SUPPORTS_UPROBES
MIPS: Remove set_swbp() in uprobes.c
arch/mips/Kconfig | 3 +--
arch/mips/kernel/uprobes.c | 18 ------------------
2 files changed, 1 insertion(+), 20 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] MIPS: Use def_bool y for ARCH_SUPPORTS_UPROBES
2023-04-11 7:17 [PATCH 0/2] Clean up uprobes for MIPS Tiezhu Yang
@ 2023-04-11 7:17 ` Tiezhu Yang
2023-04-11 7:17 ` [PATCH 2/2] MIPS: Remove set_swbp() in uprobes.c Tiezhu Yang
2023-04-12 13:32 ` [PATCH 0/2] Clean up uprobes for MIPS Thomas Bogendoerfer
2 siblings, 0 replies; 4+ messages in thread
From: Tiezhu Yang @ 2023-04-11 7:17 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel, loongson-kernel
Like all the other archs, use def_bool y for ARCH_SUPPORTS_UPROBES,
then no need to select ARCH_SUPPORTS_UPROBES.
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
arch/mips/Kconfig | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index a975f14..db9e8fc 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -16,7 +16,6 @@ config MIPS
select ARCH_HAS_UBSAN_SANITIZE_ALL
select ARCH_HAS_GCOV_PROFILE_ALL
select ARCH_KEEP_MEMBLOCK
- select ARCH_SUPPORTS_UPROBES
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
select ARCH_USE_MEMTEST
@@ -1060,7 +1059,7 @@ config FW_CFE
bool
config ARCH_SUPPORTS_UPROBES
- bool
+ def_bool y
config DMA_NONCOHERENT
bool
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] MIPS: Remove set_swbp() in uprobes.c
2023-04-11 7:17 [PATCH 0/2] Clean up uprobes for MIPS Tiezhu Yang
2023-04-11 7:17 ` [PATCH 1/2] MIPS: Use def_bool y for ARCH_SUPPORTS_UPROBES Tiezhu Yang
@ 2023-04-11 7:17 ` Tiezhu Yang
2023-04-12 13:32 ` [PATCH 0/2] Clean up uprobes for MIPS Thomas Bogendoerfer
2 siblings, 0 replies; 4+ messages in thread
From: Tiezhu Yang @ 2023-04-11 7:17 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel, loongson-kernel
set_swbp() in arch/mips/kernel/uprobes.c is same with the weak version
in kernel/events/uprobes.c, remove it.
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
arch/mips/kernel/uprobes.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c
index 6c063aa..6b630ed 100644
--- a/arch/mips/kernel/uprobes.c
+++ b/arch/mips/kernel/uprobes.c
@@ -207,24 +207,6 @@ unsigned long arch_uretprobe_hijack_return_addr(
return ra;
}
-/**
- * set_swbp - store breakpoint at a given address.
- * @auprobe: arch specific probepoint information.
- * @mm: the probed process address space.
- * @vaddr: the virtual address to insert the opcode.
- *
- * For mm @mm, store the breakpoint instruction at @vaddr.
- * Return 0 (success) or a negative errno.
- *
- * This version overrides the weak version in kernel/events/uprobes.c.
- * It is required to handle MIPS16 and microMIPS.
- */
-int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm,
- unsigned long vaddr)
-{
- return uprobe_write_opcode(auprobe, mm, vaddr, UPROBE_SWBP_INSN);
-}
-
void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
void *src, unsigned long len)
{
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Clean up uprobes for MIPS
2023-04-11 7:17 [PATCH 0/2] Clean up uprobes for MIPS Tiezhu Yang
2023-04-11 7:17 ` [PATCH 1/2] MIPS: Use def_bool y for ARCH_SUPPORTS_UPROBES Tiezhu Yang
2023-04-11 7:17 ` [PATCH 2/2] MIPS: Remove set_swbp() in uprobes.c Tiezhu Yang
@ 2023-04-12 13:32 ` Thomas Bogendoerfer
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 2023-04-12 13:32 UTC (permalink / raw)
To: Tiezhu Yang; +Cc: linux-mips, linux-kernel, loongson-kernel
On Tue, Apr 11, 2023 at 03:17:46PM +0800, Tiezhu Yang wrote:
> When I read uprobes code of all archs, I found that some code for MIPS
> is useless, so do some cleanups.
>
> Tiezhu Yang (2):
> MIPS: Use def_bool y for ARCH_SUPPORTS_UPROBES
> MIPS: Remove set_swbp() in uprobes.c
>
> arch/mips/Kconfig | 3 +--
> arch/mips/kernel/uprobes.c | 18 ------------------
> 2 files changed, 1 insertion(+), 20 deletions(-)
series applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-12 13:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-11 7:17 [PATCH 0/2] Clean up uprobes for MIPS Tiezhu Yang
2023-04-11 7:17 ` [PATCH 1/2] MIPS: Use def_bool y for ARCH_SUPPORTS_UPROBES Tiezhu Yang
2023-04-11 7:17 ` [PATCH 2/2] MIPS: Remove set_swbp() in uprobes.c Tiezhu Yang
2023-04-12 13:32 ` [PATCH 0/2] Clean up uprobes for MIPS Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®