[daveh-devel:testme 1/1] arch/x86/mm/pat/set_memory.c:2254:22: error: invalid operands to binary | (have 'pgprot_t' {aka 'struct pgprot'} and 'long long unsigned int')

From: kernel test robot
Date: Wed Sep 07 2022 - 19:22:42 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git testme
head: 081cfdf8062c89d33ee205da299ea36b7e648a5a
commit: 081cfdf8062c89d33ee205da299ea36b7e648a5a [1/1] x86/mm: Set NX bit when making pages present
config: i386-randconfig-a001 (https://download.01.org/0day-ci/archive/20220908/202209080702.1fD2ZwWW-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git/commit/?id=081cfdf8062c89d33ee205da299ea36b7e648a5a
git remote add daveh-devel https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git
git fetch --no-tags daveh-devel testme
git checkout 081cfdf8062c89d33ee205da299ea36b7e648a5a
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

arch/x86/mm/pat/set_memory.c: In function '__set_pages_p':
>> arch/x86/mm/pat/set_memory.c:2254:22: error: invalid operands to binary | (have 'pgprot_t' {aka 'struct pgprot'} and 'long long unsigned int')
2254 | cpa.mask_set |= __supported_pte_mask & _PAGE_NX;
| ^~


vim +2254 arch/x86/mm/pat/set_memory.c

2239
2240 static int __set_pages_p(struct page *page, int numpages)
2241 {
2242 unsigned long tempaddr = (unsigned long) page_address(page);
2243 struct cpa_data cpa = { .vaddr = &tempaddr,
2244 .pgd = NULL,
2245 .numpages = numpages,
2246 .mask_set = __pgprot(_PAGE_PRESENT | _PAGE_RW),
2247 .mask_clr = __pgprot(0),
2248 .flags = 0};
2249
2250 /*
2251 * Avoid W^X mappings that occur if the old
2252 * mapping was !_PAGE_RW and !_PAGE_NX.
2253 */
> 2254 cpa.mask_set |= __supported_pte_mask & _PAGE_NX;
2255
2256 /*
2257 * No alias checking needed for setting present flag. otherwise,
2258 * we may need to break large pages for 64-bit kernel text
2259 * mappings (this adds to complexity if we want to do this from
2260 * atomic context especially). Let's keep it simple!
2261 */
2262 return __change_page_attr_set_clr(&cpa, 0);
2263 }
2264

--
0-DAY CI Kernel Test Service
https://01.org/lkp