Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 3 Oct 2016 15:58:35 +0000 (08:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 3 Oct 2016 15:58:35 +0000 (08:58 -0700)
Pull arm64 updates from Will Deacon:
 "It's a bit all over the place this time with no "killer feature" to
  speak of.  Support for mismatched cache line sizes should help people
  seeing whacky JIT failures on some SoCs, and the big.LITTLE perf
  updates have been a long time coming, but a lot of the changes here
  are cleanups.

  We stray outside arch/arm64 in a few areas: the arch/arm/ arch_timer
  workaround is acked by Russell, the DT/OF bits are acked by Rob, the
  arch_timer clocksource changes acked by Marc, CPU hotplug by tglx and
  jump_label by Peter (all CC'd).

  Summary:

   - Support for execute-only page permissions
   - Support for hibernate and DEBUG_PAGEALLOC
   - Support for heterogeneous systems with mismatches cache line sizes
   - Errata workarounds (A53 843419 update and QorIQ A-008585 timer bug)
   - arm64 PMU perf updates, including cpumasks for heterogeneous systems
   - Set UTS_MACHINE for building rpm packages
   - Yet another head.S tidy-up
   - Some cleanups and refactoring, particularly in the NUMA code
   - Lots of random, non-critical fixes across the board"

* tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (100 commits)
  arm64: tlbflush.h: add __tlbi() macro
  arm64: Kconfig: remove SMP dependence for NUMA
  arm64: Kconfig: select OF/ACPI_NUMA under NUMA config
  arm64: fix dump_backtrace/unwind_frame with NULL tsk
  arm/arm64: arch_timer: Use archdata to indicate vdso suitability
  arm64: arch_timer: Work around QorIQ Erratum A-008585
  arm64: arch_timer: Add device tree binding for A-008585 erratum
  arm64: Correctly bounds check virt_addr_valid
  arm64: migrate exception table users off module.h and onto extable.h
  arm64: pmu: Hoist pmu platform device name
  arm64: pmu: Probe default hw/cache counters
  arm64: pmu: add fallback probe table
  MAINTAINERS: Update ARM PMU PROFILING AND DEBUGGING entry
  arm64: Improve kprobes test for atomic sequence
  arm64/kvm: use alternative auto-nop
  arm64: use alternative auto-nop
  arm64: alternative: add auto-nop infrastructure
  arm64: lse: convert lse alternatives NOP padding to use __nops
  arm64: barriers: introduce nops and __nops macros for NOP sequences
  arm64: sysreg: replace open-coded mrs_s/msr_s with {read,write}_sysreg_s
  ...

1  2 
Documentation/arm64/silicon-errata.txt
Documentation/kernel-parameters.txt
MAINTAINERS
arch/arm64/include/asm/spinlock.h
arch/arm64/kernel/smp.c
arch/arm64/kvm/sys_regs.c
arch/arm64/mm/proc.S
drivers/perf/arm_pmu.c
include/linux/cpuhotplug.h

@@@ -53,7 -53,6 +53,7 @@@ stable kernels
  | ARM            | Cortex-A57      | #832075         | ARM64_ERRATUM_832075    |
  | ARM            | Cortex-A57      | #852523         | N/A                     |
  | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
 +| ARM            | Cortex-A72      | #853709         | N/A                     |
  | ARM            | MMU-500         | #841119,#826419 | N/A                     |
  |                |                 |                 |                         |
  | Cavium         | ThunderX ITS    | #22375, #24313  | CAVIUM_ERRATUM_22375    |
@@@ -61,3 -60,5 +61,5 @@@
  | Cavium         | ThunderX GICv3  | #23154          | CAVIUM_ERRATUM_23154    |
  | Cavium         | ThunderX Core   | #27456          | CAVIUM_ERRATUM_27456    |
  | Cavium         | ThunderX SMMUv2 | #27704          | N/A                   |
+ |                |                 |                 |                         |
+ | Freescale/NXP  | LS2080A/LS1043A | A-008585        | FSL_ERRATUM_A008585     |
@@@ -698,6 -698,15 +698,15 @@@ bytes respectively. Such letter suffixe
                        loops can be debugged more effectively on production
                        systems.
  
+       clocksource.arm_arch_timer.fsl-a008585=
+                       [ARM64]
+                       Format: <bool>
+                       Enable/disable the workaround of Freescale/NXP
+                       erratum A-008585.  This can be useful for KVM
+                       guests, if the guest device tree doesn't show the
+                       erratum.  If unspecified, the workaround is
+                       enabled based on the device tree.
        clearcpuid=BITNUM [X86]
                        Disable CPUID feature X for the kernel. See
                        arch/x86/include/asm/cpufeatures.h for the valid bit
                                PAGE_SIZE is used as alignment.
                                PCI-PCI bridge can be specified, if resource
                                windows need to be expanded.
 +                              To specify the alignment for several
 +                              instances of a device, the PCI vendor,
 +                              device, subvendor, and subdevice may be
 +                              specified, e.g., 4096@pci:8086:9c22:103c:198f
                ecrc=           Enable/disable PCIe ECRC (transaction layer
                                end-to-end CRC checking).
                                bios: Use BIOS/firmware settings. This is the
diff --combined MAINTAINERS
@@@ -798,7 -798,6 +798,7 @@@ M: Laura Abbott <labbott@redhat.com
  M:    Sumit Semwal <sumit.semwal@linaro.org>
  L:    devel@driverdev.osuosl.org
  S:    Supported
 +F:    Documentation/devicetree/bindings/staging/ion/
  F:    drivers/staging/android/ion
  F:    drivers/staging/android/uapi/ion.h
  F:    drivers/staging/android/uapi/ion_test.h
@@@ -882,15 -881,6 +882,15 @@@ S:       Supporte
  F:    drivers/gpu/drm/arc/
  F:    Documentation/devicetree/bindings/display/snps,arcpgu.txt
  
 +ARM ARCHITECTED TIMER DRIVER
 +M:    Mark Rutland <mark.rutland@arm.com>
 +M:    Marc Zyngier <marc.zyngier@arm.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    arch/arm/include/asm/arch_timer.h
 +F:    arch/arm64/include/asm/arch_timer.h
 +F:    drivers/clocksource/arm_arch_timer.c
 +
  ARM HDLCD DRM DRIVER
  M:    Liviu Dudau <liviu.dudau@arm.com>
  S:    Supported
@@@ -913,15 -903,17 +913,17 @@@ F:      arch/arm/include/asm/floppy.
  
  ARM PMU PROFILING AND DEBUGGING
  M:    Will Deacon <will.deacon@arm.com>
R:    Mark Rutland <mark.rutland@arm.com>
M:    Mark Rutland <mark.rutland@arm.com>
  S:    Maintained
+ L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  F:    arch/arm*/kernel/perf_*
  F:    arch/arm/oprofile/common.c
  F:    arch/arm*/kernel/hw_breakpoint.c
  F:    arch/arm*/include/asm/hw_breakpoint.h
  F:    arch/arm*/include/asm/perf_event.h
- F:    drivers/perf/arm_pmu.c
+ F:    drivers/perf/*
  F:    include/linux/perf/arm_pmu.h
+ F:    Documentation/devicetree/bindings/arm/pmu.txt
  
  ARM PORT
  M:    Russell King <linux@armlinux.org.uk>
@@@ -1624,8 -1616,7 +1626,8 @@@ N:      rockchi
  
  ARM/SAMSUNG EXYNOS ARM ARCHITECTURES
  M:    Kukjin Kim <kgene@kernel.org>
 -M:    Krzysztof Kozlowski <k.kozlowski@samsung.com>
 +M:    Krzysztof Kozlowski <krzk@kernel.org>
 +R:    Javier Martinez Canillas <javier@osg.samsung.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
  S:    Maintained
@@@ -1645,6 -1636,7 +1647,6 @@@ F:      drivers/*/*s3c64xx
  F:    drivers/*/*s5pv210*
  F:    drivers/memory/samsung/*
  F:    drivers/soc/samsung/*
 -F:    drivers/spi/spi-s3c*
  F:    Documentation/arm/Samsung/
  F:    Documentation/devicetree/bindings/arm/samsung/
  F:    Documentation/devicetree/bindings/sram/samsung-sram.txt
@@@ -1832,7 -1824,6 +1834,7 @@@ T:      git git://git.kernel.org/pub/scm/lin
  ARM/UNIPHIER ARCHITECTURE
  M:    Masahiro Yamada <yamada.masahiro@socionext.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier.git
  S:    Maintained
  F:    arch/arm/boot/dts/uniphier*
  F:    arch/arm/include/asm/hardware/cache-uniphier.h
@@@ -2486,7 -2477,7 +2488,7 @@@ F:      include/net/bluetooth
  BONDING DRIVER
  M:    Jay Vosburgh <j.vosburgh@gmail.com>
  M:    Veaceslav Falico <vfalico@gmail.com>
 -M:    Andy Gospodarek <gospo@cumulusnetworks.com>
 +M:    Andy Gospodarek <andy@greyhouse.net>
  L:    netdev@vger.kernel.org
  W:    http://sourceforge.net/projects/bonding/
  S:    Supported
@@@ -2501,7 -2492,7 +2503,7 @@@ S:      Supporte
  F:    kernel/bpf/
  
  BROADCOM B44 10/100 ETHERNET DRIVER
 -M:    Gary Zambrano <zambrano@broadcom.com>
 +M:    Michael Chan <michael.chan@broadcom.com>
  L:    netdev@vger.kernel.org
  S:    Supported
  F:    drivers/net/ethernet/broadcom/b44.*
@@@ -3249,7 -3240,7 +3251,7 @@@ F:      kernel/cpuset.
  CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)
  M:    Johannes Weiner <hannes@cmpxchg.org>
  M:    Michal Hocko <mhocko@kernel.org>
 -M:    Vladimir Davydov <vdavydov@virtuozzo.com>
 +M:    Vladimir Davydov <vdavydov.dev@gmail.com>
  L:    cgroups@vger.kernel.org
  L:    linux-mm@kvack.org
  S:    Maintained
@@@ -3270,7 -3261,7 +3272,7 @@@ S:      Maintaine
  F:    drivers/net/wan/cosa*
  
  CPMAC ETHERNET DRIVER
 -M:    Florian Fainelli <florian@openwrt.org>
 +M:    Florian Fainelli <f.fainelli@gmail.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ethernet/ti/cpmac.c
@@@ -6103,7 -6094,7 +6105,7 @@@ S:      Supporte
  F:    drivers/cpufreq/intel_pstate.c
  
  INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
 -M:    Maik Broemme <mbroemme@plusserver.de>
 +M:    Maik Broemme <mbroemme@libmpq.org>
  L:    linux-fbdev@vger.kernel.org
  S:    Maintained
  F:    Documentation/fb/intelfb.txt
@@@ -7466,8 -7457,7 +7468,8 @@@ F:      Documentation/devicetree/bindings/so
  F:    sound/soc/codecs/max9860.*
  
  MAXIM MUIC CHARGER DRIVERS FOR EXYNOS BASED BOARDS
 -M:    Krzysztof Kozlowski <k.kozlowski@samsung.com>
 +M:    Krzysztof Kozlowski <krzk@kernel.org>
 +M:    Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
  L:    linux-pm@vger.kernel.org
  S:    Supported
  F:    drivers/power/max14577_charger.c
@@@ -7483,8 -7473,7 +7485,8 @@@ F:      include/dt-bindings/*/*max77802.
  
  MAXIM PMIC AND MUIC DRIVERS FOR EXYNOS BASED BOARDS
  M:    Chanwoo Choi <cw00.choi@samsung.com>
 -M:    Krzysztof Kozlowski <k.kozlowski@samsung.com>
 +M:    Krzysztof Kozlowski <krzk@kernel.org>
 +M:    Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
  L:    linux-kernel@vger.kernel.org
  S:    Supported
  F:    drivers/*/max14577*.c
@@@ -7674,7 -7663,7 +7676,7 @@@ L:      linux-rdma@vger.kernel.or
  S:    Supported
  W:    https://github.com/SoftRoCE/rxe-dev/wiki/rxe-dev:-Home
  Q:    http://patchwork.kernel.org/project/linux-rdma/list/
 -F:    drivers/infiniband/hw/rxe/
 +F:    drivers/infiniband/sw/rxe/
  F:    include/uapi/rdma/rdma_user_rxe.h
  
  MEMBARRIER SUPPORT
@@@ -8161,15 -8150,6 +8163,15 @@@ S:    Maintaine
  W:    https://fedorahosted.org/dropwatch/
  F:    net/core/drop_monitor.c
  
 +NETWORKING [DSA]
 +M:    Andrew Lunn <andrew@lunn.ch>
 +M:    Vivien Didelot <vivien.didelot@savoirfairelinux.com>
 +M:    Florian Fainelli <f.fainelli@gmail.com>
 +S:    Maintained
 +F:    net/dsa/
 +F:    include/net/dsa.h
 +F:    drivers/net/dsa/
 +
  NETWORKING [GENERAL]
  M:    "David S. Miller" <davem@davemloft.net>
  L:    netdev@vger.kernel.org
@@@ -8745,7 -8725,7 +8747,7 @@@ F:      drivers/oprofile
  F:    include/linux/oprofile.h
  
  ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
 -M:    Mark Fasheh <mfasheh@suse.com>
 +M:    Mark Fasheh <mfasheh@versity.com>
  M:    Joel Becker <jlbec@evilplan.org>
  L:    ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
  W:    http://ocfs2.wiki.kernel.org
@@@ -9259,7 -9239,7 +9261,7 @@@ F:      drivers/pinctrl/sh-pfc
  
  PIN CONTROLLER - SAMSUNG
  M:    Tomasz Figa <tomasz.figa@gmail.com>
 -M:    Krzysztof Kozlowski <k.kozlowski@samsung.com>
 +M:    Krzysztof Kozlowski <krzk@kernel.org>
  M:    Sylwester Nawrocki <s.nawrocki@samsung.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
@@@ -10192,7 -10172,7 +10194,7 @@@ S:   Maintaine
  F:    drivers/platform/x86/samsung-laptop.c
  
  SAMSUNG AUDIO (ASoC) DRIVERS
 -M:    Krzysztof Kozlowski <k.kozlowski@samsung.com>
 +M:    Krzysztof Kozlowski <krzk@kernel.org>
  M:    Sangbeom Kim <sbkim73@samsung.com>
  M:    Sylwester Nawrocki <s.nawrocki@samsung.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
@@@ -10207,8 -10187,7 +10209,8 @@@ F:   drivers/video/fbdev/s3c-fb.
  
  SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS
  M:    Sangbeom Kim <sbkim73@samsung.com>
 -M:    Krzysztof Kozlowski <k.kozlowski@samsung.com>
 +M:    Krzysztof Kozlowski <krzk@kernel.org>
 +M:    Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
  L:    linux-kernel@vger.kernel.org
  L:    linux-samsung-soc@vger.kernel.org
  S:    Supported
@@@ -10267,17 -10246,6 +10269,17 @@@ S: Supporte
  L:    linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
  F:    drivers/clk/samsung/
  
 +SAMSUNG SPI DRIVERS
 +M:    Kukjin Kim <kgene@kernel.org>
 +M:    Krzysztof Kozlowski <krzk@kernel.org>
 +M:    Andi Shyti <andi.shyti@samsung.com>
 +L:    linux-spi@vger.kernel.org
 +L:    linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/spi/spi-samsung.txt
 +F:    drivers/spi/spi-s3c*
 +F:    include/linux/platform_data/spi-s3c64xx.h
 +
  SAMSUNG SXGBE DRIVERS
  M:    Byungho An <bh74.an@samsung.com>
  M:    Girish K S <ks.giri@samsung.com>
@@@ -11257,8 -11225,12 +11259,8 @@@ S:  Odd Fixe
  F:    drivers/staging/vt665?/
  
  STAGING - WILC1000 WIFI DRIVER
 -M:    Johnny Kim <johnny.kim@atmel.com>
 -M:    Austin Shin <austin.shin@atmel.com>
 -M:    Chris Park <chris.park@atmel.com>
 -M:    Tony Cho <tony.cho@atmel.com>
 -M:    Glen Lee <glen.lee@atmel.com>
 -M:    Leo Kim <leo.kim@atmel.com>
 +M:    Aditya Shankar <aditya.shankar@microchip.com>
 +M:    Ganesh Krishna <ganesh.krishna@microchip.com>
  L:    linux-wireless@vger.kernel.org
  S:    Supported
  F:    drivers/staging/wilc1000/
@@@ -11626,7 -11598,7 +11628,7 @@@ F:   Documentation/devicetree/bindings/th
  THERMAL/CPU_COOLING
  M:    Amit Daniel Kachhap <amit.kachhap@gmail.com>
  M:    Viresh Kumar <viresh.kumar@linaro.org>
 -M:    Javi Merino <javi.merino@arm.com>
 +M:    Javi Merino <javi.merino@kernel.org>
  L:    linux-pm@vger.kernel.org
  S:    Supported
  F:    Documentation/thermal/cpu-cooling-api.txt
@@@ -12578,7 -12550,7 +12580,7 @@@ F:   include/linux/if_*vlan.
  F:    net/8021q/
  
  VLYNQ BUS
 -M:    Florian Fainelli <florian@openwrt.org>
 +M:    Florian Fainelli <f.fainelli@gmail.com>
  L:    openwrt-devel@lists.openwrt.org (subscribers-only)
  S:    Maintained
  F:    drivers/vlynq/vlynq.c
@@@ -66,8 -66,7 +66,7 @@@ static inline void arch_spin_unlock_wai
        ARM64_LSE_ATOMIC_INSN(
        /* LL/SC */
  "     stxr    %w1, %w0, %2\n"
- "     nop\n"
- "     nop\n",
+       __nops(2),
        /* LSE atomics */
  "     mov     %w1, %w0\n"
  "     cas     %w0, %w0, %2\n"
@@@ -99,9 -98,7 +98,7 @@@ static inline void arch_spin_lock(arch_
        /* LSE atomics */
  "     mov     %w2, %w5\n"
  "     ldadda  %w2, %w0, %3\n"
- "     nop\n"
- "     nop\n"
- "     nop\n"
+       __nops(3)
        )
  
        /* Did we get the lock? */
@@@ -165,8 -162,8 +162,8 @@@ static inline void arch_spin_unlock(arc
        "       stlrh   %w1, %0",
        /* LSE atomics */
        "       mov     %w1, #1\n"
-       "       nop\n"
-       "       staddlh %w1, %0")
+       "       staddlh %w1, %0\n"
+       __nops(1))
        : "=Q" (lock->owner), "=&r" (tmp)
        :
        : "memory");
