]> exis.tech > repos - linux.git/commitdiff
Merge tag 'powerpc-5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 7 Aug 2020 17:33:50 +0000 (10:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 7 Aug 2020 17:33:50 +0000 (10:33 -0700)
Pull powerpc updates from Michael Ellerman:

 - Add support for (optionally) using queued spinlocks & rwlocks.

 - Support for a new faster system call ABI using the scv instruction on
   Power9 or later.

 - Drop support for the PROT_SAO mmap/mprotect flag as it will be
   unsupported on Power10 and future processors, leaving us with no way
   to implement the functionality it requests. This risks breaking
   userspace, though we believe it is unused in practice.

 - A bug fix for, and then the removal of, our custom stack expansion
   checking. We now allow stack expansion up to the rlimit, like other
   architectures.

 - Remove the remnants of our (previously disabled) topology update
   code, which tried to react to NUMA layout changes on virtualised
   systems, but was prone to crashes and other problems.

 - Add PMU support for Power10 CPUs.

 - A change to our signal trampoline so that we don't unbalance the link
   stack (branch return predictor) in the signal delivery path.

 - Lots of other cleanups, refactorings, smaller features and so on as
   usual.

Thanks to: Abhishek Goel, Alastair D'Silva, Alexander A. Klimov, Alexey
Kardashevskiy, Alistair Popple, Andrew Donnellan, Aneesh Kumar K.V, Anju
T Sudhakar, Anton Blanchard, Arnd Bergmann, Athira Rajeev, Balamuruhan
S, Bharata B Rao, Bill Wendling, Bin Meng, Cédric Le Goater, Chris
Packham, Christophe Leroy, Christoph Hellwig, Daniel Axtens, Dan
Williams, David Lamparter, Desnes A. Nunes do Rosario, Erhard F., Finn
Thain, Frederic Barrat, Ganesh Goudar, Gautham R. Shenoy, Geoff Levand,
Greg Kurz, Gustavo A. R. Silva, Hari Bathini, Harish, Imre Kaloz, Joel
Stanley, Joe Perches, John Crispin, Jordan Niethe, Kajol Jain, Kamalesh
Babulal, Kees Cook, Laurent Dufour, Leonardo Bras, Li RongQing, Madhavan
Srinivasan, Mahesh Salgaonkar, Mark Cave-Ayland, Michal Suchanek, Milton
Miller, Mimi Zohar, Murilo Opsfelder Araujo, Nathan Chancellor, Nathan
Lynch, Naveen N. Rao, Nayna Jain, Nicholas Piggin, Oliver O'Halloran,
Palmer Dabbelt, Pedro Miraglia Franco de Carvalho, Philippe Bergheaud,
Pingfan Liu, Pratik Rajesh Sampat, Qian Cai, Qinglang Miao, Randy
Dunlap, Ravi Bangoria, Sachin Sant, Sam Bobroff, Sandipan Das, Santosh
Sivaraj, Satheesh Rajendran, Shirisha Ganta, Sourabh Jain, Srikar
Dronamraju, Stan Johnson, Stephen Rothwell, Thadeu Lima de Souza
Cascardo, Thiago Jung Bauermann, Tom Lane, Vaibhav Jain, Vladis Dronov,
Wei Yongjun, Wen Xiong, YueHaibing.

* tag 'powerpc-5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (337 commits)
  selftests/powerpc: Fix pkey syscall redefinitions
  powerpc: Fix circular dependency between percpu.h and mmu.h
  powerpc/powernv/sriov: Fix use of uninitialised variable
  selftests/powerpc: Skip vmx/vsx/tar/etc tests on older CPUs
  powerpc/40x: Fix assembler warning about r0
  powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric
  powerpc/papr_scm: Fetch nvdimm performance stats from PHYP
  cpuidle: pseries: Fixup exit latency for CEDE(0)
  cpuidle: pseries: Add function to parse extended CEDE records
  cpuidle: pseries: Set the latency-hint before entering CEDE
  selftests/powerpc: Fix online CPU selection
  powerpc/perf: Consolidate perf_callchain_user_[64|32]()
  powerpc/pseries/hotplug-cpu: Remove double free in error path
  powerpc/pseries/mobility: Add pr_debug() for device tree changes
  powerpc/pseries/mobility: Set pr_fmt()
  powerpc/cacheinfo: Warn if cache object chain becomes unordered
  powerpc/cacheinfo: Improve diagnostics about malformed cache lists
  powerpc/cacheinfo: Use name@unit instead of full DT path in debug messages
  powerpc/cacheinfo: Set pr_fmt()
  powerpc: fix function annotations to avoid section mismatch warnings with gcc-10
  ...

24 files changed:
1  2 
Documentation/admin-guide/kernel-parameters.txt
Documentation/core-api/cpu_hotplug.rst
Documentation/features/sched/membarrier-sync-core/arch-support.txt
Documentation/memory-barriers.txt
Documentation/virt/kvm/api.rst
MAINTAINERS
arch/powerpc/Kconfig
arch/powerpc/include/asm/Kbuild
arch/powerpc/include/asm/atomic.h
arch/powerpc/include/asm/device.h
arch/powerpc/include/asm/paca.h
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/process.c
arch/powerpc/kernel/ptrace/ptrace-view.c
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/mm/book3s64/hash_utils.c
arch/powerpc/perf/core-book3s.c
arch/powerpc/platforms/pseries/lpar.c
arch/powerpc/platforms/pseries/setup.c
drivers/md/dm-writecache.c
include/asm-generic/barrier.h
include/asm-generic/qspinlock.h
kernel/kexec_file.c
mm/ksm.c

index ef66b3c45ba221041b0bcf0b58afa337392945a4,3ab61cd0f89c7e187ff5dc6129be19fe7cc417a1..00b993aa936508e8213f30a69fd8ce76c2714197
        cpufreq.off=1   [CPU_FREQ]
                        disable the cpufreq sub-system
  
 +      cpufreq.default_governor=
 +                      [CPU_FREQ] Name of the default cpufreq governor or
 +                      policy to use. This governor must be registered in the
 +                      kernel before the cpufreq driver probes.
 +
        cpu_init_udelay=N
                        [X86] Delay for N microsec between assert and de-assert
                        of APIC INIT to start processors.  This delay occurs
                        useful to also enable the page_owner functionality.
                        on: enable the feature
  
 +      debugfs=        [KNL] This parameter enables what is exposed to userspace
 +                      and debugfs internal clients.
 +                      Format: { on, no-mount, off }
 +                      on:     All functions are enabled.
 +                      no-mount:
 +                              Filesystem is not registered but kernel clients can
 +                              access APIs and a crashkernel can be used to read
 +                              its content. There is nothing to mount.
 +                      off:    Filesystem is not registered and clients
 +                              get a -EPERM as result when trying to register files
 +                              or directories within debugfs.
 +                              This is equivalent of the runtime functionality if
 +                              debugfs was not enabled in the kernel at all.
 +                      Default value is set in build-time with a kernel configuration.
 +
        debugpat        [X86] Enable PAT debugging
  
        decnet.addr=    [HW,NET]
        disable_radix   [PPC]
                        Disable RADIX MMU mode on POWER9
  
+       radix_hcall_invalidate=on  [PPC/PSERIES]
+                       Disable RADIX GTSE feature and use hcall for TLB
+                       invalidate.
        disable_tlbie   [PPC]
                        Disable TLBIE instruction. Currently does not work
                        with KVM, with HASH MMU, or with coherent accelerators.
                        Format: {"off" | "on" | "skip[mbr]"}
  
        efi=            [EFI]
 -                      Format: { "old_map", "nochunk", "noruntime", "debug",
 -                                "nosoftreserve", "disable_early_pci_dma",
 -                                "no_disable_early_pci_dma" }
 -                      old_map [X86-64]: switch to the old ioremap-based EFI
 -                      runtime services mapping. [Needs CONFIG_X86_UV=y]
 +                      Format: { "debug", "disable_early_pci_dma",
 +                                "nochunk", "noruntime", "nosoftreserve",
 +                                "novamap", "no_disable_early_pci_dma",
 +                                "old_map" }
 +                      debug: enable misc debug output.
 +                      disable_early_pci_dma: disable the busmaster bit on all
 +                      PCI bridges while in the EFI boot stub.
                        nochunk: disable reading files in "chunks" in the EFI
                        boot stub, as chunking can cause problems with some
                        firmware implementations.
                        noruntime : disable EFI runtime services support
 -                      debug: enable misc debug output
                        nosoftreserve: The EFI_MEMORY_SP (Specific Purpose)
                        attribute may cause the kernel to reserve the
                        memory range for a memory mapping driver to
                        claim. Specify efi=nosoftreserve to disable this
                        reservation and treat the memory by its base type
                        (i.e. EFI_CONVENTIONAL_MEMORY / "System RAM").
 -                      disable_early_pci_dma: Disable the busmaster bit on all
 -                      PCI bridges while in the EFI boot stub
 +                      novamap: do not call SetVirtualAddressMap().
                        no_disable_early_pci_dma: Leave the busmaster bit set
                        on all PCI bridges while in the EFI boot stub
 +                      old_map [X86-64]: switch to the old ioremap-based EFI
 +                      runtime services mapping. [Needs CONFIG_X86_UV=y]
  
        efi_no_storage_paranoia [EFI; X86]
                        Using this parameter you can use more than 50% of
                        touchscreen support is not enabled in the mainstream
                        kernel as of 2.6.30, a preliminary port can be found
                        in the "bleeding edge" mini2440 support kernel at
 -                      http://repo.or.cz/w/linux-2.6/mini2440.git
 +                      https://repo.or.cz/w/linux-2.6/mini2440.git
  
        mitigations=
                        [X86,PPC,S390,ARM64] Control optional mitigations for
        no5lvl          [X86-64] Disable 5-level paging mode. Forces
                        kernel to use 4-level paging instead.
  
 +      nofsgsbase      [X86] Disables FSGSBASE instructions.
 +
        no_console_suspend
                        [HW] Never suspend the console
                        Disable suspending of consoles during suspend and
                        latencies, which will choose a value aligned
                        with the appropriate hardware boundaries.
  
 +      rcutree.rcu_min_cached_objs= [KNL]
 +                      Minimum number of objects which are cached and
 +                      maintained per one CPU. Object size is equal
 +                      to PAGE_SIZE. The cache allows to reduce the
 +                      pressure to page allocator, also it makes the
 +                      whole algorithm to behave better in low memory
 +                      condition.
 +
        rcutree.jiffies_till_first_fqs= [KNL]
                        Set delay from grace-period initialization to
                        first attempt to force quiescent states.
                        Set time (jiffies) between CPU-hotplug operations,
                        or zero to disable CPU-hotplug testing.
  
 +      rcutorture.read_exit= [KNL]
 +                      Set the number of read-then-exit kthreads used
 +                      to test the interaction of RCU updaters and
 +                      task-exit processing.
 +
 +      rcutorture.read_exit_burst= [KNL]
 +                      The number of times in a given read-then-exit
 +                      episode that a set of read-then-exit kthreads
 +                      is spawned.
 +
 +      rcutorture.read_exit_delay= [KNL]
 +                      The delay, in seconds, between successive
 +                      read-then-exit testing episodes.
 +
        rcutorture.shuffle_interval= [KNL]
                        Set task-shuffle interval (s).  Shuffling tasks
                        allows some CPUs to go into dyntick-idle mode
                              reboot_cpu is s[mp]#### with #### being the processor
                                        to be used for rebooting.
  
 +      refscale.holdoff= [KNL]
 +                      Set test-start holdoff period.  The purpose of
 +                      this parameter is to delay the start of the
 +                      test until boot completes in order to avoid
 +                      interference.
 +
 +      refscale.loops= [KNL]
 +                      Set the number of loops over the synchronization
 +                      primitive under test.  Increasing this number
 +                      reduces noise due to loop start/end overhead,
 +                      but the default has already reduced the per-pass
 +                      noise to a handful of picoseconds on ca. 2020
 +                      x86 laptops.
 +
 +      refscale.nreaders= [KNL]
 +                      Set number of readers.  The default value of -1
 +                      selects N, where N is roughly 75% of the number
 +                      of CPUs.  A value of zero is an interesting choice.
 +
 +      refscale.nruns= [KNL]
 +                      Set number of runs, each of which is dumped onto
 +                      the console log.
 +
 +      refscale.readdelay= [KNL]
 +                      Set the read-side critical-section duration,
 +                      measured in microseconds.
 +
 +      refscale.scale_type= [KNL]
 +                      Specify the read-protection implementation to test.
 +
 +      refscale.shutdown= [KNL]
 +                      Shut down the system at the end of the performance
 +                      test.  This defaults to 1 (shut it down) when
 +                      rcuperf is built into the kernel and to 0 (leave
 +                      it running) when rcuperf is built as a module.
 +
 +      refscale.verbose= [KNL]
 +                      Enable additional printk() statements.
 +
        relax_domain_level=
                        [KNL, SMP] Set scheduler's default relax_domain_level.
                        See Documentation/admin-guide/cgroup-v1/cpusets.rst.
                        Prevent the CPU-hotplug component of torturing
                        until after init has spawned.
  
 +      torture.ftrace_dump_at_shutdown= [KNL]
 +                      Dump the ftrace buffer at torture-test shutdown,
 +                      even if there were no errors.  This can be a
 +                      very costly operation when many torture tests
 +                      are running concurrently, especially on systems
 +                      with rotating-rust storage.
 +
        tp720=          [HW,PS2]
  
        tpm_suspend_pcr=[HW,TPM]
                        panic() code such as dumping handler.
  
        xen_nopvspin    [X86,XEN]
 -                      Disables the ticketlock slowpath using Xen PV
 -                      optimizations.
 +                      Disables the qspinlock slowpath using Xen PV optimizations.
 +                      This parameter is obsoleted by "nopvspin" parameter, which
 +                      has equivalent effect for XEN platform.
  
        xen_nopv        [X86]
                        Disables the PV optimizations forcing the HVM guest to
                        as generic guest with no PV drivers. Currently support
                        XEN HVM, KVM, HYPER_V and VMWARE guest.
  
 +      nopvspin        [X86,XEN,KVM]
 +                      Disables the qspinlock slow path using PV optimizations
 +                      which allow the hypervisor to 'idle' the guest on lock
 +                      contention.
 +
        xirc2ps_cs=     [NET,PCMCIA]
                        Format:
                        <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
index f64668759b6a3bf5927181a9fc0ab5bdaf5bb633,b1ae1ac159cf91ebcd8b9a93b857c7299fecc03d..298c9c8bea9a232910c7c36eec32813dc99021e6
@@@ -35,8 -35,8 +35,8 @@@ Command Line Switche
    other CPUs later online.
  
  ``nr_cpus=n``
 -  Restrict the total amount CPUs the kernel will support. If the number
 -  supplied here is lower than the number of physically available CPUs than
 +  Restrict the total amount of CPUs the kernel will support. If the number
 +  supplied here is lower than the number of physically available CPUs, then
    those CPUs can not be brought online later.
  
  ``additional_cpus=n``
  
    This option is limited to the X86 and S390 architecture.
  
- ``cede_offline={"off","on"}``
-   Use this option to disable/enable putting offlined processors to an extended
-   ``H_CEDE`` state on supported pseries platforms. If nothing is specified,
-   ``cede_offline`` is set to "on".
-   This option is limited to the PowerPC architecture.
  ``cpu0_hotplug``
    Allow to shutdown CPU0.
  
index 68658a6f8c5b4fd7642d8d506a20ef30b00b7723,52ad74a25f54a9c68ee6556a3b8191662cfdf6ff..47e6903f47a5b722200e326254720ff1439cd2f6
@@@ -5,7 -5,7 +5,7 @@@
  #
  # Architecture requirements
  #
- # * arm/arm64
+ # * arm/arm64/powerpc
  #
  # Rely on implicit context synchronization as a result of exception return
  # when returning from IPI handler, and when returning to user-space.
      |       nios2: | TODO |
      |    openrisc: | TODO |
      |      parisc: | TODO |
-     |     powerpc: | TODO |
+     |     powerpc: |  ok  |
      |       riscv: | TODO |
      |        s390: | TODO |
      |          sh: | TODO |
      |       sparc: | TODO |
      |          um: | TODO |
 -    |   unicore32: | TODO |
      |         x86: |  ok  |
      |      xtensa: | TODO |
      -----------------------
index 4e55aba3eb4a90b983049e3134a9aa4acb1a9410,ff07cd3b2f82b2a264e01f6c38da6e5f36a7b90a..96186332e5f407016038b667d6a9f930fd3ba500
@@@ -553,12 -553,12 +553,12 @@@ There are certain things that the Linu
  DATA DEPENDENCY BARRIERS (HISTORICAL)
  -------------------------------------
  
 -As of v4.15 of the Linux kernel, an smp_read_barrier_depends() was
 -added to READ_ONCE(), which means that about the only people who
 -need to pay attention to this section are those working on DEC Alpha
 -architecture-specific code and those working on READ_ONCE() itself.
 -For those who need it, and for those who are interested in the history,
 -here is the story of data-dependency barriers.
 +As of v4.15 of the Linux kernel, an smp_mb() was added to READ_ONCE() for
 +DEC Alpha, which means that about the only people who need to pay attention
 +to this section are those working on DEC Alpha architecture-specific code
 +and those working on READ_ONCE() itself.  For those who need it, and for
 +those who are interested in the history, here is the story of
 +data-dependency barriers.
  
  The usage requirements of data dependency barriers are a little subtle, and
  it's not always obvious that they're needed.  To illustrate, consider the
@@@ -1935,6 -1935,20 +1935,20 @@@ There are some more advanced barrier fu
       relaxed I/O accessors and the Documentation/DMA-API.txt file for more
       information on consistent memory.
  
+  (*) pmem_wmb();
+      This is for use with persistent memory to ensure that stores for which
+      modifications are written to persistent storage reached a platform
+      durability domain.
+      For example, after a non-temporal write to pmem region, we use pmem_wmb()
+      to ensure that stores have reached a platform durability domain. This ensures
+      that stores have updated persistent storage before any data access or
+      data transfer caused by subsequent instructions is initiated. This is
+      in addition to the ordering done by wmb().
+      For load from persistent memory, existing read memory barriers are sufficient
+      to ensure read ordering.
  
  ===============================
  IMPLICIT KERNEL MEMORY BARRIERS
@@@ -2708,6 -2722,144 +2722,6 @@@ the properties of the memory window thr
  the use of any special device communication instructions the CPU may have.
  
  
 -CACHE COHERENCY
 ----------------
 -
 -Life isn't quite as simple as it may appear above, however: for while the
 -caches are expected to be coherent, there's no guarantee that that coherency
 -will be ordered.  This means that while changes made on one CPU will
 -eventually become visible on all CPUs, there's no guarantee that they will
 -become apparent in the same order on those other CPUs.
 -
 -
 -Consider dealing with a system that has a pair of CPUs (1 & 2), each of which
 -has a pair of parallel data caches (CPU 1 has A/B, and CPU 2 has C/D):
 -
 -                  :
 -                  :                          +--------+
 -                  :      +---------+         |        |
 -      +--------+  : +--->| Cache A |<------->|        |
 -      |        |  : |    +---------+         |        |
 -      |  CPU 1 |<---+                        |        |
 -      |        |  : |    +---------+         |        |
 -      +--------+  : +--->| Cache B |<------->|        |
 -                  :      +---------+         |        |
 -                  :                          | Memory |
 -                  :      +---------+         | System |
 -      +--------+  : +--->| Cache C |<------->|        |
 -      |        |  : |    +---------+         |        |
 -      |  CPU 2 |<---+                        |        |
 -      |        |  : |    +---------+         |        |
 -      +--------+  : +--->| Cache D |<------->|        |
 -                  :      +---------+         |        |
 -                  :                          +--------+
 -                  :
 -
 -Imagine the system has the following properties:
 -
 - (*) an odd-numbered cache line may be in cache A, cache C or it may still be
 -     resident in memory;
 -
 - (*) an even-numbered cache line may be in cache B, cache D or it may still be
 -     resident in memory;
 -
 - (*) while the CPU core is interrogating one cache, the other cache may be
 -     making use of the bus to access the rest of the system - perhaps to
 -     displace a dirty cacheline or to do a speculative load;
 -
 - (*) each cache has a queue of operations that need to be applied to that cache
 -     to maintain coherency with the rest of the system;
 -
 - (*) the coherency queue is not flushed by normal loads to lines already
 -     present in the cache, even though the contents of the queue may
 -     potentially affect those loads.
 -
 -Imagine, then, that two writes are made on the first CPU, with a write barrier
 -between them to guarantee that they will appear to reach that CPU's caches in
 -the requisite order:
 -
 -      CPU 1           CPU 2           COMMENT
 -      =============== =============== =======================================
 -                                      u == 0, v == 1 and p == &u, q == &u
 -      v = 2;
 -      smp_wmb();                      Make sure change to v is visible before
 -                                       change to p
 -      <A:modify v=2>                  v is now in cache A exclusively
 -      p = &v;
 -      <B:modify p=&v>                 p is now in cache B exclusively
 -
 -The write memory barrier forces the other CPUs in the system to perceive that
 -the local CPU's caches have apparently been updated in the correct order.  But
 -now imagine that the second CPU wants to read those values:
 -
 -      CPU 1           CPU 2           COMMENT
 -      =============== =============== =======================================
 -      ...
 -                      q = p;
 -                      x = *q;
 -
 -The above pair of reads may then fail to happen in the expected order, as the
 -cacheline holding p may get updated in one of the second CPU's caches while
 -the update to the cacheline holding v is delayed in the other of the second
 -CPU's caches by some other cache event:
 -
 -      CPU 1           CPU 2           COMMENT
 -      =============== =============== =======================================
 -                                      u == 0, v == 1 and p == &u, q == &u
 -      v = 2;
 -      smp_wmb();
 -      <A:modify v=2>  <C:busy>
 -                      <C:queue v=2>
 -      p = &v;         q = p;
 -                      <D:request p>
 -      <B:modify p=&v> <D:commit p=&v>
 -                      <D:read p>
 -                      x = *q;
 -                      <C:read *q>     Reads from v before v updated in cache
 -                      <C:unbusy>
 -                      <C:commit v=2>
 -
 -Basically, while both cachelines will be updated on CPU 2 eventually, there's
 -no guarantee that, without intervention, the order of update will be the same
 -as that committed on CPU 1.
 -
 -
 -To intervene, we need to interpolate a data dependency barrier or a read
 -barrier between the loads (which as of v4.15 is supplied unconditionally
 -by the READ_ONCE() macro).  This will force the cache to commit its
 -coherency queue before processing any further requests:
 -
 -      CPU 1           CPU 2           COMMENT
 -      =============== =============== =======================================
 -                                      u == 0, v == 1 and p == &u, q == &u
 -      v = 2;
 -      smp_wmb();
 -      <A:modify v=2>  <C:busy>
 -                      <C:queue v=2>
 -      p = &v;         q = p;
 -                      <D:request p>
 -      <B:modify p=&v> <D:commit p=&v>
 -                      <D:read p>
 -                      smp_read_barrier_depends()
 -                      <C:unbusy>
 -                      <C:commit v=2>
 -                      x = *q;
 -                      <C:read *q>     Reads from v after v updated in cache
 -
 -
 -This sort of problem can be encountered on DEC Alpha processors as they have a
 -split cache that improves performance by making better use of the data bus.
 -While most CPUs do imply a data dependency barrier on the read when a memory
 -access depends on a read, not all do, so it may not be relied on.
 -
 -Other CPUs may also have split caches, but must coordinate between the various
 -cachelets for normal memory accesses.  The semantics of the Alpha removes the
 -need for hardware coordination in the absence of memory barriers, which
 -permitted Alpha to sport higher CPU clock rates back in the day.  However,
 -please note that (again, as of v4.15) smp_read_barrier_depends() should not
 -be used except in Alpha arch-specific code and within the READ_ONCE() macro.
 -
 -
  CACHE COHERENCY VS DMA
  ----------------------
  
