Merge tag 's390-4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 9 Nov 2018 12:30:44 +0000 (06:30 -0600)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 9 Nov 2018 12:30:44 +0000 (06:30 -0600)
Pull s390 fixes from Martin Schwidefsky:

 - A fix for the pgtable_bytes misaccounting on s390. The patch changes
   common code part in regard to page table folding and adds extra
   checks to mm_[inc|dec]_nr_[pmds|puds].

 - Add FORCE for all build targets using if_changed

 - Use non-loadable phdr for the .vmlinux.info section to avoid a
   segment overlap that confuses kexec

 - Cleanup the attribute definition for the diagnostic sampling

 - Increase stack size for CONFIG_KASAN=y builds

 - Export __node_distance to fix a build error

 - Correct return code of a PMU event init function

 - An update for the default configs

* tag 's390-4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/perf: Change CPUM_CF return code in event init function
  s390: update defconfigs
  s390/mm: Fix ERROR: "__node_distance" undefined!
  s390/kasan: increase instrumented stack size to 64k
  s390/cpum_sf: Rework attribute definition for diagnostic sampling
  s390/mm: fix mis-accounting of pgtable_bytes
  mm: add mm_pxd_folded checks to pgtable_bytes accounting functions
  mm: introduce mm_[p4d|pud|pmd]_folded
  mm: make the __PAGETABLE_PxD_FOLDED defines non-empty
  s390: avoid vmlinux segments overlap
  s390/vdso: add missing FORCE to build targets
  s390/decompressor: add missing FORCE to build targets

1  2 
arch/s390/numa/numa.c
include/asm-generic/pgtable.h
include/linux/mm.h

diff --combined arch/s390/numa/numa.c
@@@ -13,6 -13,7 +13,6 @@@
  #include <linux/kernel.h>
  #include <linux/mmzone.h>
  #include <linux/cpumask.h>
 -#include <linux/bootmem.h>
  #include <linux/memblock.h>
  #include <linux/slab.h>
  #include <linux/node.h>
@@@ -53,6 -54,7 +53,7 @@@ int __node_distance(int a, int b
  {
        return mode->distance ? mode->distance(a, b) : 0;
  }
+ EXPORT_SYMBOL(__node_distance);
  
  int numa_debug_enabled;
  
@@@ -63,7 -65,7 +64,7 @@@ static __init pg_data_t *alloc_node_dat
  {
        pg_data_t *res;
  
 -      res = (pg_data_t *) memblock_alloc(sizeof(pg_data_t), 8);
 +      res = (pg_data_t *) memblock_phys_alloc(sizeof(pg_data_t), 8);
        memset(res, 0, sizeof(pg_data_t));
        return res;
  }
@@@ -757,7 -757,7 +757,7 @@@ static inline pmd_t pmd_swp_clear_soft_
  /*
   * Interfaces that can be used by architecture code to keep track of
   * memory type of pfn mappings specified by the remap_pfn_range,
 - * vm_insert_pfn.
 + * vmf_insert_pfn.
   */
  
  /*
@@@ -773,7 -773,7 +773,7 @@@ static inline int track_pfn_remap(struc
  
  /*
   * track_pfn_insert is called when a _new_ single pfn is established
 - * by vm_insert_pfn().
 + * by vmf_insert_pfn().
   */
  static inline void track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
                                    pfn_t pfn)
@@@ -1127,4 -1127,20 +1127,20 @@@ static inline bool arch_has_pfn_modify_
  #endif
  #endif
  
+ /*
+  * On some architectures it depends on the mm if the p4d/pud or pmd
+  * layer of the page table hierarchy is folded or not.
+  */
+ #ifndef mm_p4d_folded
+ #define mm_p4d_folded(mm)     __is_defined(__PAGETABLE_P4D_FOLDED)
+ #endif
+ #ifndef mm_pud_folded
+ #define mm_pud_folded(mm)     __is_defined(__PAGETABLE_PUD_FOLDED)
+ #endif
+ #ifndef mm_pmd_folded
+ #define mm_pmd_folded(mm)     __is_defined(__PAGETABLE_PMD_FOLDED)
+ #endif
  #endif /* _ASM_GENERIC_PGTABLE_H */
