All of lore.kernel.org
 help / color / mirror / Atom feed
* + kallsyms-remove-arch-specific-text-and-data-check.patch added to -mm tree
@ 2021-09-30 21:21 akpm
  2021-10-01  0:47 ` Sergey Senozhatsky
  2021-10-01  1:20 ` Sergey Senozhatsky
  0 siblings, 2 replies; 4+ messages in thread
From: akpm @ 2021-09-30 21:21 UTC (permalink / raw)
  To: andreyknvl, arnd, ast, benh, bp, christophe.leroy, davem, dvyukov,
	glider, ink, mattst88, mingo, mm-commits, monstr, mpe, paulus,
	pmladek, rostedt, rth, ryabinin.a.a, senozhatsky, tglx,
	wangkefeng.wang


The patch titled
     Subject: kallsyms: remove arch specific text and data check
has been added to the -mm tree.  Its filename is
     kallsyms-remove-arch-specific-text-and-data-check.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/kallsyms-remove-arch-specific-text-and-data-check.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/kallsyms-remove-arch-specific-text-and-data-check.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: kallsyms: remove arch specific text and data check

Patch series "sections: Unify kernel sections range check and use", v4.

There are three head files(kallsyms.h, kernel.h and sections.h) which
include the kernel sections range check, let's make some cleanup and unify
them.

1. cleanup arch specific text/data check and fix address boundary check
   in kallsyms.h

2. make all the basic/core kernel range check function into sections.h

3. update all the callers, and use the helper in sections.h to simplify
   the code

After this series, we have 5 APIs about kernel sections range check in
sections.h

 * is_kernel_rodata()		--- already in sections.h
 * is_kernel_core_data()	--- come from core_kernel_data() in kernel.h
 * is_kernel_inittext()		--- come from kernel.h and kallsyms.h
 * __is_kernel_text()		--- add new internal helper
 * __is_kernel()		--- add new internal helper

Note: For the last two helpers, people should not use directly, consider to
      use corresponding function in kallsyms.h.


This patch (of 11):