@@@ -2871,8 -3023,10 +2885,8 @@@ caches with the memory coherence system
  changes vs new data occur in the right order.
  
  The Alpha defines the Linux kernel's memory model, although as of v4.15
 -the Linux kernel's addition of smp_read_barrier_depends() to READ_ONCE()
 -greatly reduced Alpha's impact on the memory model.
 -
 -See the subsection on "Cache Coherency" above.
 +the Linux kernel's addition of smp_mb() to READ_ONCE() on Alpha greatly
 +reduced its impact on the memory model.
  
  
  VIRTUAL MACHINE GUESTS
index cdfd98155311164e93326fee27d5e08fdff4a86d,8cb6eb76c1292a65fa7ae9ca462e7cb81c52c614..eb3a1316f03ec91fc1a310b29ad2191493bf102f
@@@ -65,7 -65,7 +65,7 @@@ not be freed until both the parent (ori
  put their references to the VM's file descriptor.
  
  Because a VM's resources are not freed until the last reference to its
 -file descriptor is released, creating additional references to a VM via
 +file descriptor is released, creating additional references to a VM
  via fork(), dup(), etc... without careful consideration is strongly
  discouraged and may have unwanted side effects, e.g. memory allocated
  by and on behalf of the VM's process may not be freed/unaccounted when
@@@ -536,7 -536,7 +536,7 @@@ X86
        ========= ===================================
          0       on success,
         -EEXIST  if an interrupt is already enqueued
 -       -EINVAL  the the irq number is invalid
 +       -EINVAL  the irq number is invalid
         -ENXIO   if the PIC is in the kernel
         -EFAULT  if the pointer is invalid
        ========= ===================================
@@@ -669,10 -669,6 +669,10 @@@ MSRs that have been set successfully
  Defines the vcpu responses to the cpuid instruction.  Applications
  should use the KVM_SET_CPUID2 ioctl if available.
  
 +Note, when this IOCTL fails, KVM gives no guarantees that previous valid CPUID
 +configuration (if there is) is not corrupted. Userspace can get a copy of the
 +resulting CPUID configuration through KVM_GET_CPUID2 in case.
 +
  ::
  
    struct kvm_cpuid_entry {
@@@ -2160,9 -2156,12 +2160,12 @@@ registers, find a list below
    PPC     KVM_REG_PPC_MMCRA               64
    PPC     KVM_REG_PPC_MMCR2               64
    PPC     KVM_REG_PPC_MMCRS               64
+   PPC     KVM_REG_PPC_MMCR3               64
    PPC     KVM_REG_PPC_SIAR                64
    PPC     KVM_REG_PPC_SDAR                64
    PPC     KVM_REG_PPC_SIER                64
+   PPC     KVM_REG_PPC_SIER2               64
+   PPC     KVM_REG_PPC_SIER3               64
    PPC     KVM_REG_PPC_PMC1                32
    PPC     KVM_REG_PPC_PMC2                32
    PPC     KVM_REG_PPC_PMC3                32
@@@ -3151,7 -3150,7 +3154,7 @@@ Possible features
  :Capability: basic
  :Architectures: arm, arm64
  :Type: vm ioctl
 -:Parameters: struct struct kvm_vcpu_init (out)
 +:Parameters: struct kvm_vcpu_init (out)
  :Returns: 0 on success; -1 on error
  
  Errors:
@@@ -3171,7 -3170,7 +3174,7 @@@ not mandatory
  
  The information returned by this ioctl can be used to prepare an instance
  of struct kvm_vcpu_init for KVM_ARM_VCPU_INIT ioctl which will result in
 -in VCPU matching underlying host.
 +VCPU matching underlying host.
  
  
  4.84 KVM_GET_REG_LIST
@@@ -4343,15 -4342,14 +4346,15 @@@ Errors
  #define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
  
    struct kvm_vmx_nested_state_hdr {
 -      __u32 flags;
        __u64 vmxon_pa;
        __u64 vmcs12_pa;
 -      __u64 preemption_timer_deadline;
  
        struct {
                __u16 flags;
        } smm;
 +
 +      __u32 flags;
 +      __u64 preemption_timer_deadline;
    };
  
    struct kvm_vmx_nested_state_data {
@@@ -4799,7 -4797,6 +4802,7 @@@ hardware_exit_reason
                /* KVM_EXIT_FAIL_ENTRY */
                struct {
                        __u64 hardware_entry_failure_reason;
 +                      __u32 cpu; /* if KVM_LAST_CPU */
                } fail_entry;
  
  If exit_reason is KVM_EXIT_FAIL_ENTRY, the vcpu could not be run due
@@@ -5861,7 -5858,7 +5864,7 @@@ features of the KVM implementation
  :Architectures: ppc
  
  This capability, if KVM_CHECK_EXTENSION indicates that it is
 -available, means that that the kernel has an implementation of the
 +available, means that the kernel has an implementation of the
  H_RANDOM hypercall backed by a hardware random-number generator.
  If present, the kernel H_RANDOM handler can be enabled for guest use
  with the KVM_CAP_PPC_ENABLE_HCALL capability.
  :Architectures: x86
  
  This capability, if KVM_CHECK_EXTENSION indicates that it is
 -available, means that that the kernel has an implementation of the
 +available, means that the kernel has an implementation of the
  Hyper-V Synthetic interrupt controller(SynIC). Hyper-V SynIC is
  used to support Windows Hyper-V based guest paravirt drivers(VMBus).
  
@@@ -5887,7 -5884,7 +5890,7 @@@ by the CPU, as it's incompatible with S
  :Architectures: ppc
  
  This capability, if KVM_CHECK_EXTENSION indicates that it is
 -available, means that that the kernel can support guests using the
 +available, means that the kernel can support guests using the
  radix MMU defined in Power ISA V3.00 (as implemented in the POWER9
  processor).
  
  :Architectures: ppc
  
  This capability, if KVM_CHECK_EXTENSION indicates that it is
 -available, means that that the kernel can support guests using the
 +available, means that the kernel can support guests using the
  hashed page table MMU defined in Power ISA V3.00 (as implemented in
  the POWER9 processor), including in-memory segment tables.
  
@@@ -6002,7 -5999,7 +6005,7 @@@ run->kvm_valid_regs or run->kvm_dirty_r
  
  If KVM_CAP_ARM_USER_IRQ is supported, the KVM_CHECK_EXTENSION ioctl returns a
  number larger than 0 indicating the version of this capability is implemented
 -and thereby which bits in in run->s.regs.device_irq_level can signal values.
 +and thereby which bits in run->s.regs.device_irq_level can signal values.
  
  Currently the following bits are defined for the device_irq_level bitmap::
  
diff --combined MAINTAINERS
index a45fe1a6251ea83296be259c54b92ffc2730f00e,7de395dfbdd50df6728cc7d614ed3919ba3bdb53..9590b98ad26d131fcb444b32c47b53e3cb25d93f
@@@ -147,7 -147,7 +147,7 @@@ Maintainers Lis
  M:    Steffen Klassert <klassert@kernel.org>
  L:    netdev@vger.kernel.org
  S:    Odd Fixes
 -F:    Documentation/networking/device_drivers/3com/vortex.rst
 +F:    Documentation/networking/device_drivers/ethernet/3com/vortex.rst
  F:    drivers/net/ethernet/3com/3c59x.c
  
  3CR990 NETWORK DRIVER
@@@ -782,7 -782,7 +782,7 @@@ F: include/dt-bindings/reset/altr,rst-m
  F:    include/linux/mfd/altera-a10sr.h
  
  ALTERA TRIPLE SPEED ETHERNET DRIVER
 -M:    Thor Thayer <thor.thayer@linux.intel.com>
 +M:    Joyce Ooi <joyce.ooi@intel.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ethernet/altera/
@@@ -816,7 -816,7 +816,7 @@@ R: Saeed Bishara <saeedb@amazon.com
  R:    Zorik Machulsky <zorik@amazon.com>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    Documentation/networking/device_drivers/amazon/ena.rst
 +F:    Documentation/networking/device_drivers/ethernet/amazon/ena.rst
  F:    drivers/net/ethernet/amazon/
  
  AMAZON RDMA EFA DRIVER
@@@ -830,20 -830,11 +830,20 @@@ F:      include/uapi/rdma/efa-abi.
  
  AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER
  M:    Tom Lendacky <thomas.lendacky@amd.com>
 +M:    John Allen <john.allen@amd.com>
  L:    linux-crypto@vger.kernel.org
  S:    Supported
  F:    drivers/crypto/ccp/
  F:    include/linux/ccp.h
  
 +AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - SEV SUPPORT
 +M:    Brijesh Singh <brijesh.singh@amd.com>
 +M:    Tom Lendacky <thomas.lendacky@amd.com>
 +L:    linux-crypto@vger.kernel.org
 +S:    Supported
 +F:    drivers/crypto/ccp/sev*
 +F:    include/uapi/linux/psp-sev.h
 +
  AMD DISPLAY CORE
  M:    Harry Wentland <harry.wentland@amd.com>
  M:    Leo Li <sunpeng.li@amd.com>
@@@ -1082,7 -1073,6 +1082,7 @@@ L:      linux-media@vger.kernel.or
  S:    Supported
  W:    http://ez.analog.com/community/linux-device-drivers
  F:    drivers/media/i2c/adv7180.c
 +F:    Documentation/devicetree/bindings/media/i2c/adv7180.yaml
  
  ANALOG DEVICES INC ADV748X DRIVER
  M:    Kieran Bingham <kieran.bingham@ideasonboard.com>
@@@ -1180,8 -1170,6 +1180,8 @@@ M:      Todd Kjos <tkjos@android.com
  M:    Martijn Coenen <maco@android.com>
  M:    Joel Fernandes <joel@joelfernandes.org>
  M:    Christian Brauner <christian@brauner.io>
 +M:    Hridya Valsaraju <hridya@google.com>
 +M:    Suren Baghdasaryan <surenb@google.com>
  L:    devel@driverdev.osuosl.org
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
@@@ -1307,7 -1295,7 +1307,7 @@@ L:      netdev@vger.kernel.or
  S:    Supported
  W:    https://www.marvell.com/
  Q:    http://patchwork.ozlabs.org/project/netdev/list/
 -F:    Documentation/networking/device_drivers/aquantia/atlantic.rst
 +F:    Documentation/networking/device_drivers/ethernet/aquantia/atlantic.rst
  F:    drivers/net/ethernet/aquantia/atlantic/
  
  AQUANTIA ETHERNET DRIVER PTP SUBSYSTEM
@@@ -1437,7 -1425,7 +1437,7 @@@ F:      arch/arm*/include/asm/perf_event.
  F:    arch/arm*/kernel/hw_breakpoint.c
  F:    arch/arm*/kernel/perf_*
  F:    arch/arm/oprofile/common.c
 -F:    drivers/perf/*
 +F:    drivers/perf/
  F:    include/linux/perf/arm_pmu.h
  
  ARM PORT
@@@ -1460,6 -1448,11 +1460,6 @@@ S:     Odd Fixe
  F:    drivers/amba/
  F:    include/linux/amba/bus.h
  
 -ARM PRIMECELL CLCD PL110 DRIVER
 -M:    Russell King <linux@armlinux.org.uk>
 -S:    Odd Fixes
 -F:    drivers/video/fbdev/amba-clcd.*
 -
  ARM PRIMECELL KMI PL050 DRIVER
  M:    Russell King <linux@armlinux.org.uk>
  S:    Odd Fixes
@@@ -1604,9 -1597,6 +1604,9 @@@ F:      sound/soc/meson
  
  ARM/Amlogic Meson SoC support
  M:    Kevin Hilman <khilman@baylibre.com>
 +R:    Neil Armstrong <narmstrong@baylibre.com>
 +R:    Jerome Brunet <jbrunet@baylibre.com>
 +R:    Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    linux-amlogic@lists.infradead.org
  S:    Maintained
@@@ -1627,7 -1617,7 +1627,7 @@@ L:      linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    arch/arm/boot/dts/alpine*
  F:    arch/arm/mach-alpine/
 -F:    arch/arm64/boot/dts/al/
 +F:    arch/arm64/boot/dts/amazon/
  F:    drivers/*/*alpine*
  
  ARM/ARTPEC MACHINE SUPPORT
@@@ -1964,14 -1954,6 +1964,14 @@@ F:    drivers/irqchip/irq-ixp4xx.
  F:    include/linux/irqchip/irq-ixp4xx.h
  F:    include/linux/platform_data/timer-ixp4xx.h
  
 +ARM/INTEL KEEMBAY ARCHITECTURE
 +M:    Paul J. Murphy <paul.j.murphy@intel.com>
 +M:    Daniele Alessandrelli <daniele.alessandrelli@intel.com>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/arm/intel,keembay.yaml
 +F:    arch/arm64/boot/dts/intel/keembay-evm.dts
 +F:    arch/arm64/boot/dts/intel/keembay-soc.dtsi
 +
  ARM/INTEL RESEARCH IMOTE/STARGATE 2 MACHINE SUPPORT
  M:    Jonathan Cameron <jic23@cam.ac.uk>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2129,32 -2111,12 +2129,32 @@@ X:   drivers/net/wireless/atmel
  N:    at91
  N:    atmel
  
 +ARM/Microchip Sparx5 SoC support
 +M:    Lars Povlsen <lars.povlsen@microchip.com>
 +M:    Steen Hegelund <Steen.Hegelund@microchip.com>
 +M:    Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Supported
 +F:    arch/arm64/boot/dts/microchip/
 +N:    sparx5
 +
  ARM/MIOA701 MACHINE SUPPORT
  M:    Robert Jarzmik <robert.jarzmik@free.fr>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-pxa/mioa701.c
  
 +ARM/MStar/Sigmastar Armv7 SoC support
 +M:    Daniel Palmer <daniel@thingy.jp>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +W:    http://linux-chenxing.org/
 +F:    Documentation/devicetree/bindings/arm/mstar/*
 +F:    arch/arm/boot/dts/infinity*.dtsi
 +F:    arch/arm/boot/dts/mercury*.dtsi
 +F:    arch/arm/boot/dts/mstar-v7.dtsi
 +F:    arch/arm/mach-mstar/
 +
  ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT
  M:    Michael Petchkovsky <mkpetch@internode.on.net>
  S:    Maintained
@@@ -2309,7 -2271,7 +2309,7 @@@ F:      drivers/pci/controller/dwc/pcie-qcom
  F:    drivers/phy/qualcomm/
  F:    drivers/power/*/msm*
  F:    drivers/reset/reset-qcom-*
 -F:    drivers/scsi/ufs/ufs-qcom.*
 +F:    drivers/scsi/ufs/ufs-qcom*
  F:    drivers/spi/spi-geni-qcom.c
  F:    drivers/spi/spi-qcom-qspi.c
  F:    drivers/spi/spi-qup.c
@@@ -2865,7 -2827,7 +2865,7 @@@ ASYMMETRIC KEY
  M:    David Howells <dhowells@redhat.com>
  L:    keyrings@vger.kernel.org
  S:    Maintained
 -F:    Documentation/crypto/asymmetric-keys.txt
 +F:    Documentation/crypto/asymmetric-keys.rst
  F:    crypto/asymmetric_keys/
  F:    include/crypto/pkcs7.h
  F:    include/crypto/public_key.h
@@@ -2875,7 -2837,7 +2875,7 @@@ ASYNCHRONOUS TRANSFERS/TRANSFORMS (IOAT
  R:    Dan Williams <dan.j.williams@intel.com>
  S:    Odd fixes
  W:    http://sourceforge.net/projects/xscaleiop
 -F:    Documentation/crypto/async-tx-api.txt
 +F:    Documentation/crypto/async-tx-api.rst
  F:    crypto/async_tx/
  F:    drivers/dma/
  F:    include/linux/async_tx.h
@@@ -2919,7 -2881,7 +2919,7 @@@ S:      Supporte
  F:    drivers/net/wireless/ath/*
  
  ATHEROS ATH5K WIRELESS DRIVER
 -M:    Jiri Slaby <jirislaby@gmail.com>
 +M:    Jiri Slaby <jirislaby@kernel.org>
  M:    Nick Kossifidis <mickflemm@gmail.com>
  M:    Luis Chamberlain <mcgrof@kernel.org>
  L:    linux-wireless@vger.kernel.org
@@@ -2967,7 -2929,6 +2967,7 @@@ F:      include/uapi/linux/atm
  
  ATMEL MACB ETHERNET DRIVER
  M:    Nicolas Ferre <nicolas.ferre@microchip.com>
 +M:    Claudiu Beznea <claudiu.beznea@microchip.com>
  S:    Supported
  F:    drivers/net/ethernet/cadence/
  
@@@ -3345,7 -3306,7 +3345,7 @@@ X:      arch/riscv/net/bpf_jit_comp32.
  
  BPF JIT for S390
  M:    Ilya Leoshkevich <iii@linux.ibm.com>
 -M:    Heiko Carstens <heiko.carstens@de.ibm.com>
 +M:    Heiko Carstens <hca@linux.ibm.com>
  M:    Vasily Gorbik <gor@linux.ibm.com>
  L:    netdev@vger.kernel.org
  L:    bpf@vger.kernel.org
@@@ -3621,7 -3582,6 +3621,7 @@@ M:      Selvin Xavier <selvin.xavier@broadco
  M:    Devesh Sharma <devesh.sharma@broadcom.com>
  M:    Somnath Kotur <somnath.kotur@broadcom.com>
  M:    Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
 +M:    Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>
  L:    linux-rdma@vger.kernel.org
  S:    Supported
  W:    http://www.broadcom.com
@@@ -3986,7 -3946,7 +3986,7 @@@ L:      linux-crypto@vger.kernel.or
  S:    Supported
  F:    drivers/char/hw_random/cctrng.c
  F:    drivers/char/hw_random/cctrng.h
 -F:    Documentation/devicetree/bindings/rng/arm-cctrng.txt
 +F:    Documentation/devicetree/bindings/rng/arm-cctrng.yaml
  W:    https://developer.arm.com/products/system-ip/trustzone-cryptocell/cryptocell-700-family
  
  CEC FRAMEWORK
@@@ -4387,12 -4347,6 +4387,12 @@@ L:    netdev@vger.kernel.or
  S:    Maintained
  F:    drivers/connector/
  
 +CONSOLE SUBSYSTEM
 +M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +S:    Supported
 +F:    drivers/video/console/
 +F:    include/linux/console*
 +
  CONTROL GROUP (CGROUP)
  M:    Tejun Heo <tj@kernel.org>
  M:    Li Zefan <lizefan@huawei.com>
@@@ -4446,12 -4400,6 +4446,12 @@@ S:    Maintaine
  F:    Documentation/hwmon/coretemp.rst
  F:    drivers/hwmon/coretemp.c
  
 +CORSAIR-CPRO HARDWARE MONITOR DRIVER
 +M:    Marius Zachmann <mail@mariuszachmann.de>
 +L:    linux-hwmon@vger.kernel.org
 +S:    Maintained
 +F:    drivers/hwmon/corsair-cpro.c
 +
  COSA/SRP SYNC SERIAL DRIVER
  M:    Jan "Yenya" Kasprzak <kas@fi.muni.cz>
  S:    Maintained
@@@ -4805,7 -4753,7 +4805,7 @@@ F:      net/ax25/sysctl_net_ax25.
  DAVICOM FAST ETHERNET (DMFE) NETWORK DRIVER
  L:    netdev@vger.kernel.org
  S:    Orphan
 -F:    Documentation/networking/device_drivers/dec/dmfe.rst
 +F:    Documentation/networking/device_drivers/ethernet/dec/dmfe.rst
  F:    drivers/net/ethernet/dec/tulip/dmfe.c
  
  DC390/AM53C974 SCSI driver
@@@ -5073,6 -5021,7 +5073,6 @@@ F:      drivers/mfd/da91??-*.
  F:    drivers/pinctrl/pinctrl-da90??.c
  F:    drivers/power/supply/da9052-battery.c
  F:    drivers/power/supply/da91??-*.c
 -F:    drivers/regulator/da903x.c
  F:    drivers/regulator/da9???-regulator.[ch]
  F:    drivers/regulator/slg51000-regulator.[ch]
  F:    drivers/rtc/rtc-da90??.c
@@@ -5145,7 -5094,6 +5145,7 @@@ F:      fs/dlm
  
  DMA BUFFER SHARING FRAMEWORK
  M:    Sumit Semwal <sumit.semwal@linaro.org>
 +M:    Christian König <christian.koenig@amd.com>
  L:    linux-media@vger.kernel.org
  L:    dri-devel@lists.freedesktop.org
  L:    linaro-mm-sig@lists.linaro.org (moderated for non-subscribers)
@@@ -5163,7 -5111,7 +5163,7 @@@ M:      Vinod Koul <vkoul@kernel.org
  L:    dmaengine@vger.kernel.org
  S:    Maintained
  Q:    https://patchwork.kernel.org/project/linux-dmaengine/list/
 -T:    git git://git.infradead.org/users/vkoul/slave-dma.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git
  F:    Documentation/devicetree/bindings/dma/
  F:    Documentation/driver-api/dmaengine/
  F:    drivers/dma/
@@@ -5293,8 -5241,8 +5293,8 @@@ M:      Ioana Ciornei <ioana.ciornei@nxp.com
  M:    Ioana Radulescu <ruxandra.radulescu@nxp.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
 -F:    Documentation/networking/device_drivers/freescale/dpaa2/ethernet-driver.rst
 -F:    Documentation/networking/device_drivers/freescale/dpaa2/mac-phy-support.rst
 +F:    Documentation/networking/device_drivers/ethernet/freescale/dpaa2/ethernet-driver.rst
 +F:    Documentation/networking/device_drivers/ethernet/freescale/dpaa2/mac-phy-support.rst
  F:    drivers/net/ethernet/freescale/dpaa2/Kconfig
  F:    drivers/net/ethernet/freescale/dpaa2/Makefile
  F:    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth*
@@@ -5542,7 -5490,7 +5542,7 @@@ F:      include/uapi/drm/r128_drm.
  DRM DRIVER FOR RAYDIUM RM67191 PANELS
  M:    Robert Chiras <robert.chiras@nxp.com>
  S:    Maintained
 -F:    Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
 +F:    Documentation/devicetree/bindings/display/panel/raydium,rm67191.yaml
  F:    drivers/gpu/drm/panel/panel-raydium-rm67191.c
  
  DRM DRIVER FOR ROCKTECH JH057N00900 PANELS
@@@ -5871,7 -5819,7 +5871,7 @@@ M:      Eric Anholt <eric@anholt.net
  S:    Supported
  T:    git git://github.com/anholt/linux
  T:    git git://anongit.freedesktop.org/drm/drm-misc
 -F:    Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt
 +F:    Documentation/devicetree/bindings/display/brcm,bcm2835-*.yaml
  F:    drivers/gpu/drm/vc4/
  F:    include/uapi/drm/vc4_drm.h
  
@@@ -5895,15 -5843,6 +5895,15 @@@ T:    git git://anongit.freedesktop.org/dr
  F:    Documentation/gpu/xen-front.rst
  F:    drivers/gpu/drm/xen/
  
 +DRM DRIVERS FOR XILINX
 +M:    Hyun Kwon <hyun.kwon@xilinx.com>
 +M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 +L:    dri-devel@lists.freedesktop.org
 +S:    Maintained
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
 +F:    Documentation/devicetree/bindings/display/xlnx/
 +F:    drivers/gpu/drm/xlnx/
 +
  DRM DRIVERS FOR ZTE ZX
  M:    Shawn Guo <shawnguo@kernel.org>
  L:    dri-devel@lists.freedesktop.org
@@@ -7017,7 -6956,6 +7017,7 @@@ M:      Timur Tabi <timur@kernel.org
  M:    Nicolin Chen <nicoleotsuka@gmail.com>
  M:    Xiubo Li <Xiubo.Lee@gmail.com>
  R:    Fabio Estevam <festevam@gmail.com>
 +R:    Shengjiu Wang <shengjiu.wang@gmail.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  L:    linuxppc-dev@lists.ozlabs.org
  S:    Maintained
@@@ -7032,13 -6970,6 +7032,13 @@@ L:    linuxppc-dev@lists.ozlabs.or
  S:    Maintained
  F:    drivers/usb/gadget/udc/fsl*
  
 +FREESCALE USB PHY DRIVER
 +M:    Ran Wang <ran.wang_1@nxp.com>
 +L:    linux-usb@vger.kernel.org
 +L:    linuxppc-dev@lists.ozlabs.org
 +S:    Maintained
 +F:    drivers/usb/phy/phy-fsl-usb*
 +
  FREEVXFS FILESYSTEM
  M:    Christoph Hellwig <hch@infradead.org>
  S:    Maintained
@@@ -7175,7 -7106,7 +7175,7 @@@ F:      include/linux/futex.
  F:    include/uapi/linux/futex.h
  F:    kernel/futex.c
  F:    tools/perf/bench/futex*
 -F:    Documentation/locking/*futex*
 +F:    tools/testing/selftests/futex/
  
  GATEWORKS SYSTEM CONTROLLER (GSC) DRIVER
  M:    Tim Harvey <tharvey@gateworks.com>
@@@ -7371,7 -7302,7 +7371,7 @@@ R:      Sagi Shahar <sagis@google.com
  R:    Jon Olson <jonolson@google.com>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    Documentation/networking/device_drivers/google/gve.rst
 +F:    Documentation/networking/device_drivers/ethernet/google/gve.rst
  F:    drivers/net/ethernet/google
  
  GPD POCKET FAN DRIVER
@@@ -7982,7 -7913,7 +7982,7 @@@ HUAWEI ETHERNET DRIVE
  M:    Bin Luo <luobin9@huawei.com>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    Documentation/networking/hinic.rst
 +F:    Documentation/networking/device_drivers/ethernet/huawei/hinic.rst
  F:    drivers/net/ethernet/huawei/hinic/
  
  HUGETLB FILESYSTEM
@@@ -8034,7 -7965,7 +8034,7 @@@ S:      Supporte
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git
  F:    Documentation/ABI/stable/sysfs-bus-vmbus
  F:    Documentation/ABI/testing/debugfs-hyperv
 -F:    Documentation/networking/device_drivers/microsoft/netvsc.rst
 +F:    Documentation/networking/device_drivers/ethernet/microsoft/netvsc.rst
  F:    arch/x86/hyperv
  F:    arch/x86/include/asm/hyperv-tlfs.h
  F:    arch/x86/include/asm/mshyperv.h
@@@ -8402,7 -8333,7 +8402,7 @@@ M:      Alexander Aring <alex.aring@gmail.co
  M:    Stefan Schmidt <stefan@datenfreihafen.org>
  L:    linux-wpan@vger.kernel.org
  S:    Maintained
 -W:    http://wpan.cakelab.org/
 +W:    https://linux-wpan.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next.git
  F:    Documentation/networking/ieee802154.rst
@@@ -8669,12 -8600,6 +8669,12 @@@ L:    platform-driver-x86@vger.kernel.or
  S:    Maintained
  F:    drivers/platform/x86/intel_atomisp2_pm.c
  
 +INTEL ATOMISP2 LED DRIVER
 +M:    Hans de Goede <hdegoede@redhat.com>
 +L:    platform-driver-x86@vger.kernel.org
 +S:    Maintained
 +F:    drivers/platform/x86/intel_atomisp2_led.c
 +
  INTEL BROXTON PMC DRIVER
  M:    Mika Westerberg <mika.westerberg@linux.intel.com>
  M:    Zha Qipeng <qipeng.zha@intel.com>
@@@ -8722,7 -8647,18 +8722,7 @@@ W:     http://e1000.sourceforge.net
  Q:    http://patchwork.ozlabs.org/project/intel-wired-lan/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git
 -F:    Documentation/networking/device_drivers/intel/e100.rst
 -F:    Documentation/networking/device_drivers/intel/e1000.rst
 -F:    Documentation/networking/device_drivers/intel/e1000e.rst
 -F:    Documentation/networking/device_drivers/intel/fm10k.rst
 -F:    Documentation/networking/device_drivers/intel/i40e.rst
 -F:    Documentation/networking/device_drivers/intel/iavf.rst
 -F:    Documentation/networking/device_drivers/intel/ice.rst
 -F:    Documentation/networking/device_drivers/intel/igb.rst
 -F:    Documentation/networking/device_drivers/intel/igbvf.rst
 -F:    Documentation/networking/device_drivers/intel/ixgb.rst
 -F:    Documentation/networking/device_drivers/intel/ixgbe.rst
 -F:    Documentation/networking/device_drivers/intel/ixgbevf.rst
 +F:    Documentation/networking/device_drivers/ethernet/intel/
  F:    drivers/net/ethernet/intel/
  F:    drivers/net/ethernet/intel/*/
  F:    include/linux/avf/virtchnl.h
@@@ -8850,7 -8786,7 +8850,7 @@@ M:      Tomas Winkler <tomas.winkler@intel.c
  L:    linux-kernel@vger.kernel.org
  S:    Supported
  F:    Documentation/driver-api/mei/*
 -F:    drivers/misc/mei/*
 +F:    drivers/misc/mei/
  F:    drivers/watchdog/mei_wdt.c
  F:    include/linux/mei_cl_bus.h
  F:    include/uapi/linux/mei.h
@@@ -8912,8 -8848,8 +8912,8 @@@ INTEL PRO/WIRELESS 2100, 2200BG, 2915AB
  M:    Stanislav Yakovlev <stas.yakovlev@gmail.com>
  L:    linux-wireless@vger.kernel.org
  S:    Maintained
 -F:    Documentation/networking/device_drivers/intel/ipw2100.rst
 -F:    Documentation/networking/device_drivers/intel/ipw2200.rst
 +F:    Documentation/networking/device_drivers/wifi/intel/ipw2100.rst
 +F:    Documentation/networking/device_drivers/wifi/intel/ipw2200.rst
  F:    drivers/net/wireless/intel/ipw2x00/
  
  INTEL PSTATE DRIVER
@@@ -9043,14 -8979,6 +9043,14 @@@ F:    include/dt-bindings/interconnect
  F:    include/linux/interconnect-provider.h
  F:    include/linux/interconnect.h
  
 +INVENSENSE ICM-426xx IMU DRIVER
 +M:    Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
 +L:    linux-iio@vger.kernel.org
 +S:    Maintained
 +W     https://invensense.tdk.com/
 +F:    Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml
 +F:    drivers/iio/imu/inv_icm42600/
 +
  INVENSENSE MPU-3050 GYROSCOPE DRIVER
  M:    Linus Walleij <linus.walleij@linaro.org>
  L:    linux-iio@vger.kernel.org
@@@ -9377,17 -9305,6 +9377,17 @@@ F:    Documentation/kbuild/kconfig
  F:    scripts/Kconfig.include
  F:    scripts/kconfig/
  
 +KCOV
 +R:    Dmitry Vyukov <dvyukov@google.com>
 +R:    Andrey Konovalov <andreyknvl@google.com>
 +L:    kasan-dev@googlegroups.com
 +S:    Maintained
 +F:    Documentation/dev-tools/kcov.rst
 +F:    include/linux/kcov.h
 +F:    include/uapi/linux/kcov.h
 +F:    kernel/kcov.c
 +F:    scripts/Makefile.kcov
 +
  KCSAN
  M:    Marco Elver <elver@google.com>
  R:    Dmitry Vyukov <dvyukov@google.com>
@@@ -9524,11 -9441,9 +9524,11 @@@ F:    arch/arm64/kvm
  F:    include/kvm/arm_*
  
  KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips)
 +M:    Huacai Chen <chenhc@lemote.com>
 +M:    Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
  L:    linux-mips@vger.kernel.org
  L:    kvm@vger.kernel.org
 -S:    Orphan
 +S:    Maintained
  F:    arch/mips/include/asm/kvm*
  F:    arch/mips/include/uapi/asm/kvm*
  F:    arch/mips/kvm/
@@@ -9682,7 -9597,7 +9682,7 @@@ M:      Anil S Keshavamurthy <anil.s.keshava
  M:    "David S. Miller" <davem@davemloft.net>
  M:    Masami Hiramatsu <mhiramat@kernel.org>
  S:    Maintained
 -F:    Documentation/kprobes.txt
 +F:    Documentation/trace/kprobes.rst
  F:    include/asm-generic/kprobes.h
  F:    include/linux/kprobes.h
  F:    kernel/kprobes.c
@@@ -9754,10 -9669,12 +9754,10 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    scripts/leaking_addresses.pl
  
  LED SUBSYSTEM
 -M:    Jacek Anaszewski <jacek.anaszewski@gmail.com>
  M:    Pavel Machek <pavel@ucw.cz>
  R:    Dan Murphy <dmurphy@ti.com>
  L:    linux-leds@vger.kernel.org
  S:    Maintained
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git
  F:    Documentation/devicetree/bindings/leds/
  F:    drivers/leds/
@@@ -10043,7 -9960,6 +10043,7 @@@ M:    Luc Maranget <luc.maranget@inria.fr
  M:    "Paul E. McKenney" <paulmck@kernel.org>
  R:    Akira Yokosawa <akiyks@gmail.com>
  R:    Daniel Lustig <dlustig@nvidia.com>
 +R:    Joel Fernandes <joel@joelfernandes.org>
  L:    linux-kernel@vger.kernel.org
  L:    linux-arch@vger.kernel.org
  S:    Supported
@@@ -10052,7 -9968,6 +10052,7 @@@ F:    Documentation/atomic_bitops.tx
  F:    Documentation/atomic_t.txt
  F:    Documentation/core-api/atomic_ops.rst
  F:    Documentation/core-api/refcount-vs-atomic.rst
 +F:    Documentation/litmus-tests/
  F:    Documentation/memory-barriers.txt
  F:    tools/memory-model/
  
@@@ -10447,7 -10362,7 +10447,7 @@@ M:   Geetha sowjanya <gakula@marvell.com
  M:    Jerin Jacob <jerinj@marvell.com>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    Documentation/networking/device_drivers/marvell/octeontx2.rst
 +F:    Documentation/networking/device_drivers/ethernet/marvell/octeontx2.rst
  F:    drivers/net/ethernet/marvell/octeontx2/af/
  
  MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
@@@ -10893,7 -10808,7 +10893,7 @@@ F:   Documentation/devicetree/bindings/dm
  F:    drivers/dma/mediatek/
  
  MEDIATEK ETHERNET DRIVER
 -M:    Felix Fietkau <nbd@openwrt.org>
 +M:    Felix Fietkau <nbd@nbd.name>
  M:    John Crispin <john@phrozen.org>
  M:    Sean Wang <sean.wang@mediatek.com>
  M:    Mark Lee <Mark-MC.Lee@mediatek.com>
@@@ -11116,7 -11031,7 +11116,7 @@@ L:   linux-rdma@vger.kernel.or
  S:    Supported
  W:    http://www.mellanox.com
  Q:    http://patchwork.ozlabs.org/project/netdev/list/
 -F:    Documentation/networking/device_drivers/mellanox/
 +F:    Documentation/networking/device_drivers/ethernet/mellanox/
  F:    drivers/net/ethernet/mellanox/mlx5/core/
  F:    include/linux/mlx5/
  
@@@ -11170,23 -11085,6 +11170,23 @@@ F: Documentation/core-api/boot-time-mm.
  F:    include/linux/memblock.h
  F:    mm/memblock.c
  
 +MEMORY CONTROLLER DRIVERS
 +M:    Krzysztof Kozlowski <krzk@kernel.org>
 +L:    linux-kernel@vger.kernel.org
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git
 +F:    Documentation/devicetree/bindings/memory-controllers/
 +F:    drivers/memory/
 +
 +MEMORY FREQUENCY SCALING DRIVERS FOR NVIDIA TEGRA
 +M:    Dmitry Osipenko <digetx@gmail.com>
 +L:    linux-pm@vger.kernel.org
 +L:    linux-tegra@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git
 +S:    Maintained
 +F:    drivers/devfreq/tegra20-devfreq.c
 +F:    drivers/devfreq/tegra30-devfreq.c
 +
  MEMORY MANAGEMENT
  M:    Andrew Morton <akpm@linux-foundation.org>
  L:    linux-mm@kvack.org
@@@ -11342,7 -11240,7 +11342,7 @@@ S:   Maintaine
  F:    drivers/crypto/atmel-ecc.*
  
  MICROCHIP I2C DRIVER
 -M:    Ludovic Desroches <ludovic.desroches@microchip.com>
 +M:    Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
  L:    linux-i2c@vger.kernel.org
  S:    Supported
  F:    drivers/i2c/busses/i2c-at91-*.c
@@@ -11426,6 -11324,7 +11426,6 @@@ F:   Documentation/devicetree/bindings/pw
  F:    drivers/pwm/pwm-atmel.c
  
  MICROCHIP SAMA5D2-COMPATIBLE ADC DRIVER
 -M:    Ludovic Desroches <ludovic.desroches@microchip.com>
  M:    Eugen Hristev <eugen.hristev@microchip.com>
  L:    linux-iio@vger.kernel.org
  S:    Supported
@@@ -11434,17 -11333,17 +11434,17 @@@ F:        drivers/iio/adc/at91-sama5d2_adc.
  F:    include/dt-bindings/iio/adc/at91-sama5d2_adc.h
  
  MICROCHIP SAMA5D2-COMPATIBLE SHUTDOWN CONTROLLER
 -M:    Nicolas Ferre <nicolas.ferre@microchip.com>
 +M:    Claudiu Beznea <claudiu.beznea@microchip.com>
  S:    Supported
  F:    drivers/power/reset/at91-sama5d2_shdwc.c
  
  MICROCHIP SPI DRIVER
 -M:    Nicolas Ferre <nicolas.ferre@microchip.com>
 +M:    Tudor Ambarus <tudor.ambarus@microchip.com>
  S:    Supported
  F:    drivers/spi/spi-atmel.*
  
  MICROCHIP SSC DRIVER
 -M:    Nicolas Ferre <nicolas.ferre@microchip.com>
 +M:    Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Supported
  F:    drivers/misc/atmel-ssc.c
@@@ -11463,13 -11362,6 +11463,13 @@@ L: linux-arm-kernel@lists.infradead.or
  S:    Supported
  F:    drivers/usb/gadget/udc/atmel_usba_udc.*
  
 +MICROCHIP WILC1000 WIFI DRIVER
 +M:    Ajay Singh <ajay.kathat@microchip.com>
 +M:    Claudiu Beznea <claudiu.beznea@microchip.com>
 +L:    linux-wireless@vger.kernel.org
 +S:    Supported
 +F:    drivers/net/wireless/microchip/wilc1000/
 +
  MICROCHIP XDMA DRIVER
  M:    Ludovic Desroches <ludovic.desroches@microchip.com>
  L:    linux-arm-kernel@lists.infradead.org
@@@ -11532,17 -11424,6 +11532,17 @@@ F: arch/mips/configs/generic/board-bost
  F:    drivers/clk/imgtec/clk-boston.c
  F:    include/dt-bindings/clock/boston-clock.h
  
 +MIPS CORE DRIVERS
 +M:    Thomas Bogendoerfer <tsbogend@alpha.franken.de>
 +M:    Serge Semin <fancer.lancer@gmail.com>
 +L:    linux-mips@vger.kernel.org
 +S:    Supported
 +F:    drivers/bus/mips_cdmm.c
 +F:    drivers/clocksource/mips-gic-timer.c
 +F:    drivers/cpuidle/cpuidle-cps.c
 +F:    drivers/irqchip/irq-mips-cpu.c
 +F:    drivers/irqchip/irq-mips-gic.c
 +
  MIPS GENERIC PLATFORM
  M:    Paul Burton <paulburton@kernel.org>
  L:    linux-mips@vger.kernel.org
@@@ -11671,7 -11552,7 +11671,7 @@@ F:   drivers/media/pci/meye
  F:    include/uapi/linux/meye.h
  
  MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD
 -M:    Jiri Slaby <jirislaby@gmail.com>
 +M:    Jiri Slaby <jirislaby@kernel.org>
  S:    Maintained
  F:    Documentation/driver-api/serial/moxa-smartio.rst
  F:    drivers/tty/mxser.*
@@@ -11925,8 -11806,8 +11925,8 @@@ NETERION 10GbE DRIVERS (s2io/vxge
  M:    Jon Mason <jdmason@kudzu.us>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    Documentation/networking/device_drivers/neterion/s2io.rst
 -F:    Documentation/networking/device_drivers/neterion/vxge.rst
 +F:    Documentation/networking/device_drivers/ethernet/neterion/s2io.rst
 +F:    Documentation/networking/device_drivers/ethernet/neterion/vxge.rst
  F:    drivers/net/ethernet/neterion/
  
  NETFILTER
@@@ -12371,7 -12252,6 +12371,7 @@@ F:   drivers/nvme/target
  NVMEM FRAMEWORK
  M:    Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
  S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/srini/nvmem.git
  F:    Documentation/ABI/stable/sysfs-bus-nvmem
  F:    Documentation/devicetree/bindings/nvmem/
  F:    drivers/nvmem/
@@@ -12815,14 -12695,13 +12815,14 @@@ F:        arch/mips/boot/dts/ralink/omega2p.dt
  
  OP-TEE DRIVER
  M:    Jens Wiklander <jens.wiklander@linaro.org>
 -L:    tee-dev@lists.linaro.org
 +L:    op-tee@lists.trustedfirmware.org
  S:    Maintained
 +F:    Documentation/ABI/testing/sysfs-bus-optee-devices
  F:    drivers/tee/optee/
  
  OP-TEE RANDOM NUMBER GENERATOR (RNG) DRIVER
  M:    Sumit Garg <sumit.garg@linaro.org>
 -L:    tee-dev@lists.linaro.org
 +L:    op-tee@lists.trustedfirmware.org
  S:    Maintained
  F:    drivers/char/hw_random/optee-rng.c
  
@@@ -13308,7 -13187,6 +13308,6 @@@ F:   tools/pci
  
  PCI ENHANCED ERROR HANDLING (EEH) FOR POWERPC
  M:    Russell Currey <ruscur@russell.cc>
- M:    Sam Bobroff <sbobroff@linux.ibm.com>
  M:    Oliver O'Halloran <oohall@gmail.com>
  L:    linuxppc-dev@lists.ozlabs.org
  S:    Supported
@@@ -13491,7 -13369,7 +13490,7 @@@ M:   Shannon Nelson <snelson@pensando.io
  M:    Pensando Drivers <drivers@pensando.io>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    Documentation/networking/device_drivers/pensando/ionic.rst
 +F:    Documentation/networking/device_drivers/ethernet/pensando/ionic.rst
  F:    drivers/net/ethernet/pensando/
  
  PER-CPU MEMORY ALLOCATOR
@@@ -13701,19 -13579,22 +13700,19 @@@ F:        drivers/block/pktcdvd.
  F:    include/linux/pktcdvd.h
  F:    include/uapi/linux/pktcdvd.h
  
 -PKUNITY SOC DRIVERS
 -M:    Guan Xuetao <gxt@pku.edu.cn>
 -S:    Maintained
 -W:    http://mprc.pku.edu.cn/~guanxuetao/linux
 -T:    git git://github.com/gxt/linux.git
 -F:    drivers/i2c/busses/i2c-puv3.c
 -F:    drivers/input/serio/i8042-unicore32io.h
 -F:    drivers/rtc/rtc-puv3.c
 -F:    drivers/video/fbdev/fb-puv3.c
 -
  PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
  M:    Tomasz Duszynski <tduszyns@gmail.com>
  S:    Maintained
  F:    Documentation/devicetree/bindings/iio/chemical/plantower,pms7003.yaml
  F:    drivers/iio/chemical/pms7003.c
  
 +PLDMFW LIBRARY
 +M:    Jacob Keller <jacob.e.keller@intel.com>
 +S:    Maintained
 +F:    Documentation/driver-api/pldmfw/
 +F:    include/linux/pldmfw.h
 +F:    lib/pldmfw/
 +
  PLX DMA DRIVER
  M:    Logan Gunthorpe <logang@deltatee.com>
  S:    Maintained
@@@ -14171,7 -14052,7 +14170,7 @@@ QLOGIC QLA3XXX NETWORK DRIVE
  M:    GR-Linux-NIC-Dev@marvell.com
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    Documentation/networking/device_drivers/qlogic/LICENSE.qla3xxx
 +F:    Documentation/networking/device_drivers/ethernet/qlogic/LICENSE.qla3xxx
  F:    drivers/net/ethernet/qlogic/qla3xxx.*
  
  QLOGIC QLA4XXX iSCSI DRIVER
@@@ -14222,7 -14103,7 +14221,7 @@@ M:   Laurentiu Tudor <laurentiu.tudor@nxp
  L:    linux-kernel@vger.kernel.org
  S:    Maintained
  F:    Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt
 -F:    Documentation/networking/device_drivers/freescale/dpaa2/overview.rst
 +F:    Documentation/networking/device_drivers/ethernet/freescale/dpaa2/overview.rst
  F:    drivers/bus/fsl-mc/
  
  QT1010 MEDIA DRIVER
@@@ -14294,8 -14175,7 +14293,8 @@@ F:   Documentation/devicetree/bindings/ne
  F:    drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
  
  QUALCOMM GENERIC INTERFACE I2C DRIVER
 -M:    Alok Chauhan <alokc@codeaurora.org>
 +M:    Akash Asthana <akashast@codeaurora.org>
 +M:    Mukesh Savaliya <msavaliy@codeaurora.org>
  L:    linux-i2c@vger.kernel.org
  L:    linux-arm-msm@vger.kernel.org
  S:    Supported
@@@ -14344,12 -14224,12 +14343,12 @@@ M:        Subash Abhinov Kasiviswanathan <suba
  M:    Sean Tranchetti <stranche@codeaurora.org>
  L:    netdev@vger.kernel.org
  S:    Maintained
 -F:    Documentation/networking/device_drivers/qualcomm/rmnet.rst
 +F:    Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
  F:    drivers/net/ethernet/qualcomm/rmnet/
  F:    include/linux/if_rmnet.h
  
  QUALCOMM TSENS THERMAL DRIVER
 -M:    Amit Kucheria <amit.kucheria@linaro.org>
 +M:    Amit Kucheria <amitk@kernel.org>
  L:    linux-pm@vger.kernel.org
  L:    linux-arm-msm@vger.kernel.org
  S:    Maintained
@@@ -14556,7 -14436,7 +14555,7 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    Documentation/RCU/
  F:    include/linux/rcu*
  F:    kernel/rcu/
 -X:    Documentation/RCU/torture.txt
 +X:    Documentation/RCU/torture.rst
  X:    include/linux/srcu*.h
  X:    kernel/rcu/srcu*.c
  
@@@ -14632,7 -14512,7 +14631,7 @@@ S:   Maintaine
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rproc-next
  F:    Documentation/ABI/testing/sysfs-class-remoteproc
  F:    Documentation/devicetree/bindings/remoteproc/
 -F:    Documentation/remoteproc.txt
 +F:    Documentation/staging/remoteproc.rst
  F:    drivers/remoteproc/
  F:    include/linux/remoteproc.h
  F:    include/linux/remoteproc/
@@@ -14644,7 -14524,7 +14643,7 @@@ L:   linux-remoteproc@vger.kernel.or
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rpmsg-next
  F:    Documentation/ABI/testing/sysfs-bus-rpmsg
 -F:    Documentation/rpmsg.txt
 +F:    Documentation/staging/rpmsg.rst
  F:    drivers/rpmsg/
  F:    include/linux/rpmsg.h
  F:    include/linux/rpmsg/
@@@ -14693,8 -14573,8 +14692,8 @@@ RENESAS R-CAR THERMAL DRIVER
  M:    Niklas Söderlund <niklas.soderlund@ragnatech.se>
  L:    linux-renesas-soc@vger.kernel.org
  S:    Supported
 -F:    Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
 -F:    Documentation/devicetree/bindings/thermal/rcar-thermal.txt
 +F:    Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
 +F:    Documentation/devicetree/bindings/thermal/rcar-thermal.yaml
  F:    drivers/thermal/rcar_gen3_thermal.c
  F:    drivers/thermal/rcar_thermal.c
  
@@@ -14950,7 -14830,7 +14949,7 @@@ S:   Maintaine
  F:    drivers/video/fbdev/savage/
  
  S390
 -M:    Heiko Carstens <heiko.carstens@de.ibm.com>
 +M:    Heiko Carstens <hca@linux.ibm.com>
  M:    Vasily Gorbik <gor@linux.ibm.com>
  M:    Christian Borntraeger <borntraeger@de.ibm.com>
  L:    linux-s390@vger.kernel.org
@@@ -14981,8 -14861,7 +14980,8 @@@ F:   drivers/s390/block/dasd
  F:    include/linux/dasd_mod.h
  
  S390 IOMMU (PCI)
 -M:    Gerald Schaefer <gerald.schaefer@de.ibm.com>
 +M:    Matthew Rosato <mjrosato@linux.ibm.com>
 +M:    Gerald Schaefer <gerald.schaefer@linux.ibm.com>
  L:    linux-s390@vger.kernel.org
  S:    Supported
  W:    http://www.ibm.com/developerworks/linux/linux390/
@@@ -15010,7 -14889,7 +15009,7 @@@ F:   drivers/s390/net
  
  S390 PCI SUBSYSTEM
  M:    Niklas Schnelle <schnelle@linux.ibm.com>
 -M:    Gerald Schaefer <gerald.schaefer@de.ibm.com>
 +M:    Gerald Schaefer <gerald.schaefer@linux.ibm.com>
  L:    linux-s390@vger.kernel.org
  S:    Supported
  W:    http://www.ibm.com/developerworks/linux/linux390/
@@@ -15416,7 -15295,7 +15415,7 @@@ F:   drivers/mmc/host/sdhci
  F:    include/linux/mmc/sdhci*
  
  SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) MICROCHIP DRIVER
 -M:    Ludovic Desroches <ludovic.desroches@microchip.com>
 +M:    Eugen Hristev <eugen.hristev@microchip.com>
  L:    linux-mmc@vger.kernel.org
  S:    Supported
  F:    drivers/mmc/host/sdhci-of-at91.c
@@@ -15481,20 -15360,11 +15480,20 @@@ F:        scripts/selinux
  F:    security/selinux/
  
  SENSABLE PHANTOM
 -M:    Jiri Slaby <jirislaby@gmail.com>
 +M:    Jiri Slaby <jirislaby@kernel.org>
  S:    Maintained
  F:    drivers/misc/phantom.c
  F:    include/uapi/linux/phantom.h
  
 +SENSIRION SCD30 CARBON DIOXIDE SENSOR DRIVER
 +M:    Tomasz Duszynski <tomasz.duszynski@octakon.com>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml
 +F:    drivers/iio/chemical/scd30.h
 +F:    drivers/iio/chemical/scd30_core.c
 +F:    drivers/iio/chemical/scd30_i2c.c
 +F:    drivers/iio/chemical/scd30_serial.c
 +
  SENSIRION SPS30 AIR POLLUTION SENSOR DRIVER
  M:    Tomasz Duszynski <tduszyns@gmail.com>
  S:    Maintained
@@@ -15546,7 -15416,7 +15545,7 @@@ F:   drivers/net/phy/phylink.
  F:    drivers/net/phy/sfp*
  F:    include/linux/phylink.h
  F:    include/linux/sfp.h
 -K:    phylink
 +K:    phylink\.h|struct\s+phylink|\.phylink|>phylink_|phylink_(autoneg|clear|connect|create|destroy|disconnect|ethtool|helper|mac|mii|of|set|start|stop|test|validate)
  
  SGI GRU DRIVER
  M:    Dimitri Sivanich <sivanich@sgi.com>
@@@ -16141,9 -16011,8 +16140,9 @@@ F:   sound/soc/sof
  
  SOUNDWIRE SUBSYSTEM
  M:    Vinod Koul <vkoul@kernel.org>
 -M:    Sanyog Kale <sanyog.r.kale@intel.com>
 +M:    Bard Liao <yung-chuan.liao@linux.intel.com>
  R:    Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
 +R:    Sanyog Kale <sanyog.r.kale@intel.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  S:    Supported
  F:    Documentation/driver-api/soundwire/
@@@ -16188,22 -16057,10 +16187,22 @@@ SPARSE CHECKE
  M:    "Luc Van Oostenryck" <luc.vanoostenryck@gmail.com>
  L:    linux-sparse@vger.kernel.org
  S:    Maintained
 -W:    https://sparse.wiki.kernel.org/
 +W:    https://sparse.docs.kernel.org/
  T:    git git://git.kernel.org/pub/scm/devel/sparse/sparse.git
 +Q:    https://patchwork.kernel.org/project/linux-sparse/list/
 +B:    https://bugzilla.kernel.org/enter_bug.cgi?component=Sparse&product=Tools
  F:    include/linux/compiler.h
  
 +SPEAKUP CONSOLE SPEECH DRIVER
 +M:    William Hubbs <w.d.hubbs@gmail.com>
 +M:    Chris Brannon <chris@the-brannons.com>
 +M:    Kirk Reiser <kirk@reisers.ca>
 +M:    Samuel Thibault <samuel.thibault@ens-lyon.org>
 +L:    speakup@linux-speakup.org
 +S:    Odd Fixes
 +W:    http://www.linux-speakup.org/
 +F:    drivers/accessibility/speakup/
 +
  SPEAR CLOCK FRAMEWORK SUPPORT
  M:    Viresh Kumar <vireshk@kernel.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -16248,7 -16105,7 +16247,7 @@@ SPIDERNET NETWORK DRIVER for CEL
  M:    Ishizaki Kou <kou.ishizaki@toshiba.co.jp>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    Documentation/networking/device_drivers/toshiba/spider_net.rst
 +F:    Documentation/networking/device_drivers/ethernet/toshiba/spider_net.rst
  F:    drivers/net/ethernet/toshiba/spider_net*
  
  SPMI SUBSYSTEM
@@@ -16391,11 -16248,28 +16390,11 @@@ L:        linux-fbdev@vger.kernel.or
  S:    Maintained
  F:    drivers/staging/sm750fb/
  
 -STAGING - SPEAKUP CONSOLE SPEECH DRIVER
 -M:    William Hubbs <w.d.hubbs@gmail.com>
 -M:    Chris Brannon <chris@the-brannons.com>
 -M:    Kirk Reiser <kirk@reisers.ca>
 -M:    Samuel Thibault <samuel.thibault@ens-lyon.org>
 -L:    speakup@linux-speakup.org
 -S:    Odd Fixes
 -W:    http://www.linux-speakup.org/
 -F:    drivers/staging/speakup/
 -
  STAGING - VIA VT665X DRIVERS
  M:    Forest Bond <forest@alittletooquiet.net>
  S:    Odd Fixes
  F:    drivers/staging/vt665?/
  
 -STAGING - WILC1000 WIFI DRIVER
 -M:    Adham Abozaeid <adham.abozaeid@microchip.com>
 -M:    Ajay Singh <ajay.kathat@microchip.com>
 -L:    linux-wireless@vger.kernel.org
 -S:    Supported
 -F:    drivers/staging/wilc1000/
 -
  STAGING SUBSYSTEM
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  L:    devel@driverdev.osuosl.org
@@@ -16458,7 -16332,7 +16457,7 @@@ M:   Jose Abreu <joabreu@synopsys.com
  L:    netdev@vger.kernel.org
  S:    Supported
  W:    http://www.stlinux.com
 -F:    Documentation/networking/device_drivers/stmicro/
 +F:    Documentation/networking/device_drivers/ethernet/stmicro/
  F:    drivers/net/ethernet/stmicro/stmmac/
  
  SUN3/3X
@@@ -16897,9 -16771,9 +16896,9 @@@ F:   include/media/i2c/tw9910.
  
  TEE SUBSYSTEM
  M:    Jens Wiklander <jens.wiklander@linaro.org>
 -L:    tee-dev@lists.linaro.org
 +L:    op-tee@lists.trustedfirmware.org
  S:    Maintained
 -F:    Documentation/tee.txt
 +F:    Documentation/staging/tee.rst
  F:    drivers/tee/
  F:    include/linux/tee_drv.h
  F:    include/uapi/linux/tee.h
@@@ -17053,7 -16927,7 +17052,7 @@@ F:   drivers/media/radio/radio-raremono.
  THERMAL
  M:    Zhang Rui <rui.zhang@intel.com>
  M:    Daniel Lezcano <daniel.lezcano@linaro.org>
 -R:    Amit Kucheria <amit.kucheria@verdurent.com>
 +R:    Amit Kucheria <amitk@kernel.org>
  L:    linux-pm@vger.kernel.org
  S:    Supported
  Q:    https://patchwork.kernel.org/project/linux-pm/list/
@@@ -17086,14 -16960,6 +17085,14 @@@ F: drivers/thermal/cpufreq_cooling.
  F:    drivers/thermal/cpuidle_cooling.c
  F:    include/linux/cpu_cooling.h
  
 +THERMAL/POWER_ALLOCATOR
 +M:    Lukasz Luba <lukasz.luba@arm.com>
 +L:    linux-pm@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/driver-api/thermal/power_allocator.rst
 +F:    drivers/thermal/gov_power_allocator.c
 +F:    include/trace/events/thermal_power_allocator.h
 +
  THINKPAD ACPI EXTRAS DRIVER
  M:    Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
  L:    ibm-acpi-devel@lists.sourceforge.net
@@@ -17354,7 -17220,7 +17353,7 @@@ M:   Samuel Chessman <chessman@tux.org
  L:    tlan-devel@lists.sourceforge.net (subscribers-only)
  S:    Maintained
  W:    http://sourceforge.net/projects/tlan/
 -F:    Documentation/networking/device_drivers/ti/tlan.rst
 +F:    Documentation/networking/device_drivers/ethernet/ti/tlan.rst
  F:    drivers/net/ethernet/ti/tlan.*
  
  TM6000 VIDEO4LINUX DRIVER
@@@ -17419,7 -17285,7 +17418,7 @@@ M:   Josh Triplett <josh@joshtriplett.org
  L:    linux-kernel@vger.kernel.org
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev
 -F:    Documentation/RCU/torture.txt
 +F:    Documentation/RCU/torture.rst
  F:    kernel/locking/locktorture.c
  F:    kernel/rcu/rcuperf.c
  F:    kernel/rcu/rcutorture.c
@@@ -17511,7 -17377,7 +17510,7 @@@ K:   ^Subject:.*(?i)trivia
  
  TTY LAYER
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -M:    Jiri Slaby <jslaby@suse.com>
 +M:    Jiri Slaby <jirislaby@kernel.org>
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
  F:    Documentation/driver-api/serial/
@@@ -17644,7 -17510,7 +17643,7 @@@ F:   Documentation/admin-guide/ufs.rs
  F:    fs/ufs/
  
  UHID USERSPACE HID IO DRIVER
 -M:    David Herrmann <dh.herrmann@googlemail.com>
 +M:    David Rheinsberg <david.rheinsberg@gmail.com>
  L:    linux-input@vger.kernel.org
  S:    Maintained
  F:    drivers/hid/uhid.c
@@@ -17663,6 -17529,13 +17662,6 @@@ L:  linux-fsdevel@vger.kernel.or
  S:    Supported
  F:    fs/unicode/
  
 -UNICORE32 ARCHITECTURE
 -M:    Guan Xuetao <gxt@pku.edu.cn>
 -S:    Maintained
 -W:    http://mprc.pku.edu.cn/~guanxuetao/linux
 -T:    git git://github.com/gxt/linux.git
 -F:    arch/unicore32/
 -
  UNIFDEF
  M:    Tony Finch <dot@dotat.at>
  S:    Maintained
@@@ -18596,7 -18469,7 +18595,7 @@@ S:   Maintaine
  F:    drivers/rtc/rtc-sd3078.c
  
  WIIMOTE HID DRIVER
 -M:    David Herrmann <dh.herrmann@googlemail.com>
 +M:    David Rheinsberg <david.rheinsberg@gmail.com>
  L:    linux-input@vger.kernel.org
  S:    Maintained
  F:    drivers/hid/hid-wiimote*
@@@ -18983,24 -18856,6 +18982,24 @@@ F: Documentation/devicetree/bindings/me
  F:    drivers/media/platform/xilinx/
  F:    include/uapi/linux/xilinx-v4l2-controls.h
  
 +XILINX ZYNQMP DPDMA DRIVER
 +M:    Hyun Kwon <hyun.kwon@xilinx.com>
 +M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 +L:    dmaengine@vger.kernel.org
 +S:    Supported
 +F:    Documentation/devicetree/bindings/dma/xilinx/xlnx,zynqmp-dpdma.yaml
 +F:    drivers/dma/xilinx/xilinx_dpdma.c
 +F:    include/dt-bindings/dma/xlnx-zynqmp-dpdma.h
 +
 +XILINX ZYNQMP PSGTR PHY DRIVER
 +M:    Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
 +M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 +L:    linux-kernel@vger.kernel.org
 +S:    Supported
 +T:    git https://github.com/Xilinx/linux-xlnx.git
 +F:    Documentation/devicetree/bindings/phy/xlnx,zynqmp-psgtr.yaml
 +F:    drivers/phy/xilinx/phy-zynqmp.c
 +
  XILLYBUS DRIVER
  M:    Eli Billauer <eli.billauer@gmail.com>
  L:    linux-kernel@vger.kernel.org
@@@ -19057,7 -18912,7 +19056,7 @@@ L:   linux-hams@vger.kernel.or
  S:    Maintained
  W:    http://yaina.de/jreuter/
  W:    http://www.qsl.net/dl1bke/
 -F:    Documentation/networking/z8530drv.rst
 +F:    Documentation/networking/device_drivers/hamradio/z8530drv.rst
  F:    drivers/net/hamradio/*scc.c
  F:    drivers/net/hamradio/z8530.h
  
diff --combined arch/powerpc/Kconfig
index 29a0579081730ba1e424f52d04ab1c16f9f80081,8c7656cc10eb60e447203330789f0a6f98b5967c..1f48bbfb3ce99dc9eccbee3612689e88be4ae675
@@@ -131,6 -131,7 +131,7 @@@ config PP
        select ARCH_HAS_PTE_DEVMAP              if PPC_BOOK3S_64
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_MEMBARRIER_CALLBACKS
+       select ARCH_HAS_MEMBARRIER_SYNC_CORE
        select ARCH_HAS_SCALED_CPUTIME          if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64
        select ARCH_HAS_STRICT_KERNEL_RWX       if (PPC32 && !HIBERNATION)
        select ARCH_HAS_TICK_BROADCAST          if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_SUPPORTS_ATOMIC_RMW
        select ARCH_USE_BUILTIN_BSWAP
        select ARCH_USE_CMPXCHG_LOCKREF         if PPC64
+       select ARCH_USE_QUEUED_RWLOCKS          if PPC_QUEUED_SPINLOCKS
+       select ARCH_USE_QUEUED_SPINLOCKS        if PPC_QUEUED_SPINLOCKS
        select ARCH_WANT_IPC_PARSE_VERSION
        select ARCH_WEAK_RELEASE_ACQUIRE
        select BINFMT_ELF
        select BUILDTIME_TABLE_SORT
        select CLONE_BACKWARDS
        select DCACHE_WORD_ACCESS               if PPC64 && CPU_LITTLE_ENDIAN
 +      select DMA_OPS                          if PPC64
 +      select DMA_OPS_BYPASS                   if PPC64
        select DYNAMIC_FTRACE                   if FUNCTION_TRACER
        select EDAC_ATOMIC_SCRUB
        select EDAC_SUPPORT
        select HAVE_STACKPROTECTOR              if PPC32 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r2)
        select HAVE_CONTEXT_TRACKING            if PPC64
        select HAVE_TIF_NOHZ                    if PPC64
 -      select HAVE_COPY_THREAD_TLS
        select HAVE_DEBUG_KMEMLEAK
        select HAVE_DEBUG_STACKOVERFLOW
        select HAVE_DYNAMIC_FTRACE
@@@ -491,6 -493,19 +494,19 @@@ config HOTPLUG_CP
  
          Say N if you are unsure.
  
+ config PPC_QUEUED_SPINLOCKS
+       bool "Queued spinlocks"
+       depends on SMP
+       help
+         Say Y here to use queued spinlocks which give better scalability and
+         fairness on large SMP and NUMA systems without harming single threaded
+         performance.
+         This option is currently experimental, the code is more complex and
+         less tested so it defaults to "N" for the moment.
+         If unsure, say "N".
  config ARCH_CPU_PROBE_RELEASE
        def_bool y
        depends on HOTPLUG_CPU
@@@ -834,13 -849,16 +850,16 @@@ config FORCE_MAX_ZONEORDE
          this in mind when choosing a value for this option.
  
  config PPC_SUBPAGE_PROT
-       bool "Support setting protections for 4k subpages"
+       bool "Support setting protections for 4k subpages (subpage_prot syscall)"
+       default n
        depends on PPC_BOOK3S_64 && PPC_64K_PAGES
        help
-         This option adds support for system call to allow user programs
+         This option adds support for system call to allow user programs
          to set access permissions (read/write, readonly, or no access)
          on the 4k subpages of each 64k page.
  
+         If unsure, say N here.
  config PPC_COPRO_BASE
        bool
  
@@@ -860,12 -878,8 +879,8 @@@ config PPC_DENORMALISATIO
          Add support for handling denormalisation of single precision
          values.  Useful for bare metal only.  If unsure say Y here.
  
- config CMDLINE_BOOL
-       bool "Default bootloader kernel arguments"
  config CMDLINE
-       string "Initial kernel command string" if CMDLINE_BOOL
-       default "console=ttyS0,9600 console=tty0 root=/dev/sda2" if CMDLINE_BOOL
+       string "Initial kernel command string"
        default ""
        help
          On some platforms, there is currently no way for the boot loader to
@@@ -1199,6 -1213,7 +1214,7 @@@ config TASK_SIZE_BOO
  config TASK_SIZE
        hex "Size of user task space" if TASK_SIZE_BOOL
        default "0x80000000" if PPC_8xx
+       default "0xb0000000" if PPC_BOOK3S_32 && STRICT_KERNEL_RWX
        default "0xc0000000"
  endmenu
  
index 2d444d09b5533e87d21724c0046def909fa3c0d0,27c2268dfd6c0c709b1526533806fea97add5968..90cd5c53af66646153d69ce620f2393a7b6039f3
@@@ -4,8 -4,8 +4,9 @@@ generated-y += syscall_table_64.
  generated-y += syscall_table_c32.h
  generated-y += syscall_table_spu.h
  generic-y += export.h
 +generic-y += kvm_types.h
  generic-y += local64.h
  generic-y += mcs_spinlock.h
+ generic-y += qrwlock.h
  generic-y += vtime.h
  generic-y += early_ioremap.h
index 0311c3c4296062a7616bc28ae76c1e36fd65278e,f6a3d145ffb7a7082192f104f082dc6075f184c0..8a55eb8cc97bd381b210c9180d2e4b96cb88fb6f
@@@ -11,6 -11,8 +11,6 @@@
  #include <asm/cmpxchg.h>
  #include <asm/barrier.h>
  
 -#define ATOMIC_INIT(i)                { (i) }
 -
  /*
   * Since *_return_relaxed and {cmp}xchg_relaxed are implemented with
   * a "bne-" instruction at the end, so an isync is enough as a acquire barrier
@@@ -191,6 -193,34 +191,34 @@@ static __inline__ int atomic_dec_return
  #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
  #define atomic_xchg_relaxed(v, new) xchg_relaxed(&((v)->counter), (new))
  
+ /*
+  * Don't want to override the generic atomic_try_cmpxchg_acquire, because
+  * we add a lock hint to the lwarx, which may not be wanted for the
+  * _acquire case (and is not used by the other _acquire variants so it
+  * would be a surprise).
+  */
+ static __always_inline bool
+ atomic_try_cmpxchg_lock(atomic_t *v, int *old, int new)
+ {
+       int r, o = *old;
+       __asm__ __volatile__ (
+ "1:\t"        PPC_LWARX(%0,0,%2,1) "  # atomic_try_cmpxchg_acquire    \n"
+ "     cmpw    0,%0,%3                                                 \n"
+ "     bne-    2f                                                      \n"
+ "     stwcx.  %4,0,%2                                                 \n"
+ "     bne-    1b                                                      \n"
+ "\t"  PPC_ACQUIRE_BARRIER "                                           \n"
+ "2:                                                                   \n"
+       : "=&r" (r), "+m" (v->counter)
+       : "r" (&v->counter), "r" (o), "r" (new)
+       : "cr0", "memory");
+       if (unlikely(r != o))
+               *old = r;
+       return likely(r == o);
+ }
  /**
   * atomic_fetch_add_unless - add unless the number is a given value
   * @v: pointer of type atomic_t
index 452402215e12103baa99fc557667adee08430b1c,4d8934db7ef5519041e43a290095102da45f162f..d8a0729cf754b6489f299550f60056d941d61b49
@@@ -18,6 -18,11 +18,6 @@@ struct iommu_table
   * drivers/macintosh/macio_asic.c
   */
  struct dev_archdata {
 -      /*
 -       * Set to %true if the dma_iommu_ops are requested to use a direct
 -       * window instead of dynamically mapping memory.
 -       */
 -      bool                    iommu_bypass : 1;
        /*
         * These two used to be a union. However, with the hybrid ops we need
         * both so here we store both a DMA offset for direct mappings and
@@@ -44,6 -49,9 +44,9 @@@
  #ifdef CONFIG_CXL_BASE
        struct cxl_context      *cxl_ctx;
  #endif
+ #ifdef CONFIG_PCI_IOV
+       void *iov_data;
+ #endif
  };
  
  struct pdev_archdata {
index 84b2564cf5a4fddaecc162f7489e51dea4ffeb10,cc07c399306e56d79abfa0c93366ba3ce48ba54d..9454d29ff4b47d27b2cf6bdf9f882da76377c584
@@@ -29,6 -29,7 +29,6 @@@
  #include <asm/hmi.h>
  #include <asm/cpuidle.h>
  #include <asm/atomic.h>
 -#include <asm/rtas-types.h>
  
  #include <asm-generic/mmiowb_types.h>
  
@@@ -52,7 -53,6 +52,7 @@@ extern unsigned int debug_smp_processor
  #define get_slb_shadow()      (get_paca()->slb_shadow_ptr)
  
  struct task_struct;
 +struct rtas_args;
  
  /*
   * Defines the layout of the paca.
@@@ -225,6 -225,7 +225,7 @@@ struct paca_struct 
        u16 in_mce;
        u8 hmi_event_available;         /* HMI event is available */
        u8 hmi_p9_special_emu;          /* HMI P9 special emulation */
+       u32 hmi_irqs;                   /* HMI irq stat */
  #endif
        u8 ftrace_enabled;              /* Hard disable ftrace */
  
index 446e54c3f71e213f9b895ec29ee5c87b06ebe178,eda5ceef238144c93c9f674237c5390ee0363e64..f7d748b887059e26842270e94bf44d23f1f59d3b
@@@ -508,8 -508,24 +508,24 @@@ DEFINE_FIXED_SYMBOL(\name\()_common_rea
  
  .macro __GEN_COMMON_BODY name
        .if IMASK
+               .if ! ISTACK
+               .error "No support for masked interrupt to use custom stack"
+               .endif
+               /* If coming from user, skip soft-mask tests. */
+               andi.   r10,r12,MSR_PR
+               bne     2f
+               /* Kernel code running below __end_interrupts is implicitly
+                * soft-masked */
+               LOAD_HANDLER(r10, __end_interrupts)
+               cmpld   r11,r10
+               li      r10,IMASK
+               blt-    1f
+               /* Test the soft mask state against our interrupt's bit */
                lbz     r10,PACAIRQSOFTMASK(r13)
              andi.   r10,r10,IMASK
1:            andi.   r10,r10,IMASK
                /* Associate vector numbers with bits in paca->irq_happened */
                .if IVEC == 0x500 || IVEC == 0xea0
                li      r10,PACA_IRQ_EE
  
        .if ISTACK
        andi.   r10,r12,MSR_PR          /* See if coming from user      */
      mr      r10,r1                  /* Save r1                      */
2:    mr      r10,r1                  /* Save r1                      */
        subi    r1,r1,INT_FRAME_SIZE    /* alloc frame on kernel stack  */
        beq-    100f
        ld      r1,PACAKSAVE(r13)       /* kernel stack to use          */
@@@ -740,6 -756,9 +756,9 @@@ END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP
   * guarantee they will be delivered virtually. Some conditions (see the ISA)
   * cause exceptions to be delivered in real mode.
   *
+  * The scv instructions are a special case. They get a 0x3000 offset applied.
+  * scv exceptions have unique reentrancy properties, see below.
+  *
   * It's impossible to receive interrupts below 0x300 via AIL.
   *
   * KVM: None of the virtual exceptions are from the guest. Anything that
   * We layout physical memory as follows:
   * 0x0000 - 0x00ff : Secondary processor spin code
   * 0x0100 - 0x18ff : Real mode pSeries interrupt vectors
-  * 0x1900 - 0x3fff : Real mode trampolines
-  * 0x4000 - 0x58ff : Relon (IR=1,DR=1) mode pSeries interrupt vectors
+  * 0x1900 - 0x2fff : Real mode trampolines
+  * 0x3000 - 0x58ff : Relon (IR=1,DR=1) mode pSeries interrupt vectors
   * 0x5900 - 0x6fff : Relon mode trampolines
   * 0x7000 - 0x7fff : FWNMI data area
   * 0x8000 -   .... : Common interrupt handlers, remaining early
   * vectors there.
   */
  OPEN_FIXED_SECTION(real_vectors,        0x0100, 0x1900)
- OPEN_FIXED_SECTION(real_trampolines,    0x1900, 0x4000)
- OPEN_FIXED_SECTION(virt_vectors,        0x4000, 0x5900)
+ OPEN_FIXED_SECTION(real_trampolines,    0x1900, 0x3000)
+ OPEN_FIXED_SECTION(virt_vectors,        0x3000, 0x5900)
  OPEN_FIXED_SECTION(virt_trampolines,    0x5900, 0x7000)
  
  #ifdef CONFIG_PPC_POWERNV
@@@ -798,6 -817,77 +817,77 @@@ USE_FIXED_SECTION(real_vectors
        .globl __start_interrupts
  __start_interrupts:
  
+ /**
+  * Interrupt 0x3000 - System Call Vectored Interrupt (syscall).
+  * This is a synchronous interrupt invoked with the "scv" instruction. The
+  * system call does not alter the HV bit, so it is directed to the OS.
+  *
+  * Handling:
+  * scv instructions enter the kernel without changing EE, RI, ME, or HV.
+  * In particular, this means we can take a maskable interrupt at any point
+  * in the scv handler, which is unlike any other interrupt. This is solved
+  * by treating the instruction addresses below __end_interrupts as being
+  * soft-masked.
+  *
+  * AIL-0 mode scv exceptions go to 0x17000-0x17fff, but we set AIL-3 and
+  * ensure scv is never executed with relocation off, which means AIL-0
+  * should never happen.
+  *
+  * Before leaving the below __end_interrupts text, at least of the following
+  * must be true:
+  * - MSR[PR]=1 (i.e., return to userspace)
+  * - MSR_EE|MSR_RI is set (no reentrant exceptions)
+  * - Standard kernel environment is set up (stack, paca, etc)
+  *
+  * Call convention:
+  *
+  * syscall register convention is in Documentation/powerpc/syscall64-abi.rst
+  */
+ EXC_VIRT_BEGIN(system_call_vectored, 0x3000, 0x1000)
+       /* SCV 0 */
+       mr      r9,r13
+       GET_PACA(r13)
+       mflr    r11
+       mfctr   r12
+       li      r10,IRQS_ALL_DISABLED
+       stb     r10,PACAIRQSOFTMASK(r13)
+ #ifdef CONFIG_RELOCATABLE
+       b       system_call_vectored_tramp
+ #else
+       b       system_call_vectored_common
+ #endif
+       nop
+       /* SCV 1 - 127 */
+       .rept   127
+       mr      r9,r13
+       GET_PACA(r13)
+       mflr    r11
+       mfctr   r12
+       li      r10,IRQS_ALL_DISABLED
+       stb     r10,PACAIRQSOFTMASK(r13)
+       li      r0,-1 /* cause failure */
+ #ifdef CONFIG_RELOCATABLE
+       b       system_call_vectored_sigill_tramp
+ #else
+       b       system_call_vectored_sigill
+ #endif
+       .endr
+ EXC_VIRT_END(system_call_vectored, 0x3000, 0x1000)
+ #ifdef CONFIG_RELOCATABLE
+ TRAMP_VIRT_BEGIN(system_call_vectored_tramp)
+       __LOAD_HANDLER(r10, system_call_vectored_common)
+       mtctr   r10
+       bctr
+ TRAMP_VIRT_BEGIN(system_call_vectored_sigill_tramp)
+       __LOAD_HANDLER(r10, system_call_vectored_sigill)
+       mtctr   r10
+       bctr
+ #endif
  /* No virt vectors corresponding with 0x0..0x100 */
  EXC_VIRT_NONE(0x4000, 0x100)
  
@@@ -2838,7 -2928,8 +2928,8 @@@ masked_interrupt
        ld      r10,PACA_EXGEN+EX_R10(r13)
        ld      r11,PACA_EXGEN+EX_R11(r13)
        ld      r12,PACA_EXGEN+EX_R12(r13)
-       /* returns to kernel where r13 must be set up, so don't restore it */
+       ld      r13,PACA_EXGEN+EX_R13(r13)
+       /* May return to masked low address where r13 is not set up */
        .if \hsrr
        HRFI_TO_KERNEL
        .else
@@@ -2946,6 -3037,47 +3037,47 @@@ TRAMP_REAL_BEGIN(hrfi_flush_fallback
        GET_SCRATCH0(r13);
        hrfid
  
+ TRAMP_REAL_BEGIN(rfscv_flush_fallback)
+       /* system call volatile */
+       mr      r7,r13
+       GET_PACA(r13);
+       mr      r8,r1
+       ld      r1,PACAKSAVE(r13)
+       mfctr   r9
+       ld      r10,PACA_RFI_FLUSH_FALLBACK_AREA(r13)
+       ld      r11,PACA_L1D_FLUSH_SIZE(r13)
+       srdi    r11,r11,(7 + 3) /* 128 byte lines, unrolled 8x */
+       mtctr   r11
+       DCBT_BOOK3S_STOP_ALL_STREAM_IDS(r11) /* Stop prefetch streams */
+       /* order ld/st prior to dcbt stop all streams with flushing */
+       sync
+       /*
+        * The load adresses are at staggered offsets within cachelines,
+        * which suits some pipelines better (on others it should not
+        * hurt).
+        */
+ 1:
+       ld      r11,(0x80 + 8)*0(r10)
+       ld      r11,(0x80 + 8)*1(r10)
+       ld      r11,(0x80 + 8)*2(r10)
+       ld      r11,(0x80 + 8)*3(r10)
+       ld      r11,(0x80 + 8)*4(r10)
+       ld      r11,(0x80 + 8)*5(r10)
+       ld      r11,(0x80 + 8)*6(r10)
+       ld      r11,(0x80 + 8)*7(r10)
+       addi    r10,r10,0x80*8
+       bdnz    1b
+       mtctr   r9
+       li      r9,0
+       li      r10,0
+       li      r11,0
+       mr      r1,r8
+       mr      r13,r7
+       RFSCV
  USE_TEXT_SECTION()
        MASKED_INTERRUPT
        MASKED_INTERRUPT hsrr=1
@@@ -2997,6 -3129,10 +3129,10 @@@ EXC_COMMON_BEGIN(ppc64_runlatch_on_tram
  
  USE_FIXED_SECTION(virt_trampolines)
        /*
+        * All code below __end_interrupts is treated as soft-masked. If
+        * any code runs here with MSR[EE]=1, it must then cope with pending
+        * soft interrupt being raised (i.e., by ensuring it is replayed).
+        *
         * The __end_interrupts marker must be past the out-of-line (OOL)
         * handlers, so that they are copied to real address 0x100 when running
         * a relocatable kernel. This ensures they can be reached from the short
@@@ -3072,18 -3208,10 +3208,18 @@@ do_hash_page
        ori     r0,r0,DSISR_BAD_FAULT_64S@l
        and.    r0,r5,r0                /* weird error? */
        bne-    handle_page_fault       /* if not, try to insert a HPTE */
 +
 +      /*
 +       * If we are in an "NMI" (e.g., an interrupt when soft-disabled), then
 +       * don't call hash_page, just fail the fault. This is required to
 +       * prevent re-entrancy problems in the hash code, namely perf
 +       * interrupts hitting while something holds H_PAGE_BUSY, and taking a
 +       * hash fault. See the comment in hash_preload().
 +       */
        ld      r11, PACA_THREAD_INFO(r13)
 -      lwz     r0,TI_PREEMPT(r11)      /* If we're in an "NMI" */
 -      andis.  r0,r0,NMI_MASK@h        /* (i.e. an irq when soft-disabled) */
 -      bne     77f                     /* then don't call hash_page now */
 +      lwz     r0,TI_PREEMPT(r11)
 +      andis.  r0,r0,NMI_MASK@h
 +      bne     77f
  
        /*
         * r3 contains the trap number
index 794b754deec23934e7e6e62bb272203ce8323d30,e4fcc817c46ce9344c767dad6e328ef5b134ad16..016bd831908ec191fe02d252a8d4cc298ca4b33f
@@@ -471,49 -471,58 +471,58 @@@ EXPORT_SYMBOL(giveup_all)
  
  #ifdef CONFIG_PPC_BOOK3S_64
  #ifdef CONFIG_PPC_FPU
- static int restore_fp(struct task_struct *tsk)
+ static bool should_restore_fp(void)
  {
-       if (tsk->thread.load_fp) {
-               load_fp_state(&current->thread.fp_state);
+       if (current->thread.load_fp) {
                current->thread.load_fp++;
-               return 1;
+               return true;
        }
-       return 0;
+       return false;
+ }
+ static void do_restore_fp(void)
+ {
+       load_fp_state(&current->thread.fp_state);
  }
  #else
- static int restore_fp(struct task_struct *tsk) { return 0; }
+ static bool should_restore_fp(void) { return false; }
+ static void do_restore_fp(void) { }
  #endif /* CONFIG_PPC_FPU */
  
  #ifdef CONFIG_ALTIVEC
- #define loadvec(thr) ((thr).load_vec)
- static int restore_altivec(struct task_struct *tsk)
+ static bool should_restore_altivec(void)
  {
-       if (cpu_has_feature(CPU_FTR_ALTIVEC) && (tsk->thread.load_vec)) {
-               load_vr_state(&tsk->thread.vr_state);
-               tsk->thread.used_vr = 1;
-               tsk->thread.load_vec++;
-               return 1;
+       if (cpu_has_feature(CPU_FTR_ALTIVEC) && (current->thread.load_vec)) {
+               current->thread.load_vec++;
+               return true;
        }
-       return 0;
+       return false;
+ }
+ static void do_restore_altivec(void)
+ {
+       load_vr_state(&current->thread.vr_state);
+       current->thread.used_vr = 1;
  }
  #else
- #define loadvec(thr) 0
- static inline int restore_altivec(struct task_struct *tsk) { return 0; }
+ static bool should_restore_altivec(void) { return false; }
+ static void do_restore_altivec(void) { }
  #endif /* CONFIG_ALTIVEC */
  
  #ifdef CONFIG_VSX
- static int restore_vsx(struct task_struct *tsk)
+ static bool should_restore_vsx(void)
  {
-       if (cpu_has_feature(CPU_FTR_VSX)) {
-               tsk->thread.used_vsr = 1;
-               return 1;
-       }
-       return 0;
+       if (cpu_has_feature(CPU_FTR_VSX))
+               return true;
+       return false;
+ }
+ static void do_restore_vsx(void)
+ {
+       current->thread.used_vsr = 1;
  }
  #else
- static inline int restore_vsx(struct task_struct *tsk) { return 0; }
+ static bool should_restore_vsx(void) { return false; }
+ static void do_restore_vsx(void) { }
  #endif /* CONFIG_VSX */
  
  /*
  void notrace restore_math(struct pt_regs *regs)
  {
        unsigned long msr;
-       if (!MSR_TM_ACTIVE(regs->msr) &&
-               !current->thread.load_fp && !loadvec(current->thread))
-               return;
+       unsigned long new_msr = 0;
  
        msr = regs->msr;
-       msr_check_and_set(msr_all_available);
  
        /*
-        * Only reload if the bit is not set in the user MSR, the bit BEING set
-        * indicates that the registers are hot
+        * new_msr tracks the facilities that are to be restored. Only reload
+        * if the bit is not set in the user MSR (if it is set, the registers
+        * are live for the user thread).
         */
-       if ((!(msr & MSR_FP)) && restore_fp(current))
-               msr |= MSR_FP | current->thread.fpexc_mode;
+       if ((!(msr & MSR_FP)) && should_restore_fp())
+               new_msr |= MSR_FP | current->thread.fpexc_mode;
  
-       if ((!(msr & MSR_VEC)) && restore_altivec(current))
-               msr |= MSR_VEC;
+       if ((!(msr & MSR_VEC)) && should_restore_altivec())
+               new_msr |= MSR_VEC;
  
-       if ((msr & (MSR_FP | MSR_VEC)) == (MSR_FP | MSR_VEC) &&
-                       restore_vsx(current)) {
-               msr |= MSR_VSX;
+       if ((!(msr & MSR_VSX)) && should_restore_vsx()) {
+               if (((msr | new_msr) & (MSR_FP | MSR_VEC)) == (MSR_FP | MSR_VEC))
+                       new_msr |= MSR_VSX;
        }
  
-       msr_check_and_clear(msr_all_available);
+       if (new_msr) {
+               msr_check_and_set(new_msr);
+               if (new_msr & MSR_FP)
+                       do_restore_fp();
+               if (new_msr & MSR_VEC)
+                       do_restore_altivec();
  
-       regs->msr = msr;
+               if (new_msr & MSR_VSX)
+                       do_restore_vsx();
+               msr_check_and_clear(new_msr);
+               regs->msr |= new_msr;
+       }
  }
  #endif
  
@@@ -1593,12 -1612,13 +1612,13 @@@ static void setup_ksp_vsid(struct task_
  /*
   * Copy architecture-specific thread state
   */
 -int copy_thread_tls(unsigned long clone_flags, unsigned long usp,
 +int copy_thread(unsigned long clone_flags, unsigned long usp,
                unsigned long kthread_arg, struct task_struct *p,
                unsigned long tls)
  {
        struct pt_regs *childregs, *kregs;
        extern void ret_from_fork(void);
+       extern void ret_from_fork_scv(void);
        extern void ret_from_kernel_thread(void);
        void (*f)(void);
        unsigned long sp = (unsigned long)task_stack_page(p) + THREAD_SIZE;
                if (usp)
                        childregs->gpr[1] = usp;
                p->thread.regs = childregs;
-               childregs->gpr[3] = 0;  /* Result from fork() */
+               /* 64s sets this in ret_from_fork */
+               if (!IS_ENABLED(CONFIG_PPC_BOOK3S_64))
+                       childregs->gpr[3] = 0;  /* Result from fork() */
                if (clone_flags & CLONE_SETTLS) {
                        if (!is_32bit_task())
                                childregs->gpr[13] = tls;
                                childregs->gpr[2] = tls;
                }
  
-               f = ret_from_fork;
+               if (trap_is_scv(regs))
+                       f = ret_from_fork_scv;
+               else
+                       f = ret_from_fork;
        }
        childregs->msr &= ~(MSR_FP|MSR_VEC|MSR_VSX);
        sp -= STACK_FRAME_OVERHEAD;
index 13208a9a02ca4afc261ec1c3bc87073342b16b65,ac7d480cb9c1f7f5629113e363d90059ed4d4dc4..19823a250aa0219828e3717040cdffaa0b9c8131
@@@ -215,9 -215,9 +215,9 @@@ int ptrace_put_reg(struct task_struct *
  }
  
  static int gpr_get(struct task_struct *target, const struct user_regset *regset,
 -                 unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf)
 +                 struct membuf to)
  {
 -      int i, ret;
 +      int i;
  
        if (target->thread.regs == NULL)
                return -EIO;
                        target->thread.regs->gpr[i] = NV_REG_POISON;
        }
  
 -      ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 -                                target->thread.regs,
 -                                0, offsetof(struct pt_regs, msr));
 -      if (!ret) {
 -              unsigned long msr = get_user_msr(target);
 -              ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, &msr,
 -                                        offsetof(struct pt_regs, msr),
 -                                        offsetof(struct pt_regs, msr) +
 -                                        sizeof(msr));
 -      }
 +      membuf_write(&to, target->thread.regs, offsetof(struct pt_regs, msr));
 +      membuf_store(&to, get_user_msr(target));
  
        BUILD_BUG_ON(offsetof(struct pt_regs, orig_gpr3) !=
                     offsetof(struct pt_regs, msr) + sizeof(long));
  
 -      if (!ret)
 -              ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 -                                        &target->thread.regs->orig_gpr3,
 -                                        offsetof(struct pt_regs, orig_gpr3),
 -                                        sizeof(struct user_pt_regs));
 -      if (!ret)
 -              ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
 -                                             sizeof(struct user_pt_regs), -1);
 -
 -      return ret;
 +      membuf_write(&to, &target->thread.regs->orig_gpr3,
 +                      sizeof(struct user_pt_regs) -
 +                      offsetof(struct pt_regs, orig_gpr3));
 +      return membuf_zero(&to, ELF_NGREG * sizeof(unsigned long) -
 +                               sizeof(struct user_pt_regs));
  }
  
  static int gpr_set(struct task_struct *target, const struct user_regset *regset,
  
  #ifdef CONFIG_PPC64
  static int ppr_get(struct task_struct *target, const struct user_regset *regset,
 -                 unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf)
 +                 struct membuf to)
  {
 -      return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 -                                 &target->thread.regs->ppr, 0, sizeof(u64));
 +      return membuf_write(&to, &target->thread.regs->ppr, sizeof(u64));
  }
  
  static int ppr_set(struct task_struct *target, const struct user_regset *regset,
  }
  
  static int dscr_get(struct task_struct *target, const struct user_regset *regset,
 -                  unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf)
 +                  struct membuf to)
  {
 -      return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 -                                 &target->thread.dscr, 0, sizeof(u64));
 +      return membuf_write(&to, &target->thread.dscr, sizeof(u64));
  }
  static int dscr_set(struct task_struct *target, const struct user_regset *regset,
                    unsigned int pos, unsigned int count, const void *kbuf,
  #endif
  #ifdef CONFIG_PPC_BOOK3S_64
  static int tar_get(struct task_struct *target, const struct user_regset *regset,
 -                 unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf)
 +                 struct membuf to)
  {
 -      return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 -                                 &target->thread.tar, 0, sizeof(u64));
 +      return membuf_write(&to, &target->thread.tar, sizeof(u64));
  }
  static int tar_set(struct task_struct *target, const struct user_regset *regset,
                   unsigned int pos, unsigned int count, const void *kbuf,
@@@ -348,7 -364,7 +348,7 @@@ static int ebb_active(struct task_struc
  }
  
  static int ebb_get(struct task_struct *target, const struct user_regset *regset,
 -                 unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf)
 +                 struct membuf to)
  {
        /* Build tests */
        BUILD_BUG_ON(TSO(ebbrr) + sizeof(unsigned long) != TSO(ebbhr));
        if (!target->thread.used_ebb)
                return -ENODATA;
  
 -      return user_regset_copyout(&pos, &count, &kbuf, &ubuf, &target->thread.ebbrr,
 -                                 0, 3 * sizeof(unsigned long));
 +      return membuf_write(&to, &target->thread.ebbrr, 3 * sizeof(unsigned long));
  }
  
  static int ebb_set(struct task_struct *target, const struct user_regset *regset,
@@@ -403,7 -420,7 +403,7 @@@ static int pmu_active(struct task_struc
  }
  
  static int pmu_get(struct task_struct *target, const struct user_regset *regset,
 -                 unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf)
 +                 struct membuf to)
  {
        /* Build tests */
        BUILD_BUG_ON(TSO(siar) + sizeof(unsigned long) != TSO(sdar));
        if (!cpu_has_feature(CPU_FTR_ARCH_207S))
                return -ENODEV;
  
 -      return user_regset_copyout(&pos, &count, &kbuf, &ubuf, &target->thread.siar,
 -                                 0, 5 * sizeof(unsigned long));
 +      return membuf_write(&to, &target->thread.siar, 5 * sizeof(unsigned long));
  }
  
  static int pmu_set(struct task_struct *target, const struct user_regset *regset,
@@@ -468,15 -486,23 +468,17 @@@ static int pkey_active(struct task_stru
  }
  
  static int pkey_get(struct task_struct *target, const struct user_regset *regset,
 -                  unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf)
 +                  struct membuf to)
  {
+       int ret;
        BUILD_BUG_ON(TSO(amr) + sizeof(unsigned long) != TSO(iamr));
-       BUILD_BUG_ON(TSO(iamr) + sizeof(unsigned long) != TSO(uamor));
  
        if (!arch_pkeys_enabled())
                return -ENODEV;
  
-       return membuf_write(&to, &target->thread.amr, ELF_NPKEY * sizeof(unsigned long));
 -      ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, &target->thread.amr,
 -                                0, 2 * sizeof(unsigned long));
 -      if (ret)
 -              return ret;
 -
 -      ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, &default_uamor,
 -                                2 * sizeof(unsigned long), 3 * sizeof(unsigned long));
 -      return ret;
++      membuf_write(&to, &target->thread.amr, 2 * sizeof(unsigned long));
++      return membuf_store(&to, default_uamor);
  }
  
  static int pkey_set(struct task_struct *target, const struct user_regset *regset,
        if (ret)
                return ret;
  
-       /* UAMOR determines which bits of the AMR can be set from userspace. */
-       target->thread.amr = (new_amr & target->thread.uamor) |
-                            (target->thread.amr & ~target->thread.uamor);
+       /*
+        * UAMOR determines which bits of the AMR can be set from userspace.
+        * UAMOR value 0b11 indicates that the AMR value can be modified
+        * from userspace. If the kernel is using a specific key, we avoid
+        * userspace modifying the AMR value for that key by masking them
+        * via UAMOR 0b00.
+        *
+        * Pick the AMR values for the keys that kernel is using. This
+        * will be indicated by the ~default_uamor bits.
+        */
+       target->thread.amr = (new_amr & default_uamor) | (target->thread.amr & ~default_uamor);
  
        return 0;
  }
