tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
pending-4.14
head: a67b765989deadd03ac363cb8616888a19ad3931
commit: ff65578d514341990a07acb386fad50cc31abc97 [130/187] s390/mm: validate VMA in PGSTE
manipulation functions
config: s390-randconfig-r001-20211114 (attached as .config)
compiler: s390-linux-gcc (GCC) 7.5.0
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/sashal/linux-stable.git/c...
git remote add sashal-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-stable pending-4.14
git checkout ff65578d514341990a07acb386fad50cc31abc97
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/s390/mm/pgtable.c: In function 'pgste_perform_essa':
arch/s390/mm/pgtable.c:910:8: error: implicit declaration of function
'vma_lookup'; did you mean 'key_lookup'?
[-Werror=implicit-function-declaration]
vma = vma_lookup(mm, hva);
^~~~~~~~~~
key_lookup
> arch/s390/mm/pgtable.c:910:6: warning: assignment makes pointer
from integer without a cast [-Wint-conversion]
vma = vma_lookup(mm, hva);
^
arch/s390/mm/pgtable.c: In function 'set_pgste_bits':
arch/s390/mm/pgtable.c:1010:6: warning: assignment makes pointer from integer without a
cast [-Wint-conversion]
vma = vma_lookup(mm, hva);
^
arch/s390/mm/pgtable.c: In function 'get_pgste':
arch/s390/mm/pgtable.c:1041:6: warning: assignment makes pointer from integer without a
cast [-Wint-conversion]
vma = vma_lookup(mm, hva);
^
cc1: some warnings being treated as errors
vim +910 arch/s390/mm/pgtable.c
883
884 /**
885 * pgste_perform_essa - perform ESSA actions on the PGSTE.
886 * @mm: the memory context. It must have PGSTEs, no check is performed here!
887 * @hva: the host virtual address of the page whose PGSTE is to be processed
888 * @orc: the specific action to perform, see the ESSA_SET_* macros.
889 * @oldpte: the PTE will be saved there if the pointer is not NULL.
890 * @oldpgste: the old PGSTE will be saved there if the pointer is not NULL.
891 *
892 * Return: 1 if the page is to be added to the CBRL, otherwise 0,
893 * or < 0 in case of error. -EINVAL is returned for invalid values
894 * of orc, -EFAULT for invalid addresses.
895 */
896 int pgste_perform_essa(struct mm_struct *mm, unsigned long hva, int orc,
897 unsigned long *oldpte, unsigned long *oldpgste)
898 {
899 struct vm_area_struct *vma;
900 unsigned long pgstev;
901 spinlock_t *ptl;
902 pgste_t pgste;
903 pte_t *ptep;
904 int res = 0;
905
906 WARN_ON_ONCE(orc > ESSA_MAX);
907 if (unlikely(orc > ESSA_MAX))
908 return -EINVAL;
909
910 vma = vma_lookup(mm, hva);
911 if (!vma ||
is_vm_hugetlb_page(vma))
912 return -EFAULT;
913 ptep = get_locked_pte(mm, hva, &ptl);
914 if (unlikely(!ptep))
915 return -EFAULT;
916 pgste = pgste_get_lock(ptep);
917 pgstev = pgste_val(pgste);
918 if (oldpte)
919 *oldpte = pte_val(*ptep);
920 if (oldpgste)
921 *oldpgste = pgstev;
922
923 switch (orc) {
924 case ESSA_GET_STATE:
925 break;
926 case ESSA_SET_STABLE:
927 pgstev &= ~(_PGSTE_GPS_USAGE_MASK | _PGSTE_GPS_NODAT);
928 pgstev |= _PGSTE_GPS_USAGE_STABLE;
929 break;
930 case ESSA_SET_UNUSED:
931 pgstev &= ~_PGSTE_GPS_USAGE_MASK;
932 pgstev |= _PGSTE_GPS_USAGE_UNUSED;
933 if (pte_val(*ptep) & _PAGE_INVALID)
934 res = 1;
935 break;
936 case ESSA_SET_VOLATILE:
937 pgstev &= ~_PGSTE_GPS_USAGE_MASK;
938 pgstev |= _PGSTE_GPS_USAGE_VOLATILE;
939 if (pte_val(*ptep) & _PAGE_INVALID)
940 res = 1;
941 break;
942 case ESSA_SET_POT_VOLATILE:
943 pgstev &= ~_PGSTE_GPS_USAGE_MASK;
944 if (!(pte_val(*ptep) & _PAGE_INVALID)) {
945 pgstev |= _PGSTE_GPS_USAGE_POT_VOLATILE;
946 break;
947 }
948 if (pgstev & _PGSTE_GPS_ZERO) {
949 pgstev |= _PGSTE_GPS_USAGE_VOLATILE;
950 break;
951 }
952 if (!(pgstev & PGSTE_GC_BIT)) {
953 pgstev |= _PGSTE_GPS_USAGE_VOLATILE;
954 res = 1;
955 break;
956 }
957 break;
958 case ESSA_SET_STABLE_RESIDENT:
959 pgstev &= ~_PGSTE_GPS_USAGE_MASK;
960 pgstev |= _PGSTE_GPS_USAGE_STABLE;
961 /*
962 * Since the resident state can go away any time after this
963 * call, we will not make this page resident. We can revisit
964 * this decision if a guest will ever start using this.
965 */
966 break;
967 case ESSA_SET_STABLE_IF_RESIDENT:
968 if (!(pte_val(*ptep) & _PAGE_INVALID)) {
969 pgstev &= ~_PGSTE_GPS_USAGE_MASK;
970 pgstev |= _PGSTE_GPS_USAGE_STABLE;
971 }
972 break;
973 case ESSA_SET_STABLE_NODAT:
974 pgstev &= ~_PGSTE_GPS_USAGE_MASK;
975 pgstev |= _PGSTE_GPS_USAGE_STABLE | _PGSTE_GPS_NODAT;
976 break;
977 default:
978 /* we should never get here! */
979 break;
980 }
981 /* If we are discarding a page, set it to logical zero */
982 if (res)
983 pgstev |= _PGSTE_GPS_ZERO;
984
985 pgste_val(pgste) = pgstev;
986 pgste_set_unlock(ptep, pgste);
987 pte_unmap_unlock(ptep, ptl);
988 return res;
989 }
990 EXPORT_SYMBOL(pgste_perform_essa);
991
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org