Re: [mmotm:master 162/365] mm/mmap.c:2858:46: error: 'PUD_SHIFT' undeclared

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jan 17, 2015 at 08:56:48AM +0800, kbuild test robot wrote:
> tree:   git://git.cmpxchg.org/linux-mmotm.git master
> head:   59f7a5af1a6c9e19c6e5152f26548c494a2d7338
> commit: c824a9dc5e8821ce083652d4f728e804161d3dd0 [162/365] mm: account pmd page tables to the process
> config: microblaze-mmu_defconfig (attached as .config)
> reproduce:
>   wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>   chmod +x ~/bin/make.cross
>   git checkout c824a9dc5e8821ce083652d4f728e804161d3dd0
>   # save the attached .config to linux build tree
>   make.cross ARCH=microblaze 
> 
> All error/warnings:
> 
>    In file included from arch/microblaze/include/asm/bug.h:1:0,
>                     from include/linux/bug.h:4,
>                     from include/linux/thread_info.h:11,
>                     from include/asm-generic/preempt.h:4,
>                     from arch/microblaze/include/generated/asm/preempt.h:1,
>                     from include/linux/preempt.h:18,
>                     from include/linux/spinlock.h:50,
>                     from include/linux/mmzone.h:7,
>                     from include/linux/gfp.h:5,
>                     from include/linux/slab.h:14,
>                     from mm/mmap.c:12:
>    mm/mmap.c: In function 'exit_mmap':
> >> mm/mmap.c:2858:46: error: 'PUD_SHIFT' undeclared (first use in this function)
>        round_up(FIRST_USER_ADDRESS, PUD_SIZE) >> PUD_SHIFT);
>                                                  ^
>    include/asm-generic/bug.h:86:25: note: in definition of macro 'WARN_ON'
>      int __ret_warn_on = !!(condition);    \
>                             ^
>    mm/mmap.c:2858:46: note: each undeclared identifier is reported only once for each function it appears in
>        round_up(FIRST_USER_ADDRESS, PUD_SIZE) >> PUD_SHIFT);
>                                                  ^
>    include/asm-generic/bug.h:86:25: note: in definition of macro 'WARN_ON'
>      int __ret_warn_on = !!(condition);    \
>                             ^
> 
> vim +/PUD_SHIFT +2858 mm/mmap.c
> 
>   2852		}
>   2853		vm_unacct_memory(nr_accounted);
>   2854	
>   2855		WARN_ON(atomic_long_read(&mm->nr_ptes) >
>   2856				round_up(FIRST_USER_ADDRESS, PMD_SIZE) >> PMD_SHIFT);
>   2857		WARN_ON(mm_nr_pmds(mm) >
> > 2858				round_up(FIRST_USER_ADDRESS, PUD_SIZE) >> PUD_SHIFT);
>   2859	}
>   2860	
>   2861	/* Insert vm structure into process list sorted by address


>From 2f475ba053750bb268a667813dd4f83f003747ae Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>
Date: Sat, 17 Jan 2015 03:26:12 +0200
Subject: [PATCH] mm, asm-generic: define PUD_SHIFT in
 <asm-generic/4level-fixup.h>

If an architecure uses <asm-generic/4level-fixup.h>, build fails if we
try to use PUD_SHIFT in generic code:

   In file included from arch/microblaze/include/asm/bug.h:1:0,
                    from include/linux/bug.h:4,
                    from include/linux/thread_info.h:11,
                    from include/asm-generic/preempt.h:4,
                    from arch/microblaze/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:18,
                    from include/linux/spinlock.h:50,
                    from include/linux/mmzone.h:7,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:14,
                    from mm/mmap.c:12:
   mm/mmap.c: In function 'exit_mmap':
>> mm/mmap.c:2858:46: error: 'PUD_SHIFT' undeclared (first use in this function)
       round_up(FIRST_USER_ADDRESS, PUD_SIZE) >> PUD_SHIFT);
                                                 ^
   include/asm-generic/bug.h:86:25: note: in definition of macro 'WARN_ON'
     int __ret_warn_on = !!(condition);    \
                            ^
   mm/mmap.c:2858:46: note: each undeclared identifier is reported only once for each function it appears in
       round_up(FIRST_USER_ADDRESS, PUD_SIZE) >> PUD_SHIFT);
                                                 ^
   include/asm-generic/bug.h:86:25: note: in definition of macro 'WARN_ON'
     int __ret_warn_on = !!(condition);    \
                            ^
As with <asm-generic/pgtable-nopud.h>, let's define PUD_SHIFT to
PGDIR_SHIFT.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
---
 include/asm-generic/4level-fixup.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h
index 77ff547730af..5bdab6bffd23 100644
--- a/include/asm-generic/4level-fixup.h
+++ b/include/asm-generic/4level-fixup.h
@@ -4,6 +4,7 @@
 #define __ARCH_HAS_4LEVEL_HACK
 #define __PAGETABLE_PUD_FOLDED
 
+#define PUD_SHIFT			PGDIR_SHIFT
 #define PUD_SIZE			PGDIR_SIZE
 #define PUD_MASK			PGDIR_MASK
 #define PTRS_PER_PUD			1
-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]