All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: arch/mips/include/asm/uaccess.h:82:10: error: use of undeclared identifier '__UA_LIMIT'
Date: Fri, 5 Nov 2021 19:36:28 +0800	[thread overview]
Message-ID: <202111051920.dcCUQ0QN-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 8933 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d4439a1189f93d0ac1eaf0197db8e6b3e197d5c7
commit: 04324f44cb69a03fdc8f2ee52386a4fdf6a0043b MIPS: Remove get_fs/set_fs
date:   7 months ago
config: mips-randconfig-r014-20211103 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 264d3b6d4e08401c5b50a85bd76e80b3461d77e6)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=04324f44cb69a03fdc8f2ee52386a4fdf6a0043b
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 04324f44cb69a03fdc8f2ee52386a4fdf6a0043b
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips prepare

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 arch/mips/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:14:
   In file included from include/linux/sem.h:5:
   In file included from include/uapi/linux/sem.h:5:
   In file included from include/linux/ipc.h:5:
   In file included from include/linux/spinlock.h:61:
   In file included from arch/mips/include/asm/mmiowb.h:5:
   In file included from arch/mips/include/asm/io.h:29:
   arch/mips/include/asm/page.h:196:13: error: use of undeclared identifier 'CAC_BASE'
           return x - PAGE_OFFSET + PHYS_OFFSET;
                      ^
   arch/mips/include/asm/mach-generic/spaces.h:91:23: note: expanded from macro 'PAGE_OFFSET'
   #define PAGE_OFFSET             (CAC_BASE + PHYS_OFFSET)
                                    ^
   In file included from arch/mips/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:14:
   In file included from include/linux/sem.h:5:
   In file included from include/uapi/linux/sem.h:5:
   In file included from include/linux/ipc.h:5:
   In file included from include/linux/spinlock.h:61:
   In file included from arch/mips/include/asm/mmiowb.h:5:
   arch/mips/include/asm/io.h:134:28: error: use of undeclared identifier 'CAC_BASE'
           return (void *)(address + PAGE_OFFSET - PHYS_OFFSET);
                                     ^
   arch/mips/include/asm/mach-generic/spaces.h:91:23: note: expanded from macro 'PAGE_OFFSET'
   #define PAGE_OFFSET             (CAC_BASE + PHYS_OFFSET)
                                    ^
   In file included from arch/mips/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:9:
   In file included from include/linux/sched/task.h:11:
   In file included from include/linux/uaccess.h:11:
>> arch/mips/include/asm/uaccess.h:82:10: error: use of undeclared identifier '__UA_LIMIT'
           return (__UA_LIMIT & (addr | (addr + size) | __ua_size(size))) == 0;
                   ^
   arch/mips/include/asm/uaccess.h:464:3: error: expected ')'
                   __UA_ADDU "\t$1, %1, %2\n\t"
                   ^
   arch/mips/include/asm/uaccess.h:514:3: error: expected ')'
                   __UA_ADDU "\t$1, %1, %2\n\t"
                   ^
   arch/mips/include/asm/uaccess.h:558:5: error: expected string literal in 'asm'
                   : bzero_clobbers);
                     ^
   arch/mips/include/asm/uaccess.h:546:42: note: expanded from macro 'bzero_clobbers'
   #define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"
                                            ^
   arch/mips/include/asm/uaccess.h:558:5: error: expected ')'
   arch/mips/include/asm/uaccess.h:546:42: note: expanded from macro 'bzero_clobbers'
   #define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"
                                            ^
   arch/mips/include/asm/uaccess.h:609:35: error: expected string literal in 'asm'
                   : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
                                                   ^
   arch/mips/include/asm/uaccess.h:609:35: error: expected ')'
   arch/mips/include/asm/uaccess.h:644:23: error: expected string literal in 'asm'
                   : "$2", "$4", "$5", __UA_t0, "$31");
                                       ^
   arch/mips/include/asm/uaccess.h:644:23: error: expected ')'
   In file included from arch/mips/kernel/asm-offsets.c:15:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