@@@ -510,110 -544,110 +520,110 @@@ static const struct user_regset native_
        [REGSET_GPR] = {
                .core_note_type = NT_PRSTATUS, .n = ELF_NGREG,
                .size = sizeof(long), .align = sizeof(long),
 -              .get = gpr_get, .set = gpr_set
 +              .regset_get = gpr_get, .set = gpr_set
        },
        [REGSET_FPR] = {
                .core_note_type = NT_PRFPREG, .n = ELF_NFPREG,
                .size = sizeof(double), .align = sizeof(double),
 -              .get = fpr_get, .set = fpr_set
 +              .regset_get = fpr_get, .set = fpr_set
        },
  #ifdef CONFIG_ALTIVEC
        [REGSET_VMX] = {
                .core_note_type = NT_PPC_VMX, .n = 34,
                .size = sizeof(vector128), .align = sizeof(vector128),
 -              .active = vr_active, .get = vr_get, .set = vr_set
 +              .active = vr_active, .regset_get = vr_get, .set = vr_set
        },
  #endif
  #ifdef CONFIG_VSX
        [REGSET_VSX] = {
                .core_note_type = NT_PPC_VSX, .n = 32,
                .size = sizeof(double), .align = sizeof(double),
 -              .active = vsr_active, .get = vsr_get, .set = vsr_set
 +              .active = vsr_active, .regset_get = vsr_get, .set = vsr_set
        },
  #endif
  #ifdef CONFIG_SPE
        [REGSET_SPE] = {
                .core_note_type = NT_PPC_SPE, .n = 35,
                .size = sizeof(u32), .align = sizeof(u32),
 -              .active = evr_active, .get = evr_get, .set = evr_set
 +              .active = evr_active, .regset_get = evr_get, .set = evr_set
        },
  #endif
  #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
        [REGSET_TM_CGPR] = {
                .core_note_type = NT_PPC_TM_CGPR, .n = ELF_NGREG,
                .size = sizeof(long), .align = sizeof(long),
 -              .active = tm_cgpr_active, .get = tm_cgpr_get, .set = tm_cgpr_set
 +              .active = tm_cgpr_active, .regset_get = tm_cgpr_get, .set = tm_cgpr_set
        },
        [REGSET_TM_CFPR] = {
                .core_note_type = NT_PPC_TM_CFPR, .n = ELF_NFPREG,
                .size = sizeof(double), .align = sizeof(double),
 -              .active = tm_cfpr_active, .get = tm_cfpr_get, .set = tm_cfpr_set
 +              .active = tm_cfpr_active, .regset_get = tm_cfpr_get, .set = tm_cfpr_set
        },
        [REGSET_TM_CVMX] = {
                .core_note_type = NT_PPC_TM_CVMX, .n = ELF_NVMX,
                .size = sizeof(vector128), .align = sizeof(vector128),
 -              .active = tm_cvmx_active, .get = tm_cvmx_get, .set = tm_cvmx_set
 +              .active = tm_cvmx_active, .regset_get = tm_cvmx_get, .set = tm_cvmx_set
        },
        [REGSET_TM_CVSX] = {
                .core_note_type = NT_PPC_TM_CVSX, .n = ELF_NVSX,
                .size = sizeof(double), .align = sizeof(double),
 -              .active = tm_cvsx_active, .get = tm_cvsx_get, .set = tm_cvsx_set
 +              .active = tm_cvsx_active, .regset_get = tm_cvsx_get, .set = tm_cvsx_set
        },
        [REGSET_TM_SPR] = {
                .core_note_type = NT_PPC_TM_SPR, .n = ELF_NTMSPRREG,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = tm_spr_active, .get = tm_spr_get, .set = tm_spr_set
 +              .active = tm_spr_active, .regset_get = tm_spr_get, .set = tm_spr_set
        },
        [REGSET_TM_CTAR] = {
                .core_note_type = NT_PPC_TM_CTAR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = tm_tar_active, .get = tm_tar_get, .set = tm_tar_set
 +              .active = tm_tar_active, .regset_get = tm_tar_get, .set = tm_tar_set
        },
        [REGSET_TM_CPPR] = {
                .core_note_type = NT_PPC_TM_CPPR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = tm_ppr_active, .get = tm_ppr_get, .set = tm_ppr_set
 +              .active = tm_ppr_active, .regset_get = tm_ppr_get, .set = tm_ppr_set
        },
        [REGSET_TM_CDSCR] = {
                .core_note_type = NT_PPC_TM_CDSCR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = tm_dscr_active, .get = tm_dscr_get, .set = tm_dscr_set
 +              .active = tm_dscr_active, .regset_get = tm_dscr_get, .set = tm_dscr_set
        },
  #endif
  #ifdef CONFIG_PPC64
        [REGSET_PPR] = {
                .core_note_type = NT_PPC_PPR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .get = ppr_get, .set = ppr_set
 +              .regset_get = ppr_get, .set = ppr_set
        },
        [REGSET_DSCR] = {
                .core_note_type = NT_PPC_DSCR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .get = dscr_get, .set = dscr_set
 +              .regset_get = dscr_get, .set = dscr_set
        },
  #endif
  #ifdef CONFIG_PPC_BOOK3S_64
        [REGSET_TAR] = {
                .core_note_type = NT_PPC_TAR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .get = tar_get, .set = tar_set
 +              .regset_get = tar_get, .set = tar_set
        },
        [REGSET_EBB] = {
                .core_note_type = NT_PPC_EBB, .n = ELF_NEBB,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = ebb_active, .get = ebb_get, .set = ebb_set
 +              .active = ebb_active, .regset_get = ebb_get, .set = ebb_set
        },
        [REGSET_PMR] = {
                .core_note_type = NT_PPC_PMU, .n = ELF_NPMU,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = pmu_active, .get = pmu_get, .set = pmu_set
 +              .active = pmu_active, .regset_get = pmu_get, .set = pmu_set
        },
  #endif
  #ifdef CONFIG_PPC_MEM_KEYS
        [REGSET_PKEY] = {
                .core_note_type = NT_PPC_PKEY, .n = ELF_NPKEY,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = pkey_active, .get = pkey_get, .set = pkey_set
 +              .active = pkey_active, .regset_get = pkey_get, .set = pkey_set
        },
  #endif
  };
