[09/24] m68k: use asm-generic/mmu_context.h for no-op implementations
diff mbox series

Message ID 20200728033405.78469-10-npiggin@gmail.com
State New
Headers show
Series
  • Use asm-generic for mmu_context no-op functions
Related show

Commit Message

Nicholas Piggin July 28, 2020, 3:33 a.m. UTC
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/m68k/include/asm/mmu_context.h | 47 +++++------------------------
 1 file changed, 8 insertions(+), 39 deletions(-)

Comments

kernel test robot July 30, 2020, 8:11 a.m. UTC | #1
Hi Nicholas,

I love your patch! Yet something to improve:

[auto build test ERROR on openrisc/for-next]
[also build test ERROR on sparc-next/master sparc/master linus/master asm-generic/master v5.8-rc7 next-20200729]
[cannot apply to nios2/for-linus xtensa/for_next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Nicholas-Piggin/Use-asm-generic-for-mmu_context-no-op-functions/20200728-113854
base:   https://github.com/openrisc/linux.git for-next
config: m68k-randconfig-r005-20200729 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/asm-generic/bug.h:5,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from arch/m68k/include/asm/current.h:16,
                    from include/linux/sched.h:12,
                    from kernel//sched/sched.h:5,
                    from kernel//sched/core.c:9:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_no.h:33:50: warning: ordered comparison of pointer with null pointer [-Wextra]
      33 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                  ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   In file included from include/asm-generic/nommu_context.h:11,
                    from arch/m68k/include/asm/mmu_context.h:304,
                    from include/linux/mmu_context.h:5,
                    from kernel//sched/sched.h:54,
                    from kernel//sched/core.c:9:
   include/asm-generic/mmu_context.h: In function 'activate_mm':
>> include/asm-generic/mmu_context.h:59:2: error: implicit declaration of function 'switch_mm' [-Werror=implicit-function-declaration]
      59 |  switch_mm(prev_mm, next_mm, current);
         |  ^~~~~~~~~
   In file included from arch/m68k/include/asm/mmu_context.h:304,
                    from include/linux/mmu_context.h:5,
                    from kernel//sched/sched.h:54,
                    from kernel//sched/core.c:9:
   include/asm-generic/nommu_context.h: At top level:
   include/asm-generic/nommu_context.h:13:20: warning: conflicting types for 'switch_mm'
      13 | static inline void switch_mm(struct mm_struct *prev,
         |                    ^~~~~~~~~
   include/asm-generic/nommu_context.h:13:20: error: static declaration of 'switch_mm' follows non-static declaration
   In file included from include/asm-generic/nommu_context.h:11,
                    from arch/m68k/include/asm/mmu_context.h:304,
                    from include/linux/mmu_context.h:5,
                    from kernel//sched/sched.h:54,
                    from kernel//sched/core.c:9:
   include/asm-generic/mmu_context.h:59:2: note: previous implicit declaration of 'switch_mm' was here
      59 |  switch_mm(prev_mm, next_mm, current);
         |  ^~~~~~~~~
   kernel//sched/core.c: In function 'ttwu_stat':
   kernel//sched/core.c:2154:13: warning: variable 'rq' set but not used [-Wunused-but-set-variable]
    2154 |  struct rq *rq;
         |             ^~
   cc1: some warnings being treated as errors
--
   In file included from include/asm-generic/bug.h:5,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from arch/m68k/include/asm/current.h:16,
                    from include/linux/sched.h:12,
                    from kernel//sched/sched.h:5,
                    from kernel//sched/loadavg.c:9:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_no.h:33:50: warning: ordered comparison of pointer with null pointer [-Wextra]
      33 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                  ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   In file included from include/asm-generic/nommu_context.h:11,
                    from arch/m68k/include/asm/mmu_context.h:304,
                    from include/linux/mmu_context.h:5,
                    from kernel//sched/sched.h:54,
                    from kernel//sched/loadavg.c:9:
   include/asm-generic/mmu_context.h: In function 'activate_mm':
>> include/asm-generic/mmu_context.h:59:2: error: implicit declaration of function 'switch_mm' [-Werror=implicit-function-declaration]
      59 |  switch_mm(prev_mm, next_mm, current);
         |  ^~~~~~~~~
   In file included from arch/m68k/include/asm/mmu_context.h:304,
                    from include/linux/mmu_context.h:5,
                    from kernel//sched/sched.h:54,
                    from kernel//sched/loadavg.c:9:
   include/asm-generic/nommu_context.h: At top level:
   include/asm-generic/nommu_context.h:13:20: warning: conflicting types for 'switch_mm'
      13 | static inline void switch_mm(struct mm_struct *prev,
         |                    ^~~~~~~~~
   include/asm-generic/nommu_context.h:13:20: error: static declaration of 'switch_mm' follows non-static declaration
   In file included from include/asm-generic/nommu_context.h:11,
                    from arch/m68k/include/asm/mmu_context.h:304,
                    from include/linux/mmu_context.h:5,
                    from kernel//sched/sched.h:54,
                    from kernel//sched/loadavg.c:9:
   include/asm-generic/mmu_context.h:59:2: note: previous implicit declaration of 'switch_mm' was here
      59 |  switch_mm(prev_mm, next_mm, current);
         |  ^~~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/asm-generic/bug.h:5,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from arch/m68k/include/asm/current.h:16,
                    from include/linux/sched.h:12,
                    from kernel//sched/sched.h:5,
                    from kernel//sched/rt.c:6:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_no.h:33:50: warning: ordered comparison of pointer with null pointer [-Wextra]
      33 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                  ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   In file included from include/asm-generic/nommu_context.h:11,
                    from arch/m68k/include/asm/mmu_context.h:304,
                    from include/linux/mmu_context.h:5,
                    from kernel//sched/sched.h:54,
                    from kernel//sched/rt.c:6:
   include/asm-generic/mmu_context.h: In function 'activate_mm':
>> include/asm-generic/mmu_context.h:59:2: error: implicit declaration of function 'switch_mm' [-Werror=implicit-function-declaration]
      59 |  switch_mm(prev_mm, next_mm, current);
         |  ^~~~~~~~~
   In file included from arch/m68k/include/asm/mmu_context.h:304,
                    from include/linux/mmu_context.h:5,
                    from kernel//sched/sched.h:54,
                    from kernel//sched/rt.c:6:
   include/asm-generic/nommu_context.h: At top level:
   include/asm-generic/nommu_context.h:13:20: warning: conflicting types for 'switch_mm'
      13 | static inline void switch_mm(struct mm_struct *prev,
         |                    ^~~~~~~~~
   include/asm-generic/nommu_context.h:13:20: error: static declaration of 'switch_mm' follows non-static declaration
   In file included from include/asm-generic/nommu_context.h:11,
                    from arch/m68k/include/asm/mmu_context.h:304,
                    from include/linux/mmu_context.h:5,
                    from kernel//sched/sched.h:54,
                    from kernel//sched/rt.c:6:
   include/asm-generic/mmu_context.h:59:2: note: previous implicit declaration of 'switch_mm' was here
      59 |  switch_mm(prev_mm, next_mm, current);
         |  ^~~~~~~~~
   kernel//sched/rt.c:668:6: warning: no previous prototype for 'sched_rt_bandwidth_account' [-Wmissing-prototypes]
     668 | bool sched_rt_bandwidth_account(struct rt_rq *rt_rq)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/switch_mm +59 include/asm-generic/mmu_context.h

5c01b46bb6bb8f2 Arnd Bergmann   2009-05-13  49  
49435c52fb90a3c Nicholas Piggin 2020-07-28  50  /**
49435c52fb90a3c Nicholas Piggin 2020-07-28  51   * activate_mm - called after exec switches the current task to a new mm, to switch to it
49435c52fb90a3c Nicholas Piggin 2020-07-28  52   * @prev_mm: previous mm of this task
49435c52fb90a3c Nicholas Piggin 2020-07-28  53   * @next_mm: new mm
49435c52fb90a3c Nicholas Piggin 2020-07-28  54   */
49435c52fb90a3c Nicholas Piggin 2020-07-28  55  #ifndef activate_mm
49435c52fb90a3c Nicholas Piggin 2020-07-28  56  static inline void activate_mm(struct mm_struct *prev_mm,
49435c52fb90a3c Nicholas Piggin 2020-07-28  57  			       struct mm_struct *next_mm)
5c01b46bb6bb8f2 Arnd Bergmann   2009-05-13  58  {
49435c52fb90a3c Nicholas Piggin 2020-07-28 @59  	switch_mm(prev_mm, next_mm, current);
5c01b46bb6bb8f2 Arnd Bergmann   2009-05-13  60  }
49435c52fb90a3c Nicholas Piggin 2020-07-28  61  #endif
5c01b46bb6bb8f2 Arnd Bergmann   2009-05-13  62  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Patch
diff mbox series

diff --git a/arch/m68k/include/asm/mmu_context.h b/arch/m68k/include/asm/mmu_context.h
index cac9f289d1f6..56ae27322178 100644
--- a/arch/m68k/include/asm/mmu_context.h
+++ b/arch/m68k/include/asm/mmu_context.h
@@ -5,10 +5,6 @@ 
 #include <asm-generic/mm_hooks.h>
 #include <linux/mm_types.h>
 
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-{
-}
-
 #ifdef CONFIG_MMU
 
 #if defined(CONFIG_COLDFIRE)
@@ -58,6 +54,7 @@  static inline void get_mmu_context(struct mm_struct *mm)
 /*
  * We're finished using the context for an address space.
  */
+#define destroy_context destroy_context
 static inline void destroy_context(struct mm_struct *mm)
 {
 	if (mm->context != NO_CONTEXT) {
@@ -79,19 +76,6 @@  static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 	set_context(tsk->mm->context, next->pgd);
 }
 
-/*
- * After we have set current->mm to a new value, this activates
- * the context for the new mm so we see the new mappings.
- */
-static inline void activate_mm(struct mm_struct *active_mm,
-	struct mm_struct *mm)
-{
-	get_mmu_context(mm);
-	set_context(mm->context, mm->pgd);
-}
-
-#define deactivate_mm(tsk, mm) do { } while (0)
-
 #define prepare_arch_switch(next) load_ksp_mmu(next)
 
 static inline void load_ksp_mmu(struct task_struct *task)
@@ -176,6 +160,7 @@  extern unsigned long get_free_context(struct mm_struct *mm);
 extern void clear_context(unsigned long context);
 
 /* set the context for a new task to unmapped */
+#define init_new_context init_new_context
 static inline int init_new_context(struct task_struct *tsk,
 				   struct mm_struct *mm)
 {
@@ -210,8 +195,7 @@  static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 	activate_context(tsk->mm);
 }
 
-#define deactivate_mm(tsk, mm)	do { } while (0)
-
+#define activate_mm activate_mm
 static inline void activate_mm(struct mm_struct *prev_mm,
 			       struct mm_struct *next_mm)
 {
@@ -224,6 +208,7 @@  static inline void activate_mm(struct mm_struct *prev_mm,
 #include <asm/page.h>
 #include <asm/pgalloc.h>
 
+#define init_new_context init_new_context
 static inline int init_new_context(struct task_struct *tsk,
 				   struct mm_struct *mm)
 {
@@ -231,8 +216,6 @@  static inline int init_new_context(struct task_struct *tsk,
 	return 0;
 }
 
-#define destroy_context(mm)		do { } while(0)
-
 static inline void switch_mm_0230(struct mm_struct *mm)
 {
 	unsigned long crp[2] = {
@@ -300,8 +283,7 @@  static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, str
 	}
 }
 
-#define deactivate_mm(tsk,mm)	do { } while (0)
-
+#define activate_mm activate_mm
 static inline void activate_mm(struct mm_struct *prev_mm,
 			       struct mm_struct *next_mm)
 {
@@ -315,24 +297,11 @@  static inline void activate_mm(struct mm_struct *prev_mm,
 
 #endif
 
-#else /* !CONFIG_MMU */
+#include <asm-generic/mmu_context.h>
 
-static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
-{
-	return 0;
-}
-
-
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
-{
-}
-
-#define destroy_context(mm)	do { } while (0)
-#define deactivate_mm(tsk,mm)	do { } while (0)
+#else /* !CONFIG_MMU */
 
-static inline void activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
-{
-}
+#include <asm-generic/nommu_context.h>
 
 #endif /* CONFIG_MMU */
 #endif /* __M68K_MMU_CONTEXT_H */