@@@ -212,7 -209,7 +209,7 @@@ static inline void arch_write_lock(arch
        "       cbnz    %w0, 1b\n"
        "       stxr    %w0, %w2, %1\n"
        "       cbnz    %w0, 2b\n"
-       "       nop",
+       __nops(1),
        /* LSE atomics */
        "1:     mov     %w0, wzr\n"
        "2:     casa    %w0, %w2, %1\n"
@@@ -241,8 -238,7 +238,7 @@@ static inline int arch_write_trylock(ar
        /* LSE atomics */
        "       mov     %w0, wzr\n"
        "       casa    %w0, %w2, %1\n"
-       "       nop\n"
-       "       nop")
+       __nops(2))
        : "=&r" (tmp), "+Q" (rw->lock)
        : "r" (0x80000000)
        : "memory");
@@@ -290,8 -286,8 +286,8 @@@ static inline void arch_read_lock(arch_
        "       add     %w0, %w0, #1\n"
        "       tbnz    %w0, #31, 1b\n"
        "       stxr    %w1, %w0, %2\n"
-       "       nop\n"
-       "       cbnz    %w1, 2b",
+       "       cbnz    %w1, 2b\n"
+       __nops(1),
        /* LSE atomics */
        "1:     wfe\n"
        "2:     ldxr    %w0, %2\n"
@@@ -317,9 -313,8 +313,8 @@@ static inline void arch_read_unlock(arc
        "       cbnz    %w1, 1b",
        /* LSE atomics */
        "       movn    %w0, #0\n"
-       "       nop\n"
-       "       nop\n"
-       "       staddl  %w0, %2")
+       "       staddl  %w0, %2\n"
+       __nops(2))
        : "=&r" (tmp), "=&r" (tmp2), "+Q" (rw->lock)
        :
        : "memory");