@@@ -627,16 -661,49 +637,16 @@@ const struct user_regset_view user_ppc_
  
  int gpr32_get_common(struct task_struct *target,
                     const struct user_regset *regset,
 -                   unsigned int pos, unsigned int count,
 -                          void *kbuf, void __user *ubuf,
 -                          unsigned long *regs)
 +                   struct membuf to, unsigned long *regs)
  {
 -      compat_ulong_t *k = kbuf;
 -      compat_ulong_t __user *u = ubuf;
 -      compat_ulong_t reg;
 -
 -      pos /= sizeof(reg);
 -      count /= sizeof(reg);
 -
 -      if (kbuf)
 -              for (; count > 0 && pos < PT_MSR; --count)
 -                      *k++ = regs[pos++];
 -      else
 -              for (; count > 0 && pos < PT_MSR; --count)
 -                      if (__put_user((compat_ulong_t)regs[pos++], u++))
 -                              return -EFAULT;
 -
 -      if (count > 0 && pos == PT_MSR) {
 -              reg = get_user_msr(target);
 -              if (kbuf)
 -                      *k++ = reg;
 -              else if (__put_user(reg, u++))
 -                      return -EFAULT;
 -              ++pos;
 -              --count;
 -      }
 -
 -      if (kbuf)
 -              for (; count > 0 && pos < PT_REGS_COUNT; --count)
 -                      *k++ = regs[pos++];
 -      else
 -              for (; count > 0 && pos < PT_REGS_COUNT; --count)
 -                      if (__put_user((compat_ulong_t)regs[pos++], u++))
 -                              return -EFAULT;
 +      int i;
  
 -      kbuf = k;
 -      ubuf = u;
 -      pos *= sizeof(reg);
 -      count *= sizeof(reg);
 -      return user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
 -                                      PT_REGS_COUNT * sizeof(reg), -1);
 +      for (i = 0; i < PT_MSR; i++)
 +              membuf_store(&to, (u32)regs[i]);
 +      membuf_store(&to, (u32)get_user_msr(target));
 +      for (i++ ; i < PT_REGS_COUNT; i++)
 +              membuf_store(&to, (u32)regs[i]);
 +      return membuf_zero(&to, (ELF_NGREG - PT_REGS_COUNT) * sizeof(u32));
  }
  
  int gpr32_set_common(struct task_struct *target,
  
  static int gpr32_get(struct task_struct *target,
                     const struct user_regset *regset,
 -                   unsigned int pos, unsigned int count,
 -                   void *kbuf, void __user *ubuf)
 +                   struct membuf to)
  {
        int i;
  
                for (i = 14; i < 32; i++)
                        target->thread.regs->gpr[i] = NV_REG_POISON;
        }
 -      return gpr32_get_common(target, regset, pos, count, kbuf, ubuf,
 +      return gpr32_get_common(target, regset, to,
                        &target->thread.regs->gpr[0]);
  }
  
