Skip to contentSkip to conversation

Linux 4.14.20

DISCUSSION Greg KH 1 participant 2 messages Feb 17, 2018 Stable branch

lore
Share & tools
lore

Greg KH

author maintainer
#0 lore raw

I'm announcing the release of the 4.14.20 kernel.

All users of the 4.14 kernel series must upgrade.

The updated 4.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Documentation/arm64/silicon-errata.txt                        |    3 
 Makefile                                                      |    5 
 arch/alpha/include/asm/futex.h                                |    8 
 arch/alpha/kernel/osf_sys.c                                   |    4 
 arch/alpha/kernel/pci_impl.h                                  |    3 
 arch/alpha/kernel/process.c                                   |    3 
 arch/alpha/kernel/traps.c                                     |   13 
 arch/arm/crypto/crc32-ce-glue.c                               |    2 
 arch/arm/include/asm/kvm_host.h                               |    6 
 arch/arm/include/asm/kvm_mmu.h                                |   10 
 arch/arm/include/asm/kvm_psci.h                               |   27 
 arch/arm/kvm/handle_exit.c                                    |   17 
 arch/arm64/Kconfig                                            |   56 
 arch/arm64/boot/dts/marvell/armada-7040-db.dts                |    6 
 arch/arm64/boot/dts/marvell/armada-8040-db.dts                |    7 
 arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts             |    6 
 arch/arm64/crypto/crc32-ce-glue.c                             |    2 
 arch/arm64/include/asm/asm-uaccess.h                          |   36 
 arch/arm64/include/asm/assembler.h                            |   54 
 arch/arm64/include/asm/barrier.h                              |   23 
 arch/arm64/include/asm/cpucaps.h                              |    5 
 arch/arm64/include/asm/cputype.h                              |   11 
 arch/arm64/include/asm/efi.h                                  |   12 
 arch/arm64/include/asm/fixmap.h                               |    5 
 arch/arm64/include/asm/futex.h                                |    9 
 arch/arm64/include/asm/kvm_asm.h                              |    2 
 arch/arm64/include/asm/kvm_host.h                             |    5 
 arch/arm64/include/asm/kvm_mmu.h                              |   38 
 arch/arm64/include/asm/kvm_psci.h                             |   27 
 arch/arm64/include/asm/memory.h                               |   15 
 arch/arm64/include/asm/mmu.h                                  |   48 
 arch/arm64/include/asm/mmu_context.h                          |   12 
 arch/arm64/include/asm/pgtable-hwdef.h                        |    1 
 arch/arm64/include/asm/pgtable-prot.h                         |   35 
 arch/arm64/include/asm/pgtable.h                              |    1 
 arch/arm64/include/asm/proc-fns.h                             |    6 
 arch/arm64/include/asm/processor.h                            |   24 
 arch/arm64/include/asm/sysreg.h                               |    2 
 arch/arm64/include/asm/tlbflush.h                             |   16 
 arch/arm64/include/asm/uaccess.h                              |  181 +
 arch/arm64/kernel/Makefile                                    |    4 
 arch/arm64/kernel/arm64ksyms.c                                |    4 
 arch/arm64/kernel/asm-offsets.c                               |    6 
 arch/arm64/kernel/bpi.S                                       |   83 
 arch/arm64/kernel/cpu-reset.S                                 |    3 
 arch/arm64/kernel/cpu_errata.c                                |  239 ++
 arch/arm64/kernel/cpufeature.c                                |  138 +
 arch/arm64/kernel/efi-entry.S                                 |    2 
 arch/arm64/kernel/entry.S                                     |  230 +-
 arch/arm64/kernel/head.S                                      |    3 
 arch/arm64/kernel/process.c                                   |   12 
 arch/arm64/kernel/relocate_kernel.S                           |    1 
 arch/arm64/kernel/sleep.S                                     |    2 
 arch/arm64/kernel/vmlinux.lds.S                               |   22 
 arch/arm64/kvm/handle_exit.c                                  |   14 
 arch/arm64/kvm/hyp-init.S                                     |    1 
 arch/arm64/kvm/hyp/entry.S                                    |   12 
 arch/arm64/kvm/hyp/hyp-entry.S                                |   20 
 arch/arm64/kvm/hyp/switch.c                                   |   13 
 arch/arm64/lib/clear_user.S                                   |   10 
 arch/arm64/lib/copy_from_user.S                               |    4 
 arch/arm64/lib/copy_in_user.S                                 |    9 
 arch/arm64/lib/copy_to_user.S                                 |    4 
 arch/arm64/mm/cache.S                                         |    4 
 arch/arm64/mm/context.c                                       |   48 
 arch/arm64/mm/fault.c                                         |   36 
 arch/arm64/mm/mmu.c                                           |   35 
 arch/arm64/mm/proc.S                                          |  223 ++
 arch/arm64/xen/hypercall.S                                    |    4 
 arch/mn10300/mm/misalignment.c                                |    2 
 arch/openrisc/kernel/traps.c                                  |   10 
 arch/powerpc/crypto/crc32c-vpmsum_glue.c                      |    1 
 arch/powerpc/include/asm/hvcall.h                             |    1 
 arch/powerpc/kvm/Kconfig                                      |    2 
 arch/powerpc/kvm/book3s_hv.c                                  |   16 
 arch/powerpc/kvm/book3s_hv_rmhandlers.S                       |   40 
 arch/s390/crypto/crc32-vx.c                                   |    3 
 arch/sh/kernel/traps_32.c                                     |    3 
 arch/sparc/crypto/crc32c_glue.c                               |    1 
 arch/x86/crypto/crc32-pclmul_glue.c                           |    1 
 arch/x86/crypto/crc32c-intel_glue.c                           |    1 
 arch/x86/crypto/poly1305_glue.c                               |    1 
 arch/x86/crypto/sha512-mb/sha512_mb_mgr_init_avx2.c           |   10 
 arch/x86/kvm/mmu.c                                            |    3 
 arch/x86/kvm/vmx.c                                            |    6 
 arch/x86/kvm/x86.h                                            |    1 
 arch/xtensa/include/asm/futex.h                               |   23 
 block/blk-core.c                                              |    9 
 crypto/ahash.c                                                |   33 
 crypto/algif_hash.c                                           |   52 
 crypto/crc32_generic.c                                        |    1 
 crypto/crc32c_generic.c                                       |    1 
 crypto/cryptd.c                                               |   10 
 crypto/mcryptd.c                                              |   10 
 crypto/poly1305_generic.c                                     |   17 
 crypto/shash.c                                                |   25 
 drivers/acpi/nfit/core.c                                      |    3 
 drivers/acpi/sbshc.c                                          |    4 
 drivers/ata/ahci.c                                            |   37 
 drivers/block/pktcdvd.c                                       |   12 
 drivers/bluetooth/btsdio.c                                    |    9 
 drivers/bluetooth/btusb.c                                     |   20 
 drivers/char/ipmi/ipmi_dmi.c                                  |    5 
 drivers/clocksource/timer-stm32.c                             |    7 
 drivers/cpufreq/cpufreq-dt-platdev.c                          |    8 
 drivers/crypto/bfin_crc.c                                     |    3 
 drivers/crypto/caam/ctrl.c                                    |    8 
 drivers/crypto/stm32/stm32_crc32.c                            |    2 
 drivers/dma/dmatest.c                                         |    2 
 drivers/edac/octeon_edac-lmc.c                                |    1 
 drivers/firmware/psci.c                                       |   57 
 drivers/gpu/drm/i915/intel_display.c                          |  303 +-
 drivers/gpu/drm/i915/intel_dp.c                               |    6 
 drivers/gpu/drm/i915/intel_drv.h                              |    2 
 drivers/gpu/drm/i915/intel_sprite.c                           |   83 
 drivers/hid/hid-core.c                                        |   12 
 drivers/media/dvb-frontends/ascot2e.c                         |    4 
 drivers/media/dvb-frontends/cxd2841er.c                       |    4 
 drivers/media/dvb-frontends/helene.c                          |    4 
 drivers/media/dvb-frontends/horus3a.c                         |    4 
 drivers/media/dvb-frontends/itd1000.c                         |    5 
 drivers/media/dvb-frontends/mt312.c                           |    5 
 drivers/media/dvb-frontends/stb0899_drv.c                     |    3 
 drivers/media/dvb-frontends/stb6100.c                         |    6 
 drivers/media/dvb-frontends/stv0367.c                         |    4 
 drivers/media/dvb-frontends/stv090x.c                         |    4 
 drivers/media/dvb-frontends/stv6110x.c                        |    4 
 drivers/media/dvb-frontends/ts2020.c                          |    4 
 drivers/media/dvb-frontends/zl10039.c                         |    4 
 drivers/media/usb/dvb-usb-v2/lmedm04.c                        |   39 
 drivers/media/usb/dvb-usb/cxusb.c                             |    2 
 drivers/media/usb/dvb-usb/dib0700_devices.c                   |    1 
 drivers/media/usb/hdpvr/hdpvr-core.c                          |   26 
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c                 | 1032 +++++-----
 drivers/media/v4l2-core/v4l2-ioctl.c                          |  145 -
 drivers/mtd/nand/brcmnand/brcmnand.c                          |   13 
 drivers/mtd/nand/nand_base.c                                  |    5 
 drivers/mtd/nand/sunxi_nand.c                                 |    8 
 drivers/mtd/ubi/block.c                                       |   42 
 drivers/mtd/ubi/vmt.c                                         |   15 
 drivers/mtd/ubi/wl.c                                          |   77 
 drivers/pinctrl/intel/pinctrl-intel.c                         |   23 
 drivers/pinctrl/pinctrl-mcp23s08.c                            |    8 
 drivers/pinctrl/pinctrl-sx150x.c                              |   40 
 drivers/scsi/cxlflash/main.c                                  |    1 
 drivers/scsi/hosts.c                                          |    6 
 drivers/scsi/lpfc/lpfc_init.c                                 |   84 
 drivers/scsi/scsi_error.c                                     |   18 
 drivers/scsi/scsi_lib.c                                       |   39 
 drivers/staging/lustre/lnet/libcfs/linux/linux-crypto-adler.c |    1 
 drivers/watchdog/Kconfig                                      |    2 
 drivers/watchdog/gpio_wdt.c                                   |    3 
 drivers/watchdog/imx2_wdt.c                                   |   20 
 fs/btrfs/inode.c                                              |   11 
 fs/btrfs/raid56.c                                             |   11 
 fs/cifs/cifsencrypt.c                                         |    3 
 fs/cifs/connect.c                                             |    6 
 fs/cifs/file.c                                                |   26 
 fs/cifs/misc.c                                                |   14 
 fs/cifs/smb2pdu.c                                             |    3 
 fs/devpts/inode.c                                             |    4 
 fs/kernfs/file.c                                              |    2 
 fs/nfs/direct.c                                               |    4 
 fs/nfs/filelayout/filelayout.c                                |    4 
 fs/nfs/io.c                                                   |    2 
 fs/nfs/nfs4idmap.c                                            |    6 
 fs/nfs/nfs4xdr.c                                              |   64 
 fs/nfs/pnfs.c                                                 |    4 
 fs/nfs/write.c                                                |    2 
 fs/overlayfs/readdir.c                                        |   17 
 fs/pipe.c                                                     |   15 
 fs/proc/kcore.c                                               |   18 
 fs/ubifs/dir.c                                                |   10 
 include/crypto/hash.h                                         |   34 
 include/crypto/internal/hash.h                                |    2 
 include/crypto/poly1305.h                                     |    2 
 include/kvm/arm_psci.h                                        |   51 
 include/linux/arm-smccc.h                                     |  165 +
 include/linux/crypto.h                                        |    8 
 include/linux/mtd/map.h                                       |  130 -
 include/linux/nfs4.h                                          |   12 
 include/linux/psci.h                                          |   14 
 include/scsi/scsi_host.h                                      |    2 
 include/uapi/linux/psci.h                                     |    3 
 kernel/async.c                                                |   20 
 kernel/rcu/update.c                                           |    2 
 kernel/relay.c                                                |    1 
 kernel/sched/rt.c                                             |   24 
 kernel/sched/sched.h                                          |    2 
 kernel/sched/topology.c                                       |   13 
 kernel/sched/wait.c                                           |    2 
 kernel/trace/ftrace.c                                         |    1 
 lib/Kconfig.debug                                             |    2 
 lib/Kconfig.kasan                                             |   11 
 lib/ubsan.c                                                   |   50 
 lib/ubsan.h                                                   |   14 
 net/dccp/proto.c                                              |    5 
 scripts/Makefile.kasan                                        |    5 
 scripts/Makefile.lib                                          |    2 
 sound/soc/intel/skylake/skl-nhlt.c                            |    3 
 sound/soc/rockchip/rockchip_i2s.c                             |    6 
 tools/objtool/check.c                                         |   41 
 tools/objtool/check.h                                         |    1 
 virt/kvm/arm/arm.c                                            |   11 
 virt/kvm/arm/psci.c                                           |  143 +
 205 files changed, 3886 insertions(+), 1626 deletions(-)

Amir Goldstein (2):
ovl: fix failure to fsync lower dir
ovl: take mnt_want_write() for removing impure xattr

Andrew Morton (1):
lib/ubsan.c: s/missaligned/misaligned/

Andrew-sh Cheng (1):
cpufreq: mediatek: add mediatek related projects into blacklist

Andrey Konovalov (1):
kasan: don't emit builtin calls when sanitization is off

Andrey Ryabinin (1):
lib/ubsan: add type mismatch handler for new GCC/Clang