@@@ -344,7 -339,7 +339,7 @@@ static inline int arch_read_trylock(arc
        "       tbnz    %w1, #31, 1f\n"
        "       casa    %w0, %w1, %2\n"
        "       sbc     %w1, %w1, %w0\n"
-       "       nop\n"
+       __nops(1)
        "1:")
        : "=&r" (tmp), "=&r" (tmp2), "+Q" (rw->lock)
        :
  #define arch_read_relax(lock) cpu_relax()
  #define arch_write_relax(lock)        cpu_relax()
  
 +/*
 + * Accesses appearing in program order before a spin_lock() operation
 + * can be reordered with accesses inside the critical section, by virtue
 + * of arch_spin_lock being constructed using acquire semantics.
 + *
 + * In cases where this is problematic (e.g. try_to_wake_up), an
 + * smp_mb__before_spinlock() can restore the required ordering.
 + */
 +#define smp_mb__before_spinlock()     smp_mb()
 +
  #endif /* __ASM_SPINLOCK_H */
diff --combined arch/arm64/kernel/smp.c
@@@ -201,6 -201,12 +201,6 @@@ int __cpu_up(unsigned int cpu, struct t
        return ret;
  }
  
 -static void smp_store_cpu_info(unsigned int cpuid)
 -{
 -      store_cpu_topology(cpuid);
 -      numa_store_cpu_info(cpuid);
 -}
 -
  /*
   * This is the secondary CPU boot entry.  We're using this CPUs
   * idle thread stack, but a set of temporary page tables.
@@@ -233,7 -239,7 +233,7 @@@ asmlinkage void secondary_start_kernel(
         * this CPU ticks all of those. If it doesn't, the CPU will
         * fail to come online.
         */