diff --combined include/linux/mm.h
@@@ -848,8 -848,6 +848,8 @@@ static inline bool is_zone_device_page(
  {
        return page_zonenum(page) == ZONE_DEVICE;
  }
 +extern void memmap_init_zone_device(struct zone *, unsigned long,
 +                                  unsigned long, struct dev_pagemap *);
  #else
  static inline bool is_zone_device_page(const struct page *page)
  {
@@@ -1744,11 -1742,15 +1744,15 @@@ int __pud_alloc(struct mm_struct *mm, p
  
  static inline void mm_inc_nr_puds(struct mm_struct *mm)
  {
+       if (mm_pud_folded(mm))
+               return;
        atomic_long_add(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes);
  }
  
  static inline void mm_dec_nr_puds(struct mm_struct *mm)
  {
+       if (mm_pud_folded(mm))
+               return;
        atomic_long_sub(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes);
  }
  #endif
@@@ -1768,11 -1770,15 +1772,15 @@@ int __pmd_alloc(struct mm_struct *mm, p
  
  static inline void mm_inc_nr_pmds(struct mm_struct *mm)
  {
+       if (mm_pmd_folded(mm))
+               return;
        atomic_long_add(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes);
  }
  
  static inline void mm_dec_nr_pmds(struct mm_struct *mm)
  {
+       if (mm_pmd_folded(mm))
+               return;
        atomic_long_sub(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes);
  }
  #endif
@@@ -2163,7 -2169,7 +2171,7 @@@ extern int __meminit __early_pfn_to_nid
                                        struct mminit_pfnnid_cache *state);
  #endif
  
 -#if defined(CONFIG_HAVE_MEMBLOCK) && !defined(CONFIG_FLAT_NODE_MEM_MAP)
 +#if !defined(CONFIG_FLAT_NODE_MEM_MAP)
  void zero_resv_unavail(void);
  #else
  static inline void zero_resv_unavail(void) {}
@@@ -2306,8 -2312,6 +2314,8 @@@ extern unsigned long do_mmap(struct fil
        unsigned long len, unsigned long prot, unsigned long flags,
        vm_flags_t vm_flags, unsigned long pgoff, unsigned long *populate,
        struct list_head *uf);
 +extern int __do_munmap(struct mm_struct *, unsigned long, size_t,
 +                     struct list_head *uf, bool downgrade);
  extern int do_munmap(struct mm_struct *, unsigned long, size_t,
                     struct list_head *uf);
  
@@@ -2506,11 -2510,11 +2514,11 @@@ struct vm_area_struct *find_extend_vma(
  int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
                        unsigned long pfn, unsigned long size, pgprot_t);
  int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
 -int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
 +vm_fault_t vmf_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
                        unsigned long pfn);
 -int vm_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr,
 +vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr,
                        unsigned long pfn, pgprot_t pgprot);
 -int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
 +vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
                        pfn_t pfn);
  vm_fault_t vmf_insert_mixed_mkwrite(struct vm_area_struct *vma,
                unsigned long addr, pfn_t pfn);
@@@ -2529,6 -2533,32 +2537,6 @@@ static inline vm_fault_t vmf_insert_pag
        return VM_FAULT_NOPAGE;
  }
  
 -static inline vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma,
 -                              unsigned long addr, pfn_t pfn)
 -{
 -      int err = vm_insert_mixed(vma, addr, pfn);
 -
 -      if (err == -ENOMEM)
 -              return VM_FAULT_OOM;
 -      if (err < 0 && err != -EBUSY)
 -              return VM_FAULT_SIGBUS;
 -
 -      return VM_FAULT_NOPAGE;
 -}
 -
 -static inline vm_fault_t vmf_insert_pfn(struct vm_area_struct *vma,
 -                      unsigned long addr, unsigned long pfn)
 -{
 -      int err = vm_insert_pfn(vma, addr, pfn);
 -
 -      if (err == -ENOMEM)
 -              return VM_FAULT_OOM;
 -      if (err < 0 && err != -EBUSY)
 -              return VM_FAULT_SIGBUS;
 -
 -      return VM_FAULT_NOPAGE;
 -}
 -
  static inline vm_fault_t vmf_error(int err)
  {
        if (err == -ENOMEM)
        return VM_FAULT_SIGBUS;
  }
  
 -struct page *follow_page_mask(struct vm_area_struct *vma,
 -                            unsigned long address, unsigned int foll_flags,
 -                            unsigned int *page_mask);
 -
 -static inline struct page *follow_page(struct vm_area_struct *vma,
 -              unsigned long address, unsigned int foll_flags)
 -{
 -      unsigned int unused_page_mask;
 -      return follow_page_mask(vma, address, foll_flags, &unused_page_mask);
 -}
 +struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
 +                       unsigned int foll_flags);
  
  #define FOLL_WRITE    0x01    /* check pte is writable */
  #define FOLL_TOUCH    0x02    /* mark page accessed */