Arnd Bergmann (4):
mtd: cfi: convert inline functions to macros
kasan: rework Kconfig settings
media: dvb-frontends: fix i2c access helpers for KASAN
alpha: osf_sys.c: fix put_tv32 regression

Arvind Yadav (1):
media: hdpvr: Fix an error handling path in hdpvr_probe()

Aurelien Aptel (1):
CIFS: zero sensitive data when freeing

Bart Van Assche (3):
pktcdvd: Fix pkt_setup_dev() error path
pktcdvd: Fix a recently introduced NULL pointer dereference
scsi: core: Ensure that the SCSI error handler gets woken up

Bradley Bolen (1):
ubi: block: Fix locking for idr_alloc/idr_remove

Catalin Marinas (1):
arm64: kpti: Fix the interaction between ASID switching and software PAN

Clay McClure (1):
ubi: Fix race condition between ubi volume creation and udev

Daniel Lezcano (1):
clocksource/drivers/stm32: Fix kernel panic with multiple timers

Daniel Mentz (1):
media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic

Daniel N Pettersson (1):
cifs: Fix autonegotiate security settings mismatch

Dmitry Mastykin (1):
pinctrl: mcp23s08: fix irq setup order

Eric Biggers (13):
ubifs: free the encrypted symlink target
NFS: reject request for id_legacy key without auxdata
crypto: hash - introduce crypto_hash_alg_has_setkey()
crypto: cryptd - pass through absence of ->setkey()
crypto: mcryptd - pass through absence of ->setkey()
crypto: poly1305 - remove ->setkey() method
crypto: hash - annotate algorithms taking optional key
crypto: hash - prevent using keyed hashes without setting key
crypto: sha512-mb - initialize pending lengths correctly kernel/relay.c: revert "kernel/relay.c: fix potential memory leak"
pipe: actually allow root to exceed the pipe buffer limits
pipe: fix off-by-one error when checking buffer limits
devpts: fix error handling in devpts_mntget()

Eric W. Biederman (3):
signal/openrisc: Fix do_unaligned_access to send the proper signal signal/sh: Ensure si_signo is initialized in do_divide_error mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy

Greg Kroah-Hartman (2):
ACPI: sbshc: remove raw pointer from printk() message Linux 4.14.20

Hans Verkuil (12):
media: v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt
media: v4l2-ioctl.c: don't copy back the result for -ENOTTY
media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF
media: v4l2-compat-ioctl32.c: fix the indentation
media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32
media: v4l2-compat-ioctl32.c: avoid sizeof(type)
media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32
media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer
media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32
media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type
media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors
media: v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs

Hans de Goede (5):
ahci: Annotate PCI ids for mobile Intel chipsets as such
ahci: Add PCI ids for Intel Bay Trail, Cherry Trail and Apollo Lake AHCI
HID: quirks: Fix keyboard + touchpad on Toshiba Click Mini not working
Bluetooth: btsdio: Do not bind to non-removable BCM43341
Bluetooth: btusb: Restore QCA Rome suspend/resume fix with a "rewritten" version

Haozhong Zhang (1):
KVM MMU: check pending exception before injecting APF

Heiko Carstens (1):
fs/proc/kcore.c: use probe_kernel_read() instead of memcpy()

Horia Geantă (1):
crypto: caam - fix endless loop when DECO acquire fails

Imre Deak (1):
drm/i915: Avoid PPS HW/SW state mismatch due to rounding

Ivan Vecera (1):
kernfs: fix regression in kernfs_fop_write caused by wrong type

J. Bruce Fields (1):
NFS: commit direct writes even if they fail partially

James Hogan (1):
EDAC, octeon: Fix an uninitialized variable warning

James Morse (2):
arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early
KVM: arm/arm64: Handle CPU_PM_ENTER_FAILED

James Smart (1):
scsi: lpfc: Fix crash after bad bar setup on driver attachment

Jayachandran C (3):
arm64: cputype: Add MIDR values for Cavium ThunderX2 CPUs
arm64: Turn on KPTI only on CPUs that need it
arm64: Branch predictor hardening for Cavium ThunderX2

John Garry (1):
ipmi: use dynamic memory for DMI driver override

John Keeping (1):
ASoC: rockchip: i2s: fix playback after runtime resume

Kai-Heng Feng (1):
Revert "Bluetooth: btusb: fix QCA Rome suspend/resume"

Kamal Dasu (1):
mtd: nand: brcmnand: Disable prefetch by default

Liran Alon (2):
KVM: nVMX: Fix races when sending nested PI while dest enters/leaves L2
KVM: nVMX: Fix bug of injecting L2 exception into L1

Liu Bo (1):
Btrfs: raid56: iterate raid56 internal bio with bio_for_each_segment_all

Malcolm Priestley (2):
media: dvb-usb-v2: lmedm04: Improve logic checking of warm start
media: dvb-usb-v2: lmedm04: move ts2020 attach to dm04_lme2510_tuner

Marc Zyngier (21):
arm64: Force KPTI to be disabled on Cavium ThunderX
arm64: Move post_ttbr_update_workaround to C code
arm64: Move BP hardening to check_and_switch_context
arm64: KVM: Use per-CPU vector when BP hardening is enabled
arm64: KVM: Increment PC after handling an SMC trap arm/arm64: KVM: Consolidate the PSCI include files arm/arm64: KVM: Add PSCI_VERSION helper
arm/arm64: KVM: Add smccc accessors to PSCI code arm/arm64: KVM: Implement PSCI 1.0 support
arm/arm64: KVM: Advertise SMCCC v1.1
arm64: KVM: Make PSCI_VERSION a fast path
arm/arm64: KVM: Turn kvm_psci_version into a static inline
arm64: KVM: Report SMCCC_ARCH_WORKAROUND_1 BP hardening support
arm64: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling firmware/psci: Expose PSCI conduit
firmware/psci: Expose SMCCC version through psci_ops arm/arm64: smccc: Make function identifiers an unsigned quantity arm/arm64: smccc: Implement SMCCC v1.1 inline primitive
arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support
arm64: Kill PSCI_GET_VERSION as a variant-2 workaround
arm: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls

Martin Kaiser (1):
watchdog: imx2_wdt: restore previous timeout after suspend+resume

Matt Redfearn (1):
watchdog: indydog: Add dependency on SGI_HAS_INDYDOG

Matthew Wilcox (1):
cifs: Fix missing put_xid in cifs_file_strict_mmap

Mauro Carvalho Chehab (2):
media: ts2020: avoid integer overflows on 32 bit machines
media: cxusb, dib0700: ignore XC2028_I2C_FLUSH

Max Filippov (1):
xtensa: fix futex_atomic_cmpxchg_inatomic

Michael Cree (1):
alpha: Fix mixed up args in EXC macro in futex operations

Michal Suchanek (1):
powerpc/pseries: include linux/types.h in asm/hvcall.h

Mika Westerberg (2):
ahci: Add Intel Cannon Lake PCH-H PCI ID
pinctrl: intel: Initialize GPIO properly when used through irqchip

Mikulas Patocka (3):
alpha: fix crash if pthread_create races with signal delivery
alpha: fix reboot on Avanti platform
alpha: fix formating of stack content

Ming Lei (1):
blk-mq: quiesce queue before freeing queue

Miquel Raynal (2):
mtd: nand: Fix nand_do_read_oob() return value
mtd: nand: sunxi: Fix ECC strength choice

Mohamed Ghannam (1):

      dccp: CVE-2017-8824: use-after-free in DCCP code

Nikolay Borisov (1):
btrfs: Handle btrfs_set_extent_delalloc failure in fixup worker

Omar Sandoval (1):
sched/wait: Fix add_wait_queue() behavioral change

Paul E. McKenney (1):
rcu: Export init_rcu_head() and destroy_rcu_head() to GPL modules

Paul Mackerras (2):
KVM: PPC: Book3S HV: Make sure we don't re-enter guest without XIVE loaded
KVM: PPC: Book3S HV: Drop locks before reading guest memory

Peter Rosin (3):

      pinctrl: sx150x: Unregister the pinctrl on release
      pinctrl: sx150x: Register pinctrl before adding the gpiochip
      pinctrl: sx150x: Add a static gpio/pinctrl pin range mapping

Peter Zijlstra (1):
objtool: Fix switch-table detection

Rasmus Villemoes (2):
watchdog: gpio_wdt: set WDOG_HW_RUNNING in gpio_wdt_stop kernel/async.c: revert "async: simplify lowest_in_progress()"

Robin Murphy (3):
arm64: Implement array_index_mask_nospec()
arm64: Make USER_DS an inclusive limit
arm64: Use pointer masking to limit uaccess speculation

Sascha Hauer (1):
ubi: fastmap: Erase outdated anchor PEBs during attach

Scott Mayhew (1):
nfs/pnfs: fix nfs_direct_req ref leak when i/o falls back to the mds

Shanker Donthineni (3):
arm64: Define cputype macros for Falkor CPU
arm64: Add software workaround for Falkor erratum 1041
arm64: Implement branch predictor hardening for Falkor

Stephen Boyd (1):
arm64: cpu_errata: Add Kryo to Falkor 1003 errata

Steven Rostedt (VMware) (3):
sched/rt: Use container_of() to get root domain in rto_push_irq_work_func() sched/rt: Up the root domain ref count when passing it around via IPIs
ftrace: Remove incorrect setting of glob search field

Suzuki K Poulose (2):
arm64: capabilities: Handle duplicate entries for a capability
arm64: Run enable method for errata work arounds on late CPUs

Takashi Iwai (1):
ASoC: skl: Fix kernel warning due to zero NHTL entry

Tigran Mkrtchyan (1):
nfs41: do not return ENOMEM on LAYOUTUNAVAILABLE

Toshi Kani (1):
acpi, nfit: fix register dimm error handling

Trond Myklebust (3):
NFS: Add a cond_resched() to nfs_commit_release_pages()
NFS: Fix nfsstat breakage due to LOOKUPP
NFS: Fix a race between mmap() and O_DIRECT

Ulf Magnusson (1):
KVM: PPC: Book3S PR: Fix broken select due to misspelling

Uma Krishnan (1):
scsi: cxlflash: Reset command ioasc

Ville Syrjälä (3):
drm/i915: Add .get_hw_state() method for planes drm/i915: Redo plane sanitation during readout drm/i915: Fix deadlock in i830_disable_pipe()

Will Deacon (40):
arm64: mm: Use non-global mappings for kernel space
arm64: mm: Temporarily disable ARM64_SW_TTBR0_PAN
arm64: mm: Move ASID from TTBR0 to TTBR1
arm64: mm: Remove pre_ttbr0_update_workaround for Falkor erratum #E1003
arm64: mm: Rename post_ttbr0_update_workaround
arm64: mm: Fix and re-enable ARM64_SW_TTBR0_PAN
arm64: mm: Allocate ASIDs in pairs
arm64: mm: Add arm64_kernel_unmapped_at_el0 helper
arm64: mm: Invalidate both kernel and user ASIDs when performing TLBI
arm64: entry: Add exception trampoline page for exceptions from EL0
arm64: mm: Map entry trampoline into trampoline and kernel page tables
arm64: entry: Explicitly pass exception level to kernel_ventry macro
arm64: entry: Hook up entry trampoline to exception vectors
arm64: erratum: Work around Falkor erratum #E1003 in trampoline code
arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks
arm64: entry: Add fake CPU feature for unmapping the kernel at EL0
arm64: kaslr: Put kernel vectors address in separate data page
arm64: use RET instruction for exiting the trampoline
arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0
arm64: Kconfig: Reword UNMAP_KERNEL_AT_EL0 kconfig entry
arm64: Take into account ID_AA64PFR0_EL1.CSV3
arm64: mm: Introduce TTBR_ASID_MASK for getting at the ASID in the TTBR
arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0()
arm64: mm: Permit transitioning from Global to Non-Global without BBM
arm64: kpti: Add ->enable callback to remap swapper using nG mappings
arm64: entry: Reword comment about post_ttbr_update_workaround
arm64: idmap: Use "awx" flags for .idmap.text .pushsection directives
arm64: barrier: Add CSDB macros to control data-value prediction
arm64: entry: Ensure branch through syscall table is bounded under speculation
arm64: uaccess: Prevent speculative use of the current addr_limit
arm64: uaccess: Don't bother eliding access_ok checks in __{get, put}_user
arm64: uaccess: Mask __user pointers for __arch_{clear, copy_*}_user
arm64: futex: Mask __user pointers prior to dereference
arm64: cpufeature: Pass capability structure to ->enable callback drivers/firmware: Expose psci_get_version through psci_ops structure
arm64: Add skeleton to harden the branch predictor against aliasing attacks
arm64: entry: Apply BP hardening for high-priority synchronous exceptions
arm64: entry: Apply BP hardening for suspicious interrupts from EL0
arm64: cputype: Add missing MIDR values for Cortex-A72 and Cortex-A75
arm64: Implement branch predictor hardening for affected Cortex-A CPUs

Yan Markman (1):
arm64: dts: marvell: add Ethernet aliases

Yang Shunyong (1):
dmaengine: dmatest: fix container_of member in dmatest_callback

Yury Norov (1):
arm64: move TASK_* definitions to <asm/processor.h>

author maintainer
#1 lore raw
Documentation/arm64/silicon-errata.txt +2 -1
index 66e8ce14d23d..f3d0d316d5f1 100644
@@ -71,6 +71,7 @@ stable kernels.
 | Hisilicon      | Hip0{5,6,7}     | #161010101      | HISILICON_ERRATUM_161010101 |
 | Hisilicon      | Hip0{6,7}       | #161010701      | N/A                         |
 |                |                 |                 |                             |
