lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202409301241.wzlwAxsQ-lkp@intel.com>
Date: Mon, 30 Sep 2024 12:04:37 +0800
From: kernel test robot <lkp@...el.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Masahiro Yamada <masahiroy@...nel.org>, Alex Shi <alexs@...nel.org>,
	Nick Desaulniers <ndesaulniers@...gle.com>,
	Miguel Ojeda <ojeda@...nel.org>,
	Nathan Chancellor <nathan@...nel.org>
Subject: arch/sh/mm/cache-sh4.c:224:13: error: assignment to 'pmd_t *' from
 'int' makes pointer from integer without a cast

Hi Arnd,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9852d85ec9d492ebef56dc5f229416c925758edc
commit: e8c07082a810fbb9db303a2b66b66b8d7e588b53 Kbuild: move to -std=gnu11
date:   2 years, 7 months ago
config: sh-randconfig-001-20240930 (https://download.01.org/0day-ci/archive/20240930/202409301241.wzlwAxsQ-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240930/202409301241.wzlwAxsQ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409301241.wzlwAxsQ-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/sh/mm/cache-sh4.c: In function 'flush_cache_one':
   arch/sh/mm/cache-sh4.c:99:31: error: 'cached_to_uncached' undeclared (first use in this function); did you mean 'jump_to_uncached'?
      99 |                 exec_offset = cached_to_uncached;
         |                               ^~~~~~~~~~~~~~~~~~
         |                               jump_to_uncached
   arch/sh/mm/cache-sh4.c:99:31: note: each undeclared identifier is reported only once for each function it appears in
   arch/sh/mm/cache-sh4.c: In function 'sh4_flush_cache_mm':
   arch/sh/mm/cache-sh4.c:192:13: error: implicit declaration of function 'cpu_context'; did you mean 'put_io_context'? [-Wimplicit-function-declaration]
     192 |         if (cpu_context(smp_processor_id(), mm) == NO_CONTEXT)
         |             ^~~~~~~~~~~
         |             put_io_context
   arch/sh/mm/cache-sh4.c: In function 'sh4_flush_cache_page':
   arch/sh/mm/cache-sh4.c:224:15: error: implicit declaration of function 'pmd_off' [-Wimplicit-function-declaration]
     224 |         pmd = pmd_off(vma->vm_mm, address);
         |               ^~~~~~~
>> arch/sh/mm/cache-sh4.c:224:13: error: assignment to 'pmd_t *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     224 |         pmd = pmd_off(vma->vm_mm, address);
         |             ^
   arch/sh/mm/cache-sh4.c:225:15: error: implicit declaration of function 'pte_offset_kernel' [-Wimplicit-function-declaration]
     225 |         pte = pte_offset_kernel(pmd, address);
         |               ^~~~~~~~~~~~~~~~~
>> arch/sh/mm/cache-sh4.c:225:13: error: assignment to 'pte_t *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     225 |         pte = pte_offset_kernel(pmd, address);
         |             ^
   arch/sh/mm/cache-sh4.c: In function 'sh4_flush_cache_range':
   arch/sh/mm/cache-sh4.c:276:30: warning: variable 'end' set but not used [-Wunused-but-set-variable]
     276 |         unsigned long start, end;
         |                              ^~~
   arch/sh/mm/cache-sh4.c:276:23: warning: variable 'start' set but not used [-Wunused-but-set-variable]
     276 |         unsigned long start, end;
         |                       ^~~~~
   arch/sh/mm/cache-sh4.c: At top level:
   arch/sh/mm/cache-sh4.c:374:13: warning: no previous prototype for 'sh4_cache_init' [-Wmissing-prototypes]
     374 | void __init sh4_cache_init(void)
         |             ^~~~~~~~~~~~~~


vim +224 arch/sh/mm/cache-sh4.c

^1da177e4c3f41 Linus Torvalds     2005-04-16  197  
^1da177e4c3f41 Linus Torvalds     2005-04-16  198  /*
^1da177e4c3f41 Linus Torvalds     2005-04-16  199   * Write back and invalidate I/D-caches for the page.
^1da177e4c3f41 Linus Torvalds     2005-04-16  200   *
^1da177e4c3f41 Linus Torvalds     2005-04-16  201   * ADDR: Virtual Address (U0 address)
^1da177e4c3f41 Linus Torvalds     2005-04-16  202   * PFN: Physical page number
^1da177e4c3f41 Linus Torvalds     2005-04-16  203   */
f26b2a562b46ab Paul Mundt         2009-08-21  204  static void sh4_flush_cache_page(void *args)
^1da177e4c3f41 Linus Torvalds     2005-04-16  205  {
f26b2a562b46ab Paul Mundt         2009-08-21  206  	struct flusher_data *data = args;
f26b2a562b46ab Paul Mundt         2009-08-21  207  	struct vm_area_struct *vma;
deaef20e9789d9 Paul Mundt         2009-09-09  208  	struct page *page;
f26b2a562b46ab Paul Mundt         2009-08-21  209  	unsigned long address, pfn, phys;
deaef20e9789d9 Paul Mundt         2009-09-09  210  	int map_coherent = 0;
deaef20e9789d9 Paul Mundt         2009-09-09  211  	pmd_t *pmd;
deaef20e9789d9 Paul Mundt         2009-09-09  212  	pte_t *pte;
deaef20e9789d9 Paul Mundt         2009-09-09  213  	void *vaddr;
b638d0b921dc95 Richard Curnow     2006-09-27  214  
f26b2a562b46ab Paul Mundt         2009-08-21  215  	vma = data->vma;
abeaf33a410176 Paul Mundt         2009-10-16  216  	address = data->addr1 & PAGE_MASK;
f26b2a562b46ab Paul Mundt         2009-08-21  217  	pfn = data->addr2;
f26b2a562b46ab Paul Mundt         2009-08-21  218  	phys = pfn << PAGE_SHIFT;
deaef20e9789d9 Paul Mundt         2009-09-09  219  	page = pfn_to_page(pfn);
f26b2a562b46ab Paul Mundt         2009-08-21  220  
e7b8b7f16edc9b Paul Mundt         2009-08-15  221  	if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
e7b8b7f16edc9b Paul Mundt         2009-08-15  222  		return;
e7b8b7f16edc9b Paul Mundt         2009-08-15  223  
e05c7b1f2bc4b7 Mike Rapoport      2020-06-08 @224  	pmd = pmd_off(vma->vm_mm, address);
deaef20e9789d9 Paul Mundt         2009-09-09 @225  	pte = pte_offset_kernel(pmd, address);
deaef20e9789d9 Paul Mundt         2009-09-09  226  
deaef20e9789d9 Paul Mundt         2009-09-09  227  	/* If the page isn't present, there is nothing to do here. */
deaef20e9789d9 Paul Mundt         2009-09-09  228  	if (!(pte_val(*pte) & _PAGE_PRESENT))
deaef20e9789d9 Paul Mundt         2009-09-09  229  		return;
^1da177e4c3f41 Linus Torvalds     2005-04-16  230  
deaef20e9789d9 Paul Mundt         2009-09-09  231  	if ((vma->vm_mm == current->active_mm))
deaef20e9789d9 Paul Mundt         2009-09-09  232  		vaddr = NULL;
deaef20e9789d9 Paul Mundt         2009-09-09  233  	else {
b638d0b921dc95 Richard Curnow     2006-09-27  234  		/*
deaef20e9789d9 Paul Mundt         2009-09-09  235  		 * Use kmap_coherent or kmap_atomic to do flushes for
deaef20e9789d9 Paul Mundt         2009-09-09  236  		 * another ASID than the current one.
b638d0b921dc95 Richard Curnow     2006-09-27  237  		 */
deaef20e9789d9 Paul Mundt         2009-09-09  238  		map_coherent = (current_cpu_data.dcache.n_aliases &&
55661fc1f105ed Paul Mundt         2010-12-01  239  			test_bit(PG_dcache_clean, &page->flags) &&
e1534ae95004d6 Kirill A. Shutemov 2016-01-15  240  			page_mapcount(page));
deaef20e9789d9 Paul Mundt         2009-09-09  241  		if (map_coherent)
deaef20e9789d9 Paul Mundt         2009-09-09  242  			vaddr = kmap_coherent(page, address);
deaef20e9789d9 Paul Mundt         2009-09-09  243  		else
bc3e11be88010e Cong Wang          2011-11-25  244  			vaddr = kmap_atomic(page);
deaef20e9789d9 Paul Mundt         2009-09-09  245  
deaef20e9789d9 Paul Mundt         2009-09-09  246  		address = (unsigned long)vaddr;
deaef20e9789d9 Paul Mundt         2009-09-09  247  	}
deaef20e9789d9 Paul Mundt         2009-09-09  248  
abeaf33a410176 Paul Mundt         2009-10-16  249  	flush_cache_one(CACHE_OC_ADDRESS_ARRAY |
deaef20e9789d9 Paul Mundt         2009-09-09  250  			(address & shm_align_mask), phys);
deaef20e9789d9 Paul Mundt         2009-09-09  251  
deaef20e9789d9 Paul Mundt         2009-09-09  252  	if (vma->vm_flags & VM_EXEC)
deaef20e9789d9 Paul Mundt         2009-09-09  253  		flush_icache_all();
deaef20e9789d9 Paul Mundt         2009-09-09  254  
deaef20e9789d9 Paul Mundt         2009-09-09  255  	if (vaddr) {
deaef20e9789d9 Paul Mundt         2009-09-09  256  		if (map_coherent)
deaef20e9789d9 Paul Mundt         2009-09-09  257  			kunmap_coherent(vaddr);
deaef20e9789d9 Paul Mundt         2009-09-09  258  		else
bc3e11be88010e Cong Wang          2011-11-25  259  			kunmap_atomic(vaddr);
^1da177e4c3f41 Linus Torvalds     2005-04-16  260  	}
b638d0b921dc95 Richard Curnow     2006-09-27  261  }
^1da177e4c3f41 Linus Torvalds     2005-04-16  262  

:::::: The code at line 224 was first introduced by commit
:::::: e05c7b1f2bc4b7b28199b9a7572f73436d97317e mm: pgtable: add shortcuts for accessing kernel PMD and PTE

:::::: TO: Mike Rapoport <rppt@...ux.ibm.com>
:::::: CC: Linus Torvalds <torvalds@...ux-foundation.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