@@@ -748,25 -816,25 +758,25 @@@ static const struct user_regset compat_
        [REGSET_GPR] = {
                .core_note_type = NT_PRSTATUS, .n = ELF_NGREG,
                .size = sizeof(compat_long_t), .align = sizeof(compat_long_t),
 -              .get = gpr32_get, .set = gpr32_set
 +              .regset_get = gpr32_get, .set = gpr32_set
        },
        [REGSET_FPR] = {
                .core_note_type = NT_PRFPREG, .n = ELF_NFPREG,
                .size = sizeof(double), .align = sizeof(double),
 -              .get = fpr_get, .set = fpr_set
 +              .regset_get = fpr_get, .set = fpr_set
        },
  #ifdef CONFIG_ALTIVEC
        [REGSET_VMX] = {
                .core_note_type = NT_PPC_VMX, .n = 34,
                .size = sizeof(vector128), .align = sizeof(vector128),
 -              .active = vr_active, .get = vr_get, .set = vr_set
 +              .active = vr_active, .regset_get = vr_get, .set = vr_set
        },
  #endif
  #ifdef CONFIG_SPE
        [REGSET_SPE] = {
                .core_note_type = NT_PPC_SPE, .n = 35,
                .size = sizeof(u32), .align = sizeof(u32),
 -              .active = evr_active, .get = evr_get, .set = evr_set
 +              .active = evr_active, .regset_get = evr_get, .set = evr_set
        },
  #endif
  #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
                .core_note_type = NT_PPC_TM_CGPR, .n = ELF_NGREG,
                .size = sizeof(long), .align = sizeof(long),
                .active = tm_cgpr_active,
 -              .get = tm_cgpr32_get, .set = tm_cgpr32_set
 +              .regset_get = tm_cgpr32_get, .set = tm_cgpr32_set
        },
        [REGSET_TM_CFPR] = {
                .core_note_type = NT_PPC_TM_CFPR, .n = ELF_NFPREG,
                .size = sizeof(double), .align = sizeof(double),
 -              .active = tm_cfpr_active, .get = tm_cfpr_get, .set = tm_cfpr_set
 +              .active = tm_cfpr_active, .regset_get = tm_cfpr_get, .set = tm_cfpr_set
        },
        [REGSET_TM_CVMX] = {
                .core_note_type = NT_PPC_TM_CVMX, .n = ELF_NVMX,
                .size = sizeof(vector128), .align = sizeof(vector128),
 -              .active = tm_cvmx_active, .get = tm_cvmx_get, .set = tm_cvmx_set
 +              .active = tm_cvmx_active, .regset_get = tm_cvmx_get, .set = tm_cvmx_set
        },
        [REGSET_TM_CVSX] = {
                .core_note_type = NT_PPC_TM_CVSX, .n = ELF_NVSX,
                .size = sizeof(double), .align = sizeof(double),
 -              .active = tm_cvsx_active, .get = tm_cvsx_get, .set = tm_cvsx_set
 +              .active = tm_cvsx_active, .regset_get = tm_cvsx_get, .set = tm_cvsx_set
        },
        [REGSET_TM_SPR] = {
                .core_note_type = NT_PPC_TM_SPR, .n = ELF_NTMSPRREG,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = tm_spr_active, .get = tm_spr_get, .set = tm_spr_set
 +              .active = tm_spr_active, .regset_get = tm_spr_get, .set = tm_spr_set
        },
        [REGSET_TM_CTAR] = {
                .core_note_type = NT_PPC_TM_CTAR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = tm_tar_active, .get = tm_tar_get, .set = tm_tar_set
 +              .active = tm_tar_active, .regset_get = tm_tar_get, .set = tm_tar_set
        },
        [REGSET_TM_CPPR] = {
                .core_note_type = NT_PPC_TM_CPPR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = tm_ppr_active, .get = tm_ppr_get, .set = tm_ppr_set
 +              .active = tm_ppr_active, .regset_get = tm_ppr_get, .set = tm_ppr_set
        },
        [REGSET_TM_CDSCR] = {
                .core_note_type = NT_PPC_TM_CDSCR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = tm_dscr_active, .get = tm_dscr_get, .set = tm_dscr_set
 +              .active = tm_dscr_active, .regset_get = tm_dscr_get, .set = tm_dscr_set
        },
  #endif
  #ifdef CONFIG_PPC64
        [REGSET_PPR] = {
                .core_note_type = NT_PPC_PPR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .get = ppr_get, .set = ppr_set
 +              .regset_get = ppr_get, .set = ppr_set
        },
        [REGSET_DSCR] = {
                .core_note_type = NT_PPC_DSCR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .get = dscr_get, .set = dscr_set
 +              .regset_get = dscr_get, .set = dscr_set
        },
  #endif
  #ifdef CONFIG_PPC_BOOK3S_64
        [REGSET_TAR] = {
                .core_note_type = NT_PPC_TAR, .n = 1,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .get = tar_get, .set = tar_set
 +              .regset_get = tar_get, .set = tar_set
        },
        [REGSET_EBB] = {
                .core_note_type = NT_PPC_EBB, .n = ELF_NEBB,
                .size = sizeof(u64), .align = sizeof(u64),
 -              .active = ebb_active, .get = ebb_get, .set = ebb_set
 +              .active = ebb_active, .regset_get = ebb_get, .set = ebb_set
        },
  #endif
  };