-| Qualcomm Tech. | Falkor v1       | E1003           | QCOM_FALKOR_ERRATUM_1003    |
+| Qualcomm Tech. | Kryo/Falkor v1  | E1003           | QCOM_FALKOR_ERRATUM_1003    |
 | Qualcomm Tech. | Falkor v1       | E1009           | QCOM_FALKOR_ERRATUM_1009    |
 | Qualcomm Tech. | QDF2400 ITS     | E0065           | QCOM_QDF2400_ERRATUM_0065   |
+| Qualcomm Tech. | Falkor v{1,2}   | E1041           | QCOM_FALKOR_ERRATUM_1041    |
Makefile +3 -2
index 76a0b13623f4..33176140f133 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 4
 PATCHLEVEL = 14
-SUBLEVEL = 19
+SUBLEVEL = 20
 EXTRAVERSION =
 NAME = Petit Gorille
 
@@ -416,7 +416,8 @@ export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
 export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
 
 export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
-export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_KASAN CFLAGS_UBSAN
+export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
+export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
 export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
 export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
 export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
arch/alpha/include/asm/futex.h +4 -4
index d2e4da93e68c..ca3322536f72 100644
@@ -20,8 +20,8 @@
 	"3:	.subsection 2\n"				\
 	"4:	br	1b\n"					\
 	"	.previous\n"					\
-	EXC(1b,3b,%1,$31)					\
-	EXC(2b,3b,%1,$31)					\
+	EXC(1b,3b,$31,%1)					\
+	EXC(2b,3b,$31,%1)					\
 	:	"=&r" (oldval), "=&r"(ret)			\
 	:	"r" (uaddr), "r"(oparg)				\
 	:	"memory")
@@ -82,8 +82,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 	"3:	.subsection 2\n"
 	"4:	br	1b\n"
 	"	.previous\n"
-	EXC(1b,3b,%0,$31)
-	EXC(2b,3b,%0,$31)
+	EXC(1b,3b,$31,%0)
+	EXC(2b,3b,$31,%0)
 	:	"+r"(ret), "=&r"(prev), "=&r"(cmp)
 	:	"r"(uaddr), "r"((long)(int)oldval), "r"(newval)
 	:	"memory");
arch/alpha/kernel/osf_sys.c +2 -2
index ce3a675c0c4b..75a5c35a2067 100644
@@ -964,8 +964,8 @@ static inline long
 put_tv32(struct timeval32 __user *o, struct timeval *i)
 {
 	return copy_to_user(o, &(struct timeval32){
-				.tv_sec = o->tv_sec,
-				.tv_usec = o->tv_usec},
+				.tv_sec = i->tv_sec,
+				.tv_usec = i->tv_usec},
 			    sizeof(struct timeval32));
 }
 
arch/alpha/kernel/pci_impl.h +2 -1
index 26231601630e..f332d88ffaff 100644
@@ -144,7 +144,8 @@ struct pci_iommu_arena
 };
 
 #if defined(CONFIG_ALPHA_SRM) && \
-    (defined(CONFIG_ALPHA_CIA) || defined(CONFIG_ALPHA_LCA))
+    (defined(CONFIG_ALPHA_CIA) || defined(CONFIG_ALPHA_LCA) || \
+     defined(CONFIG_ALPHA_AVANTI))
 # define NEED_SRM_SAVE_RESTORE
 #else
 # undef NEED_SRM_SAVE_RESTORE
arch/alpha/kernel/process.c +2 -1
index 74bfb1f2d68e..3a885253f486 100644
@@ -269,12 +269,13 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
 	   application calling fork.  */
 	if (clone_flags & CLONE_SETTLS)
 		childti->pcb.unique = regs->r20;
+	else
+		regs->r20 = 0;	/* OSF/1 has some strange fork() semantics.  */
 	childti->pcb.usp = usp ?: rdusp();
 	*childregs = *regs;
 	childregs->r0 = 0;
 	childregs->r19 = 0;
 	childregs->r20 = 1;	/* OSF/1 has some strange fork() semantics.  */
-	regs->r20 = 0;
 	stack = ((struct switch_stack *) regs) - 1;
 	*childstack = *stack;
 	childstack->r26 = (unsigned long) ret_from_fork;
arch/alpha/kernel/traps.c +9 -4
index 4bd99a7b1c41..f43bd05dede2 100644
@@ -160,11 +160,16 @@ void show_stack(struct task_struct *task, unsigned long *sp)
 	for(i=0; i < kstack_depth_to_print; i++) {
 		if (((long) stack & (THREAD_SIZE-1)) == 0)
 			break;
-		if (i && ((i % 4) == 0))
-			printk("\n       ");
-		printk("%016lx ", *stack++);
+		if ((i % 4) == 0) {
+			if (i)
+				pr_cont("\n");
+			printk("       ");
+		} else {
+			pr_cont(" ");
+		}
+		pr_cont("%016lx", *stack++);
 	}
-	printk("\n");
+	pr_cont("\n");
 	dik_show_trace(sp);
 }
 
arch/arm/crypto/crc32-ce-glue.c +2 -0
index 1b0e0e86ee9c..96e62ec105d0 100644
@@ -188,6 +188,7 @@ static struct shash_alg crc32_pmull_algs[] = { {
 	.base.cra_name		= "crc32",
 	.base.cra_driver_name	= "crc32-arm-ce",
 	.base.cra_priority	= 200,
+	.base.cra_flags		= CRYPTO_ALG_OPTIONAL_KEY,
 	.base.cra_blocksize	= 1,
 	.base.cra_module	= THIS_MODULE,
 }, {
@@ -203,6 +204,7 @@ static struct shash_alg crc32_pmull_algs[] = { {
 	.base.cra_name		= "crc32c",
 	.base.cra_driver_name	= "crc32c-arm-ce",
 	.base.cra_priority	= 200,
+	.base.cra_flags		= CRYPTO_ALG_OPTIONAL_KEY,
 	.base.cra_blocksize	= 1,
 	.base.cra_module	= THIS_MODULE,
 } };
arch/arm/include/asm/kvm_host.h +6 -0
index 4a879f6ff13b..31fbb9285f62 100644
@@ -293,4 +293,10 @@ int kvm_arm_vcpu_arch_get_attr(struct kvm_vcpu *vcpu,
 int kvm_arm_vcpu_arch_has_attr(struct kvm_vcpu *vcpu,
 			       struct kvm_device_attr *attr);
 
+static inline bool kvm_arm_harden_branch_predictor(void)
+{
+	/* No way to detect it yet, pretend it is not there. */
+	return false;
+}
+
 #endif /* __ARM_KVM_HOST_H__ */
arch/arm/include/asm/kvm_mmu.h +10 -0
index fa6f2174276b..eb46fc81a440 100644
@@ -221,6 +221,16 @@ static inline unsigned int kvm_get_vmid_bits(void)
 	return 8;
 }
 
+static inline void *kvm_get_hyp_vector(void)
+{
+	return kvm_ksym_ref(__kvm_hyp_vector);
+}
+
+static inline int kvm_map_vectors(void)
+{
+	return 0;
+}
+
 #endif	/* !__ASSEMBLY__ */
 
 #endif /* __ARM_KVM_MMU_H__ */
arch/arm/include/asm/kvm_psci.h deleted +0 -27
deleted file mode 100644
index 6bda945d31fa..000000000000
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2012 - ARM Ltd
- * Author: Marc Zyngier <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __ARM_KVM_PSCI_H__
-#define __ARM_KVM_PSCI_H__
-
-#define KVM_ARM_PSCI_0_1	1
-#define KVM_ARM_PSCI_0_2	2
-
-int kvm_psci_version(struct kvm_vcpu *vcpu);
-int kvm_psci_call(struct kvm_vcpu *vcpu);
-
-#endif /* __ARM_KVM_PSCI_H__ */
arch/arm/kvm/handle_exit.c +13 -4
index cf8bf6bf87c4..910bd8dabb3c 100644
@@ -21,7 +21,7 @@
 #include <asm/kvm_emulate.h>
 #include <asm/kvm_coproc.h>
 #include <asm/kvm_mmu.h>
-#include <asm/kvm_psci.h>
+#include <kvm/arm_psci.h>
 #include <trace/events/kvm.h>
 
 #include "trace.h"
@@ -36,9 +36,9 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)
 		      kvm_vcpu_hvc_get_imm(vcpu));
 	vcpu->stat.hvc_exit_stat++;
 
-	ret = kvm_psci_call(vcpu);
+	ret = kvm_hvc_call_handler(vcpu);
 	if (ret < 0) {
-		kvm_inject_undefined(vcpu);
+		vcpu_set_reg(vcpu, 0, ~0UL);
 		return 1;
 	}
 
@@ -47,7 +47,16 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)
 
 static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run)
 {
-	kvm_inject_undefined(vcpu);
+	/*
+	 * "If an SMC instruction executed at Non-secure EL1 is
+	 * trapped to EL2 because HCR_EL2.TSC is 1, the exception is a
+	 * Trap exception, not a Secure Monitor Call exception [...]"
+	 *
+	 * We need to advance the PC after the trap, as it would
+	 * otherwise return to the same address...
+	 */
+	vcpu_set_reg(vcpu, 0, ~0UL);
+	kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));
 	return 1;
 }
 
arch/arm64/Kconfig +44 -12

76 lines not on this page · raw message

arch/arm64/boot/dts/marvell/armada-7040-db.dts +6 -0
index 9c3bdf87e543..51327645b3fb 100644
@@ -61,6 +61,12 @@
 		reg = <0x0 0x0 0x0 0x80000000>;
 	};
 
+	aliases {
+		ethernet0 = &cpm_eth0;
+		ethernet1 = &cpm_eth1;
+		ethernet2 = &cpm_eth2;
+	};
+
 	cpm_reg_usb3_0_vbus: cpm-usb3-0-vbus {
 		compatible = "regulator-fixed";
 		regulator-name = "usb3h0-vbus";
arch/arm64/boot/dts/marvell/armada-8040-db.dts +7 -0
index 0d7b2ae46610..a4f82f1efbbc 100644
@@ -61,6 +61,13 @@
 		reg = <0x0 0x0 0x0 0x80000000>;
 	};
 
+	aliases {
+		ethernet0 = &cpm_eth0;
+		ethernet1 = &cpm_eth2;
+		ethernet2 = &cps_eth0;
+		ethernet3 = &cps_eth1;
+	};
+
 	cpm_reg_usb3_0_vbus: cpm-usb3-0-vbus {
 		compatible = "regulator-fixed";
 		regulator-name = "cpm-usb3h0-vbus";
arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts +6 -0
index acf5c7d16d79..2b6b792dab93 100644
@@ -62,6 +62,12 @@
 		reg = <0x0 0x0 0x0 0x80000000>;
 	};
 
