Merge tag 'powerpc-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Mar 2019 17:45:17 +0000 (10:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Mar 2019 17:45:17 +0000 (10:45 -0700)
Pull powerpc fixes from Michael Ellerman:
 "One fix to prevent runtime allocation of 16GB pages when running in a
  VM (as opposed to bare metal), because it doesn't work.

  A small fix to our recently added KCOV support to exempt some more
  code from being instrumented.

  Plus a few minor build fixes, a small dead code removal and a
  defconfig update.

  Thanks to: Alexey Kardashevskiy, Aneesh Kumar K.V, Christophe Leroy,
  Jason Yan, Joel Stanley, Mahesh Salgaonkar, Mathieu Malaterre"

* tag 'powerpc-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/64s: Include <asm/nmi.h> header file to fix a warning
  powerpc/powernv: Fix compile without CONFIG_TRACEPOINTS
  powerpc/mm: Disable kcov for SLB routines
  powerpc: remove dead code in head_fsl_booke.S
  powerpc/configs: Sync skiroot defconfig
  powerpc/hugetlb: Don't do runtime allocation of 16G pages in LPAR configuration

1  2 
arch/powerpc/include/asm/book3s/64/hugetlb.h

index 66c1e4f88d654ebf18cadcfff1f906eeae048fce,46130ef4941cfaf2c8aef77377bdce59ccc53637..ec2a55a553c75adb8a66327dc7d756f9f7e0cdfe
@@@ -13,10 -13,6 +13,10 @@@ radix__hugetlb_get_unmapped_area(struc
                                unsigned long len, unsigned long pgoff,
                                unsigned long flags);
  
 +extern void radix__huge_ptep_modify_prot_commit(struct vm_area_struct *vma,
 +                                              unsigned long addr, pte_t *ptep,
 +                                              pte_t old_pte, pte_t pte);
 +
  static inline int hstate_get_psize(struct hstate *hstate)
  {
        unsigned long shift;
  #ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
  static inline bool gigantic_page_supported(void)
  {
+       /*
+        * We used gigantic page reservation with hypervisor assist in some case.
+        * We cannot use runtime allocation of gigantic pages in those platforms
+        * This is hash translation mode LPARs.
+        */
+       if (firmware_has_feature(FW_FEATURE_LPAR) && !radix_enabled())
+               return false;
        return true;
  }
  #endif
  /* hugepd entry valid bit */
  #define HUGEPD_VAL_BITS               (0x8000000000000000UL)
  
 +#define huge_ptep_modify_prot_start huge_ptep_modify_prot_start
 +extern pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma,
 +                                       unsigned long addr, pte_t *ptep);
 +
 +#define huge_ptep_modify_prot_commit huge_ptep_modify_prot_commit
 +extern void huge_ptep_modify_prot_commit(struct vm_area_struct *vma,
 +                                       unsigned long addr, pte_t *ptep,
 +                                       pte_t old_pte, pte_t new_pte);
  #endif