-       verify_local_cpu_capabilities();
+       check_local_cpu_capabilities();
  
        if (cpu_ops[cpu]->cpu_postboot)
                cpu_ops[cpu]->cpu_postboot();
         */
        notify_cpu_starting(cpu);
  
 -      smp_store_cpu_info(cpu);
 +      store_cpu_topology(cpu);
  
        /*
         * OK, now it's safe to let the boot CPU continue.  Wait for
@@@ -431,8 -437,19 +431,19 @@@ void __init smp_cpus_done(unsigned int 
  void __init smp_prepare_boot_cpu(void)
  {
        set_my_cpu_offset(per_cpu_offset(smp_processor_id()));
+       /*
+        * Initialise the static keys early as they may be enabled by the
+        * cpufeature code.
+        */
+       jump_label_init();
        cpuinfo_store_boot_cpu();
        save_boot_cpu_run_el();
+       /*
+        * Run the errata work around checks on the boot CPU, once we have
+        * initialised the cpu feature infrastructure from
+        * cpuinfo_store_boot_cpu() above.
+        */
+       update_cpu_errata_workarounds();
  }
  
  static u64 __init of_get_cpu_mpidr(struct device_node *dn)
@@@ -613,6 -630,7 +624,7 @@@ static void __init of_parse_and_init_cp
                        }
  
                        bootcpu_valid = true;
