Linux 4.15.4
Greg KH
maintainerI'm announcing the release of the 4.15.4 kernel.
All users of the 4.15 kernel series must upgrade.
The updated 4.15.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.15.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 | 2 Documentation/devicetree/bindings/media/cec-gpio.txt | 6 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 | 46 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 | 22 arch/arm64/include/asm/cpucaps.h | 5 arch/arm64/include/asm/cputype.h | 9 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/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 | 3 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 | 2 arch/arm64/kernel/cpu_errata.c | 239 ++ arch/arm64/kernel/cpufeature.c | 138 + arch/arm64/kernel/entry.S | 228 +- arch/arm64/kernel/head.S | 2 arch/arm64/kernel/process.c | 12 arch/arm64/kernel/sleep.S | 2 arch/arm64/kernel/vmlinux.lds.S | 22 arch/arm64/kvm/handle_exit.c | 14 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 | 224 ++ 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/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/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/crypto/talitos.c | 4 drivers/dma/dmatest.c | 2 drivers/edac/octeon_edac-lmc.c | 1 drivers/firmware/psci.c | 57 drivers/gpu/drm/i915/i915_pci.c | 94 drivers/gpu/drm/i915/intel_dp.c | 6 drivers/hid/hid-core.c | 12 drivers/media/dvb-core/dvb_frontend.c | 4 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/platform/vivid/vivid-core.h | 1 drivers/media/platform/vivid/vivid-ctrls.c | 35 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/perf/arm_spe_pmu.c | 9 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/ssb/Kconfig | 2 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/afs/addr_list.c | 13 fs/afs/rotate.c | 20 fs/afs/server_list.c | 3 fs/afs/vlclient.c | 10 fs/afs/volume.c | 47 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/nfsd/nfs4state.c | 1 fs/overlayfs/inode.c | 39 fs/overlayfs/readdir.c | 17 fs/overlayfs/super.c | 38 fs/overlayfs/util.c | 4 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/irq/autoprobe.c | 2 kernel/irq/chip.c | 6 kernel/irq/internals.h | 2 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/trace/ftrace.c | 1 lib/Kconfig.debug | 2 lib/Kconfig.kasan | 11 lib/ubsan.c | 50 lib/ubsan.h | 14 scripts/Makefile.kasan | 5 scripts/Makefile.lib | 2 sound/soc/intel/skylake/skl-nhlt.c | 3 sound/soc/rockchip/rockchip_i2s.c | 6 sound/soc/soc-acpi.c | 8 sound/soc/soc-compress.c | 8 tools/objtool/check.c | 41 tools/objtool/check.h | 1 virt/kvm/arm/arm.c | 11 virt/kvm/arm/psci.c | 143 + 216 files changed, 3789 insertions(+), 1623 deletions(-)
Amir Goldstein (5):
ovl: force r/o mount when index dir creation fails
ovl: fix failure to fsync lower dir
ovl: take mnt_want_write() for work/index dir setup
ovl: take mnt_want_write() for removing impure xattr
ovl: hash directory inodes for fsnotify
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
Charles Keepax (1):
ASoC: compress: Correct handling of copy callback
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
David Howells (4):
afs: Add missing afs_put_cell()
afs: Need to clear responded flag in addr cursor
afs: Fix missing cursor clearance
afs: Fix server list handling
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.15.4
Hans Verkuil (14):
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
media: dt-bindings/media/cec-gpio.txt: mention the CEC/HPD max voltages
media: vivid: fix module load error when enabling fb and no_error_inj=1
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
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
LEROY Christophe (1):
crypto: talitos - fix Kernel Oops on hashing an empty file
Lionel Landwerlin (1):
Revert "drm/i915: mark all device info struct with __initconst"
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 (3):
media: dvb_frontend: be sure to init dvb_frontend_handle_ioctl() return code
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
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
Nikolay Borisov (1):
btrfs: Handle btrfs_set_extent_delalloc failure in fixup worker
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 mappingPeter Zijlstra (1):
objtool: Fix switch-table detection
Pierre-Louis Bossart (1):
ASoC: acpi: fix machine driver selection based on quirk
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 (1):
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
Sven Joachim (1):
ssb: Do not disable PCI host on non-Mips
Takashi Iwai (1):
ASoC: skl: Fix kernel warning due to zero NHTL entry
Thomas Gleixner (1):
genirq: Make legacy autoprobing work again
Tigran Mkrtchyan (1):
nfs41: do not return ENOMEM on LAYOUTUNAVAILABLE
Toshi Kani (1):
acpi, nfit: fix register dimm error handling
Trond Myklebust (4):
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
nfsd: Detect unhashed stids in nfsd4_verify_open_stid()
Ulf Magnusson (1):
KVM: PPC: Book3S PR: Fix broken select due to misspelling
Uma Krishnan (1):
scsi: cxlflash: Reset command ioasc
Will Deacon (41):
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
perf: arm_spe: Fail device probe when arm64_kernel_unmapped_at_el0()
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
Greg KH
maintainerDocumentation/arm64/silicon-errata.txt +1 -1
@@ -72,7 +72,7 @@ stable kernels. | Hisilicon | Hip0{6,7} | #161010701 | N/A | | Hisilicon | Hip07 | #161600802 | HISILICON_ERRATUM_161600802 | | | | | | -| 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 |
Documentation/devicetree/bindings/media/cec-gpio.txt +5 -1
@@ -4,6 +4,10 @@ The HDMI CEC GPIO module supports CEC implementations where the CEC line is hooked up to a pull-up GPIO line and - optionally - the HPD line is hooked up to another GPIO line. +Please note: the maximum voltage for the CEC line is 3.63V, for the HPD +line it is 5.3V. So you may need some sort of level conversion circuitry +when connecting them to a GPIO line. + Required properties: - compatible: value must be "cec-gpio". - cec-gpios: gpio that the CEC line is connected to. The line should be
@@ -21,7 +25,7 @@ the following property is optional: Example for the Raspberry Pi 3 where the CEC line is connected to pin 26 aka BCM7 aka CE1 on the GPIO pin header and the HPD line is -connected to pin 11 aka BCM17: +connected to pin 11 aka BCM17 (some level shifter is needed for this!): #include <dt-bindings/gpio/gpio.h>
Makefile +3 -2
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 15 -SUBLEVEL = 3 +SUBLEVEL = 4 EXTRAVERSION = NAME = Fearless Coyote
@@ -432,7 +432,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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -301,4 +301,10 @@ int kvm_arm_vcpu_arch_has_attr(struct kvm_vcpu *vcpu,/* All host FP/SIMD state is restored on guest exit, so nothing to save: */ static inline void kvm_fpsimd_flush_cpu_state (void ) {} +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
@@ -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
@@ -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
@@ -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 +34 -12
60 lines not on this page · raw message
arch/arm64/boot/dts/marvell/armada-7040-db.dts +6 -0
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 +20 -34
72 lines not on this page · raw message
arch/arm64/include/asm/barrier.h +22 -0
@@ -32,6 +32,7 @@#define dsb (opt) asm volatile("dsb " #opt : : : "memory")#define psb_csync () asm volatile("hint #17" : : : "memory") +#define csdb () asm volatile("hint #20" : : : "memory")#define mb () dsb(sy)#define rmb () dsb(ld)
@@ -40,6 +41,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; + + asmvolatile ( +" 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
@@ -41,7 +41,10 @@#define ARM64_WORKAROUND_CAVIUM_30115 20#define ARM64_HAS_DCPOP 21#define ARM64_SVE 22 +#define ARM64_UNMAP_KERNEL_AT_EL0 23 +#define ARM64_HARDEN_BRANCH_PREDICTOR 24 +#define ARM64_HARDEN_BP_POST_GUEST_EXIT 25 -#define ARM64_NCAPS 23 +#define ARM64_NCAPS 26#endif /* __ASM_CPUCAPS_H */
arch/arm64/include/asm/cputype.h +9 -0
@@ -79,28 +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
@@ -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
@@ -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
@@ -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 (); asmvolatile ("// futex_atomic_cmpxchg_inatomic\n" " prfm pstl1strm, %2\n"
arch/arm64/include/asm/kvm_asm.h +2 -0
@@ -68,6 +68,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
@@ -396,4 +396,9 @@ static inline void kvm_fpsimd_flush_cpu_state(void) sve_flush_cpu_state(); } +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
@@ -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
@@ -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/mmu.h +48 -0
64 lines not on this page · raw message
arch/arm64/include/asm/mmu_context.h +9 -3
@@ -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
@@ -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
@@ -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
@@ -683,6 +683,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
@@ -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 +3 -0
@@ -21,6 +21,9 @@#define TASK_SIZE_64 (UL(1) << VA_BITS) +#define KERNEL_DS UL(-1) +#define USER_DS (TASK_SIZE_64 - 1) +#ifndef __ASSEMBLY__/*
arch/arm64/include/asm/sysreg.h +2 -0
@@ -437,6 +437,8 @@#define ID_AA64ISAR1_DPB_SHIFT 0/* id_aa64pfr0 */ +#define ID_AA64PFR0_CSV3_SHIFT 60 +#define ID_AA64PFR0_CSV2_SHIFT 56#define ID_AA64PFR0_SVE_SHIFT 32#define ID_AA64PFR0_GIC_SHIFT 24#define ID_AA64PFR0_ASIMD_SHIFT 20
arch/arm64/include/asm/tlbflush.h +14 -2
@@ -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
@@ -53,6 +53,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
@@ -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
@@ -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 +1 -1
@@ -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
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/entry.S +194 -34
352 lines not on this page · raw message
arch/arm64/kernel/head.S +1 -1
@@ -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
arch/arm64/kernel/process.c +5 -7
@@ -370,16 +370,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/sleep.S +1 -1
@@ -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
@@ -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
@@ -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> #include <asm/debug-monitors.h> #define CREATE_TRACE_POINTS
@@ -43,7 +44,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 ;
@@ -54,7 +55,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/entry.S +12 -0
@@ -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
@@ -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
@@ -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>
@@ -52,7 +55,7 @@ static void __hyp_text __activate_traps_vhe(void) val &= ~(CPACR_EL1_FPEN |CPACR_EL1_ZEN );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)
@@ -393,6 +396,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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -240,7 +240,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 );
@@ -414,7 +414,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);
@@ -707,6 +707,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); +} + + asmlinkage void __exception do_sp_pc_abort(unsigned long addr,unsigned int esr,struct pt_regs *regs)
@@ -714,6 +737,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),
@@ -773,6 +802,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
@@ -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 +208 -16
264 lines not on this page · raw message
arch/arm64/xen/hypercall.S +2 -2
@@ -101,12 +101,12 @@ ENTRY(privcmd_call) * need the explicit uaccess_enable/disable if the TTBR0 PAN emulation * is enabled (it implies that hardware UAO and PAN disabled). */ - uaccess_ttbr0_enable x6, x7 + uaccess_ttbr0_enable x6, x7, x8 hvc XEN_IMM /* * Disable userspace access from kernel once the hyp call completed. */ - uaccess_ttbr0_disable x6 + uaccess_ttbr0_disable x6, x7 ret ENDPROC(privcmd_call);
arch/mn10300/mm/misalignment.c +1 -1
@@ -437,7 +437,7 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code) info.si_signo =SIGSEGV ; info.si_errno =0 ; - info.si_code =0 ; + info.si_code =SEGV_MAPERR ; info.si_addr = (void *) regs->pc;
Lines of this file are not shown. View the raw message.
arch/powerpc/crypto/crc32c-vpmsum_glue.c +1 -0
Lines of this file are not shown. View the raw message.
arch/powerpc/kvm/book3s_hv_rmhandlers.S +20 -20
Lines of this file are not shown. View the raw message.
arch/x86/crypto/sha512-mb/sha512_mb_mgr_init_avx2.c +6 -4
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
drivers/firmware/psci.c +52 -5
57 lines not on this page · raw message
drivers/gpu/drm/i915/i915_pci.c +47 -47
94 lines not on this page · raw message
drivers/media/dvb-frontends/cxd2841er.c +3 -1
Lines of this file are not shown. View the raw message.
drivers/media/dvb-frontends/stb0899_drv.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/vivid/vivid-core.h +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/vivid/vivid-ctrls.c +29 -6
Lines of this file are not shown. View the raw message.
drivers/media/usb/dvb-usb-v2/lmedm04.c +24 -15
Lines of this file are not shown. View the raw message.
drivers/media/usb/dvb-usb/dib0700_devices.c +1 -0
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/ubi/block.c +26 -16
42 lines not on this page · raw message
drivers/mtd/ubi/wl.c +57 -20
77 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_init.c +51 -33
84 lines not on this page · raw message
drivers/staging/lustre/lnet/libcfs/linux/linux-crypto-adler.c +1 -0
Lines of this file are not shown. View the raw message.
fs/afs/volume.c +3 -44
47 lines not on this page · raw message
fs/nfs/nfs4xdr.c +38 -26
64 lines not on this page · 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/mtd/map.h +61 -69
130 lines not on this page · raw message
lib/ubsan.c +39 -11
50 lines not on this page · raw message
tools/objtool/check.c +39 -2
41 lines not on this page · 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.