+	aliases {
+		ethernet0 = &cpm_eth0;
+		ethernet1 = &cps_eth0;
+		ethernet2 = &cps_eth1;
+	};
+
 	/* Regulator labels correspond with schematics */
 	v_3_3: regulator-3-3v {
 		compatible = "regulator-fixed";
arch/arm64/crypto/crc32-ce-glue.c +2 -0
index 624f4137918c..34b4e3d46aab 100644
@@ -185,6 +185,7 @@ static struct shash_alg crc32_pmull_algs[] = { {
 	.base.cra_name		= "crc32",
 	.base.cra_driver_name	= "crc32-arm64-ce",
 	.base.cra_priority	= 200,
+	.base.cra_flags		= CRYPTO_ALG_OPTIONAL_KEY,
 	.base.cra_blocksize	= 1,
 	.base.cra_module	= THIS_MODULE,
 }, {
@@ -200,6 +201,7 @@ static struct shash_alg crc32_pmull_algs[] = { {
 	.base.cra_name		= "crc32c",
 	.base.cra_driver_name	= "crc32c-arm64-ce",
 	.base.cra_priority	= 200,
+	.base.cra_flags		= CRYPTO_ALG_OPTIONAL_KEY,
 	.base.cra_blocksize	= 1,
 	.base.cra_module	= THIS_MODULE,
 } };
arch/arm64/include/asm/asm-uaccess.h +24 -12
index b3da6c886835..dd49c3567f20 100644
@@ -4,6 +4,7 @@
 
 #include <asm/alternative.h>
 #include <asm/kernel-pgtable.h>
+#include <asm/mmu.h>
 #include <asm/sysreg.h>
 #include <asm/assembler.h>
 
@@ -13,51 +14,62 @@
 #ifdef CONFIG_ARM64_SW_TTBR0_PAN
 	.macro	__uaccess_ttbr0_disable, tmp1
 	mrs	\tmp1, ttbr1_el1		// swapper_pg_dir
+	bic	\tmp1, \tmp1, #TTBR_ASID_MASK
 	add	\tmp1, \tmp1, #SWAPPER_DIR_SIZE	// reserved_ttbr0 at the end of swapper_pg_dir
 	msr	ttbr0_el1, \tmp1		// set reserved TTBR0_EL1
 	isb
+	sub	\tmp1, \tmp1, #SWAPPER_DIR_SIZE
+	msr	ttbr1_el1, \tmp1		// set reserved ASID
+	isb
 	.endm
 
-	.macro	__uaccess_ttbr0_enable, tmp1
+	.macro	__uaccess_ttbr0_enable, tmp1, tmp2
 	get_thread_info \tmp1
 	ldr	\tmp1, [\tmp1, #TSK_TI_TTBR0]	// load saved TTBR0_EL1
+	mrs	\tmp2, ttbr1_el1
+	extr    \tmp2, \tmp2, \tmp1, #48
+	ror     \tmp2, \tmp2, #16
+	msr	ttbr1_el1, \tmp2		// set the active ASID
+	isb
 	msr	ttbr0_el1, \tmp1		// set the non-PAN TTBR0_EL1
 	isb
 	.endm
 
-	.macro	uaccess_ttbr0_disable, tmp1
+	.macro	uaccess_ttbr0_disable, tmp1, tmp2
 alternative_if_not ARM64_HAS_PAN
+	save_and_disable_irq \tmp2		// avoid preemption
 	__uaccess_ttbr0_disable \tmp1
+	restore_irq \tmp2
 alternative_else_nop_endif
 	.endm
 
-	.macro	uaccess_ttbr0_enable, tmp1, tmp2
+	.macro	uaccess_ttbr0_enable, tmp1, tmp2, tmp3
 alternative_if_not ARM64_HAS_PAN
-	save_and_disable_irq \tmp2		// avoid preemption
-	__uaccess_ttbr0_enable \tmp1
-	restore_irq \tmp2
+	save_and_disable_irq \tmp3		// avoid preemption
+	__uaccess_ttbr0_enable \tmp1, \tmp2
+	restore_irq \tmp3
 alternative_else_nop_endif
 	.endm
 #else
-	.macro	uaccess_ttbr0_disable, tmp1
+	.macro	uaccess_ttbr0_disable, tmp1, tmp2
 	.endm
 
-	.macro	uaccess_ttbr0_enable, tmp1, tmp2
+	.macro	uaccess_ttbr0_enable, tmp1, tmp2, tmp3
 	.endm
 #endif
 
 /*
  * These macros are no-ops when UAO is present.
  */
-	.macro	uaccess_disable_not_uao, tmp1
-	uaccess_ttbr0_disable \tmp1
+	.macro	uaccess_disable_not_uao, tmp1, tmp2
+	uaccess_ttbr0_disable \tmp1, \tmp2
 alternative_if ARM64_ALT_PAN_NOT_UAO
 	SET_PSTATE_PAN(1)
 alternative_else_nop_endif
 	.endm
 
-	.macro	uaccess_enable_not_uao, tmp1, tmp2
-	uaccess_ttbr0_enable \tmp1, \tmp2
+	.macro	uaccess_enable_not_uao, tmp1, tmp2, tmp3
+	uaccess_ttbr0_enable \tmp1, \tmp2, \tmp3
 alternative_if ARM64_ALT_PAN_NOT_UAO
 	SET_PSTATE_PAN(0)
 alternative_else_nop_endif
arch/arm64/include/asm/assembler.h +25 -29

77 lines not on this page · raw message

arch/arm64/include/asm/barrier.h +23 -0
index 0fe7e43b7fbc..0b0755c961ac 100644
@@ -31,6 +31,8 @@
 #define dmb(opt)	asm volatile("dmb " #opt : : : "memory")
 #define dsb(opt)	asm volatile("dsb " #opt : : : "memory")
 
+#define csdb()		asm volatile("hint #20" : : : "memory")
+
 #define mb()		dsb(sy)
 #define rmb()		dsb(ld)
 #define wmb()		dsb(st)
@@ -38,6 +40,27 @@
 #define dma_rmb()	dmb(oshld)
 #define dma_wmb()	dmb(oshst)
 
+/*
+ * Generate a mask for array_index__nospec() that is ~0UL when 0 <= idx < sz
+ * and 0 otherwise.
+ */
+#define array_index_mask_nospec array_index_mask_nospec
+static inline unsigned long array_index_mask_nospec(unsigned long idx,
+						    unsigned long sz)
+{
+	unsigned long mask;
+
+	asm volatile(
+	"	cmp	%1, %2\n"
+	"	sbc	%0, xzr, xzr\n"
+	: "=r" (mask)
+	: "r" (idx), "Ir" (sz)
+	: "cc");
+
+	csdb();
+	return mask;
+}
+
 #define __smp_mb()	dmb(ish)
 #define __smp_rmb()	dmb(ishld)
 #define __smp_wmb()	dmb(ishst)
arch/arm64/include/asm/cpucaps.h +4 -1
index 8da621627d7c..2e7b236bc596 100644
@@ -40,7 +40,10 @@
 #define ARM64_WORKAROUND_858921			19
 #define ARM64_WORKAROUND_CAVIUM_30115		20
 #define ARM64_HAS_DCPOP				21
+#define ARM64_UNMAP_KERNEL_AT_EL0		23
+#define ARM64_HARDEN_BRANCH_PREDICTOR		24
+#define ARM64_HARDEN_BP_POST_GUEST_EXIT		25
 
-#define ARM64_NCAPS				22
+#define ARM64_NCAPS				26
 
 #endif /* __ASM_CPUCAPS_H */
arch/arm64/include/asm/cputype.h +11 -0
index 235e77d98261..be7bd19c87ec 100644
@@ -79,26 +79,37 @@
 #define ARM_CPU_PART_AEM_V8		0xD0F
 #define ARM_CPU_PART_FOUNDATION		0xD00
 #define ARM_CPU_PART_CORTEX_A57		0xD07
+#define ARM_CPU_PART_CORTEX_A72		0xD08
 #define ARM_CPU_PART_CORTEX_A53		0xD03
 #define ARM_CPU_PART_CORTEX_A73		0xD09
+#define ARM_CPU_PART_CORTEX_A75		0xD0A
 
 #define APM_CPU_PART_POTENZA		0x000
 
 #define CAVIUM_CPU_PART_THUNDERX	0x0A1
 #define CAVIUM_CPU_PART_THUNDERX_81XX	0x0A2
 #define CAVIUM_CPU_PART_THUNDERX_83XX	0x0A3
+#define CAVIUM_CPU_PART_THUNDERX2	0x0AF
 
 #define BRCM_CPU_PART_VULCAN		0x516
 
 #define QCOM_CPU_PART_FALKOR_V1		0x800
+#define QCOM_CPU_PART_FALKOR		0xC00
+#define QCOM_CPU_PART_KRYO		0x200
 
 #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
 #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
+#define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72)
 #define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
+#define MIDR_CORTEX_A75 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A75)
 #define MIDR_THUNDERX	MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
 #define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)
 #define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX)
+#define MIDR_CAVIUM_THUNDERX2 MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX2)
+#define MIDR_BRCM_VULCAN MIDR_CPU_MODEL(ARM_CPU_IMP_BRCM, BRCM_CPU_PART_VULCAN)
 #define MIDR_QCOM_FALKOR_V1 MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR_V1)
+#define MIDR_QCOM_FALKOR MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR)
+#define MIDR_QCOM_KRYO MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO)
 
 #ifndef __ASSEMBLY__
 
arch/arm64/include/asm/efi.h +7 -5
index c4cd5081d78b..8389050328bb 100644
@@ -121,19 +121,21 @@ static inline void efi_set_pgd(struct mm_struct *mm)
 		if (mm != current->active_mm) {
 			/*
 			 * Update the current thread's saved ttbr0 since it is
-			 * restored as part of a return from exception. Set
-			 * the hardware TTBR0_EL1 using cpu_switch_mm()
-			 * directly to enable potential errata workarounds.
+			 * restored as part of a return from exception. Enable
+			 * access to the valid TTBR0_EL1 and invoke the errata
+			 * workaround directly since there is no return from
+			 * exception when invoking the EFI run-time services.
 			 */
 			update_saved_ttbr0(current, mm);
-			cpu_switch_mm(mm->pgd, mm);
+			uaccess_ttbr0_enable();
+			post_ttbr_update_workaround();
 		} else {
 			/*
 			 * Defer the switch to the current thread's TTBR0_EL1
 			 * until uaccess_enable(). Restore the current
 			 * thread's saved ttbr0 corresponding to its active_mm
 			 */
-			cpu_set_reserved_ttbr0();
+			uaccess_ttbr0_disable();
 			update_saved_ttbr0(current, current->active_mm);
 		}
 	}
arch/arm64/include/asm/fixmap.h +5 -0
index 4052ec39e8db..ec1e6d6fa14c 100644
@@ -58,6 +58,11 @@ enum fixed_addresses {
 	FIX_APEI_GHES_NMI,
 #endif /* CONFIG_ACPI_APEI_GHES */
 
+#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+	FIX_ENTRY_TRAMP_DATA,
+	FIX_ENTRY_TRAMP_TEXT,
+#define TRAMP_VALIAS		(__fix_to_virt(FIX_ENTRY_TRAMP_TEXT))
+#endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
 	__end_of_permanent_fixed_addresses,
 
 	/*
arch/arm64/include/asm/futex.h +6 -3
index 5bb2fd4674e7..07fe2479d310 100644
@@ -48,9 +48,10 @@ do {									\
 } while (0)
 
 static inline int
-arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr)
+arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *_uaddr)
 {
 	int oldval = 0, ret, tmp;
+	u32 __user *uaddr = __uaccess_mask_ptr(_uaddr);
 
 	pagefault_disable();
 
@@ -88,15 +89,17 @@ arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr)
 }
 
 static inline int
-futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
+futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *_uaddr,
 			      u32 oldval, u32 newval)
 {
 	int ret = 0;
 	u32 val, tmp;
+	u32 __user *uaddr;
 
-	if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
+	if (!access_ok(VERIFY_WRITE, _uaddr, sizeof(u32)))
 		return -EFAULT;
 
+	uaddr = __uaccess_mask_ptr(_uaddr);
 	uaccess_enable();
 	asm volatile("// futex_atomic_cmpxchg_inatomic\n"
 "	prfm	pstl1strm, %2\n"
arch/arm64/include/asm/kvm_asm.h +2 -0
index 26a64d0f9ab9..a7ef5a051911 100644
@@ -66,6 +66,8 @@ extern u32 __kvm_get_mdcr_el2(void);
 
 extern u32 __init_stage2_translation(void);
 
+extern void __qcom_hyp_sanitize_btac_predictors(void);
+
 #endif
 
 #endif /* __ARM_KVM_ASM_H__ */
arch/arm64/include/asm/kvm_host.h +5 -0
index e923b58606e2..8ad208cb866c 100644
@@ -384,4 +384,9 @@ static inline void __cpu_init_stage2(void)
 		  "PARange is %d bits, unsupported configuration!", parange);
 }
 
+static inline bool kvm_arm_harden_branch_predictor(void)
+{
+	return cpus_have_const_cap(ARM64_HARDEN_BRANCH_PREDICTOR);
+}
+
 #endif /* __ARM64_KVM_HOST_H__ */
arch/arm64/include/asm/kvm_mmu.h +38 -0
index 672c8684d5c2..2d6d4bd9de52 100644
@@ -309,5 +309,43 @@ static inline unsigned int kvm_get_vmid_bits(void)
 	return (cpuid_feature_extract_unsigned_field(reg, ID_AA64MMFR1_VMIDBITS_SHIFT) == 2) ? 16 : 8;
 }
 
+#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
+#include <asm/mmu.h>
+
+static inline void *kvm_get_hyp_vector(void)
+{
+	struct bp_hardening_data *data = arm64_get_bp_hardening_data();
+	void *vect = kvm_ksym_ref(__kvm_hyp_vector);
+
+	if (data->fn) {
+		vect = __bp_harden_hyp_vecs_start +
+		       data->hyp_vectors_slot * SZ_2K;
+
+		if (!has_vhe())
+			vect = lm_alias(vect);
+	}
+
+	return vect;
+}
+
+static inline int kvm_map_vectors(void)
+{
+	return create_hyp_mappings(kvm_ksym_ref(__bp_harden_hyp_vecs_start),
+				   kvm_ksym_ref(__bp_harden_hyp_vecs_end),
+				   PAGE_HYP_EXEC);
+}
+
+#else
+static inline void *kvm_get_hyp_vector(void)
+{
+	return kvm_ksym_ref(__kvm_hyp_vector);
+}
+
+static inline int kvm_map_vectors(void)
+{
+	return 0;
+}
+#endif
+
 #endif /* __ASSEMBLY__ */
 #endif /* __ARM64_KVM_MMU_H__ */
arch/arm64/include/asm/kvm_psci.h deleted +0 -27
deleted file mode 100644
index bc39e557c56c..000000000000
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2012,2013 - ARM Ltd
- * Author: Marc Zyngier <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __ARM64_KVM_PSCI_H__
-#define __ARM64_KVM_PSCI_H__
-
-#define KVM_ARM_PSCI_0_1	1
-#define KVM_ARM_PSCI_0_2	2
-
-int kvm_psci_version(struct kvm_vcpu *vcpu);
-int kvm_psci_call(struct kvm_vcpu *vcpu);
-
-#endif /* __ARM64_KVM_PSCI_H__ */
arch/arm64/include/asm/memory.h +0 -15
index f7c4d2146aed..d4bae7d6e0d8 100644
@@ -61,8 +61,6 @@
  * KIMAGE_VADDR - the virtual address of the start of the kernel image
  * VA_BITS - the maximum number of bits for virtual addresses.
  * VA_START - the first kernel virtual address.
- * TASK_SIZE - the maximum size of a user space task.
- * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area.
  */
 #define VA_BITS			(CONFIG_ARM64_VA_BITS)
 #define VA_START		(UL(0xffffffffffffffff) - \
@@ -77,19 +75,6 @@
 #define PCI_IO_END		(VMEMMAP_START - SZ_2M)
 #define PCI_IO_START		(PCI_IO_END - PCI_IO_SIZE)
 #define FIXADDR_TOP		(PCI_IO_START - SZ_2M)
-#define TASK_SIZE_64		(UL(1) << VA_BITS)
-
-#ifdef CONFIG_COMPAT
-#define TASK_SIZE_32		UL(0x100000000)
-#define TASK_SIZE		(test_thread_flag(TIF_32BIT) ? \
-				TASK_SIZE_32 : TASK_SIZE_64)
-#define TASK_SIZE_OF(tsk)	(test_tsk_thread_flag(tsk, TIF_32BIT) ? \
-				TASK_SIZE_32 : TASK_SIZE_64)
-#else
-#define TASK_SIZE		TASK_SIZE_64
-#endif /* CONFIG_COMPAT */
-
-#define TASK_UNMAPPED_BASE	(PAGE_ALIGN(TASK_SIZE / 4))
 
 #define KERNEL_START      _text
 #define KERNEL_END        _end