>> arch/mips/include/asm/pgtable.h:232:29: error: implicit declaration of function 'pte_pfn' [-Werror,-Wimplicit-function-declaration]
           if (pte_present(*ptep) && (pte_pfn(*ptep) == pte_pfn(pteval)))
                                      ^
>> arch/mips/include/asm/pgtable.h:550:25: error: unknown type name 'pmd_t'
           unsigned long address, pmd_t *pmdp)
                                  ^
   In file included from arch/mips/kernel/asm-offsets.c:15:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:14:
>> include/asm-generic/pgtable_uffd.h:10:40: error: unknown type name 'pmd_t'
   static __always_inline int pmd_uffd_wp(pmd_t pmd)
                                          ^
   include/asm-generic/pgtable_uffd.h:20:24: error: unknown type name 'pmd_t'
   static __always_inline pmd_t pmd_mkuffd_wp(pmd_t pmd)
                          ^
   include/asm-generic/pgtable_uffd.h:20:44: error: unknown type name 'pmd_t'
   static __always_inline pmd_t pmd_mkuffd_wp(pmd_t pmd)
                                              ^
   include/asm-generic/pgtable_uffd.h:30:24: error: unknown type name 'pmd_t'
   static __always_inline pmd_t pmd_clear_uffd_wp(pmd_t pmd)
                          ^
   include/asm-generic/pgtable_uffd.h:30:48: error: unknown type name 'pmd_t'
   static __always_inline pmd_t pmd_clear_uffd_wp(pmd_t pmd)
                                                  ^
   include/asm-generic/pgtable_uffd.h:50:15: error: unknown type name 'pmd_t'
   static inline pmd_t pmd_swp_mkuffd_wp(pmd_t pmd)
                 ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.
   make[2]: *** [scripts/Makefile.build:116: arch/mips/kernel/asm-offsets.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [Makefile:1233: prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:215: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.


vim +/__UA_LIMIT +82 arch/mips/include/asm/uaccess.h

    44	
    45	/*
    46	 * Is a address valid? This does a straightforward calculation rather
    47	 * than tests.
    48	 *
    49	 * Address valid if:
    50	 *  - "addr" doesn't have any high-bits set
    51	 *  - AND "size" doesn't have any high-bits set
    52	 *  - AND "addr+size" doesn't have any high-bits set
    53	 *  - OR we are in kernel mode.
    54	 *
    55	 * __ua_size() is a trick to avoid runtime checking of positive constant
    56	 * sizes; for those we already know at compile time that the size is ok.
    57	 */
    58	#define __ua_size(size)							\
    59		((__builtin_constant_p(size) && (signed long) (size) > 0) ? 0 : (size))
    60	
    61	/*
    62	 * access_ok: - Checks if a user space pointer is valid
    63	 * @addr: User space pointer to start of block to check
    64	 * @size: Size of block to check
    65	 *
    66	 * Context: User context only. This function may sleep if pagefaults are
    67	 *          enabled.
    68	 *
    69	 * Checks if a pointer to a block of memory in user space is valid.
    70	 *
    71	 * Returns true (nonzero) if the memory block may be valid, false (zero)
    72	 * if it is definitely invalid.
    73	 *
    74	 * Note that, depending on architecture, this function probably just
    75	 * checks that the pointer is in the user space range - after calling
    76	 * this function, memory access functions may still return -EFAULT.
    77	 */
    78	
    79	static inline int __access_ok(const void __user *p, unsigned long size)
    80	{
    81		unsigned long addr = (unsigned long)p;
  > 82		return (__UA_LIMIT & (addr | (addr + size) | __ua_size(size))) == 0;
    83	}
    84	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27375 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: arch/mips/include/asm/uaccess.h:82:10: error: use of undeclared identifier '__UA_LIMIT'
Date: Fri, 05 Nov 2021 19:36:28 +0800	[thread overview]
Message-ID: <202111051920.dcCUQ0QN-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 9108 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d4439a1189f93d0ac1eaf0197db8e6b3e197d5c7
commit: 04324f44cb69a03fdc8f2ee52386a4fdf6a0043b MIPS: Remove get_fs/set_fs
date:   7 months ago
config: mips-randconfig-r014-20211103 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 264d3b6d4e08401c5b50a85bd76e80b3461d77e6)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=04324f44cb69a03fdc8f2ee52386a4fdf6a0043b
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 04324f44cb69a03fdc8f2ee52386a4fdf6a0043b
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips prepare

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 arch/mips/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:14:
   In file included from include/linux/sem.h:5:
   In file included from include/uapi/linux/sem.h:5:
   In file included from include/linux/ipc.h:5:
   In file included from include/linux/spinlock.h:61:
   In file included from arch/mips/include/asm/mmiowb.h:5:
   In file included from arch/mips/include/asm/io.h:29:
   arch/mips/include/asm/page.h:196:13: error: use of undeclared identifier 'CAC_BASE'
           return x - PAGE_OFFSET + PHYS_OFFSET;
                      ^
   arch/mips/include/asm/mach-generic/spaces.h:91:23: note: expanded from macro 'PAGE_OFFSET'
   #define PAGE_OFFSET             (CAC_BASE + PHYS_OFFSET)
                                    ^
   In file included from arch/mips/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:14:
   In file included from include/linux/sem.h:5:
   In file included from include/uapi/linux/sem.h:5:
   In file included from include/linux/ipc.h:5:
   In file included from include/linux/spinlock.h:61:
   In file included from arch/mips/include/asm/mmiowb.h:5:
   arch/mips/include/asm/io.h:134:28: error: use of undeclared identifier 'CAC_BASE'
           return (void *)(address + PAGE_OFFSET - PHYS_OFFSET);
                                     ^
   arch/mips/include/asm/mach-generic/spaces.h:91:23: note: expanded from macro 'PAGE_OFFSET'
   #define PAGE_OFFSET             (CAC_BASE + PHYS_OFFSET)
                                    ^
   In file included from arch/mips/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:9:
   In file included from include/linux/sched/task.h:11:
   In file included from include/linux/uaccess.h:11:
>> arch/mips/include/asm/uaccess.h:82:10: error: use of undeclared identifier '__UA_LIMIT'
           return (__UA_LIMIT & (addr | (addr + size) | __ua_size(size))) == 0;
                   ^
   arch/mips/include/asm/uaccess.h:464:3: error: expected ')'
                   __UA_ADDU "\t$1, %1, %2\n\t"
                   ^
   arch/mips/include/asm/uaccess.h:514:3: error: expected ')'
                   __UA_ADDU "\t$1, %1, %2\n\t"
                   ^
   arch/mips/include/asm/uaccess.h:558:5: error: expected string literal in 'asm'
                   : bzero_clobbers);
                     ^
   arch/mips/include/asm/uaccess.h:546:42: note: expanded from macro 'bzero_clobbers'
   #define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"
                                            ^
   arch/mips/include/asm/uaccess.h:558:5: error: expected ')'
   arch/mips/include/asm/uaccess.h:546:42: note: expanded from macro 'bzero_clobbers'
   #define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"
                                            ^
   arch/mips/include/asm/uaccess.h:609:35: error: expected string literal in 'asm'
                   : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
                                                   ^
   arch/mips/include/asm/uaccess.h:609:35: error: expected ')'
   arch/mips/include/asm/uaccess.h:644:23: error: expected string literal in 'asm'
                   : "$2", "$4", "$5", __UA_t0, "$31");
                                       ^
   arch/mips/include/asm/uaccess.h:644:23: error: expected ')'
   In file included from arch/mips/kernel/asm-offsets.c:15:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