+                       early_map_cpu_to_node(0, of_node_to_nid(dn));
  
                        /*
                         * cpu_logical_map has already been
@@@ -683,13 -701,10 +695,13 @@@ void __init smp_prepare_cpus(unsigned i
  {
        int err;
        unsigned int cpu;
 +      unsigned int this_cpu;
  
        init_cpu_topology();
  
 -      smp_store_cpu_info(smp_processor_id());
 +      this_cpu = smp_processor_id();
 +      store_cpu_topology(this_cpu);
 +      numa_store_cpu_info(this_cpu);
  
        /*
         * If UP is mandated by "nosmp" (which implies "maxcpus=0"), don't set
                        continue;
  
                set_cpu_present(cpu, true);
 +              numa_store_cpu_info(cpu);
        }
  }
  
@@@ -36,6 -36,7 +36,7 @@@
  #include <asm/kvm_host.h>
  #include <asm/kvm_mmu.h>
  #include <asm/perf_event.h>
+ #include <asm/sysreg.h>
  
  #include <trace/events/kvm.h>
  
@@@ -67,11 -68,9 +68,9 @@@ static u32 get_ccsidr(u32 csselr
  
        /* Make sure noone else changes CSSELR during this! */
        local_irq_disable();
-       /* Put value into CSSELR */
-       asm volatile("msr csselr_el1, %x0" : : "r" (csselr));
+       write_sysreg(csselr, csselr_el1);
        isb();
-       /* Read result out of CCSIDR */
-       asm volatile("mrs %0, ccsidr_el1" : "=r" (ccsidr));
+       ccsidr = read_sysreg(ccsidr_el1);
        local_irq_enable();
  
        return ccsidr;
@@@ -174,9 -173,7 +173,7 @@@ static bool trap_dbgauthstatus_el1(stru
        if (p->is_write) {
                return ignore_write(vcpu, p);
        } else {
-               u32 val;
-               asm volatile("mrs %0, dbgauthstatus_el1" : "=r" (val));
-               p->regval = val;
+               p->regval = read_sysreg(dbgauthstatus_el1);
                return true;
        }
  }
@@@ -429,10 -426,7 +426,7 @@@ static void reset_wcr(struct kvm_vcpu *
  
  static void reset_amair_el1(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r)
  {
-       u64 amair;
-       asm volatile("mrs %0, amair_el1\n" : "=r" (amair));
-       vcpu_sys_reg(vcpu, AMAIR_EL1) = amair;
+       vcpu_sys_reg(vcpu, AMAIR_EL1) = read_sysreg(amair_el1);
  }
  
  static void reset_mpidr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r)
@@@ -456,8 -450,9 +450,9 @@@ static void reset_pmcr(struct kvm_vcpu 
  {
        u64 pmcr, val;
  
-       asm volatile("mrs %0, pmcr_el0\n" : "=r" (pmcr));
-       /* Writable bits of PMCR_EL0 (ARMV8_PMU_PMCR_MASK) is reset to UNKNOWN
+       pmcr = read_sysreg(pmcr_el0);
+       /*
+        * Writable bits of PMCR_EL0 (ARMV8_PMU_PMCR_MASK) are reset to UNKNOWN
         * except PMCR.E resetting to zero.
         */
        val = ((pmcr & ~ARMV8_PMU_PMCR_MASK)
@@@ -557,9 -552,9 +552,9 @@@ static bool access_pmceid(struct kvm_vc
                return false;
  
        if (!(p->Op2 & 1))
-               asm volatile("mrs %0, pmceid0_el0\n" : "=r" (pmceid));
+               pmceid = read_sysreg(pmceid0_el0);
        else
-               asm volatile("mrs %0, pmceid1_el0\n" : "=r" (pmceid));
+               pmceid = read_sysreg(pmceid1_el0);
  
        p->regval = pmceid;
  
@@@ -823,6 -818,14 +818,6 @@@ static bool access_pmuserenr(struct kvm
   * Architected system registers.
   * Important: Must be sorted ascending by Op0, Op1, CRn, CRm, Op2
   *
 - * We could trap ID_DFR0 and tell the guest we don't support performance
 - * monitoring.  Unfortunately the patch to make the kernel check ID_DFR0 was
 - * NAKed, so it will read the PMCR anyway.
 - *
 - * Therefore we tell the guest we have 0 counters.  Unfortunately, we
 - * must always support PMCCNTR (the cycle counter): we just RAZ/WI for
 - * all PM registers, which doesn't crash the guest kernel at least.
 - *
   * Debug handling: We do trap most, if not all debug related system
   * registers. The implementation is good enough to ensure that a guest
   * can use these with minimal performance degradation. The drawback is
@@@ -1352,7 -1355,7 +1347,7 @@@ static const struct sys_reg_desc cp15_r
        { Op1( 0), CRn(10), CRm( 3), Op2( 1), access_vm_reg, NULL, c10_AMAIR1 },
  
        /* ICC_SRE */
 -      { Op1( 0), CRn(12), CRm(12), Op2( 5), trap_raz_wi },
 +      { Op1( 0), CRn(12), CRm(12), Op2( 5), access_gic_sre },
  
        { Op1( 0), CRn(13), CRm( 0), Op2( 1), access_vm_reg, NULL, c13_CID },
  
@@@ -1833,11 -1836,7 +1828,7 @@@ static const struct sys_reg_desc *index
        static void get_##reg(struct kvm_vcpu *v,                       \
                              const struct sys_reg_desc *r)             \
        {                                                               \
-               u64 val;                                                \
-                                                                       \
-               asm volatile("mrs %0, " __stringify(reg) "\n"           \
-                            : "=r" (val));                             \
-               ((struct sys_reg_desc *)r)->val = val;                  \
+               ((struct sys_reg_desc *)r)->val = read_sysreg(reg);     \
        }
  
  FUNCTION_INVARIANT(midr_el1)
diff --combined arch/arm64/mm/proc.S
@@@ -83,6 -83,7 +83,7 @@@ ENDPROC(cpu_do_suspend
   *
   * x0: Address of context pointer
   */
+       .pushsection ".idmap.text", "ax"
  ENTRY(cpu_do_resume)
        ldp     x2, x3, [x0]
        ldp     x4, x5, [x0, #16]
  
        msr     tcr_el1, x8
        msr     vbar_el1, x9
 +
 +      /*
 +       * __cpu_setup() cleared MDSCR_EL1.MDE and friends, before unmasking
 +       * debug exceptions. By restoring MDSCR_EL1 here, we may take a debug
 +       * exception. Mask them until local_dbg_restore() in cpu_suspend()
 +       * resets them.
 +       */
 +      disable_dbg
        msr     mdscr_el1, x10
 +
        msr     sctlr_el1, x12
        /*
         * Restore oslsr_el1 by writing oslar_el1
        isb
        ret
  ENDPROC(cpu_do_resume)
+       .popsection
  #endif
  
  /*
@@@ -134,17 -127,12 +136,12 @@@ ENTRY(cpu_do_switch_mm
        bfi     x0, x1, #48, #16                // set the ASID
        msr     ttbr0_el1, x0                   // set TTBR0
        isb
- alternative_if_not ARM64_WORKAROUND_CAVIUM_27456
-       ret
-       nop
-       nop
-       nop
- alternative_else
+ alternative_if ARM64_WORKAROUND_CAVIUM_27456
        ic      iallu
        dsb     nsh
        isb
+ alternative_else_nop_endif
        ret
- alternative_endif
  ENDPROC(cpu_do_switch_mm)
  
        .pushsection ".idmap.text", "ax"
@@@ -181,6 -169,7 +178,7 @@@ ENDPROC(idmap_cpu_replace_ttbr1
   *    Initialise the processor for turning the MMU on.  Return in x0 the
   *    value of the SCTLR_EL1 register.
   */
+       .pushsection ".idmap.text", "ax"
  ENTRY(__cpu_setup)
        tlbi    vmalle1                         // Invalidate local TLB
        dsb     nsh
@@@ -266,3 -255,4 +264,4 @@@ ENDPROC(__cpu_setup
  crval:
        .word   0xfcffffff                      // clear
        .word   0x34d5d91d                      // set
+       .popsection
diff --combined drivers/perf/arm_pmu.c
@@@ -534,6 -534,24 +534,24 @@@ static int armpmu_filter_match(struct p
        return cpumask_test_cpu(cpu, &armpmu->supported_cpus);
  }
  
+ static ssize_t armpmu_cpumask_show(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
+ {
+       struct arm_pmu *armpmu = to_arm_pmu(dev_get_drvdata(dev));
+       return cpumap_print_to_pagebuf(true, buf, &armpmu->supported_cpus);
+ }
+ static DEVICE_ATTR(cpus, S_IRUGO, armpmu_cpumask_show, NULL);
+ static struct attribute *armpmu_common_attrs[] = {
+       &dev_attr_cpus.attr,
+       NULL,
+ };
+ static struct attribute_group armpmu_common_attr_group = {
+       .attrs = armpmu_common_attrs,
+ };
  static void armpmu_init(struct arm_pmu *armpmu)
  {
        atomic_set(&armpmu->active_events, 0);
                .stop           = armpmu_stop,
                .read           = armpmu_read,
                .filter_match   = armpmu_filter_match,
+               .attr_groups    = armpmu->attr_groups,
        };
+       armpmu->attr_groups[ARMPMU_ATTR_GROUP_COMMON] =
+               &armpmu_common_attr_group;
  }
  
  /* Set at runtime when we know what CPU type we are. */
@@@ -602,7 -623,7 +623,7 @@@ static void cpu_pmu_free_irq(struct arm
        irqs = min(pmu_device->num_resources, num_possible_cpus());
  
        irq = platform_get_irq(pmu_device, 0);
-       if (irq >= 0 && irq_is_percpu(irq)) {
+       if (irq > 0 && irq_is_percpu(irq)) {
                on_each_cpu_mask(&cpu_pmu->supported_cpus,
                                 cpu_pmu_disable_percpu_irq, &irq, 1);
                free_percpu_irq(irq, &hw_events->percpu_pmu);
                        if (!cpumask_test_and_clear_cpu(cpu, &cpu_pmu->active_irqs))
                                continue;
                        irq = platform_get_irq(pmu_device, i);
-                       if (irq >= 0)
+                       if (irq > 0)
                                free_irq(irq, per_cpu_ptr(&hw_events->percpu_pmu, cpu));
                }
        }
@@@ -638,7 -659,7 +659,7 @@@ static int cpu_pmu_request_irq(struct a
        }
  
        irq = platform_get_irq(pmu_device, 0);
-       if (irq >= 0 && irq_is_percpu(irq)) {
+       if (irq > 0 && irq_is_percpu(irq)) {
                err = request_percpu_irq(irq, handler, "arm-pmu",
                                         &hw_events->percpu_pmu);
                if (err) {
@@@ -919,13 -940,12 +940,13 @@@ static int of_pmu_irq_cfg(struct arm_pm
  
                /* Check the IRQ type and prohibit a mix of PPIs and SPIs */
                irq = platform_get_irq(pdev, i);
-               if (irq >= 0) {
+               if (irq > 0) {
                        bool spi = !irq_is_percpu(irq);
  
                        if (i > 0 && spi != using_spi) {
                                pr_err("PPI/SPI IRQ type mismatch for %s!\n",
                                        dn->name);
 +                              of_node_put(dn);
                                kfree(irqs);
                                return -EINVAL;
                        }
        if (cpumask_weight(&pmu->supported_cpus) == 0) {
                int irq = platform_get_irq(pdev, 0);
  
-               if (irq >= 0 && irq_is_percpu(irq)) {
+               if (irq > 0 && irq_is_percpu(irq)) {
 +                      /* If using PPIs, check the affinity of the partition */
                        int ret;
  
                        ret = irq_get_percpu_devid_partition(irq, &pmu->supported_cpus);
@@@ -1029,7 -1048,7 +1050,7 @@@ int arm_pmu_device_probe(struct platfor
                ret = of_pmu_irq_cfg(pmu);
                if (!ret)
                        ret = init_fn(pmu);
-       } else {
+       } else if (probe_table) {
                cpumask_setall(&pmu->supported_cpus);
                ret = probe_current_pmu(pmu, probe_table);
        }
                goto out_free;
        }
  
        ret = cpu_pmu_init(pmu);
        if (ret)
                goto out_free;
@@@ -1,8 -1,6 +1,8 @@@
  #ifndef __CPUHOTPLUG_H
  #define __CPUHOTPLUG_H
  
 +#include <linux/types.h>
 +
  enum cpuhp_state {
        CPUHP_OFFLINE,
        CPUHP_CREATE_THREADS,
@@@ -47,6 -45,8 +47,8 @@@
        CPUHP_AP_PERF_METAG_STARTING,
        CPUHP_AP_MIPS_OP_LOONGSON3_STARTING,
        CPUHP_AP_ARM_VFP_STARTING,
+       CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING,
+       CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING,
        CPUHP_AP_PERF_ARM_STARTING,
        CPUHP_AP_ARM_L2X0_STARTING,
        CPUHP_AP_ARM_ARCH_TIMER_STARTING,