arch/arm64/include/asm/mmu.h +48 -0

64 lines not on this page · raw message

arch/arm64/include/asm/mmu_context.h +9 -3
index 9d155fa9a507..779d7a2ec5ec 100644
@@ -19,8 +19,6 @@
 #ifndef __ASM_MMU_CONTEXT_H
 #define __ASM_MMU_CONTEXT_H
 
-#define FALKOR_RESERVED_ASID	1
-
 #ifndef __ASSEMBLY__
 
 #include <linux/compiler.h>
@@ -57,6 +55,13 @@ static inline void cpu_set_reserved_ttbr0(void)
 	isb();
 }
 
+static inline void cpu_switch_mm(pgd_t *pgd, struct mm_struct *mm)
+{
+	BUG_ON(pgd == swapper_pg_dir);
+	cpu_set_reserved_ttbr0();
+	cpu_do_switch_mm(virt_to_phys(pgd),mm);
+}
+
 /*
  * TCR.T0SZ value to use when the ID map is active. Usually equals
  * TCR_T0SZ(VA_BITS), unless system RAM is positioned very high in
@@ -170,7 +175,7 @@ static inline void update_saved_ttbr0(struct task_struct *tsk,
 	else
 		ttbr = virt_to_phys(mm->pgd) | ASID(mm) << 48;
 
-	task_thread_info(tsk)->ttbr0 = ttbr;
+	WRITE_ONCE(task_thread_info(tsk)->ttbr0, ttbr);
 }
 #else
 static inline void update_saved_ttbr0(struct task_struct *tsk,
@@ -225,6 +230,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
 #define activate_mm(prev,next)	switch_mm(prev, next, current)
 
 void verify_cpu_asid_bits(void);
+void post_ttbr_update_workaround(void);
 
 #endif /* !__ASSEMBLY__ */
 
arch/arm64/include/asm/pgtable-hwdef.h +1 -0
index eb0c2bd90de9..8df4cb6ac6f7 100644
@@ -272,6 +272,7 @@
 #define TCR_TG1_4K		(UL(2) << TCR_TG1_SHIFT)
 #define TCR_TG1_64K		(UL(3) << TCR_TG1_SHIFT)
 
+#define TCR_A1			(UL(1) << 22)
 #define TCR_ASID16		(UL(1) << 36)
 #define TCR_TBI0		(UL(1) << 37)
 #define TCR_HA			(UL(1) << 39)
arch/arm64/include/asm/pgtable-prot.h +21 -14
index 0a5635fb0ef9..2db84df5eb42 100644
@@ -34,8 +34,14 @@
 
 #include <asm/pgtable-types.h>
 
-#define PROT_DEFAULT		(PTE_TYPE_PAGE | PTE_AF | PTE_SHARED)
-#define PROT_SECT_DEFAULT	(PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
+#define _PROT_DEFAULT		(PTE_TYPE_PAGE | PTE_AF | PTE_SHARED)
+#define _PROT_SECT_DEFAULT	(PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
+
+#define PTE_MAYBE_NG		(arm64_kernel_unmapped_at_el0() ? PTE_NG : 0)
+#define PMD_MAYBE_NG		(arm64_kernel_unmapped_at_el0() ? PMD_SECT_NG : 0)
+
+#define PROT_DEFAULT		(_PROT_DEFAULT | PTE_MAYBE_NG)
+#define PROT_SECT_DEFAULT	(_PROT_SECT_DEFAULT | PMD_MAYBE_NG)
 
 #define PROT_DEVICE_nGnRnE	(PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_WRITE | PTE_ATTRINDX(MT_DEVICE_nGnRnE))
 #define PROT_DEVICE_nGnRE	(PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_WRITE | PTE_ATTRINDX(MT_DEVICE_nGnRE))
@@ -47,23 +53,24 @@
 #define PROT_SECT_NORMAL	(PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
 #define PROT_SECT_NORMAL_EXEC	(PROT_SECT_DEFAULT | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
 
-#define _PAGE_DEFAULT		(PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
+#define _PAGE_DEFAULT		(_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
+#define _HYP_PAGE_DEFAULT	_PAGE_DEFAULT
 
-#define PAGE_KERNEL		__pgprot(_PAGE_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_WRITE)
-#define PAGE_KERNEL_RO		__pgprot(_PAGE_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_RDONLY)
-#define PAGE_KERNEL_ROX		__pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_RDONLY)
-#define PAGE_KERNEL_EXEC	__pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_WRITE)
-#define PAGE_KERNEL_EXEC_CONT	__pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_WRITE | PTE_CONT)
+#define PAGE_KERNEL		__pgprot(PROT_NORMAL)
+#define PAGE_KERNEL_RO		__pgprot((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY)
+#define PAGE_KERNEL_ROX		__pgprot((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY)
+#define PAGE_KERNEL_EXEC	__pgprot(PROT_NORMAL & ~PTE_PXN)
+#define PAGE_KERNEL_EXEC_CONT	__pgprot((PROT_NORMAL & ~PTE_PXN) | PTE_CONT)
 
-#define PAGE_HYP		__pgprot(_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
-#define PAGE_HYP_EXEC		__pgprot(_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
-#define PAGE_HYP_RO		__pgprot(_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
+#define PAGE_HYP		__pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
+#define PAGE_HYP_EXEC		__pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
+#define PAGE_HYP_RO		__pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
 #define PAGE_HYP_DEVICE		__pgprot(PROT_DEVICE_nGnRE | PTE_HYP)
 
-#define PAGE_S2			__pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY)
-#define PAGE_S2_DEVICE		__pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_UXN)
+#define PAGE_S2			__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY)
+#define PAGE_S2_DEVICE		__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_UXN)
 
-#define PAGE_NONE		__pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_RDONLY | PTE_PXN | PTE_UXN)
+#define PAGE_NONE		__pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN)
 #define PAGE_SHARED		__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE)
 #define PAGE_SHARED_EXEC	__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_WRITE)
 #define PAGE_READONLY		__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN)
arch/arm64/include/asm/pgtable.h +1 -0
index 960d05c8816a..aafea648a30f 100644
@@ -684,6 +684,7 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
 
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
+extern pgd_t tramp_pg_dir[PTRS_PER_PGD];
 
 /*
  * Encode and decode a swap entry:
arch/arm64/include/asm/proc-fns.h +0 -6
index 14ad6e4e87d1..16cef2e8449e 100644
@@ -35,12 +35,6 @@ extern u64 cpu_do_resume(phys_addr_t ptr, u64 idmap_ttbr);
 
 #include <asm/memory.h>
 
-#define cpu_switch_mm(pgd,mm)				\
-do {							\
-	BUG_ON(pgd == swapper_pg_dir);			\
-	cpu_do_switch_mm(virt_to_phys(pgd),mm);		\
-} while (0)
-
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* __ASM_PROCFNS_H */
arch/arm64/include/asm/processor.h +24 -0
index 29adab8138c3..fda6f5812281 100644
@@ -19,6 +19,13 @@
 #ifndef __ASM_PROCESSOR_H
 #define __ASM_PROCESSOR_H
 
+#define TASK_SIZE_64		(UL(1) << VA_BITS)
+
+#define KERNEL_DS	UL(-1)
+#define USER_DS		(TASK_SIZE_64 - 1)
+
+#ifndef __ASSEMBLY__
+
 /*
  * Default implementation of macro that returns current
  * instruction pointer ("program counter").
@@ -37,6 +44,22 @@
 #include <asm/ptrace.h>
 #include <asm/types.h>
 
+/*
+ * TASK_SIZE - the maximum size of a user space task.
+ * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area.
+ */
+#ifdef CONFIG_COMPAT
+#define TASK_SIZE_32		UL(0x100000000)
+#define TASK_SIZE		(test_thread_flag(TIF_32BIT) ? \
+				TASK_SIZE_32 : TASK_SIZE_64)
+#define TASK_SIZE_OF(tsk)	(test_tsk_thread_flag(tsk, TIF_32BIT) ? \
+				TASK_SIZE_32 : TASK_SIZE_64)
+#else
+#define TASK_SIZE		TASK_SIZE_64
+#endif /* CONFIG_COMPAT */
+
+#define TASK_UNMAPPED_BASE	(PAGE_ALIGN(TASK_SIZE / 4))
+
 #define STACK_TOP_MAX		TASK_SIZE_64
 #ifdef CONFIG_COMPAT
 #define AARCH32_VECTORS_BASE	0xffff0000
@@ -194,4 +217,5 @@ static inline void spin_lock_prefetch(const void *ptr)
 int cpu_enable_pan(void *__unused);
 int cpu_enable_cache_maint_trap(void *__unused);
 
+#endif /* __ASSEMBLY__ */
 #endif /* __ASM_PROCESSOR_H */
arch/arm64/include/asm/sysreg.h +2 -0
index f707fed5886f..ede80d47d0ef 100644
@@ -332,6 +332,8 @@
 #define ID_AA64ISAR1_DPB_SHIFT		0
 
 /* id_aa64pfr0 */
+#define ID_AA64PFR0_CSV3_SHIFT		60
+#define ID_AA64PFR0_CSV2_SHIFT		56
 #define ID_AA64PFR0_GIC_SHIFT		24
 #define ID_AA64PFR0_ASIMD_SHIFT		20
 #define ID_AA64PFR0_FP_SHIFT		16
arch/arm64/include/asm/tlbflush.h +14 -2
index af1c76981911..9e82dd79c7db 100644
@@ -23,6 +23,7 @@
 
 #include <linux/sched.h>
 #include <asm/cputype.h>
+#include <asm/mmu.h>
 
 /*
  * Raw TLBI operations.
@@ -54,6 +55,11 @@
 
 #define __tlbi(op, ...)		__TLBI_N(op, ##__VA_ARGS__, 1, 0)
 
+#define __tlbi_user(op, arg) do {						\
+	if (arm64_kernel_unmapped_at_el0())					\
+		__tlbi(op, (arg) | USER_ASID_FLAG);				\
+} while (0)
+
 /*
  *	TLB Management
  *	==============
@@ -115,6 +121,7 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
 
 	dsb(ishst);
 	__tlbi(aside1is, asid);
+	__tlbi_user(aside1is, asid);
 	dsb(ish);
 }
 
@@ -125,6 +132,7 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
 
 	dsb(ishst);
 	__tlbi(vale1is, addr);
+	__tlbi_user(vale1is, addr);
 	dsb(ish);
 }
 
@@ -151,10 +159,13 @@ static inline void __flush_tlb_range(struct vm_area_struct *vma,
 
 	dsb(ishst);
 	for (addr = start; addr < end; addr += 1 << (PAGE_SHIFT - 12)) {
-		if (last_level)
+		if (last_level) {
 			__tlbi(vale1is, addr);
-		else
+			__tlbi_user(vale1is, addr);
+		} else {
 			__tlbi(vae1is, addr);
+			__tlbi_user(vae1is, addr);
+		}
 	}
 	dsb(ish);
 }
@@ -194,6 +205,7 @@ static inline void __flush_tlb_pgtable(struct mm_struct *mm,
 	unsigned long addr = uaddr >> 12 | (ASID(mm) << 48);
 
 	__tlbi(vae1is, addr);
+	__tlbi_user(vae1is, addr);
 	dsb(ish);
 }
 
arch/arm64/include/asm/uaccess.h +128 -53

281 lines not on this page · raw message

arch/arm64/kernel/Makefile +4 -0
index 2f5ff2a65db3..def8d5623fd1 100644
@@ -55,6 +55,10 @@ arm64-obj-$(CONFIG_ARM64_RELOC_TEST)	+= arm64-reloc-test.o
 arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o
 arm64-obj-$(CONFIG_CRASH_DUMP)		+= crash_dump.o
 
+ifeq ($(CONFIG_KVM),y)
+arm64-obj-$(CONFIG_HARDEN_BRANCH_PREDICTOR)	+= bpi.o
+endif
+
 obj-y					+= $(arm64-obj-y) vdso/ probes/
 obj-m					+= $(arm64-obj-m)
 head-y					:= head.o
arch/arm64/kernel/arm64ksyms.c +2 -2
index 67368c7329c0..66be504edb6c 100644
@@ -37,8 +37,8 @@ EXPORT_SYMBOL(clear_page);
 	/* user mem (segment) */
 EXPORT_SYMBOL(__arch_copy_from_user);
 EXPORT_SYMBOL(__arch_copy_to_user);
-EXPORT_SYMBOL(__clear_user);
-EXPORT_SYMBOL(raw_copy_in_user);
+EXPORT_SYMBOL(__arch_clear_user);
+EXPORT_SYMBOL(__arch_copy_in_user);
 
 	/* physical memory */
 EXPORT_SYMBOL(memstart_addr);
