Merge tag 'powerpc-5.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 24 Jul 2019 16:58:39 +0000 (09:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 24 Jul 2019 16:58:39 +0000 (09:58 -0700)
Pull powerpc fixes from Michael Ellerman:
 "An assortment of non-regression fixes that have accumulated since the
  start of the merge window.

   - A fix for a user triggerable oops on machines where transactional
     memory is disabled, eg. Power9 bare metal, Power8 with TM disabled
     on the command line, or all Power7 or earlier machines.

   - Three fixes for handling of PMU and power saving registers when
     running nested KVM on Power9.

   - Two fixes for bugs found while stress testing the XIVE interrupt
     controller code, also on Power9.

   - A fix to allow guests to boot under Qemu/KVM on Power9 using the
     the Hash MMU with >= 1TB of memory.

   - Two fixes for bugs in the recent DMA cleanup, one of which could
     lead to checkstops.

   - And finally three fixes for the PAPR SCM nvdimm driver.

  Thanks to: Alexey Kardashevskiy, Andrea Arcangeli, Cédric Le Goater,
  Christoph Hellwig, David Gibson, Gautham R. Shenoy, Michael Neuling,
  Oliver O'Halloran, Satheesh Rajendran, Shawn Anastasio, Suraj Jitindar
  Singh, Vaibhav Jain"

* tag 'powerpc-5.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails
  powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL
  powerpc/pseries: Update SCM hcall op-codes in hvcall.h
  powerpc/tm: Fix oops on sigreturn on systems without TM
  powerpc/dma: Fix invalid DMA mmap behavior
  KVM: PPC: Book3S HV: XIVE: fix rollback when kvmppc_xive_create fails
  powerpc/xive: Fix loop exit-condition in xive_find_target_in_mask()
  powerpc: fix off by one in max_zone_pfn initialization for ZONE_DMA
  KVM: PPC: Book3S HV: Save and restore guest visible PSSCR bits on pseries
  powerpc/pmu: Set pmcregs_in_use in paca when running as LPAR
  KVM: PPC: Book3S HV: Always save guest pmu for guest capable of nesting
  powerpc/mm: Limit rma_size to 1TB when running without HV mode

1  2 
arch/powerpc/Kconfig
arch/powerpc/mm/mem.c

diff --combined arch/powerpc/Kconfig
index d8dcd8820369eb4be85e4493bf325779f3645e5f,5c96d3c948cd17361f1d5d5f95661ab46f8315c2..77f6ebf97113cea548e360c942b81041a7b10027
@@@ -121,6 -121,7 +121,7 @@@ config PP
        select ARCH_32BIT_OFF_T if PPC32
        select ARCH_HAS_DEBUG_VIRTUAL
        select ARCH_HAS_DEVMEM_IS_ALLOWED
+       select ARCH_HAS_DMA_MMAP_PGPROT
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_FORTIFY_SOURCE
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_HAS_MMIOWB                  if PPC64
        select ARCH_HAS_PHYS_TO_DMA
        select ARCH_HAS_PMEM_API                if PPC64
 +      select ARCH_HAS_PTE_DEVMAP              if PPC_BOOK3S_64
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_MEMBARRIER_CALLBACKS
        select ARCH_HAS_SCALED_CPUTIME          if VIRT_CPU_ACCOUNTING_NATIVE && PPC64
        select ARCH_HAS_TICK_BROADCAST          if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAS_UACCESS_FLUSHCACHE      if PPC64
        select ARCH_HAS_UBSAN_SANITIZE_ALL
 -      select ARCH_HAS_ZONE_DEVICE             if PPC_BOOK3S_64
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select ARCH_KEEP_MEMBLOCK
        select ARCH_MIGHT_HAVE_PC_PARPORT
diff --combined arch/powerpc/mm/mem.c
index 9259337d737466b247d7c5241fff78f2a7856047,b6beb86e53007bf61a26b7c1d5b3b4ead61886e1..9191a66b3bc55666ca94b589ddadd8661cd325bd
@@@ -125,14 -125,23 +125,14 @@@ int __ref arch_add_memory(int nid, u64 
        return __add_pages(nid, start_pfn, nr_pages, restrictions);
  }
  
 -#ifdef CONFIG_MEMORY_HOTREMOVE
  void __ref arch_remove_memory(int nid, u64 start, u64 size,
                             struct vmem_altmap *altmap)
  {
        unsigned long start_pfn = start >> PAGE_SHIFT;
        unsigned long nr_pages = size >> PAGE_SHIFT;
 -      struct page *page;
 +      struct page *page = pfn_to_page(start_pfn) + vmem_altmap_offset(altmap);
        int ret;
  
 -      /*
 -       * If we have an altmap then we need to skip over any reserved PFNs
 -       * when querying the zone.
 -       */
 -      page = pfn_to_page(start_pfn);
 -      if (altmap)
 -              page += vmem_altmap_offset(altmap);
 -
        __remove_pages(page_zone(page), start_pfn, nr_pages, altmap);
  
        /* Remove htab bolted mappings for this section of memory */
                pr_warn("Hash collision while resizing HPT\n");
  }
  #endif
 -#endif /* CONFIG_MEMORY_HOTPLUG */
  
  #ifndef CONFIG_NEED_MULTIPLE_NODES
  void __init mem_topology_setup(void)
@@@ -239,7 -249,7 +239,7 @@@ void __init paging_init(void
  
  #ifdef CONFIG_ZONE_DMA
        max_zone_pfns[ZONE_DMA] = min(max_low_pfn,
-                       ((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT);
+                                     1UL << (ARCH_ZONE_DMA_BITS - PAGE_SHIFT));
  #endif
        max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
  #ifdef CONFIG_HIGHMEM