>> arch/mips/include/asm/pgtable.h:232:29: error: implicit declaration of function 'pte_pfn' [-Werror,-Wimplicit-function-declaration]
           if (pte_present(*ptep) && (pte_pfn(*ptep) == pte_pfn(pteval)))
                                      ^
>> arch/mips/include/asm/pgtable.h:550:25: error: unknown type name 'pmd_t'
           unsigned long address, pmd_t *pmdp)
                                  ^
   In file included from arch/mips/kernel/asm-offsets.c:15:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:14:
>> include/asm-generic/pgtable_uffd.h:10:40: error: unknown type name 'pmd_t'
   static __always_inline int pmd_uffd_wp(pmd_t pmd)
                                          ^
   include/asm-generic/pgtable_uffd.h:20:24: error: unknown type name 'pmd_t'
   static __always_inline pmd_t pmd_mkuffd_wp(pmd_t pmd)
                          ^
   include/asm-generic/pgtable_uffd.h:20:44: error: unknown type name 'pmd_t'
   static __always_inline pmd_t pmd_mkuffd_wp(pmd_t pmd)
                                              ^
   include/asm-generic/pgtable_uffd.h:30:24: error: unknown type name 'pmd_t'
   static __always_inline pmd_t pmd_clear_uffd_wp(pmd_t pmd)
                          ^
   include/asm-generic/pgtable_uffd.h:30:48: error: unknown type name 'pmd_t'
   static __always_inline pmd_t pmd_clear_uffd_wp(pmd_t pmd)
                                                  ^
   include/asm-generic/pgtable_uffd.h:50:15: error: unknown type name 'pmd_t'
   static inline pmd_t pmd_swp_mkuffd_wp(pmd_t pmd)
                 ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.
   make[2]: *** [scripts/Makefile.build:116: arch/mips/kernel/asm-offsets.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [Makefile:1233: prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:215: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.


vim +/__UA_LIMIT +82 arch/mips/include/asm/uaccess.h

    44	
    45	/*
    46	 * Is a address valid? This does a straightforward calculation rather
    47	 * than tests.
    48	 *
    49	 * Address valid if:
    50	 *  - "addr" doesn't have any high-bits set
    51	 *  - AND "size" doesn't have any high-bits set
    52	 *  - AND "addr+size" doesn't have any high-bits set
    53	 *  - OR we are in kernel mode.
    54	 *
    55	 * __ua_size() is a trick to avoid runtime checking of positive constant
    56	 * sizes; for those we already know at compile time that the size is ok.
    57	 */
    58	#define __ua_size(size)							\
    59		((__builtin_constant_p(size) && (signed long) (size) > 0) ? 0 : (size))
    60	
    61	/*
    62	 * access_ok: - Checks if a user space pointer is valid
    63	 * @addr: User space pointer to start of block to check
    64	 * @size: Size of block to check
    65	 *
    66	 * Context: User context only. This function may sleep if pagefaults are
    67	 *          enabled.
    68	 *
    69	 * Checks if a pointer to a block of memory in user space is valid.
    70	 *
    71	 * Returns true (nonzero) if the memory block may be valid, false (zero)
    72	 * if it is definitely invalid.
    73	 *
    74	 * Note that, depending on architecture, this function probably just
    75	 * checks that the pointer is in the user space range - after calling
    76	 * this function, memory access functions may still return -EFAULT.
    77	 */
    78	
    79	static inline int __access_ok(const void __user *p, unsigned long size)
    80	{
    81		unsigned long addr = (unsigned long)p;
  > 82		return (__UA_LIMIT & (addr | (addr + size) | __ua_size(size))) == 0;
    83	}
    84	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27375 bytes --]

             reply	other threads:[~2021-11-05 11:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 11:36 kernel test robot [this message]
2021-11-05 11:36 ` arch/mips/include/asm/uaccess.h:82:10: error: use of undeclared identifier '__UA_LIMIT' kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202111051920.dcCUQ0QN-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hch@lst.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.