arch/arm64/kernel/asm-offsets.c +5 -1
index 71bf088f1e4b..af247d10252f 100644
@@ -24,6 +24,7 @@
 #include <linux/kvm_host.h>
 #include <linux/suspend.h>
 #include <asm/cpufeature.h>
+#include <asm/fixmap.h>
 #include <asm/thread_info.h>
 #include <asm/memory.h>
 #include <asm/smp_plat.h>
@@ -148,11 +149,14 @@ int main(void)
   DEFINE(ARM_SMCCC_RES_X2_OFFS,		offsetof(struct arm_smccc_res, a2));
   DEFINE(ARM_SMCCC_QUIRK_ID_OFFS,	offsetof(struct arm_smccc_quirk, id));
   DEFINE(ARM_SMCCC_QUIRK_STATE_OFFS,	offsetof(struct arm_smccc_quirk, state));
-
   BLANK();
   DEFINE(HIBERN_PBE_ORIG,	offsetof(struct pbe, orig_address));
   DEFINE(HIBERN_PBE_ADDR,	offsetof(struct pbe, address));
   DEFINE(HIBERN_PBE_NEXT,	offsetof(struct pbe, next));
   DEFINE(ARM64_FTR_SYSVAL,	offsetof(struct arm64_ftr_reg, sys_val));
+  BLANK();
+#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+  DEFINE(TRAMP_VALIAS,		TRAMP_VALIAS);
+#endif
   return 0;
 }
arch/arm64/kernel/bpi.S new file +83 -0

83 lines not on this page · raw message

arch/arm64/kernel/cpu-reset.S +2 -1
index 65f42d257414..8021b46c9743 100644
@@ -16,7 +16,7 @@
 #include <asm/virt.h>
 
 .text
-.pushsection    .idmap.text, "ax"
+.pushsection    .idmap.text, "awx"
 
 /*
  * __cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2) - Helper for
@@ -37,6 +37,7 @@ ENTRY(__cpu_soft_restart)
 	mrs	x12, sctlr_el1
 	ldr	x13, =SCTLR_ELx_FLAGS
 	bic	x12, x12, x13
+	pre_disable_mmu_workaround
 	msr	sctlr_el1, x12
 	isb
 
arch/arm64/kernel/cpu_errata.c +236 -3

275 lines not on this page · raw message

arch/arm64/kernel/cpufeature.c +115 -23

192 lines not on this page · raw message

arch/arm64/kernel/efi-entry.S +2 -0
index 4e6ad355bd05..6b9736c3fb56 100644
@@ -96,6 +96,7 @@ ENTRY(entry)
 	mrs	x0, sctlr_el2
 	bic	x0, x0, #1 << 0	// clear SCTLR.M
 	bic	x0, x0, #1 << 2	// clear SCTLR.C
+	pre_disable_mmu_workaround
 	msr	sctlr_el2, x0
 	isb
 	b	2f
@@ -103,6 +104,7 @@ ENTRY(entry)
 	mrs	x0, sctlr_el1
 	bic	x0, x0, #1 << 0	// clear SCTLR.M
 	bic	x0, x0, #1 << 2	// clear SCTLR.C
+	pre_disable_mmu_workaround
 	msr	sctlr_el1, x0
 	isb
 2:
arch/arm64/kernel/entry.S +194 -36

354 lines not on this page · raw message

arch/arm64/kernel/head.S +2 -1
index 0b243ecaf7ac..261f3f88364c 100644
@@ -371,7 +371,7 @@ ENDPROC(__primary_switched)
  * end early head section, begin head code that is also used for
  * hotplug and needs to have the same protections as the text region
  */
-	.section ".idmap.text","ax"
+	.section ".idmap.text","awx"
 
 ENTRY(kimage_vaddr)
 	.quad		_text - TEXT_OFFSET
@@ -732,6 +732,7 @@ __primary_switch:
 	 * to take into account by discarding the current kernel mapping and
 	 * creating a new one.
 	 */
+	pre_disable_mmu_workaround
 	msr	sctlr_el1, x20			// disable the MMU
 	isb
 	bl	__create_page_tables		// recreate kernel mapping
arch/arm64/kernel/process.c +5 -7
index bcd22d7ee590..9e773732520c 100644
@@ -314,16 +314,14 @@ void tls_preserve_current_state(void)
 
 static void tls_thread_switch(struct task_struct *next)
 {
-	unsigned long tpidr, tpidrro;
-
 	tls_preserve_current_state();
 
-	tpidr = *task_user_tls(next);
-	tpidrro = is_compat_thread(task_thread_info(next)) ?
-		  next->thread.tp_value : 0;
+	if (is_compat_thread(task_thread_info(next)))
+		write_sysreg(next->thread.tp_value, tpidrro_el0);
+	else if (!arm64_kernel_unmapped_at_el0())
+		write_sysreg(0, tpidrro_el0);
 
-	write_sysreg(tpidr, tpidr_el0);
-	write_sysreg(tpidrro, tpidrro_el0);
+	write_sysreg(*task_user_tls(next), tpidr_el0);
 }
 
 /* Restore the UAO state depending on next's addr_limit */
arch/arm64/kernel/relocate_kernel.S +1 -0
index ce704a4aeadd..f407e422a720 100644
@@ -45,6 +45,7 @@ ENTRY(arm64_relocate_new_kernel)
 	mrs	x0, sctlr_el2
 	ldr	x1, =SCTLR_ELx_FLAGS
 	bic	x0, x0, x1
+	pre_disable_mmu_workaround
 	msr	sctlr_el2, x0
 	isb
 1:
arch/arm64/kernel/sleep.S +1 -1
index 10dd16d7902d..bebec8ef9372 100644
@@ -96,7 +96,7 @@ ENTRY(__cpu_suspend_enter)
 	ret
 ENDPROC(__cpu_suspend_enter)
 
-	.pushsection ".idmap.text", "ax"
+	.pushsection ".idmap.text", "awx"
 ENTRY(cpu_resume)
 	bl	el2_setup		// if in EL2 drop to EL1 cleanly
 	bl	__cpu_setup
arch/arm64/kernel/vmlinux.lds.S +21 -1
index 7da3e5c366a0..ddfd3c0942f7 100644
@@ -57,6 +57,17 @@ jiffies = jiffies_64;
 #define HIBERNATE_TEXT
 #endif
 
+#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+#define TRAMP_TEXT					\
+	. = ALIGN(PAGE_SIZE);				\
+	VMLINUX_SYMBOL(__entry_tramp_text_start) = .;	\
+	*(.entry.tramp.text)				\
+	. = ALIGN(PAGE_SIZE);				\
+	VMLINUX_SYMBOL(__entry_tramp_text_end) = .;
+#else
+#define TRAMP_TEXT
+#endif
+
 /*
  * The size of the PE/COFF section that covers the kernel image, which
  * runs from stext to _edata, must be a round multiple of the PE/COFF
@@ -113,6 +124,7 @@ SECTIONS
 			HYPERVISOR_TEXT
 			IDMAP_TEXT
 			HIBERNATE_TEXT
+			TRAMP_TEXT
 			*(.fixup)
 			*(.gnu.warning)
 		. = ALIGN(16);
@@ -214,6 +226,11 @@ SECTIONS
 	. += RESERVED_TTBR0_SIZE;
 #endif
 
+#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+	tramp_pg_dir = .;
+	. += PAGE_SIZE;
+#endif
+
 	__pecoff_data_size = ABSOLUTE(. - __initdata_begin);
 	_end = .;
 
@@ -234,7 +251,10 @@ ASSERT(__idmap_text_end - (__idmap_text_start & ~(SZ_4K - 1)) <= SZ_4K,
 ASSERT(__hibernate_exit_text_end - (__hibernate_exit_text_start & ~(SZ_4K - 1))
 	<= SZ_4K, "Hibernate exit text too big or misaligned")
 #endif
-
+#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+ASSERT((__entry_tramp_text_end - __entry_tramp_text_start) == PAGE_SIZE,
+	"Entry trampoline text too big")
+#endif
 /*
  * If padding is applied before .head.text, virt<->phys conversions will fail.
  */
arch/arm64/kvm/handle_exit.c +12 -2
index 380261e258ef..ab48c5ed3943 100644
@@ -22,12 +22,13 @@
 #include <linux/kvm.h>
 #include <linux/kvm_host.h>
 
+#include <kvm/arm_psci.h>
+
 #include <asm/esr.h>
 #include <asm/kvm_asm.h>
 #include <asm/kvm_coproc.h>
 #include <asm/kvm_emulate.h>
 #include <asm/kvm_mmu.h>
-#include <asm/kvm_psci.h>
 
 #define CREATE_TRACE_POINTS
 #include "trace.h"
@@ -42,7 +43,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)
 			    kvm_vcpu_hvc_get_imm(vcpu));
 	vcpu->stat.hvc_exit_stat++;
 
-	ret = kvm_psci_call(vcpu);
+	ret = kvm_hvc_call_handler(vcpu);
 	if (ret < 0) {
 		vcpu_set_reg(vcpu, 0, ~0UL);
 		return 1;
@@ -53,7 +54,16 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)
 
 static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run)
 {
+	/*
+	 * "If an SMC instruction executed at Non-secure EL1 is
+	 * trapped to EL2 because HCR_EL2.TSC is 1, the exception is a
+	 * Trap exception, not a Secure Monitor Call exception [...]"
+	 *
+	 * We need to advance the PC after the trap, as it would
+	 * otherwise return to the same address...
+	 */
 	vcpu_set_reg(vcpu, 0, ~0UL);
+	kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));
 	return 1;
 }
 
arch/arm64/kvm/hyp-init.S +1 -0
index 3f9615582377..870828c364c5 100644
@@ -151,6 +151,7 @@ reset:
 	mrs	x5, sctlr_el2
 	ldr	x6, =SCTLR_ELx_FLAGS
 	bic	x5, x5, x6		// Clear SCTL_M and etc
+	pre_disable_mmu_workaround
 	msr	sctlr_el2, x5
 	isb
 
arch/arm64/kvm/hyp/entry.S +12 -0
index 12ee62d6d410..9c45c6af1f58 100644
@@ -196,3 +196,15 @@ alternative_endif
 
 	eret
 ENDPROC(__fpsimd_guest_restore)
+
+ENTRY(__qcom_hyp_sanitize_btac_predictors)
+	/**
+	 * Call SMC64 with Silicon provider serviceID 23<<8 (0xc2001700)
+	 * 0xC2000000-0xC200FFFF: assigned to SiP Service Calls
+	 * b15-b0: contains SiP functionID
+	 */
+	movz    x0, #0x1700
+	movk    x0, #0xc200, lsl #16
+	smc     #0
+	ret
+ENDPROC(__qcom_hyp_sanitize_btac_predictors)
arch/arm64/kvm/hyp/hyp-entry.S +18 -2
index 5170ce1021da..f49b53331d28 100644
@@ -15,6 +15,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <linux/arm-smccc.h>
 #include <linux/linkage.h>
 
 #include <asm/alternative.h>
@@ -64,10 +65,11 @@ alternative_endif
 	lsr	x0, x1, #ESR_ELx_EC_SHIFT
 
 	cmp	x0, #ESR_ELx_EC_HVC64
+	ccmp	x0, #ESR_ELx_EC_HVC32, #4, ne
 	b.ne	el1_trap
 
-	mrs	x1, vttbr_el2		// If vttbr is valid, the 64bit guest
-	cbnz	x1, el1_trap		// called HVC
+	mrs	x1, vttbr_el2		// If vttbr is valid, the guest
+	cbnz	x1, el1_hvc_guest	// called HVC
 
 	/* Here, we're pretty sure the host called HVC. */
 	ldp	x0, x1, [sp], #16
@@ -100,6 +102,20 @@ alternative_endif
 
 	eret
 
+el1_hvc_guest:
+	/*
+	 * Fastest possible path for ARM_SMCCC_ARCH_WORKAROUND_1.
+	 * The workaround has already been applied on the host,
+	 * so let's quickly get back to the guest. We don't bother
+	 * restoring x1, as it can be clobbered anyway.
+	 */
+	ldr	x1, [sp]				// Guest's x0
+	eor	w1, w1, #ARM_SMCCC_ARCH_WORKAROUND_1
+	cbnz	w1, el1_trap
+	mov	x0, x1
+	add	sp, sp, #16
+	eret
+
 el1_trap:
 	/*
 	 * x0: ESR_EC
arch/arm64/kvm/hyp/switch.c +12 -1
index 945e79c641c4..79364d3455c0 100644
@@ -17,6 +17,9 @@
 
 #include <linux/types.h>
 #include <linux/jump_label.h>
+#include <uapi/linux/psci.h>
+
+#include <kvm/arm_psci.h>
 
 #include <asm/kvm_asm.h>
 #include <asm/kvm_emulate.h>
@@ -51,7 +54,7 @@ static void __hyp_text __activate_traps_vhe(void)
 	val &= ~CPACR_EL1_FPEN;
 	write_sysreg(val, cpacr_el1);
 
-	write_sysreg(__kvm_hyp_vector, vbar_el1);
+	write_sysreg(kvm_get_hyp_vector(), vbar_el1);
 }
 
 static void __hyp_text __activate_traps_nvhe(void)
@@ -364,6 +367,14 @@ int __hyp_text __kvm_vcpu_run(struct kvm_vcpu *vcpu)
 		/* 0 falls through to be handled out of EL2 */
 	}
 
+	if (cpus_have_const_cap(ARM64_HARDEN_BP_POST_GUEST_EXIT)) {
+		u32 midr = read_cpuid_id();
+
+		/* Apply BTAC predictors mitigation to all Falkor chips */
+		if ((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR_V1)
+			__qcom_hyp_sanitize_btac_predictors();
+	}
+
 	fp_enabled = __fpsimd_enabled();
 
 	__sysreg_save_guest_state(guest_ctxt);
arch/arm64/lib/clear_user.S +5 -5
index e88fb99c1561..21ba0b29621b 100644
@@ -21,7 +21,7 @@
 
 	.text
 
-/* Prototype: int __clear_user(void *addr, size_t sz)
+/* Prototype: int __arch_clear_user(void *addr, size_t sz)
  * Purpose  : clear some user memory
  * Params   : addr - user memory address to clear
  *          : sz   - number of bytes to clear
@@ -29,8 +29,8 @@
  *
  * Alignment fixed up by hardware.
  */
-ENTRY(__clear_user)
-	uaccess_enable_not_uao x2, x3
+ENTRY(__arch_clear_user)
+	uaccess_enable_not_uao x2, x3, x4
 	mov	x2, x1			// save the size for fixup return
 	subs	x1, x1, #8
 	b.mi	2f
@@ -50,9 +50,9 @@ uao_user_alternative 9f, strh, sttrh, wzr, x0, 2
 	b.mi	5f
 uao_user_alternative 9f, strb, sttrb, wzr, x0, 0
 5:	mov	x0, #0
-	uaccess_disable_not_uao x2
+	uaccess_disable_not_uao x2, x3
 	ret
-ENDPROC(__clear_user)
+ENDPROC(__arch_clear_user)
 
 	.section .fixup,"ax"
 	.align	2
arch/arm64/lib/copy_from_user.S +2 -2
index 4b5d826895ff..20305d485046 100644
@@ -64,10 +64,10 @@
 
 end	.req	x5
 ENTRY(__arch_copy_from_user)
-	uaccess_enable_not_uao x3, x4
+	uaccess_enable_not_uao x3, x4, x5
 	add	end, x0, x2
 #include "copy_template.S"
-	uaccess_disable_not_uao x3
+	uaccess_disable_not_uao x3, x4
 	mov	x0, #0				// Nothing to copy
 	ret
 ENDPROC(__arch_copy_from_user)
arch/arm64/lib/copy_in_user.S +5 -4
index b24a830419ad..54b75deb1d16 100644
@@ -64,14 +64,15 @@
 	.endm
 
 end	.req	x5
-ENTRY(raw_copy_in_user)
-	uaccess_enable_not_uao x3, x4
+
+ENTRY(__arch_copy_in_user)
+	uaccess_enable_not_uao x3, x4, x5
 	add	end, x0, x2
 #include "copy_template.S"
-	uaccess_disable_not_uao x3
+	uaccess_disable_not_uao x3, x4
 	mov	x0, #0
 	ret
-ENDPROC(raw_copy_in_user)
+ENDPROC(__arch_copy_in_user)
 
 	.section .fixup,"ax"
 	.align	2
arch/arm64/lib/copy_to_user.S +2 -2
index 351f0766f7a6..fda6172d6b88 100644
@@ -63,10 +63,10 @@
 
 end	.req	x5
 ENTRY(__arch_copy_to_user)
-	uaccess_enable_not_uao x3, x4
+	uaccess_enable_not_uao x3, x4, x5
 	add	end, x0, x2
 #include "copy_template.S"
-	uaccess_disable_not_uao x3
+	uaccess_disable_not_uao x3, x4
 	mov	x0, #0
 	ret
 ENDPROC(__arch_copy_to_user)
arch/arm64/mm/cache.S +2 -2
index 7f1dbe962cf5..91464e7f77cc 100644
@@ -49,7 +49,7 @@ ENTRY(flush_icache_range)
  *	- end     - virtual end address of region
  */
 ENTRY(__flush_cache_user_range)
-	uaccess_ttbr0_enable x2, x3
+	uaccess_ttbr0_enable x2, x3, x4
 	dcache_line_size x2, x3
 	sub	x3, x2, #1
 	bic	x4, x0, x3
@@ -72,7 +72,7 @@ USER(9f, ic	ivau, x4	)		// invalidate I line PoU
 	isb
 	mov	x0, #0
 1:
-	uaccess_ttbr0_disable x1
+	uaccess_ttbr0_disable x1, x2
 	ret
 9:
 	mov	x0, #-EFAULT
arch/arm64/mm/context.c +29 -19

107 lines not on this page · raw message

arch/arm64/mm/fault.c +34 -2
index b64958b23a7f..5edb706aacb0 100644
@@ -242,7 +242,7 @@ static inline bool is_permission_fault(unsigned int esr, struct pt_regs *regs,
 	if (fsc_type == ESR_ELx_FSC_PERM)
 		return true;
 
-	if (addr < USER_DS && system_uses_ttbr0_pan())
+	if (addr < TASK_SIZE && system_uses_ttbr0_pan())
 		return fsc_type == ESR_ELx_FSC_FAULT &&
 			(regs->pstate & PSR_PAN_BIT);
 
@@ -426,7 +426,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		mm_flags |= FAULT_FLAG_WRITE;
 	}
 
-	if (addr < USER_DS && is_permission_fault(esr, regs, addr)) {
+	if (addr < TASK_SIZE && is_permission_fault(esr, regs, addr)) {
 		/* regs->orig_addr_limit may be 0 if we entered from EL0 */
 		if (regs->orig_addr_limit == KERNEL_DS)
 			die("Accessing user space memory with fs=KERNEL_DS", regs, esr);
@@ -751,6 +751,29 @@ asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
 	arm64_notify_die("", regs, &info, esr);
 }
 
+asmlinkage void __exception do_el0_irq_bp_hardening(void)
+{
+	/* PC has already been checked in entry.S */
+	arm64_apply_bp_hardening();
+}
+
+asmlinkage void __exception do_el0_ia_bp_hardening(unsigned long addr,
+						   unsigned int esr,
+						   struct pt_regs *regs)
+{
+	/*
+	 * We've taken an instruction abort from userspace and not yet
+	 * re-enabled IRQs. If the address is a kernel address, apply
+	 * BP hardening prior to enabling IRQs and pre-emption.
+	 */
+	if (addr > TASK_SIZE)
+		arm64_apply_bp_hardening();
+
+	local_irq_enable();
+	do_mem_abort(addr, esr, regs);
+}
+
+
 /*
  * Handle stack alignment exceptions.
  */
@@ -761,6 +784,12 @@ asmlinkage void __exception do_sp_pc_abort(unsigned long addr,
 	struct siginfo info;
 	struct task_struct *tsk = current;
 
+	if (user_mode(regs)) {
+		if (instruction_pointer(regs) > TASK_SIZE)
+			arm64_apply_bp_hardening();
+		local_irq_enable();
+	}
+
 	if (show_unhandled_signals && unhandled_signal(tsk, SIGBUS))
 		pr_info_ratelimited("%s[%d]: %s exception: pc=%p sp=%p\n",
 				    tsk->comm, task_pid_nr(tsk),
@@ -820,6 +849,9 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
 	if (interrupts_enabled(regs))
 		trace_hardirqs_off();
 
+	if (user_mode(regs) && instruction_pointer(regs) > TASK_SIZE)
+		arm64_apply_bp_hardening();
+
 	if (!inf->fn(addr, esr, regs)) {
 		rv = 1;
 	} else {
arch/arm64/mm/mmu.c +35 -0
index f1eb15e0e864..fa20124c19d5 100644
@@ -117,6 +117,10 @@ static bool pgattr_change_is_safe(u64 old, u64 new)
 	if ((old | new) & PTE_CONT)
 		return false;
 
+	/* Transitioning from Global to Non-Global is safe */
+	if (((old ^ new) == PTE_NG) && (new & PTE_NG))
+		return true;
+
 	return ((old ^ new) & ~mask) == 0;
 }
 
@@ -525,6 +529,37 @@ static int __init parse_rodata(char *arg)
 }
 early_param("rodata", parse_rodata);
 
+#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+static int __init map_entry_trampoline(void)
+{
+	extern char __entry_tramp_text_start[];
+
+	pgprot_t prot = rodata_enabled ? PAGE_KERNEL_ROX : PAGE_KERNEL_EXEC;
+	phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
+
+	/* The trampoline is always mapped and can therefore be global */
+	pgprot_val(prot) &= ~PTE_NG;
+
+	/* Map only the text into the trampoline page table */
+	memset(tramp_pg_dir, 0, PGD_SIZE);
+	__create_pgd_mapping(tramp_pg_dir, pa_start, TRAMP_VALIAS, PAGE_SIZE,
+			     prot, pgd_pgtable_alloc, 0);
+
+	/* Map both the text and data into the kernel page table */
+	__set_fixmap(FIX_ENTRY_TRAMP_TEXT, pa_start, prot);
+	if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {
+		extern char __entry_tramp_data_start[];
+
+		__set_fixmap(FIX_ENTRY_TRAMP_DATA,
+			     __pa_symbol(__entry_tramp_data_start),
+			     PAGE_KERNEL_RO);
+	}
+
+	return 0;
+}
+core_initcall(map_entry_trampoline);
+#endif
+
 /*
  * Create fine-grained mappings for the kernel.
  */
arch/arm64/mm/proc.S +207 -16

178 lines not on this page · raw message

arch/arm64/xen/hypercall.S +2 -2
index 401ceb71540c..c5f05c4a4d00 100644

Lines of this file are not shown. View the raw message.

arch/mn10300/mm/misalignment.c +1 -1
index b39a388825ae..8ace89617c1c 100644

Lines of this file are not shown. View the raw message.

arch/openrisc/kernel/traps.c +5 -5
index 803e9e756f77..8d8437169b5e 100644

Lines of this file are not shown. View the raw message.

arch/powerpc/crypto/crc32c-vpmsum_glue.c +1 -0
index f058e0c3e4d4..fd1d6c83f0c0 100644

Lines of this file are not shown. View the raw message.

arch/powerpc/include/asm/hvcall.h +1 -0
index f0461618bf7b..eca3f9c68907 100644

Lines of this file are not shown. View the raw message.

arch/powerpc/kvm/Kconfig +1 -1
index b12b8eb39c29..648160334abf 100644

Lines of this file are not shown. View the raw message.

arch/powerpc/kvm/book3s_hv.c +12 -4
index 8d43cf205d34..f48e3379a18a 100644

Lines of this file are not shown. View the raw message.

arch/powerpc/kvm/book3s_hv_rmhandlers.S +20 -20
index c85ac5c83bd4..2b3194b9608f 100644

Lines of this file are not shown. View the raw message.

arch/s390/crypto/crc32-vx.c +3 -0
index 992e630c227b..6f4985f357c6 100644

Lines of this file are not shown. View the raw message.

arch/sh/kernel/traps_32.c +2 -1
index 57cff00cad17..b3770bb26211 100644

Lines of this file are not shown. View the raw message.

arch/sparc/crypto/crc32c_glue.c +1 -0
index d1064e46efe8..8aa664638c3c 100644

Lines of this file are not shown. View the raw message.

arch/x86/crypto/crc32-pclmul_glue.c +1 -0
index 27226df3f7d8..c8d9cdacbf10 100644

Lines of this file are not shown. View the raw message.

arch/x86/crypto/crc32c-intel_glue.c +1 -0
index c194d5717ae5..5773e1161072 100644

Lines of this file are not shown. View the raw message.

arch/x86/crypto/poly1305_glue.c +0 -1
index e32142bc071d..28c372003e44 100644

Lines of this file are not shown. View the raw message.

arch/x86/crypto/sha512-mb/sha512_mb_mgr_init_avx2.c +6 -4
index 36870b26067a..d08805032f01 100644

Lines of this file are not shown. View the raw message.

arch/x86/kvm/mmu.c +2 -1
index 0fce8d73403c..beb7f8795bc1 100644

Lines of this file are not shown. View the raw message.

arch/x86/kvm/vmx.c +3 -3
index 0ae4b1a86168..0ea909ca45c2 100644

Lines of this file are not shown. View the raw message.

arch/x86/kvm/x86.h +1 -0
index d0b95b7a90b4..6d112d8f799c 100644

Lines of this file are not shown. View the raw message.

arch/xtensa/include/asm/futex.h +10 -13
index eaaf1ebcc7a4..5bfbc1c401d4 100644

Lines of this file are not shown. View the raw message.

block/blk-core.c +9 -0
index 7b30bf10b1d4..f3750389e351 100644

Lines of this file are not shown. View the raw message.

crypto/ahash.c +28 -5
index 5e8666e6ccae..f75b5c1f7152 100644

Lines of this file are not shown. View the raw message.

crypto/algif_hash.c +11 -41

52 lines not on this page · raw message

crypto/crc32_generic.c +1 -0
index aa2a25fc7482..718cbce8d169 100644

Lines of this file are not shown. View the raw message.

crypto/crc32c_generic.c +1 -0
index 4c0a0e271876..372320399622 100644

Lines of this file are not shown. View the raw message.

crypto/cryptd.c +5 -5
index 0508c48a45c4..248f6ba41688 100644

Lines of this file are not shown. View the raw message.

crypto/mcryptd.c +5 -5
index eca04d3729b3..e0732d979e3b 100644

Lines of this file are not shown. View the raw message.

crypto/poly1305_generic.c +5 -12
index b1c2d57dc734..ba39eb308c79 100644

Lines of this file are not shown. View the raw message.

crypto/shash.c +21 -4
index e849d3ee2e27..5d732c6bb4b2 100644

Lines of this file are not shown. View the raw message.

drivers/acpi/nfit/core.c +3 -0
index dea0fb3d6f64..f14b4326e855 100644

Lines of this file are not shown. View the raw message.

drivers/acpi/sbshc.c +2 -2
index 2fa8304171e0..7a3431018e0a 100644

Lines of this file are not shown. View the raw message.

drivers/ata/ahci.c +21 -16
index 9f78bb03bb76..bc013f757d5d 100644

Lines of this file are not shown. View the raw message.

drivers/block/pktcdvd.c +5 -7
index 67974796c350..531a0915066b 100644

Lines of this file are not shown. View the raw message.

drivers/bluetooth/btsdio.c +9 -0
index c8e945d19ffe..20142bc77554 100644

Lines of this file are not shown. View the raw message.

drivers/bluetooth/btusb.c +6 -14
index 513a7a59d421..d54c3f6f728c 100644

Lines of this file are not shown. View the raw message.

drivers/char/ipmi/ipmi_dmi.c +4 -1
index 2059f79d669a..c3a23ec3e76f 100644

Lines of this file are not shown. View the raw message.

drivers/clocksource/timer-stm32.c +6 -1
index 8f2423789ba9..4bfeb9929ab2 100644

Lines of this file are not shown. View the raw message.

drivers/cpufreq/cpufreq-dt-platdev.c +8 -0
index a753c50e9e41..9e0aa767bbbe 100644

Lines of this file are not shown. View the raw message.

drivers/crypto/bfin_crc.c +2 -1
index a118b9bed669..bfbf8bf77f03 100644

Lines of this file are not shown. View the raw message.

drivers/crypto/caam/ctrl.c +6 -2
index 027e121c6f70..e1d4ae1153c4 100644

Lines of this file are not shown. View the raw message.

drivers/crypto/stm32/stm32_crc32.c +2 -0
index 090582baecfe..8f09b8430893 100644

Lines of this file are not shown. View the raw message.

drivers/dma/dmatest.c +1 -1
index ec5f9d2bc820..80cc2be6483c 100644

Lines of this file are not shown. View the raw message.

drivers/edac/octeon_edac-lmc.c +1 -0
index 9c1ffe3e912b..aeb222ca3ed1 100644

Lines of this file are not shown. View the raw message.

drivers/firmware/psci.c +52 -5

57 lines not on this page · raw message

drivers/gpu/drm/i915/intel_display.c +157 -146

303 lines not on this page · raw message

drivers/gpu/drm/i915/intel_dp.c +6 -0
index 09f274419eea..76cf68745870 100644

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/i915/intel_drv.h +2 -0
index 79fbaf78f604..10ae9681f02d 100644

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/i915/intel_sprite.c +83 -0

83 lines not on this page · raw message

drivers/hid/hid-core.c +11 -1
index 330ca983828b..5744eb729d24 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/ascot2e.c +3 -1
index 0ee0df53b91b..79d5d89bc95e 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/cxd2841er.c +3 -1
index 48ee9bc00c06..ccbd84fd6428 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/helene.c +3 -1
index 4bf5a551ba40..2ab8d83e5576 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/horus3a.c +3 -1
index 68d759c4c52e..5c8b405f2ddc 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/itd1000.c +3 -2
index 5bb1e73a10b4..ce7c443d3eac 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/mt312.c +4 -1
index 961b9a2508e0..0b23cbc021b8 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/stb0899_drv.c +2 -1
index 02347598277a..db5dde3215f0 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/stb6100.c +4 -2
index 17a955d0031b..75509bec66e4 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/stv0367.c +3 -1
index f3529df8211d..1a726196c126 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/stv090x.c +3 -1
index 7ef469c0c866..2695e1eb6d9c 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/stv6110x.c +3 -1
index 66eba38f1014..7e8e01389c55 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/ts2020.c +2 -2
index 931e5c98da8a..b879e1571469 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/zl10039.c +3 -1
index 623355fc2666..3208b866d1cb 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/dvb-usb-v2/lmedm04.c +24 -15
index 5e320fa4a795..be26c029546b 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/dvb-usb/cxusb.c +2 -0
index 37dea0adc695..cfe86b4864b3 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/dvb-usb/dib0700_devices.c +1 -0
index 92098c1b78e5..9be1e658ef47 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/hdpvr/hdpvr-core.c +15 -11
index dbe29c6c4d8b..1e8cbaf36896 100644

Lines of this file are not shown. View the raw message.

drivers/media/v4l2-core/v4l2-compat-ioctl32.c +607 -425

1,032 lines not on this page · raw message

drivers/media/v4l2-core/v4l2-ioctl.c +58 -87

145 lines not on this page · raw message

drivers/mtd/nand/brcmnand/brcmnand.c +3 -10
index e0eb51d8c012..edf24c148fa6 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/nand/nand_base.c +4 -1
index 3f1d806e590a..a0b0302aea14 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/nand/sunxi_nand.c +7 -1
index 82244be3e766..958974821582 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/ubi/block.c +26 -16

42 lines not on this page · raw message

drivers/mtd/ubi/vmt.c +10 -5
index 85237cf661f9..3fd8d7ff7a02 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/ubi/wl.c +57 -20

77 lines not on this page · raw message

drivers/pinctrl/intel/pinctrl-intel.c +15 -8
index 71df0f70b61f..72b4527d690f 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/pinctrl-mcp23s08.c +4 -4
index 9c950bbf07ba..447763aad815 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/pinctrl-sx150x.c +26 -14
index 7450f5118445..70a0228f4e7f 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/cxlflash/main.c +1 -0
index 76b8b7eed0c0..0b6467206f8e 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/hosts.c +6 -0
index fe3a0da3ec97..57bf43e34863 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/lpfc/lpfc_init.c +51 -33

84 lines not on this page · raw message

drivers/scsi/scsi_error.c +16 -2
index dab876c65473..fa504ba83ade 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/scsi_lib.c +28 -11
index 635cfa1f2ace..0d3696e9dddd 100644

Lines of this file are not shown. View the raw message.

drivers/staging/lustre/lnet/libcfs/linux/linux-crypto-adler.c +1 -0
index db0572733712..ab30a0f5129c 100644

Lines of this file are not shown. View the raw message.

drivers/watchdog/Kconfig +1 -1
index c722cbfdc7e6..3ece1335ba84 100644

Lines of this file are not shown. View the raw message.

drivers/watchdog/gpio_wdt.c +2 -1
index cb66c2f99ff1..7a6279daa8b9 100644

Lines of this file are not shown. View the raw message.

drivers/watchdog/imx2_wdt.c +15 -5
index 4874b0f18650..518dfa1047cb 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/inode.c +9 -2
index c71afd424900..5eaedff28a32 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/raid56.c +5 -6
index 24a62224b24b..6154825c30e1 100644

Lines of this file are not shown. View the raw message.

fs/cifs/cifsencrypt.c +1 -2
index 68abbb0db608..f2b0a7f124da 100644

Lines of this file are not shown. View the raw message.

fs/cifs/connect.c +3 -3
index 0bfc2280436d..f7db2fedfa8c 100644

Lines of this file are not shown. View the raw message.

fs/cifs/file.c +12 -14
index 92fdf9c35de2..7d6539a04fac 100644

Lines of this file are not shown. View the raw message.

fs/cifs/misc.c +4 -10
index eea93ac15ef0..a0dbced4a45c 100644

Lines of this file are not shown. View the raw message.

fs/cifs/smb2pdu.c +1 -2
index 01346b8b6edb..66af1f8a13cc 100644

Lines of this file are not shown. View the raw message.

fs/devpts/inode.c +2 -2
index 7eae33ffa3fc..e31d6ed3ec32 100644

Lines of this file are not shown. View the raw message.

fs/kernfs/file.c +1 -1
index 9698e51656b1..d8f49c412f50 100644

Lines of this file are not shown. View the raw message.

fs/nfs/direct.c +1 -3
index d2972d537469..8c10b0562e75 100644

Lines of this file are not shown. View the raw message.

fs/nfs/filelayout/filelayout.c +1 -3
index 508126eb49f9..3db2b7464748 100644

Lines of this file are not shown. View the raw message.

fs/nfs/io.c +1 -1
index 20fef85d2bb1..9034b4926909 100644

Lines of this file are not shown. View the raw message.

fs/nfs/nfs4idmap.c +5 -1
index 30426c1a1bbd..22dc30a679a0 100644

Lines of this file are not shown. View the raw message.

fs/nfs/nfs4xdr.c +38 -26

64 lines not on this page · raw message

fs/nfs/pnfs.c +2 -2
index 3bcd669a3152..5f2f852ef506 100644

Lines of this file are not shown. View the raw message.

fs/nfs/write.c +2 -0
index de325804941d..76da415be39a 100644

Lines of this file are not shown. View the raw message.

fs/overlayfs/readdir.c +14 -3
index d94a51dc4e32..7fa7d68baa6d 100644

Lines of this file are not shown. View the raw message.

fs/pipe.c +10 -5
index f0f4ab36c444..8ef7d7bef775 100644

Lines of this file are not shown. View the raw message.

fs/proc/kcore.c +5 -13
index 4bc85cb8be6a..e8a93bc8285d 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/dir.c +4 -6
index 417fe0b29f23..ef820f803176 100644

Lines of this file are not shown. View the raw message.

include/crypto/hash.h +24 -10
index b5727bcd2336..74827781593c 100644

Lines of this file are not shown. View the raw message.

include/crypto/internal/hash.h +2 -0
index c2bae8da642c..27040a46d50a 100644

Lines of this file are not shown. View the raw message.

include/crypto/poly1305.h +0 -2
index c65567d01e8e..f718a19da82f 100644

Lines of this file are not shown. View the raw message.

include/kvm/arm_psci.h new file +51 -0

51 lines not on this page · raw message

include/linux/arm-smccc.h +163 -2

165 lines not on this page · raw message

include/linux/crypto.h +8 -0
index 84da9978e951..cc36484d29e1 100644

Lines of this file are not shown. View the raw message.

include/linux/mtd/map.h +61 -69

130 lines not on this page · raw message

include/linux/nfs4.h +8 -4
index 47adac640191..57ffaa20d564 100644

Lines of this file are not shown. View the raw message.

include/linux/psci.h +14 -0
index bdea1cb5e1db..347077cf19c6 100644

Lines of this file are not shown. View the raw message.

include/scsi/scsi_host.h +2 -0
index a8b7bf879ced..1a1df0d21ee3 100644

Lines of this file are not shown. View the raw message.

include/uapi/linux/psci.h +3 -0
index 760e52a9640f..b3bcabe380da 100644

Lines of this file are not shown. View the raw message.

kernel/async.c +12 -8
index 2cbd3dd5940d..a893d6170944 100644

Lines of this file are not shown. View the raw message.

kernel/rcu/update.c +2 -0
index 5033b66d2753..7a577bd989a4 100644

Lines of this file are not shown. View the raw message.

kernel/relay.c +0 -1
index 39a9dfc69486..55da824f4adc 100644

Lines of this file are not shown. View the raw message.

kernel/sched/rt.c +15 -9
index 7464c5c4de46..298f62b8662d 100644

Lines of this file are not shown. View the raw message.

kernel/sched/sched.h +2 -0
index b732e779fe7d..307c35d33660 100644

Lines of this file are not shown. View the raw message.

kernel/sched/topology.c +13 -0
index 093f2ceba2e2..659e075ef70b 100644

Lines of this file are not shown. View the raw message.

kernel/sched/wait.c +1 -1
index 98feab7933c7..929ecb7d6b78 100644

Lines of this file are not shown. View the raw message.

kernel/trace/ftrace.c +0 -1
index 8319e09e15b9..7379bcf3baa0 100644

Lines of this file are not shown. View the raw message.

lib/Kconfig.debug +1 -1
index ff21b4dbb392..00cb02daeddd 100644

Lines of this file are not shown. View the raw message.

lib/Kconfig.kasan +11 -0
index bd38aab05929..3d35d062970d 100644

Lines of this file are not shown. View the raw message.

lib/ubsan.c +39 -11

50 lines not on this page · raw message

lib/ubsan.h +14 -0
index 88f23557edbe..7e30b26497e0 100644

Lines of this file are not shown. View the raw message.

net/dccp/proto.c +5 -0
index b68168fcc06a..9d43c1f40274 100644

Lines of this file are not shown. View the raw message.

scripts/Makefile.kasan +5 -0
index 1ce7115aa499..97a56c0b565a 100644

Lines of this file are not shown. View the raw message.

scripts/Makefile.lib +1 -1
index 04b5633df1cf..0b46136a91a8 100644

Lines of this file are not shown. View the raw message.

sound/soc/intel/skylake/skl-nhlt.c +2 -1
index e7d766d56c8e..55859c5b456f 100644

Lines of this file are not shown. View the raw message.

sound/soc/rockchip/rockchip_i2s.c +6 -0
index b6590467fd14..66fc13a2396a 100644

Lines of this file are not shown. View the raw message.

tools/objtool/check.c +39 -2

41 lines not on this page · raw message

tools/objtool/check.h +1 -0
index dbadb304a410..23a1d065cae1 100644

Lines of this file are not shown. View the raw message.

virt/kvm/arm/arm.c +9 -2
index 9a07ee94a230..8b6c42dc1aa9 100644

Lines of this file are not shown. View the raw message.

virt/kvm/arm/psci.c +119 -24

143 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.