Remove arch specific text and data check after commit 4ba66a976072 ("arch:
remove blackfin port"), no need arch-specific text/data check.

Link: https://lkml.kernel.org/r/20210930071143.63410-1-wangkefeng.wang@huawei.com
Link: https://lkml.kernel.org/r/20210930071143.63410-2-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/asm-generic/sections.h |   16 ----------------
 include/linux/kallsyms.h       |    3 +--
 kernel/locking/lockdep.c       |    3 ---
 3 files changed, 1 insertion(+), 21 deletions(-)

--- a/include/asm-generic/sections.h~kallsyms-remove-arch-specific-text-and-data-check
+++ a/include/asm-generic/sections.h
@@ -64,22 +64,6 @@ extern __visible const void __nosave_beg
 #define dereference_kernel_function_descriptor(p) ((void *)(p))
 #endif
 
-/* random extra sections (if any).  Override
- * in asm/sections.h */
-#ifndef arch_is_kernel_text
-static inline int arch_is_kernel_text(unsigned long addr)
-{
-	return 0;
-}
-#endif
-
-#ifndef arch_is_kernel_data
-static inline int arch_is_kernel_data(unsigned long addr)
-{
-	return 0;
-}
-#endif
-
 /**
  * memory_contains - checks if an object is contained within a memory region
  * @begin: virtual address of the beginning of the memory region
--- a/include/linux/kallsyms.h~kallsyms-remove-arch-specific-text-and-data-check
+++ a/include/linux/kallsyms.h
@@ -34,8 +34,7 @@ static inline int is_kernel_inittext(uns
 
 static inline int is_kernel_text(unsigned long addr)
 {
-	if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) ||
-	    arch_is_kernel_text(addr))
+	if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext))
 		return 1;
 	return in_gate_area_no_mm(addr);
 }
--- a/kernel/locking/lockdep.c~kallsyms-remove-arch-specific-text-and-data-check
+++ a/kernel/locking/lockdep.c
@@ -818,9 +818,6 @@ static int static_obj(const void *obj)
 	if ((addr >= start) && (addr < end))
 		return 1;
 
-	if (arch_is_kernel_data(addr))
-		return 1;
-
 	/*
 	 * in-kernel percpu var?
 	 */
_

Patches currently in -mm which might be from wangkefeng.wang@huawei.com are

slub-add-back-check-for-free-nonslab-objects.patch
mm-nommu-kill-arch_get_unmapped_area.patch
kallsyms-remove-arch-specific-text-and-data-check.patch
kallsyms-fix-address-checks-for-kernel-related-range.patch
sections-move-and-rename-core_kernel_data-to-is_kernel_core_data.patch
sections-move-is_kernel_inittext-into-sectionsh.patch
x86-mm-rename-__is_kernel_text-to-is_x86_32_kernel_text.patch
sections-provide-internal-__is_kernel-and-__is_kernel_text-helper.patch
mm-kasan-use-is_kernel-helper.patch
extable-use-is_kernel_text-helper.patch
powerpc-mm-use-core_kernel_text-helper.patch
microblaze-use-is_kernel_text-helper.patch
alpha-use-is_kernel_text-helper.patch


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: + kallsyms-remove-arch-specific-text-and-data-check.patch added to -mm tree
  2021-09-30 21:21 + kallsyms-remove-arch-specific-text-and-data-check.patch added to -mm tree akpm
@ 2021-10-01  0:47 ` Sergey Senozhatsky
  2021-10-01  0:55   ` Sergey Senozhatsky
  2021-10-01  1:20 ` Sergey Senozhatsky
  1 sibling, 1 reply; 4+ messages in thread
From: Sergey Senozhatsky @ 2021-10-01  0:47 UTC (permalink / raw)
  To: akpm
  Cc: andreyknvl, arnd, ast, benh, bp, christophe.leroy, davem, dvyukov,
	glider, ink, mattst88, mingo, mm-commits, monstr, mpe, paulus,
	pmladek, rostedt, rth, ryabinin.a.a, senozhatsky, tglx,
	wangkefeng.wang

On (21/09/30 14:21), akpm@linux-foundation.org wrote:
> +++ a/include/linux/kallsyms.h
> @@ -34,8 +34,7 @@ static inline int is_kernel_inittext(uns
>  
>  static inline int is_kernel_text(unsigned long addr)
>  {
> -	if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) ||
> -	    arch_is_kernel_text(addr))
> +	if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext))
>  		return 1;

Does this need to include _etext or should it be '< _etext'?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: + kallsyms-remove-arch-specific-text-and-data-check.patch added to -mm tree
  2021-10-01  0:47 ` Sergey Senozhatsky
@ 2021-10-01  0:55   ` Sergey Senozhatsky
  0 siblings, 0 replies; 4+ messages in thread
From: Sergey Senozhatsky @ 2021-10-01  0:55 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: akpm, andreyknvl, arnd, ast, benh, bp, christophe.leroy, davem,
	dvyukov, glider, ink, mattst88, mingo, mm-commits, monstr, mpe,
	paulus, pmladek, rostedt, rth, ryabinin.a.a, tglx,
	wangkefeng.wang

On (21/10/01 09:47), Sergey Senozhatsky wrote:
> On (21/09/30 14:21), akpm@linux-foundation.org wrote:
> > +++ a/include/linux/kallsyms.h
> > @@ -34,8 +34,7 @@ static inline int is_kernel_inittext(uns
> >  
> >  static inline int is_kernel_text(unsigned long addr)
> >  {
> > -	if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) ||
> > -	    arch_is_kernel_text(addr))
> > +	if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext))
> >  		return 1;
> 
> Does this need to include _etext or should it be '< _etext'?

Oh, this is fixed in the next patch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: + kallsyms-remove-arch-specific-text-and-data-check.patch added to -mm tree
  2021-09-30 21:21 + kallsyms-remove-arch-specific-text-and-data-check.patch added to -mm tree akpm
  2021-10-01  0:47 ` Sergey Senozhatsky
@ 2021-10-01  1:20 ` Sergey Senozhatsky
  1 sibling, 0 replies; 4+ messages in thread
From: Sergey Senozhatsky @ 2021-10-01  1:20 UTC (permalink / raw)
  To: akpm
  Cc: andreyknvl, arnd, ast, benh, bp, christophe.leroy, davem, dvyukov,
	glider, ink, mattst88, mingo, mm-commits, monstr, mpe, paulus,
	pmladek, rostedt, rth, ryabinin.a.a, senozhatsky, tglx,
	wangkefeng.wang

On (21/09/30 14:21), akpm@linux-foundation.org wrote:
> 
> Patch series "sections: Unify kernel sections range check and use", v4.
> 
> There are three head files(kallsyms.h, kernel.h and sections.h) which
> include the kernel sections range check, let's make some cleanup and unify
> them.
> 
> 1. cleanup arch specific text/data check and fix address boundary check
>    in kallsyms.h
> 
> 2. make all the basic/core kernel range check function into sections.h
> 
> 3. update all the callers, and use the helper in sections.h to simplify
>    the code
> 
> After this series, we have 5 APIs about kernel sections range check in
> sections.h
> 
>  * is_kernel_rodata()		--- already in sections.h
>  * is_kernel_core_data()	--- come from core_kernel_data() in kernel.h
>  * is_kernel_inittext()		--- come from kernel.h and kallsyms.h
>  * __is_kernel_text()		--- add new internal helper
>  * __is_kernel()		--- add new internal helper
> 
> Note: For the last two helpers, people should not use directly, consider to
>       use corresponding function in kallsyms.h.

FWIW, Andrew, feel free to add (to the series)

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-01  1:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-30 21:21 + kallsyms-remove-arch-specific-text-and-data-check.patch added to -mm tree akpm
2021-10-01  0:47 ` Sergey Senozhatsky
2021-10-01  0:55   ` Sergey Senozhatsky
2021-10-01  1:20 ` Sergey Senozhatsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.