index ebb04f331ad33e6f752c191d5cd7aec425f7dbea,a22ac01fa660c3a99aaee87b32f0437fa04d0371..0f83f39a2bd2f9d8033c1e860e07c7a664be582e
@@@ -74,7 -74,6 +74,7 @@@
  #include <asm/hw_breakpoint.h>
  #include <asm/kvm_book3s_uvmem.h>
  #include <asm/ultravisor.h>
 +#include <asm/dtl.h>
  
  #include "book3s.h"
  
@@@ -765,7 -764,7 +765,7 @@@ static int kvmppc_h_set_mode(struct kvm
                        return H_P3;
                vcpu->arch.ciabr  = value1;
                return H_SUCCESS;
-       case H_SET_MODE_RESOURCE_SET_DAWR:
+       case H_SET_MODE_RESOURCE_SET_DAWR0:
                if (!kvmppc_power8_compatible(vcpu))
                        return H_P2;
                if (!ppc_breakpoint_available())
@@@ -1680,10 -1679,22 +1680,22 @@@ static int kvmppc_get_one_reg_hv(struc
        case KVM_REG_PPC_UAMOR:
                *val = get_reg_val(id, vcpu->arch.uamor);
                break;
-       case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCRS:
+       case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCR1:
                i = id - KVM_REG_PPC_MMCR0;
                *val = get_reg_val(id, vcpu->arch.mmcr[i]);
                break;
+       case KVM_REG_PPC_MMCR2:
+               *val = get_reg_val(id, vcpu->arch.mmcr[2]);
+               break;
+       case KVM_REG_PPC_MMCRA:
+               *val = get_reg_val(id, vcpu->arch.mmcra);
+               break;
+       case KVM_REG_PPC_MMCRS:
+               *val = get_reg_val(id, vcpu->arch.mmcrs);
+               break;
+       case KVM_REG_PPC_MMCR3:
+               *val = get_reg_val(id, vcpu->arch.mmcr[3]);
+               break;
        case KVM_REG_PPC_PMC1 ... KVM_REG_PPC_PMC8:
                i = id - KVM_REG_PPC_PMC1;
                *val = get_reg_val(id, vcpu->arch.pmc[i]);
                *val = get_reg_val(id, vcpu->arch.sdar);
                break;
        case KVM_REG_PPC_SIER:
-               *val = get_reg_val(id, vcpu->arch.sier);
+               *val = get_reg_val(id, vcpu->arch.sier[0]);
+               break;
+       case KVM_REG_PPC_SIER2:
+               *val = get_reg_val(id, vcpu->arch.sier[1]);
+               break;
+       case KVM_REG_PPC_SIER3:
+               *val = get_reg_val(id, vcpu->arch.sier[2]);
                break;
        case KVM_REG_PPC_IAMR:
                *val = get_reg_val(id, vcpu->arch.iamr);
@@@ -1901,10 -1918,22 +1919,22 @@@ static int kvmppc_set_one_reg_hv(struc
        case KVM_REG_PPC_UAMOR:
                vcpu->arch.uamor = set_reg_val(id, *val);
                break;
-       case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCRS:
+       case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCR1:
                i = id - KVM_REG_PPC_MMCR0;
                vcpu->arch.mmcr[i] = set_reg_val(id, *val);
                break;
+       case KVM_REG_PPC_MMCR2:
+               vcpu->arch.mmcr[2] = set_reg_val(id, *val);
+               break;
+       case KVM_REG_PPC_MMCRA:
+               vcpu->arch.mmcra = set_reg_val(id, *val);
+               break;
+       case KVM_REG_PPC_MMCRS:
+               vcpu->arch.mmcrs = set_reg_val(id, *val);
+               break;
+       case KVM_REG_PPC_MMCR3:
+               *val = get_reg_val(id, vcpu->arch.mmcr[3]);
+               break;
        case KVM_REG_PPC_PMC1 ... KVM_REG_PPC_PMC8:
                i = id - KVM_REG_PPC_PMC1;
                vcpu->arch.pmc[i] = set_reg_val(id, *val);
                vcpu->arch.sdar = set_reg_val(id, *val);
                break;
        case KVM_REG_PPC_SIER:
-               vcpu->arch.sier = set_reg_val(id, *val);
+               vcpu->arch.sier[0] = set_reg_val(id, *val);
+               break;
+       case KVM_REG_PPC_SIER2:
+               vcpu->arch.sier[1] = set_reg_val(id, *val);
+               break;
+       case KVM_REG_PPC_SIER3:
+               vcpu->arch.sier[2] = set_reg_val(id, *val);
                break;
        case KVM_REG_PPC_IAMR:
                vcpu->arch.iamr = set_reg_val(id, *val);
index 9b9f92ad0e7abef0343232064264365a38a267e8,30a4a91d99877fecb5f535b71a7be3058410266d..1478fceeb683ce466d9f0f57705349a4b8dff79b
@@@ -232,8 -232,6 +232,6 @@@ unsigned long htab_convert_pte_flags(un
                rflags |= HPTE_R_I;
        else if ((pteflags & _PAGE_CACHE_CTL) == _PAGE_NON_IDEMPOTENT)
                rflags |= (HPTE_R_I | HPTE_R_G);
-       else if ((pteflags & _PAGE_CACHE_CTL) == _PAGE_SAO)
-               rflags |= (HPTE_R_W | HPTE_R_I | HPTE_R_M);
        else
                /*
                 * Add memory coherence if cache inhibited is not set
@@@ -596,7 -594,7 +594,7 @@@ static void __init htab_scan_page_sizes
        }
  
  #ifdef CONFIG_HUGETLB_PAGE
-       if (!hugetlb_disabled) {
+       if (!hugetlb_disabled && !early_radix_enabled() ) {
                /* Reserve 16G huge page memory sections for huge pages */
                of_scan_flat_dt(htab_dt_scan_hugepage_blocks, NULL);
        }
@@@ -663,11 -661,10 +661,10 @@@ static void __init htab_init_page_sizes
                 * Pick a size for the linear mapping. Currently, we only
                 * support 16M, 1M and 4K which is the default
                 */
-               if (IS_ENABLED(STRICT_KERNEL_RWX) &&
+               if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX) &&
                    (unsigned long)_stext % 0x1000000) {
                        if (mmu_psize_defs[MMU_PAGE_16M].shift)
-                               pr_warn("Kernel not 16M aligned, "
-                                       "disabling 16M linear map alignment");
+                               pr_warn("Kernel not 16M aligned, disabling 16M linear map alignment\n");
                        aligned = false;
                }
  
@@@ -788,7 -785,7 +785,7 @@@ static unsigned long __init htab_get_ta
  }
  
  #ifdef CONFIG_MEMORY_HOTPLUG
- int resize_hpt_for_hotplug(unsigned long new_mem_size)
static int resize_hpt_for_hotplug(unsigned long new_mem_size)
  {
        unsigned target_hpt_shift;
  
@@@ -822,6 -819,8 +819,8 @@@ int hash__create_section_mapping(unsign
                return -1;
        }
  
+       resize_hpt_for_hotplug(memblock_phys_mem_size());
        rc = htab_bolt_mapping(start, end, __pa(start),
                               pgprot_val(prot), mmu_linear_psize,
                               mmu_kernel_ssize);
@@@ -839,6 -838,10 +838,10 @@@ int hash__remove_section_mapping(unsign
        int rc = htab_remove_mapping(start, end, mmu_linear_psize,
                                     mmu_kernel_ssize);
        WARN_ON(rc < 0);
+       if (resize_hpt_for_hotplug(memblock_phys_mem_size()) == -ENOSPC)
+               pr_warn("Hash collision while resizing HPT\n");
        return rc;
  }
  #endif /* CONFIG_MEMORY_HOTPLUG */
@@@ -1111,6 -1114,10 +1114,10 @@@ void hash__early_init_mmu_secondary(voi
        if (cpu_has_feature(CPU_FTR_ARCH_206)
                        && cpu_has_feature(CPU_FTR_HVMODE))
                tlbiel_all();
+ #ifdef CONFIG_PPC_MEM_KEYS
+       mtspr(SPRN_UAMOR, default_uamor);
+ #endif
  }
  #endif /* CONFIG_SMP */
  
@@@ -1559,7 -1566,6 +1566,7 @@@ static void hash_preload(struct mm_stru
        pgd_t *pgdir;
        int rc, ssize, update_flags = 0;
        unsigned long access = _PAGE_PRESENT | _PAGE_READ | (is_exec ? _PAGE_EXEC : 0);
 +      unsigned long flags;
  
        BUG_ON(get_region_id(ea) != USER_REGION_ID);
  
                return;
  #endif /* CONFIG_PPC_64K_PAGES */
  
 +      /*
 +       * __hash_page_* must run with interrupts off, as it sets the
 +       * H_PAGE_BUSY bit. It's possible for perf interrupts to hit at any
 +       * time and may take a hash fault reading the user stack, see
 +       * read_user_stack_slow() in the powerpc/perf code.
 +       *
 +       * If that takes a hash fault on the same page as we lock here, it
 +       * will bail out when seeing H_PAGE_BUSY set, and retry the access
 +       * leading to an infinite loop.
 +       *
 +       * Disabling interrupts here does not prevent perf interrupts, but it
 +       * will prevent them taking hash faults (see the NMI test in
 +       * do_hash_page), then read_user_stack's copy_from_user_nofault will
 +       * fail and perf will fall back to read_user_stack_slow(), which
 +       * walks the Linux page tables.
 +       *
 +       * Interrupts must also be off for the duration of the
 +       * mm_is_thread_local test and update, to prevent preempt running the
 +       * mm on another CPU (XXX: this may be racy vs kthread_use_mm).
 +       */
 +      local_irq_save(flags);
 +
        /* Is that local to this CPU ? */
        if (mm_is_thread_local(mm))
                update_flags |= HPTE_LOCAL_UPDATE;
                                   mm_ctx_user_psize(&mm->context),
                                   mm_ctx_user_psize(&mm->context),
                                   pte_val(*ptep));
 +
 +      local_irq_restore(flags);
  }
  
  /*
@@@ -1731,10 -1713,6 +1738,6 @@@ unsigned long pte_get_hash_gslot(unsign
        return gslot;
  }
  
- /*
-  * WARNING: This is called from hash_low_64.S, if you change this prototype,
-  *          do not forget to update the assembly call site !
-  */
  void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize, int ssize,
                     unsigned long flags)
  {
index 01d70280d287215bae6416b3f75bdbaaba7abefe,e29c846bf35dd6e0d67f9f71635088a695bcd9b5..78fe349865942719cea9a1359459dde0293b7703
@@@ -37,12 -37,7 +37,7 @@@ struct cpu_hw_events 
        struct perf_event *event[MAX_HWEVENTS];
        u64 events[MAX_HWEVENTS];
        unsigned int flags[MAX_HWEVENTS];
-       /*
-        * The order of the MMCR array is:
-        *  - 64-bit, MMCR0, MMCR1, MMCRA, MMCR2
-        *  - 32-bit, MMCR0, MMCR1, MMCR2
-        */
-       unsigned long mmcr[4];
+       struct mmcr_regs mmcr;
        struct perf_event *limited_counter[MAX_LIMITED_HWCOUNTERS];
        u8  limited_hwidx[MAX_LIMITED_HWCOUNTERS];
        u64 alternatives[MAX_HWEVENTS][MAX_EVENT_ALTERNATIVES];
@@@ -77,6 -72,11 +72,11 @@@ static unsigned int freeze_events_kerne
  /*
   * 32-bit doesn't have MMCRA but does have an MMCR2,
   * and a few other names are different.
+  * Also 32-bit doesn't have MMCR3, SIER2 and SIER3.
+  * Define them as zero knowing that any code path accessing
+  * these registers (via mtspr/mfspr) are done under ppmu flag
+  * check for PPMU_ARCH_31 and we will not enter that code path
+  * for 32-bit.
   */
  #ifdef CONFIG_PPC32
  
  #define MMCR0_PMCC_U6         0
  
  #define SPRN_MMCRA            SPRN_MMCR2
+ #define SPRN_MMCR3            0
+ #define SPRN_SIER2            0
+ #define SPRN_SIER3            0
  #define MMCRA_SAMPLE_ENABLE   0
+ #define MMCRA_BHRB_DISABLE     0
  
  static inline unsigned long perf_ip_adjust(struct pt_regs *regs)
  {
@@@ -121,7 -125,7 +125,7 @@@ static void ebb_event_add(struct perf_e
  static void ebb_switch_out(unsigned long mmcr0) { }
  static unsigned long ebb_switch_in(bool ebb, struct cpu_hw_events *cpuhw)
  {
-       return cpuhw->mmcr[0];
+       return cpuhw->mmcr.mmcr0;
  }
  
  static inline void power_pmu_bhrb_enable(struct perf_event *event) {}
@@@ -466,8 -470,11 +470,11 @@@ static void power_pmu_bhrb_read(struct 
                         * addresses at this point. Check the privileges before
                         * exporting it to userspace (avoid exposure of regions
                         * where we could have speculative execution)
+                        * Incase of ISA v3.1, BHRB will capture only user-space
+                        * addresses, hence include a check before filtering code
                         */
-                       if (is_kernel_addr(addr) && perf_allow_kernel(&event->attr) != 0)
+                       if (!(ppmu->flags & PPMU_ARCH_31) &&
+                               is_kernel_addr(addr) && perf_allow_kernel(&event->attr) != 0)
                                continue;
  
                        /* Branches are read most recent first (ie. mfbhrb 0 is
@@@ -586,11 -593,16 +593,16 @@@ static void ebb_switch_out(unsigned lon
        current->thread.sdar  = mfspr(SPRN_SDAR);
        current->thread.mmcr0 = mmcr0 & MMCR0_USER_MASK;
        current->thread.mmcr2 = mfspr(SPRN_MMCR2) & MMCR2_USER_MASK;
+       if (ppmu->flags & PPMU_ARCH_31) {
+               current->thread.mmcr3 = mfspr(SPRN_MMCR3);
+               current->thread.sier2 = mfspr(SPRN_SIER2);
+               current->thread.sier3 = mfspr(SPRN_SIER3);
+       }
  }
  
  static unsigned long ebb_switch_in(bool ebb, struct cpu_hw_events *cpuhw)
  {
-       unsigned long mmcr0 = cpuhw->mmcr[0];
+       unsigned long mmcr0 = cpuhw->mmcr.mmcr0;
  
        if (!ebb)
                goto out;
         * unfreeze counters, it should not set exclude_xxx in its events and
         * instead manage the MMCR2 entirely by itself.
         */
-       mtspr(SPRN_MMCR2, cpuhw->mmcr[3] | current->thread.mmcr2);
+       mtspr(SPRN_MMCR2, cpuhw->mmcr.mmcr2 | current->thread.mmcr2);
+       if (ppmu->flags & PPMU_ARCH_31) {
+               mtspr(SPRN_MMCR3, current->thread.mmcr3);
+               mtspr(SPRN_SIER2, current->thread.sier2);
+               mtspr(SPRN_SIER3, current->thread.sier3);
+       }
  out:
        return mmcr0;
  }
@@@ -845,6 -863,11 +863,11 @@@ void perf_event_print_debug(void
                pr_info("EBBRR: %016lx BESCR: %016lx\n",
                        mfspr(SPRN_EBBRR), mfspr(SPRN_BESCR));
        }
+       if (ppmu->flags & PPMU_ARCH_31) {
+               pr_info("MMCR3: %016lx SIER2: %016lx SIER3: %016lx\n",
+                       mfspr(SPRN_MMCR3), mfspr(SPRN_SIER2), mfspr(SPRN_SIER3));
+       }
  #endif
        pr_info("SIAR:  %016lx SDAR:  %016lx SIER:  %016lx\n",
                mfspr(SPRN_SIAR), sdar, sier);
@@@ -1196,7 -1219,7 +1219,7 @@@ static void write_mmcr0(struct cpu_hw_e
  static void power_pmu_disable(struct pmu *pmu)
  {
        struct cpu_hw_events *cpuhw;
-       unsigned long flags, mmcr0, val;
+       unsigned long flags, mmcr0, val, mmcra;
  
        if (!ppmu)
                return;
                mb();
                isync();
  
+               val = mmcra = cpuhw->mmcr.mmcra;
                /*
                 * Disable instruction sampling if it was enabled
                 */
-               if (cpuhw->mmcr[2] & MMCRA_SAMPLE_ENABLE) {
-                       mtspr(SPRN_MMCRA,
-                             cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE);
+               if (cpuhw->mmcr.mmcra & MMCRA_SAMPLE_ENABLE)
+                       val &= ~MMCRA_SAMPLE_ENABLE;
+               /* Disable BHRB via mmcra (BHRBRD) for p10 */
+               if (ppmu->flags & PPMU_ARCH_31)
+                       val |= MMCRA_BHRB_DISABLE;
+               /*
+                * Write SPRN_MMCRA if mmcra has either disabled
+                * instruction sampling or BHRB.
+                */
+               if (val != mmcra) {
+                       mtspr(SPRN_MMCRA, mmcra);
                        mb();
                        isync();
                }
@@@ -1308,18 -1343,20 +1343,20 @@@ static void power_pmu_enable(struct pm
         * (possibly updated for removal of events).
         */
        if (!cpuhw->n_added) {
-               mtspr(SPRN_MMCRA, cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE);
-               mtspr(SPRN_MMCR1, cpuhw->mmcr[1]);
+               mtspr(SPRN_MMCRA, cpuhw->mmcr.mmcra & ~MMCRA_SAMPLE_ENABLE);
+               mtspr(SPRN_MMCR1, cpuhw->mmcr.mmcr1);
+               if (ppmu->flags & PPMU_ARCH_31)
+                       mtspr(SPRN_MMCR3, cpuhw->mmcr.mmcr3);
                goto out_enable;
        }
  
        /*
         * Clear all MMCR settings and recompute them for the new set of events.
         */
-       memset(cpuhw->mmcr, 0, sizeof(cpuhw->mmcr));
+       memset(&cpuhw->mmcr, 0, sizeof(cpuhw->mmcr));
  
        if (ppmu->compute_mmcr(cpuhw->events, cpuhw->n_events, hwc_index,
-                              cpuhw->mmcr, cpuhw->event)) {
+                              &cpuhw->mmcr, cpuhw->event)) {
                /* shouldn't ever get here */
                printk(KERN_ERR "oops compute_mmcr failed\n");
                goto out;
                 */
                event = cpuhw->event[0];
                if (event->attr.exclude_user)
-                       cpuhw->mmcr[0] |= MMCR0_FCP;
+                       cpuhw->mmcr.mmcr0 |= MMCR0_FCP;
                if (event->attr.exclude_kernel)
-                       cpuhw->mmcr[0] |= freeze_events_kernel;
+                       cpuhw->mmcr.mmcr0 |= freeze_events_kernel;
                if (event->attr.exclude_hv)
-                       cpuhw->mmcr[0] |= MMCR0_FCHV;
+                       cpuhw->mmcr.mmcr0 |= MMCR0_FCHV;
        }
  
        /*
         * Then unfreeze the events.
         */
        ppc_set_pmu_inuse(1);
-       mtspr(SPRN_MMCRA, cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE);
-       mtspr(SPRN_MMCR1, cpuhw->mmcr[1]);
-       mtspr(SPRN_MMCR0, (cpuhw->mmcr[0] & ~(MMCR0_PMC1CE | MMCR0_PMCjCE))
+       mtspr(SPRN_MMCRA, cpuhw->mmcr.mmcra & ~MMCRA_SAMPLE_ENABLE);
+       mtspr(SPRN_MMCR1, cpuhw->mmcr.mmcr1);
+       mtspr(SPRN_MMCR0, (cpuhw->mmcr.mmcr0 & ~(MMCR0_PMC1CE | MMCR0_PMCjCE))
                                | MMCR0_FC);
        if (ppmu->flags & PPMU_ARCH_207S)
-               mtspr(SPRN_MMCR2, cpuhw->mmcr[3]);
+               mtspr(SPRN_MMCR2, cpuhw->mmcr.mmcr2);
+       if (ppmu->flags & PPMU_ARCH_31)
+               mtspr(SPRN_MMCR3, cpuhw->mmcr.mmcr3);
  
        /*
         * Read off any pre-existing events that need to move
                perf_event_update_userpage(event);
        }
        cpuhw->n_limited = n_lim;
-       cpuhw->mmcr[0] |= MMCR0_PMXE | MMCR0_FCECE;
+       cpuhw->mmcr.mmcr0 |= MMCR0_PMXE | MMCR0_FCECE;
  
   out_enable:
        pmao_restore_workaround(ebb);
        /*
         * Enable instruction sampling if necessary
         */
-       if (cpuhw->mmcr[2] & MMCRA_SAMPLE_ENABLE) {
+       if (cpuhw->mmcr.mmcra & MMCRA_SAMPLE_ENABLE) {
                mb();
-               mtspr(SPRN_MMCRA, cpuhw->mmcr[2]);
+               mtspr(SPRN_MMCRA, cpuhw->mmcr.mmcra);
        }
  
   out:
@@@ -1550,7 -1590,7 +1590,7 @@@ static void power_pmu_del(struct perf_e
                                cpuhw->flags[i-1] = cpuhw->flags[i];
                        }
                        --cpuhw->n_events;
-                       ppmu->disable_pmc(event->hw.idx - 1, cpuhw->mmcr);
+                       ppmu->disable_pmc(event->hw.idx - 1, &cpuhw->mmcr);
                        if (event->hw.idx) {
                                write_pmc(event->hw.idx, 0);
                                event->hw.idx = 0;
        }
        if (cpuhw->n_events == 0) {
                /* disable exceptions if no events are running */
-               cpuhw->mmcr[0] &= ~(MMCR0_PMXE | MMCR0_FCECE);
+               cpuhw->mmcr.mmcr0 &= ~(MMCR0_PMXE | MMCR0_FCECE);
        }
  
        if (has_branch_stack(event))
@@@ -1795,7 -1835,7 +1835,7 @@@ static void hw_perf_event_destroy(struc
  static int hw_perf_cache_event(u64 config, u64 *eventp)
  {
        unsigned long type, op, result;
-       int ev;
+       u64 ev;
  
        if (!ppmu->cache_events)
                return -EINVAL;
@@@ -2179,12 -2219,6 +2219,12 @@@ static void __perf_event_interrupt(stru
  
        perf_read_regs(regs);
  
 +      /*
 +       * If perf interrupts hit in a local_irq_disable (soft-masked) region,
 +       * we consider them as NMIs. This is required to prevent hash faults on
 +       * user addresses when reading callchains. See the NMI test in
 +       * do_hash_page.
 +       */
        nmi = perf_intr_is_nmi(regs);
        if (nmi)
                nmi_enter();
         * XXX might want to use MSR.PM to keep the events frozen until
         * we get back out of this interrupt.
         */
-       write_mmcr0(cpuhw, cpuhw->mmcr[0]);
+       write_mmcr0(cpuhw, cpuhw->mmcr.mmcr0);
  
        if (nmi)
                nmi_exit();
@@@ -2268,7 -2302,7 +2308,7 @@@ static int power_pmu_prepare_cpu(unsign
  
        if (ppmu) {
                memset(cpuhw, 0, sizeof(*cpuhw));
-               cpuhw->mmcr[0] = MMCR0_FC;
+               cpuhw->mmcr.mmcr0 = MMCR0_FC;
        }
        return 0;
  }
@@@ -2314,6 -2348,8 +2354,8 @@@ static int __init init_ppc64_pmu(void
                return 0;
        else if (!init_power9_pmu())
                return 0;
+       else if (!init_power10_pmu())
+               return 0;
        else if (!init_ppc970_pmu())
                return 0;
        else
index f71ff2c94efed43f853e9a78706ccce5e3d7b780,f82569a505f111b883e7df41735d6d2da3a2dda4..baf24eacd268637c3e9f613e69c9d32b80a585eb
@@@ -40,7 -40,6 +40,7 @@@
  #include <asm/fadump.h>
  #include <asm/asm-prototypes.h>
  #include <asm/debugfs.h>
 +#include <asm/dtl.h>
  
  #include "pseries.h"
  
@@@ -1681,9 -1680,11 +1681,11 @@@ static int pseries_lpar_register_proces
  
        if (table_size)
                flags |= PROC_TABLE_NEW;
-       if (radix_enabled())
-               flags |= PROC_TABLE_RADIX | PROC_TABLE_GTSE;
-       else
+       if (radix_enabled()) {
+               flags |= PROC_TABLE_RADIX;
+               if (mmu_has_feature(MMU_FTR_GTSE))
+                       flags |= PROC_TABLE_GTSE;
+       } else
                flags |= PROC_TABLE_HPT_SLB;
        for (;;) {
                rc = plpar_hcall_norets(H_REGISTER_PROC_TBL, flags, base,
index 27094c872fd6aeab041ac06b7df16270db3e6c99,b1a8c72a8c1214553c8e42e70cd321c740d07432..2f4ee0a902841ba723ff559565ca2dab23817bc4
@@@ -70,7 -70,6 +70,7 @@@
  #include <asm/idle.h>
  #include <asm/swiotlb.h>
  #include <asm/svm.h>
 +#include <asm/dtl.h>
  
  #include "pseries.h"
  #include "../../../../drivers/pci/pci.h"
@@@ -359,7 -358,7 +359,7 @@@ static void pseries_lpar_idle(void
   * to ever be a problem in practice we can move this into a kernel thread to
   * finish off the process later in boot.
   */
void pseries_enable_reloc_on_exc(void)
bool pseries_enable_reloc_on_exc(void)
  {
        long rc;
        unsigned int delay, total_delay = 0;
                        if (rc == H_P2) {
                                pr_info("Relocation on exceptions not"
                                        " supported\n");
+                               return false;
                        } else if (rc != H_SUCCESS) {
                                pr_warn("Unable to enable relocation"
                                        " on exceptions: %ld\n", rc);
+                               return false;
                        }
-                       break;
+                       return true;
                }
  
                delay = get_longbusy_msecs(rc);
                        pr_warn("Warning: Giving up waiting to enable "
                                "relocation on exceptions (%u msec)!\n",
                                total_delay);
-                       return;
+                       return false;
                }
  
                mdelay(delay);
@@@ -746,6 -747,11 +748,11 @@@ static void __init pSeries_setup_arch(v
        smp_init_pseries();
  
  
+       if (radix_enabled() && !mmu_has_feature(MMU_FTR_GTSE))
+               if (!firmware_has_feature(FW_FEATURE_RPT_INVALIDATE))
+                       panic("BUG: Radix support requires either GTSE or RPT_INVALIDATE\n");
        /* openpic global configuration register (64-bit format). */
        /* openpic Interrupt Source Unit pointer (64-bit format). */
        /* python0 facility area (mmio) (64-bit format) REAL address. */
        if (firmware_has_feature(FW_FEATURE_LPAR)) {
                vpa_init(boot_cpuid);
  
-               if (lppaca_shared_proc(get_lppaca()))
+               if (lppaca_shared_proc(get_lppaca())) {
                        static_branch_enable(&shared_processor);
+                       pv_spinlocks_init();
+               }
  
                ppc_md.power_save = pseries_lpar_idle;
                ppc_md.enable_pmcs = pseries_lpar_enable_pmcs;
@@@ -832,12 -840,15 +841,15 @@@ static int pseries_set_xdabr(unsigned l
        return plpar_hcall_norets(H_SET_XDABR, dabr, dabrx);
  }
  
- static int pseries_set_dawr(unsigned long dawr, unsigned long dawrx)
+ static int pseries_set_dawr(int nr, unsigned long dawr, unsigned long dawrx)
  {
        /* PAPR says we can't set HYP */
        dawrx &= ~DAWRX_HYP;
  
-       return  plpar_set_watchpoint0(dawr, dawrx);
+       if (nr == 0)
+               return plpar_set_watchpoint0(dawr, dawrx);
+       else
+               return plpar_set_watchpoint1(dawr, dawrx);
  }
  
  #define CMO_CHARACTERISTICS_TOKEN 44
index cfea054863a428c0ca9a8e4a871d71ee981e1cd7,00534fa4a3844dd8c5f27581d04b5961e37c5833..86dbe0c8b45c60314b1d5113b4ab7c38d6b6e788
@@@ -282,8 -282,6 +282,8 @@@ static int persistent_memory_claim(stru
                        while (daa-- && i < p) {
                                pages[i++] = pfn_t_to_page(pfn);
                                pfn.val++;
 +                              if (!(i & 15))
 +                                      cond_resched();
                        }
                } while (i < p);
                wc->memory_map = vmap(pages, p, VM_MAP, PAGE_KERNEL);
@@@ -538,7 -536,7 +538,7 @@@ static void ssd_commit_superblock(struc
  static void writecache_commit_flushed(struct dm_writecache *wc, bool wait_for_ios)
  {
        if (WC_MODE_PMEM(wc))
-               wmb();
+               pmem_wmb();
        else
                ssd_commit_flushed(wc, wait_for_ios);
  }
@@@ -851,14 -849,10 +851,14 @@@ static void writecache_discard(struct d
  
                if (likely(!e->write_in_progress)) {
                        if (!discarded_something) {
 -                              writecache_wait_for_ios(wc, READ);
 -                              writecache_wait_for_ios(wc, WRITE);
 +                              if (!WC_MODE_PMEM(wc)) {
 +                                      writecache_wait_for_ios(wc, READ);
 +                                      writecache_wait_for_ios(wc, WRITE);
 +                              }
                                discarded_something = true;
                        }
 +                      if (!writecache_entry_is_committed(wc, e))
 +                              wc->uncommitted_blocks--;
                        writecache_free_entry(wc, e);
                }
  
@@@ -1244,7 -1238,7 +1244,7 @@@ static int writecache_flush_thread(voi
                                           bio_end_sector(bio));
                        wc_unlock(wc);
                        bio_set_dev(bio, wc->dev->bdev);
 -                      generic_make_request(bio);
 +                      submit_bio_noacct(bio);
                } else {
                        writecache_flush(wc);
                        wc_unlock(wc);
@@@ -1752,7 -1746,7 +1752,7 @@@ static void writecache_writeback(struc
  {
        struct dm_writecache *wc = container_of(work, struct dm_writecache, writeback_work);
        struct blk_plug plug;
 -      struct wc_entry *f, *uninitialized_var(g), *e = NULL;
 +      struct wc_entry *f, *g, *e = NULL;
        struct rb_node *node, *next_node;
        struct list_head skipped;
        struct writeback_list wbl;
@@@ -2266,12 -2260,6 +2266,12 @@@ invalid_optional
        }
  
        if (WC_MODE_PMEM(wc)) {
 +              if (!dax_synchronous(wc->ssd_dev->dax_dev)) {
 +                      r = -EOPNOTSUPP;
 +                      ti->error = "Asynchronous persistent memory not supported as pmem cache";
 +                      goto bad;
 +              }
 +
                r = persistent_memory_claim(wc);
                if (r) {
                        ti->error = "Unable to map persistent memory for cache";
index fec97dc34de78e0de5b0bee375aafa859f99dbe2,b589bb216ee57fc77d5e2b54c43b7a5baca76585..798027bb89be8ba529120ce97a1da1a9c7511743
@@@ -13,7 -13,7 +13,7 @@@
  
  #ifndef __ASSEMBLY__
  
 -#include <linux/compiler.h>
 +#include <asm/rwonce.h>
  
  #ifndef nop
  #define nop() asm volatile ("nop")
  #define dma_wmb()     wmb()
  #endif
  
 -#ifndef read_barrier_depends
 -#define read_barrier_depends()                do { } while (0)
 -#endif
 -
  #ifndef __smp_mb
  #define __smp_mb()    mb()
  #endif
  #define __smp_wmb()   wmb()
  #endif
  
 -#ifndef __smp_read_barrier_depends
 -#define __smp_read_barrier_depends()  read_barrier_depends()
 -#endif
 -
  #ifdef CONFIG_SMP
  
  #ifndef smp_mb
  #define smp_wmb()     __smp_wmb()
  #endif
  
 -#ifndef smp_read_barrier_depends
 -#define smp_read_barrier_depends()    __smp_read_barrier_depends()
 -#endif
 -
  #else /* !CONFIG_SMP */
  
  #ifndef smp_mb
  #define smp_wmb()     barrier()
  #endif
  
 -#ifndef smp_read_barrier_depends
 -#define smp_read_barrier_depends()    do { } while (0)
 -#endif
 -
  #endif        /* CONFIG_SMP */
  
  #ifndef __smp_store_mb
@@@ -180,6 -196,7 +180,6 @@@ do {                                                                       
  #define virt_mb() __smp_mb()
  #define virt_rmb() __smp_rmb()
  #define virt_wmb() __smp_wmb()
 -#define virt_read_barrier_depends() __smp_read_barrier_depends()
  #define virt_store_mb(var, value) __smp_store_mb(var, value)
  #define virt_mb__before_atomic() __smp_mb__before_atomic()
  #define virt_mb__after_atomic()       __smp_mb__after_atomic()
  })
  #endif
  
+ /*
+  * pmem_wmb() ensures that all stores for which the modification
+  * are written to persistent storage by preceding instructions have
+  * updated persistent storage before any data  access or data transfer
+  * caused by subsequent instructions is initiated.
+  */
+ #ifndef pmem_wmb
+ #define pmem_wmb()    wmb()
+ #endif
  #endif /* !__ASSEMBLY__ */
  #endif /* __ASM_GENERIC_BARRIER_H */
index 2b26cd729b94e8e1e777b60b7fb7cd5262552182,38ca14e79a86060d12d2fc0993b080e6379cca6e..4fe7fd0fe834dc56ba3f8c2f492b4ec74c8f8d18
@@@ -11,8 -11,8 +11,9 @@@
  #define __ASM_GENERIC_QSPINLOCK_H
  
  #include <asm-generic/qspinlock_types.h>
 +#include <linux/atomic.h>
  
+ #ifndef queued_spin_is_locked
  /**
   * queued_spin_is_locked - is the spinlock locked?
   * @lock: Pointer to queued spinlock structure
@@@ -26,6 -26,7 +27,7 @@@ static __always_inline int queued_spin_
         */
        return atomic_read(&lock->val);
  }
+ #endif
  
  /**
   * queued_spin_value_unlocked - is the spinlock structure unlocked?
@@@ -68,6 -69,7 +70,7 @@@ static __always_inline int queued_spin_
  
  extern void queued_spin_lock_slowpath(struct qspinlock *lock, u32 val);
  
+ #ifndef queued_spin_lock
  /**
   * queued_spin_lock - acquire a queued spinlock
   * @lock: Pointer to queued spinlock structure
@@@ -81,6 -83,7 +84,7 @@@ static __always_inline void queued_spin
  
        queued_spin_lock_slowpath(lock, val);
  }
+ #endif
  
  #ifndef queued_spin_unlock
  /**
diff --combined kernel/kexec_file.c
index 94661d2d13ad6a9866c0375bb4611736828d9d2c,eb42d2efa16af59928b423219e91185fee87003b..78c0837bfd7bdbbf753f05323f5a4332623cd50a
@@@ -181,19 -181,34 +181,19 @@@ void kimage_file_post_load_cleanup(stru
  static int
  kimage_validate_signature(struct kimage *image)
  {
 -      const char *reason;
        int ret;
  
        ret = arch_kexec_kernel_verify_sig(image, image->kernel_buf,
                                           image->kernel_buf_len);
 -      switch (ret) {
 -      case 0:
 -              break;
 +      if (ret) {
  
 -              /* Certain verification errors are non-fatal if we're not
 -               * checking errors, provided we aren't mandating that there
 -               * must be a valid signature.
 -               */
 -      case -ENODATA:
 -              reason = "kexec of unsigned image";
 -              goto decide;
 -      case -ENOPKG:
 -              reason = "kexec of image with unsupported crypto";
 -              goto decide;
 -      case -ENOKEY:
 -              reason = "kexec of image with unavailable key";
 -      decide:
                if (IS_ENABLED(CONFIG_KEXEC_SIG_FORCE)) {
 -                      pr_notice("%s rejected\n", reason);
 +                      pr_notice("Enforced kernel signature verification failed (%d).\n", ret);
                        return ret;
                }
  
 -              /* If IMA is guaranteed to appraise a signature on the kexec
 +              /*
 +               * If IMA is guaranteed to appraise a signature on the kexec
                 * image, permit it even if the kernel is otherwise locked
                 * down.
                 */
                    security_locked_down(LOCKDOWN_KEXEC))
                        return -EPERM;
  
 -              return 0;
 -
 -              /* All other errors are fatal, including nomem, unparseable
 -               * signatures and signature check failures - even if signatures
 -               * aren't required.
 -               */
 -      default:
 -              pr_notice("kernel signature verification failed (%d).\n", ret);
 +              pr_debug("kernel signature verification failed (%d).\n", ret);
        }
  
 -      return ret;
 +      return 0;
  }
  #endif
  
@@@ -265,7 -287,7 +265,7 @@@ kimage_file_prepare_segments(struct kim
                        goto out;
                }
  
 -              ima_kexec_cmdline(image->cmdline_buf,
 +              ima_kexec_cmdline(kernel_fd, image->cmdline_buf,
                                  image->cmdline_buf_len - 1);
        }
  
@@@ -635,6 -657,19 +635,19 @@@ int kexec_locate_mem_hole(struct kexec_
        return ret == 1 ? 0 : -EADDRNOTAVAIL;
  }
  
+ /**
+  * arch_kexec_locate_mem_hole - Find free memory to place the segments.
+  * @kbuf:                       Parameters for the memory search.
+  *
+  * On success, kbuf->mem will have the start address of the memory region found.
+  *
+  * Return: 0 on success, negative errno on error.
+  */
+ int __weak arch_kexec_locate_mem_hole(struct kexec_buf *kbuf)
+ {
+       return kexec_locate_mem_hole(kbuf);
+ }
  /**
   * kexec_add_buffer - place a buffer in a kexec segment
   * @kbuf:     Buffer contents and memory parameters.
   */
  int kexec_add_buffer(struct kexec_buf *kbuf)
  {
        struct kexec_segment *ksegment;
        int ret;
  
        kbuf->buf_align = max(kbuf->buf_align, PAGE_SIZE);
  
        /* Walk the RAM ranges and allocate a suitable range for the buffer */
-       ret = kexec_locate_mem_hole(kbuf);
+       ret = arch_kexec_locate_mem_hole(kbuf);
        if (ret)
                return ret;
  
diff --combined mm/ksm.c
index 5fb176d497eaa9e9938b33cc0bcdbcd01ad0a0b6,d1cfa18689b57891e48e9720c546b5687f7a790c..217842a66912f2e88704c7ae33058b6163fbc475
+++ b/mm/ksm.c
@@@ -2387,7 -2387,7 +2387,7 @@@ next_mm
  static void ksm_do_scan(unsigned int scan_npages)
  {
        struct rmap_item *rmap_item;
 -      struct page *uninitialized_var(page);
 +      struct page *page;
  
        while (scan_npages-- && likely(!freezing(current))) {
                cond_resched();
@@@ -2452,10 -2452,6 +2452,6 @@@ int ksm_madvise(struct vm_area_struct *
                if (vma_is_dax(vma))
                        return 0;
  
- #ifdef VM_SAO
-               if (*vm_flags & VM_SAO)
-                       return 0;
- #endif
  #ifdef VM_SPARC_ADI
                if (*vm_flags & VM_SPARC_ADI)
                        return 0;