This is with # CONFIG_TRANSPARENT_HUGEPAGE is not set # CONFIG_HUGETLBFS is not set so we need to fence this. With hugetlbfs enabled this compiles (and also works fine). On 07/26/2018 07:23 PM, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git hlp_vsie > head: fadb8fb358096ec793c2a233dc20ecee83c2b612 > commit: 28df31569e0eb8bd6448c1b7fa40ad138300110a [9/14] s390/mm: Add huge pmd storage key handling > config: s390-alldefconfig (attached as .config) > compiler: s390x-linux-gnu-gcc (Debian 7.2.0-11) 7.2.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 28df31569e0eb8bd6448c1b7fa40ad138300110a > # save the attached .config to linux build tree > GCC_VERSION=7.2.0 make.cross ARCH=s390 > > All error/warnings (new ones prefixed by >>): > > arch/s390/mm/pgtable.c: In function 'set_guest_storage_key': >>> arch/s390/mm/pgtable.c:744:18: error: implicit declaration of function 'huge_pte_alloc'; did you mean 'huge_pte_lock'? [-Werror=implicit-function-declaration] > pmdp = (pmd_t *)huge_pte_alloc(mm, addr, HPAGE_SIZE); > ^~~~~~~~~~~~~~ > huge_pte_lock >>> arch/s390/mm/pgtable.c:744:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > pmdp = (pmd_t *)huge_pte_alloc(mm, addr, HPAGE_SIZE); > ^ > arch/s390/mm/pgtable.c: In function 'reset_guest_reference_bit': > arch/s390/mm/pgtable.c:847:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > pmdp = (pmd_t *)huge_pte_alloc(mm, addr, HPAGE_SIZE); > ^ > arch/s390/mm/pgtable.c: In function 'get_guest_storage_key': > arch/s390/mm/pgtable.c:901:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > pmdp = (pmd_t *)huge_pte_alloc(mm, addr, HPAGE_SIZE); > ^ > cc1: some warnings being treated as errors > > vim +744 arch/s390/mm/pgtable.c > > 734 > 735 int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, > 736 unsigned char key, bool nq) > 737 { > 738 unsigned long keyul, paddr; > 739 spinlock_t *ptl; > 740 pgste_t old, new; > 741 pmd_t *pmdp; > 742 pte_t *ptep; > 743 > > 744 pmdp = (pmd_t *)huge_pte_alloc(mm, addr, HPAGE_SIZE); > 745 if (unlikely(!pmdp)) > 746 return -EFAULT; > 747 > 748 ptl = pmd_lock(mm, pmdp); > 749 if (!pmd_present(*pmdp)) { > 750 spin_unlock(ptl); > 751 return -EFAULT; > 752 } > 753 > 754 if (pmd_large(*pmdp)) { > 755 paddr = pmd_val(*pmdp) & HPAGE_MASK; > 756 paddr |= addr & ~HPAGE_MASK; > 757 /* > 758 * Huge pmds need quiescing operations, they are > 759 * always mapped. > 760 */ > 761 page_set_storage_key(paddr, key, 1); > 762 spin_unlock(ptl); > 763 return 0; > 764 } > 765 spin_unlock(ptl); > 766 > 767 ptep = pte_alloc_map_lock(mm, pmdp, addr, &ptl); > 768 if (unlikely(!ptep)) > 769 return -EFAULT; > 770 > 771 new = old = pgste_get_lock(ptep); > 772 pgste_val(new) &= ~(PGSTE_GR_BIT | PGSTE_GC_BIT | > 773 PGSTE_ACC_BITS | PGSTE_FP_BIT); > 774 keyul = (unsigned long) key; > 775 pgste_val(new) |= (keyul & (_PAGE_CHANGED | _PAGE_REFERENCED)) << 48; > 776 pgste_val(new) |= (keyul & (_PAGE_ACC_BITS | _PAGE_FP_BIT)) << 56; > 777 if (!(pte_val(*ptep) & _PAGE_INVALID)) { > 778 unsigned long bits, skey; > 779 > 780 paddr = pte_val(*ptep) & PAGE_MASK; > 781 skey = (unsigned long) page_get_storage_key(paddr); > 782 bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED); > 783 skey = key & (_PAGE_ACC_BITS | _PAGE_FP_BIT); > 784 /* Set storage key ACC and FP */ > 785 page_set_storage_key(paddr, skey, !nq); > 786 /* Merge host changed & referenced into pgste */ > 787 pgste_val(new) |= bits << 52; > 788 } > 789 /* changing the guest storage key is considered a change of the page */ > 790 if ((pgste_val(new) ^ pgste_val(old)) & > 791 (PGSTE_ACC_BITS | PGSTE_FP_BIT | PGSTE_GR_BIT | PGSTE_GC_BIT)) > 792 pgste_val(new) |= PGSTE_UC_BIT; > 793 > 794 pgste_set_unlock(ptep, new); > 795 pte_unmap_unlock(ptep, ptl); > 796 return 0; > 797 } > 798 EXPORT_SYMBOL(set_guest_storage_key); > 799 > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation > -- To unsubscribe from this list: send the line "unsubscribe linux-s390" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html