All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Evgeniy Baskov <baskov@ispras.ru>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Ard Biesheuvel <ardb@kernel.org>
Subject: [ardb:efi-x86-nx 5/24] arch/x86/mm/ident_map.c:19:8: warning: no previous prototype for function 'ident_split_large_pmd'
Date: Wed, 8 Mar 2023 22:50:51 +0800	[thread overview]
Message-ID: <202303082219.1MyCkO2j-lkp@intel.com> (raw)

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git efi-x86-nx
head:   8171142f3e4c96f6be75a6195de59d1607f1bd4b
commit: 26f02800cb89d842e554a5e030a40560adc7221b [5/24] x86/boot: Support 4KB pages for identity mapping
config: x86_64-randconfig-a011-20230306 (https://download.01.org/0day-ci/archive/20230308/202303082219.1MyCkO2j-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id=26f02800cb89d842e554a5e030a40560adc7221b
        git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
        git fetch --no-tags ardb efi-x86-nx
        git checkout 26f02800cb89d842e554a5e030a40560adc7221b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/mm/ kernel/bpf/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303082219.1MyCkO2j-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/x86/mm/init_64.c:61:
>> arch/x86/mm/ident_map.c:19:8: warning: no previous prototype for function 'ident_split_large_pmd' [-Wmissing-prototypes]
   pte_t *ident_split_large_pmd(struct x86_mapping_info *info,
          ^
   arch/x86/mm/ident_map.c:19:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   pte_t *ident_split_large_pmd(struct x86_mapping_info *info,
   ^
   static 
>> arch/x86/mm/ident_map.c:102:8: warning: no previous prototype for function 'ident_split_large_pud' [-Wmissing-prototypes]
   pmd_t *ident_split_large_pud(struct x86_mapping_info *info,
          ^
   arch/x86/mm/ident_map.c:102:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   pmd_t *ident_split_large_pud(struct x86_mapping_info *info,
   ^
   static 
   2 warnings generated.


vim +/ident_split_large_pmd +19 arch/x86/mm/ident_map.c

    18	
  > 19	pte_t *ident_split_large_pmd(struct x86_mapping_info *info,
    20				     pmd_t *pmdp, unsigned long page_addr)
    21	{
    22		unsigned long pmd_addr, page_flags;
    23		pte_t *pte;
    24	
    25		pte = (pte_t *)info->alloc_pgt_page(info->context);
    26		if (!pte)
    27			return NULL;
    28	
    29		pmd_addr = page_addr & PMD_MASK;
    30	
    31		/* Not a large page - clear PSE flag */
    32		page_flags = pmd_flags(*pmdp) & ~_PSE;
    33		ident_pte_init(info, pte, pmd_addr, pmd_addr + PMD_SIZE, page_flags);
    34	
    35		return pte;
    36	}
    37	
    38	static int ident_pmd_init(struct x86_mapping_info *info, pmd_t *pmd_page,
    39				  unsigned long addr, unsigned long end,
    40				  unsigned long flags)
    41	{
    42		unsigned long next;
    43		bool new_table = 0;
    44	
    45		for (; addr < end; addr = next) {
    46			pmd_t *pmd = pmd_page + pmd_index(addr);
    47			pte_t *pte;
    48	
    49			next = (addr & PMD_MASK) + PMD_SIZE;
    50			if (next > end)
    51				next = end;
    52	
    53			/*
    54			 * Use 2M pages if 4k pages are not allowed or
    55			 * we are not mapping extra, i.e. address and size are aligned.
    56			 */
    57	
    58			if (!info->allow_4kpages ||
    59			    (!(addr & ~PMD_MASK) && next == addr + PMD_SIZE)) {
    60	
    61				pmd_t pmdval;
    62	
    63				addr &= PMD_MASK;
    64				pmdval = __pmd((addr - info->offset) | flags | _PSE);
    65				set_pmd(pmd, pmdval);
    66				continue;
    67			}
    68	
    69			/*
    70			 * If currently mapped page is large, we need to split it.
    71			 * The case when we don't can remap 2M page to 2M page
    72			 * with different flags is already covered above.
    73			 *
    74			 * If there's nothing mapped to desired address,
    75			 * we need to allocate new page table.
    76			 */
    77	
    78			if (pmd_large(*pmd)) {
    79				pte = ident_split_large_pmd(info, pmd, addr);
    80				new_table = 1;
    81			} else if (!pmd_present(*pmd)) {
    82				pte = (pte_t *)info->alloc_pgt_page(info->context);
    83				new_table = 1;
    84			} else {
    85				pte = pte_offset_kernel(pmd, 0);
    86				new_table = 0;
    87			}
    88	
    89			if (!pte)
    90				return -ENOMEM;
    91	
    92			ident_pte_init(info, pte, addr, next, flags);
    93	
    94			if (new_table)
    95				set_pmd(pmd, __pmd(__pa(pte) | info->kernpg_flag));
    96		}
    97	
    98		return 0;
    99	}
   100	
   101	
 > 102	pmd_t *ident_split_large_pud(struct x86_mapping_info *info,
   103				     pud_t *pudp, unsigned long page_addr)
   104	{
   105		unsigned long pud_addr, page_flags;
   106		pmd_t *pmd;
   107	
   108		pmd = (pmd_t *)info->alloc_pgt_page(info->context);
   109		if (!pmd)
   110			return NULL;
   111	
   112		pud_addr = page_addr & PUD_MASK;
   113	
   114		/* Not a large page - clear PSE flag */
   115		page_flags = pud_flags(*pudp) & ~_PSE;
   116		ident_pmd_init(info, pmd, pud_addr, pud_addr + PUD_SIZE, page_flags);
   117	
   118		return pmd;
   119	}
   120	

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

                 reply	other threads:[~2023-03-08 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202303082219.1MyCkO2j-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ardb@kernel.org \
    --cc=baskov@ispras.ru \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.