tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git header-test-v3 head: 334f02c2502b2ab8cc010c21f73e7e8639585bc1 commit: 334f02c2502b2ab8cc010c21f73e7e8639585bc1 [25/25] kbuild: compile-test kernel headers to ensure they are self-contained config: sparc64-allmodconfig (attached as .config) compiler: sparc64-linux-gcc (GCC) 7.4.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 334f02c2502b2ab8cc010c21f73e7e8639585bc1 # save the attached .config to linux build tree GCC_VERSION=7.4.0 make.cross ARCH=sparc64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@xxxxxxxxx> All error/warnings (new ones prefixed by >>): In file included from include/asm-generic/barrier.h:16:0, from arch/sparc/include/asm/barrier_64.h:59, from arch/sparc/include/asm/barrier.h:5, from arch/sparc/include/asm/atomic_64.h:13, from arch/sparc/include/asm/atomic.h:5, from include/linux/atomic.h:7, from include/linux/vmw_vmci_defs.h:11, from <command-line>:0: include/linux/vmw_vmci_defs.h: In function 'vmci_q_set_pointer': >> include/linux/compiler.h:280:2: warning: 'return' with a value, in function returning void ({ \ ~^~~~~~~~~ union { typeof(x) __val; char __c[1]; } __u = \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { .__val = (__force typeof(x)) (val) }; \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __write_once_size(&(x), __u.__c, sizeof(x)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __u.__val; \ ~~~~~~~~~~~~~~~~ }) ~~ >> arch/sparc/include/asm/atomic_64.h:22:28: note: in expansion of macro 'WRITE_ONCE' #define atomic64_set(v, i) WRITE_ONCE(((v)->counter), (i)) ^~~~~~~~~~ >> include/linux/vmw_vmci_defs.h:756:9: note: in expansion of macro 'atomic64_set' return atomic64_set(var, new_val); ^~~~~~~~~~~~ In file included from <command-line>:0:0: include/linux/vmw_vmci_defs.h:750:20: note: declared here static inline void vmci_q_set_pointer(atomic64_t *var, ^~~~~~~~~~~~~~~~~~ -- In file included from include/uapi/linux/mman.h:5:0, from <command-line>:0: arch/sparc/include/asm/mman.h: In function 'ipi_set_tstate_mcde': >> arch/sparc/include/asm/mman.h:22:6: error: 'current' undeclared (first use in this function) if (current->mm == mm) { ^~~~~~~ arch/sparc/include/asm/mman.h:22:6: note: each undeclared identifier is reported only once for each function it appears in >> arch/sparc/include/asm/mman.h:25:10: error: implicit declaration of function 'task_pt_regs' [-Werror=implicit-function-declaration] regs = task_pt_regs(current); ^~~~~~~~~~~~ >> arch/sparc/include/asm/mman.h:26:7: error: dereferencing pointer to incomplete type 'struct pt_regs' regs->tstate |= TSTATE_MCDE; ^~ >> arch/sparc/include/asm/mman.h:26:19: error: 'TSTATE_MCDE' undeclared (first use in this function) regs->tstate |= TSTATE_MCDE; ^~~~~~~~~~~ arch/sparc/include/asm/mman.h: In function 'sparc_calc_vm_prot_bits': arch/sparc/include/asm/mman.h:36:8: error: 'current' undeclared (first use in this function) if (!current->mm->context.adi) { ^~~~~~~ arch/sparc/include/asm/mman.h:38:8: error: dereferencing pointer to incomplete type 'struct pt_regs' regs->tstate |= TSTATE_MCDE; ^~ arch/sparc/include/asm/mman.h:38:20: error: 'TSTATE_MCDE' undeclared (first use in this function) regs->tstate |= TSTATE_MCDE; ^~~~~~~~~~~ >> arch/sparc/include/asm/mman.h:40:4: error: implicit declaration of function 'on_each_cpu_mask' [-Werror=implicit-function-declaration] on_each_cpu_mask(mm_cpumask(current->mm), ^~~~~~~~~~~~~~~~ >> arch/sparc/include/asm/mman.h:40:21: error: implicit declaration of function 'mm_cpumask' [-Werror=implicit-function-declaration] on_each_cpu_mask(mm_cpumask(current->mm), ^~~~~~~~~~ >> arch/sparc/include/asm/mman.h:43:10: error: 'VM_SPARC_ADI' undeclared (first use in this function) return VM_SPARC_ADI; ^~~~~~~~~~~~ arch/sparc/include/asm/mman.h: At top level: >> arch/sparc/include/asm/mman.h:50:15: error: unknown type name 'pgprot_t' static inline pgprot_t sparc_vm_get_page_prot(unsigned long vm_flags) ^~~~~~~~ arch/sparc/include/asm/mman.h: In function 'sparc_vm_get_page_prot': arch/sparc/include/asm/mman.h:52:21: error: 'VM_SPARC_ADI' undeclared (first use in this function) return (vm_flags & VM_SPARC_ADI) ? __pgprot(_PAGE_MCD_4V) : __pgprot(0); ^~~~~~~~~~~~ >> arch/sparc/include/asm/mman.h:52:37: error: implicit declaration of function '__pgprot'; did you mean '__pure'? [-Werror=implicit-function-declaration] return (vm_flags & VM_SPARC_ADI) ? __pgprot(_PAGE_MCD_4V) : __pgprot(0); ^~~~~~~~ __pure >> arch/sparc/include/asm/mman.h:52:46: error: '_PAGE_MCD_4V' undeclared (first use in this function) return (vm_flags & VM_SPARC_ADI) ? __pgprot(_PAGE_MCD_4V) : __pgprot(0); ^~~~~~~~~~~~ arch/sparc/include/asm/mman.h: In function 'sparc_validate_prot': >> arch/sparc/include/asm/mman.h:67:10: error: implicit declaration of function 'find_vma' [-Werror=implicit-function-declaration] vma = find_vma(current->mm, addr); ^~~~~~~~ arch/sparc/include/asm/mman.h:67:19: error: 'current' undeclared (first use in this function) vma = find_vma(current->mm, addr); ^~~~~~~ >> arch/sparc/include/asm/mman.h:72:12: error: dereferencing pointer to incomplete type 'struct vm_area_struct' if (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP)) ^~ >> arch/sparc/include/asm/mman.h:72:26: error: 'VM_PFNMAP' undeclared (first use in this function) if (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP)) ^~~~~~~~~ >> arch/sparc/include/asm/mman.h:72:38: error: 'VM_MIXEDMAP' undeclared (first use in this function); did you mean 'VM_PFNMAP'? if (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP)) ^~~~~~~~~~~ VM_PFNMAP >> arch/sparc/include/asm/mman.h:83:25: error: 'VM_MERGEABLE' undeclared (first use in this function); did you mean 'MADV_MERGEABLE'? if (vma->vm_flags & VM_MERGEABLE) ^~~~~~~~~~~~ MADV_MERGEABLE cc1: some warnings being treated as errors vim +/current +22 arch/sparc/include/asm/mman.h 74a04967 Khalid Aziz 2018-02-23 13 74a04967 Khalid Aziz 2018-02-23 14 static inline void ipi_set_tstate_mcde(void *arg) 74a04967 Khalid Aziz 2018-02-23 15 { 74a04967 Khalid Aziz 2018-02-23 16 struct mm_struct *mm = arg; 74a04967 Khalid Aziz 2018-02-23 17 74a04967 Khalid Aziz 2018-02-23 18 /* Set TSTATE_MCDE for the task using address map that ADI has been 74a04967 Khalid Aziz 2018-02-23 19 * enabled on if the task is running. If not, it will be set 74a04967 Khalid Aziz 2018-02-23 20 * automatically at the next context switch 74a04967 Khalid Aziz 2018-02-23 21 */ 74a04967 Khalid Aziz 2018-02-23 @22 if (current->mm == mm) { 74a04967 Khalid Aziz 2018-02-23 23 struct pt_regs *regs; 74a04967 Khalid Aziz 2018-02-23 24 74a04967 Khalid Aziz 2018-02-23 @25 regs = task_pt_regs(current); 74a04967 Khalid Aziz 2018-02-23 @26 regs->tstate |= TSTATE_MCDE; 74a04967 Khalid Aziz 2018-02-23 27 } 74a04967 Khalid Aziz 2018-02-23 28 } 74a04967 Khalid Aziz 2018-02-23 29 74a04967 Khalid Aziz 2018-02-23 30 #define arch_calc_vm_prot_bits(prot, pkey) sparc_calc_vm_prot_bits(prot) 74a04967 Khalid Aziz 2018-02-23 31 static inline unsigned long sparc_calc_vm_prot_bits(unsigned long prot) 74a04967 Khalid Aziz 2018-02-23 32 { 74a04967 Khalid Aziz 2018-02-23 33 if (adi_capable() && (prot & PROT_ADI)) { 74a04967 Khalid Aziz 2018-02-23 34 struct pt_regs *regs; 74a04967 Khalid Aziz 2018-02-23 35 74a04967 Khalid Aziz 2018-02-23 @36 if (!current->mm->context.adi) { 74a04967 Khalid Aziz 2018-02-23 37 regs = task_pt_regs(current); 74a04967 Khalid Aziz 2018-02-23 @38 regs->tstate |= TSTATE_MCDE; 74a04967 Khalid Aziz 2018-02-23 39 current->mm->context.adi = true; 74a04967 Khalid Aziz 2018-02-23 @40 on_each_cpu_mask(mm_cpumask(current->mm), 74a04967 Khalid Aziz 2018-02-23 41 ipi_set_tstate_mcde, current->mm, 0); 74a04967 Khalid Aziz 2018-02-23 42 } 74a04967 Khalid Aziz 2018-02-23 @43 return VM_SPARC_ADI; 74a04967 Khalid Aziz 2018-02-23 44 } else { 74a04967 Khalid Aziz 2018-02-23 45 return 0; 74a04967 Khalid Aziz 2018-02-23 46 } 74a04967 Khalid Aziz 2018-02-23 47 } 74a04967 Khalid Aziz 2018-02-23 48 74a04967 Khalid Aziz 2018-02-23 49 #define arch_vm_get_page_prot(vm_flags) sparc_vm_get_page_prot(vm_flags) 74a04967 Khalid Aziz 2018-02-23 @50 static inline pgprot_t sparc_vm_get_page_prot(unsigned long vm_flags) 74a04967 Khalid Aziz 2018-02-23 51 { 74a04967 Khalid Aziz 2018-02-23 @52 return (vm_flags & VM_SPARC_ADI) ? __pgprot(_PAGE_MCD_4V) : __pgprot(0); 74a04967 Khalid Aziz 2018-02-23 53 } 74a04967 Khalid Aziz 2018-02-23 54 74a04967 Khalid Aziz 2018-02-23 55 #define arch_validate_prot(prot, addr) sparc_validate_prot(prot, addr) 74a04967 Khalid Aziz 2018-02-23 56 static inline int sparc_validate_prot(unsigned long prot, unsigned long addr) 74a04967 Khalid Aziz 2018-02-23 57 { 74a04967 Khalid Aziz 2018-02-23 58 if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_ADI)) 74a04967 Khalid Aziz 2018-02-23 59 return 0; 74a04967 Khalid Aziz 2018-02-23 60 if (prot & PROT_ADI) { 74a04967 Khalid Aziz 2018-02-23 61 if (!adi_capable()) 74a04967 Khalid Aziz 2018-02-23 62 return 0; 74a04967 Khalid Aziz 2018-02-23 63 74a04967 Khalid Aziz 2018-02-23 64 if (addr) { 74a04967 Khalid Aziz 2018-02-23 65 struct vm_area_struct *vma; 74a04967 Khalid Aziz 2018-02-23 66 74a04967 Khalid Aziz 2018-02-23 @67 vma = find_vma(current->mm, addr); 74a04967 Khalid Aziz 2018-02-23 68 if (vma) { 74a04967 Khalid Aziz 2018-02-23 69 /* ADI can not be enabled on PFN 74a04967 Khalid Aziz 2018-02-23 70 * mapped pages 74a04967 Khalid Aziz 2018-02-23 71 */ 74a04967 Khalid Aziz 2018-02-23 @72 if (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP)) 74a04967 Khalid Aziz 2018-02-23 73 return 0; 74a04967 Khalid Aziz 2018-02-23 74 74a04967 Khalid Aziz 2018-02-23 75 /* Mergeable pages can become unmergeable 74a04967 Khalid Aziz 2018-02-23 76 * if ADI is enabled on them even if they 74a04967 Khalid Aziz 2018-02-23 77 * have identical data on them. This can be 74a04967 Khalid Aziz 2018-02-23 78 * because ADI enabled pages with identical 74a04967 Khalid Aziz 2018-02-23 79 * data may still not have identical ADI 74a04967 Khalid Aziz 2018-02-23 80 * tags on them. Disallow ADI on mergeable 74a04967 Khalid Aziz 2018-02-23 81 * pages. 74a04967 Khalid Aziz 2018-02-23 82 */ 74a04967 Khalid Aziz 2018-02-23 @83 if (vma->vm_flags & VM_MERGEABLE) 74a04967 Khalid Aziz 2018-02-23 84 return 0; 74a04967 Khalid Aziz 2018-02-23 85 } 74a04967 Khalid Aziz 2018-02-23 86 } 74a04967 Khalid Aziz 2018-02-23 87 } 74a04967 Khalid Aziz 2018-02-23 88 return 1; 74a04967 Khalid Aziz 2018-02-23 89 } 74a04967 Khalid Aziz 2018-02-23 90 #endif /* CONFIG_SPARC64 */ 74a04967 Khalid Aziz 2018-02-23 91 :::::: The code at line 22 was first introduced by commit :::::: 74a04967482faa7144b93dae3b2e913870dd421c sparc64: Add support for ADI (Application Data Integrity) :::::: TO: Khalid Aziz <khalid.aziz@xxxxxxxxxx> :::::: CC: David S. Miller <davem@xxxxxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip