Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Oct 2018 16:30:06 +0000 (17:30 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Oct 2018 16:30:06 +0000 (17:30 +0100)
Pull arm64 updates from Catalin Marinas:
 "Apart from some new arm64 features and clean-ups, this also contains
  the core mmu_gather changes for tracking the levels of the page table
  being cleared and a minor update to the generic
  compat_sys_sigaltstack() introducing COMPAT_SIGMINSKSZ.

  Summary:

   - Core mmu_gather changes which allow tracking the levels of
     page-table being cleared together with the arm64 low-level flushing
     routines

   - Support for the new ARMv8.5 PSTATE.SSBS bit which can be used to
     mitigate Spectre-v4 dynamically without trapping to EL3 firmware

   - Introduce COMPAT_SIGMINSTKSZ for use in compat_sys_sigaltstack

   - Optimise emulation of MRS instructions to ID_* registers on ARMv8.4

   - Support for Common Not Private (CnP) translations allowing threads
     of the same CPU to share the TLB entries

   - Accelerated crc32 routines

   - Move swapper_pg_dir to the rodata section

   - Trap WFI instruction executed in user space

   - ARM erratum 1188874 workaround (arch_timer)

   - Miscellaneous fixes and clean-ups"

* tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (78 commits)
  arm64: KVM: Guests can skip __install_bp_hardening_cb()s HYP work
  arm64: cpufeature: Trap CTR_EL0 access only where it is necessary
  arm64: cpufeature: Fix handling of CTR_EL0.IDC field
  arm64: cpufeature: ctr: Fix cpu capability check for late CPUs
  Documentation/arm64: HugeTLB page implementation
  arm64: mm: Use __pa_symbol() for set_swapper_pgd()
  arm64: Add silicon-errata.txt entry for ARM erratum 1188873
  Revert "arm64: uaccess: implement unsafe accessors"
  arm64: mm: Drop the unused cpu parameter
  MAINTAINERS: fix bad sdei paths
  arm64: mm: Use #ifdef for the __PAGETABLE_P?D_FOLDED defines
  arm64: Fix typo in a comment in arch/arm64/mm/kasan_init.c
  arm64: xen: Use existing helper to check interrupt status
  arm64: Use daifflag_restore after bp_hardening
  arm64: daifflags: Use irqflags functions for daifflags
  arm64: arch_timer: avoid unused function warning
  arm64: Trap WFI executed in userspace
  arm64: docs: Document SSBS HWCAP
  arm64: docs: Fix typos in ELF hwcaps
  arm64/kprobes: remove an extra semicolon in arch_prepare_kprobe
  ...

1  2 
MAINTAINERS
arch/arm64/include/asm/kvm_host.h
arch/arm64/kernel/setup.c
arch/arm64/mm/mmu.c
mm/Makefile

diff --combined MAINTAINERS
index b2f710eee67a7cb340969c6cc91fab7f1940e5d7,ba34d052604a63ffc6ab17041d17442c88170a8a..c393746b020999228340b13f3f559ee9b6853654
@@@ -324,6 -324,7 +324,6 @@@ F: Documentation/ABI/testing/sysfs-bus-
  F:    Documentation/ABI/testing/configfs-acpi
  F:    drivers/pci/*acpi*
  F:    drivers/pci/*/*acpi*
 -F:    drivers/pci/*/*/*acpi*
  F:    tools/power/acpi/
  
  ACPI APEI
@@@ -1250,7 -1251,7 +1250,7 @@@ N:      meso
  
  ARM/Annapurna Labs ALPINE ARCHITECTURE
  M:    Tsahee Zidenberg <tsahee@annapurnalabs.com>
 -M:    Antoine Tenart <antoine.tenart@free-electrons.com>
 +M:    Antoine Tenart <antoine.tenart@bootlin.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-alpine/
@@@ -2310,7 -2311,6 +2310,7 @@@ F:      drivers/clocksource/cadence_ttc_time
  F:    drivers/i2c/busses/i2c-cadence.c
  F:    drivers/mmc/host/sdhci-of-arasan.c
  F:    drivers/edac/synopsys_edac.c
 +F:    drivers/i2c/busses/i2c-xiic.c
  
  ARM64 PORT (AARCH64 ARCHITECTURE)
  M:    Catalin Marinas <catalin.marinas@arm.com>
@@@ -2955,6 -2955,7 +2955,6 @@@ F:      include/linux/bcm963xx_tag.
  
  BROADCOM BNX2 GIGABIT ETHERNET DRIVER
  M:    Rasesh Mody <rasesh.mody@cavium.com>
 -M:    Harish Patil <harish.patil@cavium.com>
  M:    Dept-GELinuxNICDev@cavium.com
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -2975,7 -2976,6 +2975,7 @@@ F:      drivers/scsi/bnx2i
  
  BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
  M:    Ariel Elior <ariel.elior@cavium.com>
 +M:    Sudarsana Kalluru <sudarsana.kalluru@cavium.com>
  M:    everest-linux-l2@cavium.com
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -3006,14 -3006,6 +3006,14 @@@ S:    Supporte
  F:    drivers/gpio/gpio-brcmstb.c
  F:    Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt
  
 +BROADCOM BRCMSTB I2C DRIVER
 +M:    Kamal Dasu <kdasu.kdev@gmail.com>
 +L:    linux-i2c@vger.kernel.org
 +L:    bcm-kernel-feedback-list@broadcom.com
 +S:    Supported
 +F:    drivers/i2c/busses/i2c-brcmstb.c
 +F:    Documentation/devicetree/bindings/i2c/i2c-brcmstb.txt
 +
  BROADCOM BRCMSTB USB2 and USB3 PHY DRIVER
  M:    Al Cooper <alcooperx@gmail.com>
  L:    linux-kernel@vger.kernel.org
@@@ -3681,12 -3673,6 +3681,12 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/media/coda.txt
  F:    drivers/media/platform/coda/
  
 +CODE OF CONDUCT
 +M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +S:    Supported
 +F:    Documentation/process/code-of-conduct.rst
 +F:    Documentation/process/code-of-conduct-interpretation.rst
 +
  COMMON CLK FRAMEWORK
  M:    Michael Turquette <mturquette@baylibre.com>
  M:    Stephen Boyd <sboyd@kernel.org>
@@@ -5483,8 -5469,7 +5483,8 @@@ S:      Odd Fixe
  F:    drivers/net/ethernet/agere/
  
  ETHERNET BRIDGE
 -M:    Stephen Hemminger <stephen@networkplumber.org>
 +M:    Roopa Prabhu <roopa@cumulusnetworks.com>
 +M:    Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
  L:    bridge@lists.linux-foundation.org (moderated for non-subscribers)
  L:    netdev@vger.kernel.org
  W:    http://www.linuxfoundation.org/en/Net:Bridge
@@@ -5639,8 -5624,6 +5639,8 @@@ F:      lib/fault-inject.
  
  FBTFT Framebuffer drivers
  M:    Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 +L:    dri-devel@lists.freedesktop.org
 +L:    linux-fbdev@vger.kernel.org
  S:    Maintained
  F:    drivers/staging/fbtft/
  
@@@ -6076,7 -6059,7 +6076,7 @@@ F:      Documentation/gcc-plugins.tx
  
  GASKET DRIVER FRAMEWORK
  M:    Rob Springer <rspringer@google.com>
 -M:    John Joseph <jnjoseph@google.com>
 +M:    Todd Poynor <toddpoynor@google.com>
  M:    Ben Chan <benchan@chromium.org>
  S:    Maintained
  F:    drivers/staging/gasket/
@@@ -7032,20 -7015,6 +7032,20 @@@ F:    drivers/crypto/vmx/aes
  F:    drivers/crypto/vmx/ghash*
  F:    drivers/crypto/vmx/ppc-xlate.pl
  
 +IBM Power PCI Hotplug Driver for RPA-compliant PPC64 platform
 +M:    Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
 +L:    linux-pci@vger.kernel.org
 +L:    linuxppc-dev@lists.ozlabs.org
 +S:    Supported
 +F:    drivers/pci/hotplug/rpaphp*
 +
 +IBM Power IO DLPAR Driver for RPA-compliant PPC64 platform
 +M:    Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
 +L:    linux-pci@vger.kernel.org
 +L:    linuxppc-dev@lists.ozlabs.org
 +S:    Supported
 +F:    drivers/pci/hotplug/rpadlpar*
 +
  IBM ServeRAID RAID DRIVER
  S:    Orphan
  F:    drivers/scsi/ips.*
@@@ -8330,7 -8299,7 +8330,7 @@@ F:      include/linux/libata.
  F:    Documentation/devicetree/bindings/ata/
  
  LIBLOCKDEP
 -M:    Sasha Levin <alexander.levin@verizon.com>
 +M:    Sasha Levin <alexander.levin@microsoft.com>
  S:    Maintained
  F:    tools/lib/lockdep/
  
@@@ -8612,6 -8581,7 +8612,6 @@@ F:      include/linux/spinlock*.
  F:    arch/*/include/asm/spinlock*.h
  F:    include/linux/rwlock*.h
  F:    include/linux/mutex*.h
 -F:    arch/*/include/asm/mutex*.h
  F:    include/linux/rwsem*.h
  F:    arch/*/include/asm/rwsem.h
  F:    include/linux/seqlock.h
@@@ -9671,8 -9641,7 +9671,8 @@@ MIPS/LOONGSON2 ARCHITECTUR
  M:    Jiaxun Yang <jiaxun.yang@flygoat.com>
  L:    linux-mips@linux-mips.org
  S:    Maintained
 -F:    arch/mips/loongson64/*{2e/2f}*
 +F:    arch/mips/loongson64/fuloong-2e/
 +F:    arch/mips/loongson64/lemote-2f/
  F:    arch/mips/include/asm/mach-loongson64/
  F:    drivers/*/*loongson2*
  F:    drivers/*/*/*loongson2*
@@@ -9712,6 -9681,19 +9712,19 @@@ S:    Maintaine
  F:    arch/arm/boot/dts/mmp*
  F:    arch/arm/mach-mmp/
  
+ MMU GATHER AND TLB INVALIDATION
+ M:    Will Deacon <will.deacon@arm.com>
+ M:    "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
+ M:    Andrew Morton <akpm@linux-foundation.org>
+ M:    Nick Piggin <npiggin@gmail.com>
+ M:    Peter Zijlstra <peterz@infradead.org>
+ L:    linux-arch@vger.kernel.org
+ L:    linux-mm@kvack.org
+ S:    Maintained
+ F:    arch/*/include/asm/tlb.h
+ F:    include/asm-generic/tlb.h
+ F:    mm/mmu_gather.c
  MN88472 MEDIA DRIVER
  M:    Antti Palosaari <crope@iki.fi>
  L:    linux-media@vger.kernel.org
@@@ -9730,6 -9712,13 +9743,6 @@@ Q:     http://patchwork.linuxtv.org/project
  S:    Maintained
  F:    drivers/media/dvb-frontends/mn88473*
  
 -PCI DRIVER FOR MOBIVEIL PCIE IP
 -M:    Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>
 -L:    linux-pci@vger.kernel.org
 -S:    Supported
 -F:    Documentation/devicetree/bindings/pci/mobiveil-pcie.txt
 -F:    drivers/pci/controller/pcie-mobiveil.c
 -
  MODULE SUPPORT
  M:    Jessica Yu <jeyu@kernel.org>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git modules-next
@@@ -9879,7 -9868,7 +9892,7 @@@ M:      Peter Rosin <peda@axentia.se
  S:    Maintained
  F:    Documentation/ABI/testing/sysfs-class-mux*
  F:    Documentation/devicetree/bindings/mux/
 -F:    include/linux/dt-bindings/mux/
 +F:    include/dt-bindings/mux/
  F:    include/linux/mux/
  F:    drivers/mux/
  
@@@ -10136,6 -10125,7 +10149,6 @@@ L:   netdev@vger.kernel.or
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git
  S:    Maintained
 -F:    net/core/flow.c
  F:    net/xfrm/
  F:    net/key/
  F:    net/ipv4/xfrm*
@@@ -10955,7 -10945,7 +10968,7 @@@ M:   Willy Tarreau <willy@haproxy.com
  M:    Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
  S:    Odd Fixes
  F:    Documentation/auxdisplay/lcd-panel-cgram.txt
 -F:    drivers/misc/panel.c
 +F:    drivers/auxdisplay/panel.c
  
  PARALLEL PORT SUBSYSTEM
  M:    Sudip Mukherjee <sudipm.mukherjee@gmail.com>
@@@ -11143,13 -11133,6 +11156,13 @@@ F: include/uapi/linux/switchtec_ioctl.
  F:    include/linux/switchtec.h
  F:    drivers/ntb/hw/mscc/
  
 +PCI DRIVER FOR MOBIVEIL PCIE IP
 +M:    Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>
 +L:    linux-pci@vger.kernel.org
 +S:    Supported
 +F:    Documentation/devicetree/bindings/pci/mobiveil-pcie.txt
 +F:    drivers/pci/controller/pcie-mobiveil.c
 +
  PCI DRIVER FOR MVEBU (Marvell Armada 370 and Armada XP SOC support)
  M:    Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  M:    Jason Cooper <jason@lakedaemon.net>
@@@ -11183,7 -11166,7 +11196,7 @@@ F:   drivers/pci/controller/dwc/pci-exyno
  
  PCI DRIVER FOR SYNOPSYS DESIGNWARE
  M:    Jingoo Han <jingoohan1@gmail.com>
 -M:    Joao Pinto <Joao.Pinto@synopsys.com>
 +M:    Gustavo Pimentel <gustavo.pimentel@synopsys.com>
  L:    linux-pci@vger.kernel.org
  S:    Maintained
  F:    Documentation/devicetree/bindings/pci/designware-pcie.txt
@@@ -11216,14 -11199,8 +11229,14 @@@ 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
 +F:    Documentation/PCI/pci-error-recovery.txt
 +F:    drivers/pci/pcie/aer.c
 +F:    drivers/pci/pcie/dpc.c
 +F:    drivers/pci/pcie/err.c
  F:    Documentation/powerpc/eeh-pci-error-recovery.txt
  F:    arch/powerpc/kernel/eeh*.c
  F:    arch/powerpc/platforms/*/eeh*.c
@@@ -11381,10 -11358,10 +11394,10 @@@ S:        Maintaine
  F:    drivers/platform/x86/peaq-wmi.c
  
  PER-CPU MEMORY ALLOCATOR
 +M:    Dennis Zhou <dennis@kernel.org>
  M:    Tejun Heo <tj@kernel.org>
  M:    Christoph Lameter <cl@linux.com>
 -M:    Dennis Zhou <dennisszhou@gmail.com>
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu.git
  S:    Maintained
  F:    include/linux/percpu*.h
  F:    mm/percpu*.c
@@@ -11992,7 -11969,7 +12005,7 @@@ F:   Documentation/scsi/LICENSE.qla4xx
  F:    drivers/scsi/qla4xxx/
  
  QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
 -M:    Harish Patil <harish.patil@cavium.com>
 +M:    Shahed Shaikh <Shahed.Shaikh@cavium.com>
  M:    Manish Chopra <manish.chopra@cavium.com>
  M:    Dept-GELinuxNICDev@cavium.com
  L:    netdev@vger.kernel.org
@@@ -12000,6 -11977,7 +12013,6 @@@ S:   Supporte
  F:    drivers/net/ethernet/qlogic/qlcnic/
  
  QLOGIC QLGE 10Gb ETHERNET DRIVER
 -M:    Harish Patil <harish.patil@cavium.com>
  M:    Manish Chopra <manish.chopra@cavium.com>
  M:    Dept-GELinuxNICDev@cavium.com
  L:    netdev@vger.kernel.org
@@@ -12278,7 -12256,6 +12291,7 @@@ F:   Documentation/networking/rds.tx
  
  RDT - RESOURCE ALLOCATION
  M:    Fenghua Yu <fenghua.yu@intel.com>
 +M:    Reinette Chatre <reinette.chatre@intel.com>
  L:    linux-kernel@vger.kernel.org
  S:    Supported
  F:    arch/x86/kernel/cpu/intel_rdt*
@@@ -13075,7 -13052,7 +13088,7 @@@ SELINUX SECURITY MODUL
  M:    Paul Moore <paul@paul-moore.com>
  M:    Stephen Smalley <sds@tycho.nsa.gov>
  M:    Eric Paris <eparis@parisplace.org>
 -L:    selinux@tycho.nsa.gov (moderated for non-subscribers)
 +L:    selinux@vger.kernel.org
  W:    https://selinuxproject.org
  W:    https://github.com/SELinuxProject
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git
@@@ -13468,8 -13445,9 +13481,8 @@@ F:   drivers/i2c/busses/i2c-synquacer.
  F:    Documentation/devicetree/bindings/i2c/i2c-synquacer.txt
  
  SOCIONEXT UNIPHIER SOUND DRIVER
 -M:    Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 -S:    Maintained
 +S:    Orphan
  F:    sound/soc/uniphier/
  
  SOEKRIS NET48XX LED SUPPORT
@@@ -13502,8 -13480,8 +13515,8 @@@ L:   linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    Documentation/devicetree/bindings/arm/firmware/sdei.txt
  F:    drivers/firmware/arm_sdei.c
- F:    include/linux/sdei.h
- F:    include/uapi/linux/sdei.h
+ F:    include/linux/arm_sdei.h
+ F:    include/uapi/linux/arm_sdei.h
  
  SOFTWARE RAID (Multiple Disks) SUPPORT
  M:    Shaohua Li <shli@kernel.org>
@@@ -15407,7 -15385,7 +15420,7 @@@ S:   Maintaine
  UVESAFB DRIVER
  M:    Michal Januszewski <spock@gentoo.org>
  L:    linux-fbdev@vger.kernel.org
 -W:    http://dev.gentoo.org/~spock/projects/uvesafb/
 +W:    https://github.com/mjanusz/v86d
  S:    Maintained
  F:    Documentation/fb/uvesafb.txt
  F:    drivers/video/fbdev/uvesafb.*
@@@ -15931,7 -15909,6 +15944,7 @@@ F:   net/x25
  X86 ARCHITECTURE (32-BIT AND 64-BIT)
  M:    Thomas Gleixner <tglx@linutronix.de>
  M:    Ingo Molnar <mingo@redhat.com>
 +M:    Borislav Petkov <bp@alien8.de>
  R:    "H. Peter Anvin" <hpa@zytor.com>
  M:    x86@kernel.org
  L:    linux-kernel@vger.kernel.org
@@@ -15960,15 -15937,6 +15973,15 @@@ M: Borislav Petkov <bp@alien8.de
  S:    Maintained
  F:    arch/x86/kernel/cpu/microcode/*
  
 +X86 MM
 +M:    Dave Hansen <dave.hansen@linux.intel.com>
 +M:    Andy Lutomirski <luto@kernel.org>
 +M:    Peter Zijlstra <peterz@infradead.org>
 +L:    linux-kernel@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm
 +S:    Maintained
 +F:    arch/x86/mm/
 +
  X86 PLATFORM DRIVERS
  M:    Darren Hart <dvhart@infradead.org>
  M:    Andy Shevchenko <andy@infradead.org>
index 3d6d7336f871221fd29bcc3bc4faa2cee0a7765f,15501921fc75cd8084ebab4aa435a30fcca9d217..2842bf149029becc92b20383d5c0894f465b2dc4
@@@ -61,7 -61,8 +61,7 @@@ struct kvm_arch 
        u64    vmid_gen;
        u32    vmid;
  
 -      /* 1-level 2nd stage table and lock */
 -      spinlock_t pgd_lock;
 +      /* 1-level 2nd stage table, protected by kvm->mmu_lock */
        pgd_t *pgd;
  
        /* VTTBR value associated with above pgd and vmid */
@@@ -356,6 -357,7 +356,6 @@@ int __kvm_arm_vcpu_set_events(struct kv
                              struct kvm_vcpu_events *events);
  
  #define KVM_ARCH_WANT_MMU_NOTIFIER
 -int kvm_unmap_hva(struct kvm *kvm, unsigned long hva);
  int kvm_unmap_hva_range(struct kvm *kvm,
                        unsigned long start, unsigned long end);
  void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte);
@@@ -387,6 -389,8 +387,8 @@@ struct kvm_vcpu *kvm_mpidr_to_vcpu(stru
  
  DECLARE_PER_CPU(kvm_cpu_context_t, kvm_host_cpu_state);
  
+ void __kvm_enable_ssbs(void);
  static inline void __cpu_init_hyp_mode(phys_addr_t pgd_ptr,
                                       unsigned long hyp_stack_ptr,
                                       unsigned long vector_ptr)
         */
        BUG_ON(!static_branch_likely(&arm64_const_caps_ready));
        __kvm_call_hyp((void *)pgd_ptr, hyp_stack_ptr, vector_ptr, tpidr_el2);
+       /*
+        * Disabling SSBD on a non-VHE system requires us to enable SSBS
+        * at EL2.
+        */
+       if (!has_vhe() && this_cpu_has_cap(ARM64_SSBS) &&
+           arm64_get_ssbd_state() == ARM64_SSBD_FORCE_DISABLE) {
+               kvm_call_hyp(__kvm_enable_ssbs);
+       }
  }
  
  static inline bool kvm_arch_check_sve_has_vhe(void)
index b3354ff94e7984641dd5a0c076d63f67db5f62e9,95670a1eafb0cbd4ea778f2f89cad2a0899a80ea..d0f62dd24c906b7054d7d7a76897c18736b50efd
@@@ -64,9 -64,6 +64,9 @@@
  #include <asm/xen/hypervisor.h>
  #include <asm/mmu_context.h>
  
 +static int num_standard_resources;
 +static struct resource *standard_resources;
 +
  phys_addr_t __fdt_pointer __initdata;
  
  /*
@@@ -209,19 -206,14 +209,19 @@@ static void __init request_standard_res
  {
        struct memblock_region *region;
        struct resource *res;
 +      unsigned long i = 0;
  
        kernel_code.start   = __pa_symbol(_text);
        kernel_code.end     = __pa_symbol(__init_begin - 1);
        kernel_data.start   = __pa_symbol(_sdata);
        kernel_data.end     = __pa_symbol(_end - 1);
  
 +      num_standard_resources = memblock.memory.cnt;
 +      standard_resources = alloc_bootmem_low(num_standard_resources *
 +                                             sizeof(*standard_resources));
 +
        for_each_memblock(memory, region) {
 -              res = alloc_bootmem_low(sizeof(*res));
 +              res = &standard_resources[i++];
                if (memblock_is_nomap(region)) {
                        res->name  = "reserved";
                        res->flags = IORESOURCE_MEM;
  
  static int __init reserve_memblock_reserved_regions(void)
  {
 -      phys_addr_t start, end, roundup_end = 0;
 -      struct resource *mem, *res;
 -      u64 i;
 -
 -      for_each_reserved_mem_region(i, &start, &end) {
 -              if (end <= roundup_end)
 -                      continue; /* done already */
 -
 -              start = __pfn_to_phys(PFN_DOWN(start));
 -              end = __pfn_to_phys(PFN_UP(end)) - 1;
 -              roundup_end = end;
 -
 -              res = kzalloc(sizeof(*res), GFP_ATOMIC);
 -              if (WARN_ON(!res))
 -                      return -ENOMEM;
 -              res->start = start;
 -              res->end = end;
 -              res->name  = "reserved";
 -              res->flags = IORESOURCE_MEM;
 -
 -              mem = request_resource_conflict(&iomem_resource, res);
 -              /*
 -               * We expected memblock_reserve() regions to conflict with
 -               * memory created by request_standard_resources().
 -               */
 -              if (WARN_ON_ONCE(!mem))
 +      u64 i, j;
 +
 +      for (i = 0; i < num_standard_resources; ++i) {
 +              struct resource *mem = &standard_resources[i];
 +              phys_addr_t r_start, r_end, mem_size = resource_size(mem);
 +
 +              if (!memblock_is_region_reserved(mem->start, mem_size))
                        continue;
 -              kfree(res);
  
 -              reserve_region_with_split(mem, start, end, "reserved");
 +              for_each_reserved_mem_region(j, &r_start, &r_end) {
 +                      resource_size_t start, end;
 +
 +                      start = max(PFN_PHYS(PFN_DOWN(r_start)), mem->start);
 +                      end = min(PFN_PHYS(PFN_UP(r_end)) - 1, mem->end);
 +
 +                      if (start > mem->end || end < mem->start)
 +                              continue;
 +
 +                      reserve_region_with_split(mem, start, end, "reserved");
 +              }
        }
  
        return 0;
@@@ -349,11 -351,7 +349,7 @@@ void __init setup_arch(char **cmdline_p
  #endif
  
  #ifdef CONFIG_VT
- #if defined(CONFIG_VGA_CONSOLE)
-       conswitchp = &vga_con;
- #elif defined(CONFIG_DUMMY_CONSOLE)
        conswitchp = &dummy_con;
- #endif
  #endif
        if (boot_args[1] || boot_args[2] || boot_args[3]) {
                pr_err("WARNING: x1-x3 nonzero in violation of boot protocol:\n"
diff --combined arch/arm64/mm/mmu.c
index 8080c9f489c3e43af385066514f3f60cca629141,6deb836a102afe31415c844ad06f2311c771080a..9498c15b847b12e6be1e0d47b3f85f26911e79dc
@@@ -67,6 -67,24 +67,24 @@@ static pte_t bm_pte[PTRS_PER_PTE] __pag
  static pmd_t bm_pmd[PTRS_PER_PMD] __page_aligned_bss __maybe_unused;
  static pud_t bm_pud[PTRS_PER_PUD] __page_aligned_bss __maybe_unused;
  
+ static DEFINE_SPINLOCK(swapper_pgdir_lock);
+ void set_swapper_pgd(pgd_t *pgdp, pgd_t pgd)
+ {
+       pgd_t *fixmap_pgdp;
+       spin_lock(&swapper_pgdir_lock);
+       fixmap_pgdp = pgd_set_fixmap(__pa_symbol(pgdp));
+       WRITE_ONCE(*fixmap_pgdp, pgd);
+       /*
+        * We need dsb(ishst) here to ensure the page-table-walker sees
+        * our new entry before set_p?d() returns. The fixmap's
+        * flush_tlb_kernel_range() via clear_fixmap() does this for us.
+        */
+       pgd_clear_fixmap();
+       spin_unlock(&swapper_pgdir_lock);
+ }
  pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
                              unsigned long size, pgprot_t vma_prot)
  {
@@@ -629,34 -647,18 +647,18 @@@ static void __init map_kernel(pgd_t *pg
   */
  void __init paging_init(void)
  {
-       phys_addr_t pgd_phys = early_pgtable_alloc();
-       pgd_t *pgdp = pgd_set_fixmap(pgd_phys);
+       pgd_t *pgdp = pgd_set_fixmap(__pa_symbol(swapper_pg_dir));
  
        map_kernel(pgdp);
        map_mem(pgdp);
  
-       /*
-        * We want to reuse the original swapper_pg_dir so we don't have to
-        * communicate the new address to non-coherent secondaries in
-        * secondary_entry, and so cpu_switch_mm can generate the address with
-        * adrp+add rather than a load from some global variable.
-        *
-        * To do this we need to go via a temporary pgd.
-        */
-       cpu_replace_ttbr1(__va(pgd_phys));
-       memcpy(swapper_pg_dir, pgdp, PGD_SIZE);
-       cpu_replace_ttbr1(lm_alias(swapper_pg_dir));
        pgd_clear_fixmap();
-       memblock_free(pgd_phys, PAGE_SIZE);
  
-       /*
-        * We only reuse the PGD from the swapper_pg_dir, not the pud + pmd
-        * allocated with it.
-        */
-       memblock_free(__pa_symbol(swapper_pg_dir) + PAGE_SIZE,
-                     __pa_symbol(swapper_pg_end) - __pa_symbol(swapper_pg_dir)
-                     - PAGE_SIZE);
+       cpu_replace_ttbr1(lm_alias(swapper_pg_dir));
+       init_mm.pgd = swapper_pg_dir;
+       memblock_free(__pa_symbol(init_pg_dir),
+                     __pa_symbol(init_pg_end) - __pa_symbol(init_pg_dir));
  }
  
  /*
@@@ -985,9 -987,8 +987,9 @@@ int pmd_free_pte_page(pmd_t *pmdp, unsi
  
        pmd = READ_ONCE(*pmdp);
  
 -      /* No-op for empty entry and WARN_ON for valid entry */
 -      if (!pmd_present(pmd) || !pmd_table(pmd)) {
 +      if (!pmd_present(pmd))
 +              return 1;
 +      if (!pmd_table(pmd)) {
                VM_WARN_ON(!pmd_table(pmd));
                return 1;
        }
@@@ -1008,9 -1009,8 +1010,9 @@@ int pud_free_pmd_page(pud_t *pudp, unsi
  
        pud = READ_ONCE(*pudp);
  
 -      /* No-op for empty entry and WARN_ON for valid entry */
 -      if (!pud_present(pud) || !pud_table(pud)) {
 +      if (!pud_present(pud))
 +              return 1;
 +      if (!pud_table(pud)) {
                VM_WARN_ON(!pud_table(pud));
                return 1;
        }
diff --combined mm/Makefile
index 26ef77a3883b5c708659425229e975ac74069875,7c48e0d3d8ab9470ba0f03d82cbcd91d88bdcc2d..6485d5745dd7cde92379861e6995af47a1f4abab
@@@ -23,16 -23,16 +23,16 @@@ KCOV_INSTRUMENT_vmstat.o := 
  
  mmu-y                 := nommu.o
  mmu-$(CONFIG_MMU)     := gup.o highmem.o memory.o mincore.o \
-                          mlock.o mmap.o mprotect.o mremap.o msync.o \
-                          page_vma_mapped.o pagewalk.o pgtable-generic.o \
-                          rmap.o vmalloc.o
+                          mlock.o mmap.o mmu_gather.o mprotect.o mremap.o \
+                          msync.o page_vma_mapped.o pagewalk.o \
+                          pgtable-generic.o rmap.o vmalloc.o
  
  
  ifdef CONFIG_CROSS_MEMORY_ATTACH
  mmu-$(CONFIG_MMU)     += process_vm_access.o
  endif
  
 -obj-y                 := filemap.o mempool.o oom_kill.o \
 +obj-y                 := filemap.o mempool.o oom_kill.o fadvise.o \
                           maccess.o page_alloc.o page-writeback.o \
                           readahead.o swap.o truncate.o vmscan.o shmem.o \
                           util.o mmzone.o vmstat.o backing-dev.o \
@@@ -49,6 -49,7 +49,6 @@@ els
        obj-y           += bootmem.o
  endif
  
 -obj-$(CONFIG_ADVISE_SYSCALLS) += fadvise.o
  ifdef CONFIG_MMU
        obj-$(CONFIG_ADVISE_SYSCALLS)   += madvise.o
  endif