Linux 4.14.11
Greg KH
maintainerI'm announcing the release of the 4.14.11 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/admin-guide/kernel-parameters.txt | 8 Documentation/x86/x86_64/mm.txt | 5 Makefile | 5 arch/sparc/lib/hweight.S | 4 arch/x86/boot/compressed/pagetable.c | 3 arch/x86/entry/calling.h | 145 +++++++ arch/x86/entry/entry_64.S | 48 ++ arch/x86/entry/entry_64_compat.S | 24 + arch/x86/entry/vsyscall/vsyscall_64.c | 6 arch/x86/events/intel/ds.c | 130 ++++--- arch/x86/events/perf_event.h | 23 - arch/x86/include/asm/cpu_entry_area.h | 13 arch/x86/include/asm/cpufeatures.h | 4 arch/x86/include/asm/desc.h | 2 arch/x86/include/asm/disabled-features.h | 8 arch/x86/include/asm/intel_ds.h | 36 + arch/x86/include/asm/mmu_context.h | 59 ++- arch/x86/include/asm/pgalloc.h | 11 arch/x86/include/asm/pgtable.h | 30 + arch/x86/include/asm/pgtable_64.h | 92 ++++ arch/x86/include/asm/pgtable_64_types.h | 8 arch/x86/include/asm/processor-flags.h | 5 arch/x86/include/asm/processor.h | 23 - arch/x86/include/asm/pti.h | 14 arch/x86/include/asm/tlbflush.h | 208 +++++++++-- arch/x86/include/asm/vsyscall.h | 1 arch/x86/include/uapi/asm/processor-flags.h | 7 arch/x86/kernel/asm-offsets.c | 4 arch/x86/kernel/cpu/common.c | 9 arch/x86/kernel/dumpstack.c | 6 arch/x86/kernel/head_64.S | 30 + arch/x86/kernel/ldt.c | 151 ++++++++ arch/x86/kernel/machine_kexec_32.c | 4 arch/x86/kernel/smpboot.c | 9 arch/x86/kernel/tls.c | 11 arch/x86/kernel/traps.c | 2 arch/x86/kernel/vmlinux.lds.S | 8 arch/x86/mm/Makefile | 7 arch/x86/mm/cpu_entry_area.c | 27 + arch/x86/mm/debug_pagetables.c | 80 ++++ arch/x86/mm/dump_pagetables.c | 43 ++ arch/x86/mm/init.c | 80 ++-- arch/x86/mm/pgtable.c | 5 arch/x86/mm/pti.c | 387 +++++++++++++++++++++ arch/x86/mm/tlb.c | 58 +++ arch/x86/platform/efi/efi_64.c | 5 block/blk-map.c | 38 +- block/bounce.c | 6 drivers/android/binder.c | 44 +- drivers/base/cacheinfo.c | 13 drivers/gpio/gpiolib-acpi.c | 2 drivers/gpio/gpiolib-devprop.c | 17 drivers/gpio/gpiolib-of.c | 3 drivers/gpio/gpiolib.h | 3 drivers/infiniband/core/security.c | 3 drivers/infiniband/core/uverbs_cmd.c | 4 drivers/infiniband/core/verbs.c | 3 drivers/infiniband/hw/cxgb4/cq.c | 6 drivers/infiniband/hw/hfi1/hfi.h | 1 drivers/infiniband/hw/hfi1/pcie.c | 30 - drivers/infiniband/hw/mlx5/main.c | 8 drivers/infiniband/hw/mlx5/mlx5_ib.h | 4 drivers/net/dsa/bcm_sf2.c | 2 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 drivers/net/ethernet/broadcom/tg3.c | 4 drivers/net/ethernet/freescale/fec_main.c | 6 drivers/net/ethernet/marvell/mvmdio.c | 3 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 4 drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 48 +- drivers/net/ethernet/mellanox/mlx5/core/fpga/sdk.c | 6 drivers/net/ethernet/mellanox/mlx5/core/main.c | 75 +++- drivers/net/ethernet/mellanox/mlx5/core/qp.c | 4 drivers/net/ethernet/mellanox/mlx5/core/rl.c | 22 - drivers/net/ethernet/mellanox/mlx5/core/vxlan.c | 64 +-- drivers/net/ethernet/mellanox/mlx5/core/vxlan.h | 1 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 18 drivers/net/ethernet/sfc/tx.c | 5 drivers/net/phy/marvell.c | 2 drivers/net/phy/micrel.c | 1 drivers/net/phy/phylink.c | 2 drivers/net/usb/qmi_wwan.c | 1 drivers/net/vxlan.c | 5 drivers/phy/tegra/xusb.c | 58 +-- drivers/s390/net/qeth_core.h | 6 drivers/s390/net/qeth_core_main.c | 15 drivers/s390/net/qeth_l3.h | 2 drivers/s390/net/qeth_l3_main.c | 36 + drivers/s390/net/qeth_l3_sys.c | 75 ++-- drivers/scsi/osd/osd_initiator.c | 4 drivers/staging/android/ion/ion.c | 4 drivers/target/target_core_pscsi.c | 4 drivers/tty/n_tty.c | 4 drivers/tty/tty_buffer.c | 2 drivers/usb/chipidea/ci_hdrc_msm.c | 2 drivers/usb/core/config.c | 2 drivers/usb/core/quirks.c | 6 drivers/usb/host/xhci-pci.c | 3 drivers/usb/serial/ftdi_sio.c | 1 drivers/usb/serial/ftdi_sio_ids.h | 6 drivers/usb/serial/option.c | 17 drivers/usb/serial/qcserial.c | 3 drivers/usb/usbip/stub_dev.c | 3 drivers/usb/usbip/stub_main.c | 5 drivers/usb/usbip/stub_rx.c | 7 drivers/usb/usbip/stub_tx.c | 6 drivers/usb/usbip/usbip_common.c | 16 drivers/usb/usbip/vhci_hcd.c | 12 drivers/usb/usbip/vhci_rx.c | 23 - drivers/usb/usbip/vhci_tx.c | 3 include/linux/blkdev.h | 23 + include/linux/cpuhotplug.h | 2 include/linux/ipv6.h | 3 include/linux/mlx5/driver.h | 1 include/linux/mlx5/mlx5_ifc.h | 8 include/linux/pti.h | 11 include/linux/ptr_ring.h | 9 include/linux/tcp.h | 3 include/linux/tick.h | 1 include/linux/timer.h | 4 include/net/ip.h | 1 include/net/tcp.h | 2 init/main.c | 3 kernel/cpu.c | 4 kernel/sched/cpufreq_schedutil.c | 2 kernel/time/tick-sched.c | 32 + kernel/time/timer.c | 35 + kernel/trace/ring_buffer.c | 12 kernel/trace/trace.c | 13 net/bridge/br_netlink.c | 11 net/core/net_namespace.c | 2 net/core/skbuff.c | 17 net/ipv4/devinet.c | 2 net/ipv4/fib_frontend.c | 9 net/ipv4/fib_semantics.c | 8 net/ipv4/igmp.c | 44 +- net/ipv4/ip_tunnel.c | 4 net/ipv4/raw.c | 15 net/ipv4/tcp.c | 1 net/ipv4/tcp_bbr.c | 12 net/ipv4/tcp_input.c | 20 - net/ipv4/tcp_ipv4.c | 2 net/ipv4/tcp_rate.c | 10 net/ipv4/tcp_timer.c | 2 net/ipv6/addrconf.c | 2 net/ipv6/af_inet6.c | 1 net/ipv6/ip6_gre.c | 57 +-- net/ipv6/ip6_output.c | 12 net/ipv6/ip6_tunnel.c | 2 net/ipv6/ipv6_sockglue.c | 1 net/ipv6/mcast.c | 25 - net/ipv6/route.c | 19 - net/ipv6/tcp_ipv6.c | 2 net/netlink/af_netlink.c | 3 net/openvswitch/flow.c | 15 net/rds/send.c | 3 net/sched/sch_ingress.c | 9 net/sctp/socket.c | 10 net/tipc/socket.c | 2 security/Kconfig | 11 sound/hda/hdac_i915.c | 2 sound/pci/hda/patch_conexant.c | 29 + sound/pci/hda/patch_realtek.c | 14 sound/soc/codecs/da7218.c | 2 sound/soc/codecs/msm8916-wcd-analog.c | 2 sound/soc/codecs/msm8916-wcd-digital.c | 4 sound/soc/codecs/tlv320aic31xx.h | 2 sound/soc/codecs/twl4030.c | 4 sound/soc/codecs/wm_adsp.c | 12 sound/soc/fsl/fsl_ssi.c | 18 tools/testing/selftests/x86/ldt_gdt.c | 3 tools/usb/usbip/src/utils.c | 9 172 files changed, 2568 insertions(+), 671 deletions(-)
Alexey Kodanev (2):
ip6_gre: fix device features for ioctl setup
vxlan: restore dev->mtu setting based on lower device
Andrew F. Davis (1):
ASoC: tlv320aic31xx: Fix GPIO1 register definition
Andy Lutomirski (7):
x86/mm/pti: Add functions to clone kernel PMDs x86/mm/pti: Share cpu_entry_area with user space page tables x86/mm/pti: Map ESPFIX into user space
x86/mm/64: Make a full PGD-entry size hole in the memory map x86/pti: Put the LDT in its own PGD if PTI is on x86/pti: Map the vsyscall page if needed x86/espfix/64: Fix espfix double-fault handling on 5-level systems
Anna-Maria Gleixner (1):
timers: Use deferrable base independent of base::nohz_active
Avinash Repaka (1):
RDS: Check cmsg_len before dereferencing CMSG_DATA
Ben Hutchings (1):
ASoC: wm_adsp: Fix validation of firmware and coeff lengths
Bert Kenward (1):
sfc: pass valid pointers from efx_enqueue_unwind
Borislav Petkov (2):
x86/pti: Add the pti= cmdline option and documentation x86/mm/dump_pagetables: Add page table directory to the debugfs VFS hierarchy
Brian King (1):
tg3: Fix rx hang on MTU change with 5717/5719
Calvin Owens (1):
bnxt_en: Fix sources of spurious netpoll warnings
Christoph Paasch (1):
tcp md5sig: Use skb's saddr when replying to an incoming segment
Christophe Leroy (1):
gpio: fix "gpio-line-names" property retrieval
Daniel Thompson (1):
usb: xhci: Add XHCI_TRUST_TX_LENGTH for Renesas uPD720201
Daniele Palmas (1):
USB: serial: option: add support for Telit ME910 PID 0x1101
Dave Hansen (10):
x86/mm/pti: Disable global pages if PAGE_TABLE_ISOLATION=y x86/mm/pti: Prepare the x86/entry assembly code for entry/exit CR3 switching x86/mm/pti: Add mapping helper functions
x86/mm/pti: Allow NX poison to be set in p4d/pgd
x86/mm/pti: Allocate a separate user PGD
x86/mm/pti: Populate user PGD
x86/mm: Allow flushing for future ASID switches
x86/mm: Abstract switching CR3
x86/mm: Use INVPCID for __native_flush_tlb_single()
x86/mm/pti: Add Kconfig
Dmitry Fleytman Dmitry Fleytman (1):
usb: Add device quirk for Logitech HD Pro Webcam C925e
Eran Ben Elisha (1):
net/mlx5: Fix rate limit packet pacing naming and struct
Eric Dumazet (3):
ipv4: igmp: guard against silly MTU values
ipv6: mcast: better catch silly mtu values
tcp: refresh tcp_mstamp from timers callbacks
Eric Garver (1):
openvswitch: Fix pop_vlan action for double tagged frames
Eric W. Biederman (1):
net: Fix double free and memory corruption in get_net_ns_by_id()
Florian Fainelli (1):
net: dsa: bcm_sf2: Clear IDDQ_GLOBAL_PWR bit for PHY
Fugang Duan (1):
net: fec: unmap the xmit buffer that are not transferred by DMA
Gal Pressman (4):
net/mlx5e: Fix possible deadlock of VXLAN lock net/mlx5e: Fix features check of IPv6 traffic net/mlx5e: Add refcount to VXLAN structure net/mlx5e: Prevent possible races in VXLAN control flow
Greg Kroah-Hartman (1):
Linux 4.14.11
Grygorii Strashko (1):
net: phy: micrel: ksz9031: reconfigure autoneg after phy autoneg workaround
Hugh Dickins (1):
x86/events/intel/ds: Map debug buffers in cpu_entry_area
Hui Wang (3):
ALSA: hda - Add MIC_NO_PRESENCE fixup for 2 HP machines
ALSA: hda - change the location for one mic on a Lenovo machine
ALSA: hda - fix headset mic detection issue on a Dell machine
Ido Schimmel (2):
ipv4: Fix use-after-free when flushing FIB tables
ipv6: Honor specified parameters in fibmatch lookup
Jan Engelhardt (1):
sparc64: repair calling incorrect hweight function from stubs
Jens Axboe (1):
block: fix blk_rq_append_bio
Jing Xia (1):
tracing: Fix crash when it fails to alloc ring buffer
Jiri Pirko (1):
net: sched: fix static key imbalance in case of ingress/clsact_init error
Joel Fernandes (1):
cpufreq: schedutil: Use idle_calls counter of the remote CPU
Johan Hovold (5):
ASoC: da7218: fix fix child-node lookup
ASoC: twl4030: fix child-node lookup
USB: chipidea: msm: fix ulpi-node lookup
phy: tegra: fix device-tree node lookups
tty: fix tty_ldisc_receive_buf() documentation
Juan Zea (1):
usbip: fix usbip bind writing random string after command in match_busid
Julian Wiedmann (5):
s390/qeth: apply takeover changes when mode is toggled s390/qeth: don't apply takeover changes to RXIP s390/qeth: lock IP table while applying takeover changes s390/qeth: update takeover IPs after configuration change s390/qeth: fix error handling in checksum cmd callback
Kamal Heib (1):
net/mlx5: FPGA, return -EINVAL if size is zero
Kevin Cernekee (2):
net: igmp: Use correct source address on IGMPv3 reports
netlink: Add netns check on taps
Linus Torvalds (3):
kbuild: add '-fno-stack-check' to kernel build options
x86-32: Fix kexec with stack canary (CONFIG_CC_STACKPROTECTOR)
n_tty: fix EXTPROC vs ICANON interaction with TIOCINQ (aka FIONREAD)
Maciej S. Szmigiero (1):
ASoC: fsl_ssi: AC'97 ops need regmap, clock and cleaning up on failure
Majd Dibbiny (1):
IB/mlx5: Serialize access to the VMA list
Mathias Nyman (1):
USB: Fix off by one in type-specific length check of BOS SSP capability
Max Schulze (1):
USB: serial: ftdi_sio: add id for Airbus DS P8GR
Michael J. Ruhl (1):
IB/hfi: Only read capability registers if the capability exists
Michael S. Tsirkin (1):
ptr_ring: add barriers
Ming Lei (1):
block: don't let passthrough IO go into .make_request_fn()
Mohamed Ghannam (1):
net: ipv4: fix for a race condition in raw_sendmsg
Moni Shoua (3):
IB/uverbs: Fix command checking as part of ib_uverbs_ex_modify_qp() IB/core: Verify that QP is security enabled in create and destroy net/mlx5: Fix error flow in CREATE_QP command
Neal Cardwell (3):
tcp_bbr: record "full bw reached" decision in new full_bw_reached bit
tcp_bbr: reset full pipe detection on loss recovery undo
tcp_bbr: reset long-term bandwidth sampling on loss recovery undo
Nicolas Dichtel (1):
ipv6: set all.accept_dad to 0 by default
Nikita V. Shirokov (1):
adding missing rcu_read_unlock in ipxip6_rcv
Nikolay Aleksandrov (1):
net: bridge: fix early call to br_stp_change_bridge_id and plug newlink leaks
Oliver Neukum (1):
usb: add RESET_RESUME for ELSA MicroLink 56K
Parthasarathy Bhuvaragan (1):
tipc: fix hanging poll() for stream sockets
Peter Zijlstra (3):
x86/mm: Use/Fix PCID to optimize user/kernel switches x86/mm: Optimize RESTORE_CR3
x86/mm: Clarify the whole ASID/kernel PCID/user PCID naming
Phil Sutter (1):
ipv4: fib: Fix metrics match when deleting a route
Reinhard Speyerer (1):
USB: serial: qcserial: add Sierra Wireless EM7565
Russell King (2):
phylink: ensure the PHY interface mode is appropriately set
phylink: ensure AN is enabled
SZ Lin (林上智) (1):
USB: serial: option: adding support for YUGA CLM920-NC5
Saeed Mahameed (1):
Revert "mlx5: move affinity hints assignments to generic code"
Sebastian Sjoholm (1):
net: qmi_wwan: add Sierra EM7565 1199:9091
Shaohua Li (1):
net: reevalulate autoflowlabel setting after sysctl setting
Shuah Khan (3):
usbip: prevent leaking socket pointer address in messages
usbip: stub: stop printing kernel pointer addresses in messages
usbip: vhci: stop printing kernel pointer addresses in messages
Srinivas Kandagatla (1):
ASoC: codecs: msm8916-wcd: Fix supported formats
Steve Wise (1):
iw_cxgb4: Only validate the MSN for successful completions
Steven Rostedt (VMware) (4):
tracing: Remove extra zeroing out of the ring buffer page
tracing: Fix possible double free on failure of allocating trace buffer
ring-buffer: Mask out the info bits when returning buffer page length
ring-buffer: Do no reuse reader page if still in use
Sudeep Holla (1):
drivers: base: cacheinfo: fix cache type for non-architected system cache
Sushmita Susheelendra (1):
staging: android: ion: Fix dma direction for dma_sync_sg_for_cpu/device
Takashi Iwai (2):
ALSA: hda: Drop useless WARN_ON()
ALSA: hda - Fix missing COEF init for ALC225/295/299
Thomas Gleixner (16):
x86/cpufeatures: Add X86_BUG_CPU_INSECURE
x86/mm/pti: Add infrastructure for page table isolation x86/mm/pti: Force entry through trampoline when PTI active x86/entry: Align entry text section to PMD boundary x86/mm/pti: Share entry text PMD
x86/cpu_entry_area: Add debugstore entries to cpu_entry_area x86/mm/dump_pagetables: Check user space page table for WX pages x86/mm/dump_pagetables: Allow dumping current pagetables x86/ldt: Make the LDT mapping RO
timers: Invoke timer_start_debug() where it makes sense
timers: Reinitialize per cpu bases on hotplug
nohz: Prevent a timer interrupt storm in tick_nohz_stop_sched_tick() x86/smpboot: Remove stale TLB flush invocations
x86/mm: Remove preempt_disable/enable() from __native_flush_tlb() x86/ldt: Plug memory leak in error path
x86/ldt: Make LDT pgtable free conditional
Tobias Jordan (1):
net: mvmdio: disable/unprepare clocks in EPROBE_DEFER case
Todd Kjos (1):
binder: fix proc->files use-after-free
Tonghao Zhang (1):
sctp: Replace use of sockets_allocated with specified macro.
Vlastimil Babka (1):
x86/dumpstack: Indicate in Oops whether PTI is configured and enabled
Wei Wang (1):
tcp: fix potential underestimation on rcv_rtt
Willem de Bruijn (4):
sock: free skb in skb_complete_tx_timestamp on error
skbuff: orphan frags before zerocopy clone
skbuff: skb_copy_ubufs must release uarg even without user frags
skbuff: in skb_copy_ubufs unclone before releasing zerocopy
Xin Long (1):
sctp: make sure stream nums can match optlen in sctp_setsockopt_reset_streams
Yousuk Seung (1):
tcp: invalidate rate samples during SACK reneging
Yuval Mintz (1):
mlxsw: spectrum: Disable MAC learning for ovs port
Zhao Qiang (1):
net: phy: marvell: Limit 88m1101 autoneg errata to 88E1145 as well.
Greg KH
maintainerDocumentation/admin-guide/kernel-parameters.txt +8 -0
@@ -2685,6 +2685,8 @@ steal time is computed, but won't influence scheduler behaviour + nopti [X86-64] Disable kernel page table isolation + nolapic [X86-32,APIC] Do not enable or use the local APIC. nolapic_timer [X86-32,APIC] Do not use the local APIC timer.
@@ -3253,6 +3255,12 @@ pt. [PARIDE] See Documentation/blockdev/paride.txt. + pti= [X86_64] + Control user/kernel address space isolation: + on - enable + off - disable + auto - default setting + pty.legacy_count= [KNL] Number of legacy pty's. Overwrites compiled-in default number.
Documentation/x86/x86_64/mm.txt +3 -2
@@ -12,6 +12,7 @@ ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB) ... unused hole ... ffffec0000000000 - fffffbffffffffff (=44 bits) kasan shadow memory (16TB) ... unused hole ... +fffffe0000000000 - fffffe7fffffffff (=39 bits) LDT remap for PTI fffffe8000000000 - fffffeffffffffff (=39 bits) cpu_entry_area mapping ffffff0000000000 - ffffff7fffffffff (=39 bits) %esp fixup stacks ... unused hole ...
@@ -29,8 +30,8 @@ Virtual memory map with 5 level page tables: hole caused by [56:63] sign extension ff00000000000000 - ff0fffffffffffff (=52 bits) guard hole, reserved for hypervisor ff10000000000000 - ff8fffffffffffff (=55 bits) direct mapping of all phys. memory -ff90000000000000 - ff91ffffffffffff (=49 bits) hole -ff92000000000000 - ffd1ffffffffffff (=54 bits) vmalloc/ioremap space +ff90000000000000 - ff9fffffffffffff (=52 bits) LDT remap for PTI +ffa0000000000000 - ffd1ffffffffffff (=54 bits) vmalloc/ioremap space (12800 TB) ffd2000000000000 - ffd3ffffffffffff (=49 bits) hole ffd4000000000000 - ffd5ffffffffffff (=49 bits) virtual memory map (512TB) ... unused hole ...
Makefile +4 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 10 +SUBLEVEL = 11 EXTRAVERSION = NAME = Petit Gorille
@@ -802,6 +802,9 @@ KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) +# Make sure -fstack-check isn't enabled (like gentoo apparently did) +KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,) + # conserve stack if available KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
arch/sparc/lib/hweight.S +2 -2
@@ -44,8 +44,8 @@ EXPORT_SYMBOL(__arch_hweight32) .previous ENTRY(__arch_hweight64) - sethi %hi(__sw_hweight16), %g1 - jmpl %g1 + %lo(__sw_hweight16), %g0 + sethi %hi(__sw_hweight64), %g1 + jmpl %g1 + %lo(__sw_hweight64), %g0 nop ENDPROC(__arch_hweight64) EXPORT_SYMBOL(__arch_hweight64)
arch/x86/boot/compressed/pagetable.c +3 -0
@@ -23,6 +23,9 @@*/ #undef CONFIG_AMD_MEM_ENCRYPT +/* No PAGE_TABLE_ISOLATION support needed either: */ +#undef CONFIG_PAGE_TABLE_ISOLATION +#include "misc.h" /* These actually do the work of building the kernel identity maps. */
arch/x86/entry/calling.h +145 -0
157 lines not on this page · raw message
arch/x86/entry/entry_64.S +41 -7
158 lines not on this page · raw message
arch/x86/entry/entry_64_compat.S +23 -1
@@ -49,6 +49,10 @@ ENTRY(entry_SYSENTER_compat) /* Interrupts are off on entry. */ SWAPGS + + /* We are about to clobber %rsp anyway, clobbering here is OK */ + SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp + movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp /*
@@ -215,6 +219,12 @@ GLOBAL(entry_SYSCALL_compat_after_hwframe) pushq $0 /* pt_regs->r14 = 0 */ pushq $0 /* pt_regs->r15 = 0 */ + /* + * We just saved %rdi so it is safe to clobber. It is not + * preserved during the C calls inside TRACE_IRQS_OFF anyway. + */ + SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi + /* * User mode is traced as though IRQs are on, and SYSENTER * turned them off.
@@ -256,10 +266,22 @@ sysret32_from_system_call: * when the system call started, which is already known to user * code. We zero R8-R10 to avoid info leaks. */ + movq RSP-ORIG_RAX(%rsp), %rsp + + /* + * The original userspace %rsp (RSP-ORIG_RAX(%rsp)) is stored + * on the process stack which is not mapped to userspace and + * not readable after we SWITCH_TO_USER_CR3. Delay the CR3 + * switch until after after the last reference to the process + * stack. + * + * %r8/%r9 are zeroed before the sysret, thus safe to clobber. + */ + SWITCH_TO_USER_CR3_NOSTACK scratch_reg=%r8 scratch_reg2=%r9 + xorq %r8, %r8 xorq %r9, %r9 xorq %r10, %r10 - movq RSP-ORIG_RAX(%rsp), %rsp swapgs sysretl END(entry_SYSCALL_compat)
arch/x86/entry/vsyscall/vsyscall_64.c +3 -3
@@ -344,14 +344,14 @@ int in_gate_area_no_mm(unsigned long addr)* vsyscalls but leave the page not present. If so, we skip calling * this. */ -static void __init set_vsyscall_pgtable_user_bits (void ) +void __init set_vsyscall_pgtable_user_bits (pgd_t *root) {pgd_t *pgd;p4d_t *p4d;pud_t *pud;pmd_t *pmd; - pgd =pgd_offset_k (VSYSCALL_ADDR ); + pgd =pgd_offset_pgd (root,VSYSCALL_ADDR );set_pgd (pgd,__pgd (pgd_val (*pgd) | _PAGE_USER)); p4d =p4d_offset (pgd,VSYSCALL_ADDR );#if CONFIG_PGTABLE_LEVELS >=5
@@ -373,7 +373,7 @@ void __init map_vsyscall(void) vsyscall_mode ==NATIVE ?PAGE_KERNEL_VSYSCALL : PAGE_KERNEL_VVAR); -set_vsyscall_pgtable_user_bits (); +set_vsyscall_pgtable_user_bits (swapper_pg_dir); } BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_PAGE) !=
arch/x86/events/intel/ds.c +83 -47
214 lines not on this page · raw message
arch/x86/events/perf_event.h +4 -19
@@ -14,6 +14,8 @@#include <linux/perf_event.h> +#include <asm/intel_ds.h> +/* To enable MSR tracing please use the generic trace points. */ /*
@@ -77,8 +79,6 @@ struct amd_nb {struct event_constraint event_constraints[X86_PMC_IDX_MAX ]; }; -/* The maximal number of PEBS events: */ -#define MAX_PEBS_EVENTS 8#define PEBS_COUNTER_MASK ((1ULL << MAX_PEBS_EVENTS) - 1)/*
@@ -95,23 +95,6 @@ struct amd_nb { PERF_SAMPLE_TRANSACTION | PERF_SAMPLE_PHYS_ADDR | \ PERF_SAMPLE_REGS_INTR | PERF_SAMPLE_REGS_USER) -/* -* A debug store configuration. -* -* We only support architectures that use 64bit fields. -*/ -struct debug_store { -u64 bts_buffer_base; -u64 bts_index; -u64 bts_absolute_maximum; -u64 bts_interrupt_threshold; -u64 pebs_buffer_base; -u64 pebs_index; -u64 pebs_absolute_maximum; -u64 pebs_interrupt_threshold; -u64 pebs_event_reset[MAX_PEBS_EVENTS ]; -}; -#define PEBS_REGS \ (PERF_REG_X86_AX | \ PERF_REG_X86_BX | \
@@ -216,6 +199,8 @@ struct cpu_hw_events {* Intel DebugStore bits */ struct debug_store *ds; +void *ds_pebs_vaddr; +void *ds_bts_vaddr;u64 pebs_enabled;int n_pebs;int n_large_pebs;
arch/x86/include/asm/cpu_entry_area.h +13 -0
@@ -5,6 +5,7 @@#include <linux/percpu-defs.h> #include <asm/processor.h> +#include <asm/intel_ds.h> /* * cpu_entry_area is a percpu region that contains things needed by the CPU
@@ -40,6 +41,18 @@ struct cpu_entry_area {*/ char exception_stacks[(N_EXCEPTION_STACKS -1 ) *EXCEPTION_STKSZ +DEBUG_STKSZ ];#endif +#ifdef CONFIG_CPU_SUP_INTEL +/* +* Per CPU debug store for Intel performance monitoring. Wastes a +* full page at the moment. +*/ +struct debug_store cpu_debug_store; +/* +* The actual PEBS/BTS buffers must be mapped to user space +* Reserve enough fixmap PTEs. +*/ +struct debug_store_buffers cpu_debug_buffers; +#endif };#define CPU_ENTRY_AREA_SIZE (sizeof(struct cpu_entry_area))
arch/x86/include/asm/cpufeatures.h +3 -1
@@ -197,11 +197,12 @@#define X86_FEATURE_CAT_L3 ( 7*32+ 4)/* Cache Allocation Technology L3 */ #define X86_FEATURE_CAT_L2 ( 7*32+ 5)/* Cache Allocation Technology L2 */ #define X86_FEATURE_CDP_L3 ( 7*32+ 6)/* Code and Data Prioritization L3 */ +#define X86_FEATURE_INVPCID_SINGLE ( 7*32+ 7)/* Effectively INVPCID && CR4.PCIDE=1 */ #define X86_FEATURE_HW_PSTATE ( 7*32+ 8)/* AMD HW-PState */ #define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9)/* AMD ProcFeedbackInterface */ #define X86_FEATURE_SME ( 7*32+10)/* AMD Secure Memory Encryption */ - +#define X86_FEATURE_PTI ( 7*32+11)/* Kernel Page Table Isolation enabled */ #define X86_FEATURE_INTEL_PPIN ( 7*32+14)/* Intel Processor Inventory Number */ #define X86_FEATURE_INTEL_PT ( 7*32+15)/* Intel Processor Trace */ #define X86_FEATURE_AVX512_4VNNIW ( 7*32+16)/* AVX-512 Neural Network Instructions */
@@ -340,5 +341,6 @@#define X86_BUG_SWAPGS_FENCE X86_BUG(11)/* SWAPGS without input dep on GS */ #define X86_BUG_MONITOR X86_BUG(12)/* IPI required to wake up remote CPU */ #define X86_BUG_AMD_E400 X86_BUG(13)/* CPU is among the affected by Erratum 400 */ +#define X86_BUG_CPU_INSECURE X86_BUG(14)/* CPU is insecure and needs kernel page table isolation */ #endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/include/asm/desc.h +2 -0
@@ -21,6 +21,8 @@ static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *in desc->type = (info->read_exec_only ^1 ) <<1 ; desc->type |= info->contents <<2 ; +/* Set the ACCESS bit so it can be mapped RO */ + desc->type |=1 ; desc->s =1 ; desc->dpl =0x3 ;
arch/x86/include/asm/disabled-features.h +7 -1
@@ -44,6 +44,12 @@# define DISABLE_LA57 (1<<(X86_FEATURE_LA57 & 31))#endif +#ifdef CONFIG_PAGE_TABLE_ISOLATION +# define DISABLE_PTI 0 +#else +# define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31)) +#endif +/* * Make sure to add features to the correct mask */
@@ -54,7 +60,7 @@#define DISABLED_MASK4 (DISABLE_PCID)#define DISABLED_MASK5 0#define DISABLED_MASK6 0 -#define DISABLED_MASK7 0 +#define DISABLED_MASK7 (DISABLE_PTI)#define DISABLED_MASK8 0#define DISABLED_MASK9 (DISABLE_MPX)#define DISABLED_MASK10 0
arch/x86/include/asm/intel_ds.h new file +36 -0
@@ -0,0 +1,36 @@ +#ifndef _ASM_INTEL_DS_H +#define _ASM_INTEL_DS_H + +#include <linux/percpu-defs.h> + +#define BTS_BUFFER_SIZE (PAGE_SIZE << 4) +#define PEBS_BUFFER_SIZE (PAGE_SIZE << 4) + +/* The maximal number of PEBS events: */ +#define MAX_PEBS_EVENTS 8 + +/* +* A debug store configuration. +* +* We only support architectures that use 64bit fields. +*/ +struct debug_store { +u64 bts_buffer_base; +u64 bts_index; +u64 bts_absolute_maximum; +u64 bts_interrupt_threshold; +u64 pebs_buffer_base; +u64 pebs_index; +u64 pebs_absolute_maximum; +u64 pebs_interrupt_threshold; +u64 pebs_event_reset[MAX_PEBS_EVENTS ]; +}__aligned(PAGE_SIZE) ; + +DECLARE_PER_CPU_PAGE_ALIGNED(struct debug_store, cpu_debug_store); + +struct debug_store_buffers { +char bts_buffer[BTS_BUFFER_SIZE ]; +char pebs_buffer[PEBS_BUFFER_SIZE ]; +}; + +#endif
arch/x86/include/asm/mmu_context.h +53 -6
92 lines not on this page · raw message
arch/x86/include/asm/pgalloc.h +11 -0
@@ -30,6 +30,17 @@ static inline void paravirt_release_p4d(unsigned long pfn) {}*/ extern gfp_t __userpte_alloc_gfp; +#ifdef CONFIG_PAGE_TABLE_ISOLATION +/* +* Instead of one PGD, we acquire two PGDs. Being order-1, it is +* both 8k in size and 8k-aligned. That lets us just flip bit 12 +* in a pointer to swap between the two 4k halves. +*/ +#define PGD_ALLOCATION_ORDER 1 +#else +#define PGD_ALLOCATION_ORDER 0 +#endif +/* * Allocate and free page tables. */
arch/x86/include/asm/pgtable.h +26 -4
@@ -28,6 +28,7 @@ extern pgd_t early_top_pgt[PTRS_PER_PGD];int __init __early_make_pgtable (unsigned long address,pmdval_t pmd);void ptdump_walk_pgd_level (struct seq_file *m,pgd_t *pgd); +void ptdump_walk_pgd_level_debugfs (struct seq_file *m,pgd_t *pgd,bool user);void ptdump_walk_pgd_level_checkwx (void );#ifdef CONFIG_DEBUG_WX
@@ -846,7 +847,12 @@ static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)static inline int p4d_bad (p4d_t p4d) { -return (p4d_flags (p4d) & ~(_KERNPG_TABLE | _PAGE_USER)) !=0 ; +unsigned long ignore_flags = _KERNPG_TABLE | _PAGE_USER; + +if (IS_ENABLED (CONFIG_PAGE_TABLE_ISOLATION )) + ignore_flags |= _PAGE_NX; + +return (p4d_flags (p4d) & ~ignore_flags) !=0 ; }#endif /* CONFIG_PGTABLE_LEVELS > 3 */
@@ -880,7 +886,12 @@ static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)static inline int pgd_bad (pgd_t pgd) { -return (pgd_flags (pgd) & ~_PAGE_USER) != _KERNPG_TABLE; +unsigned long ignore_flags = _PAGE_USER; + +if (IS_ENABLED (CONFIG_PAGE_TABLE_ISOLATION )) + ignore_flags |= _PAGE_NX; + +return (pgd_flags (pgd) & ~ignore_flags) != _KERNPG_TABLE; }static inline int pgd_none (pgd_t pgd)
@@ -909,7 +920,11 @@ static inline int pgd_none(pgd_t pgd)* pgd_offset() returns a (pgd_t *) * pgd_index() is used get the offset into the pgd page's array of pgd_t's; */ -#define pgd_offset (mm, address) ((mm)->pgd + pgd_index((address))) +#define pgd_offset_pgd (pgd, address) (pgd + pgd_index((address))) +/* +* a shortcut to get a pgd_t in a given mm +*/ +#define pgd_offset (mm, address) pgd_offset_pgd((mm)->pgd, (address))/* * a shortcut which implies the use of the kernel's pgd, instead * of a process's
@@ -1111,7 +1126,14 @@ static inline int pud_write(pud_t pud)*/ static inline void clone_pgd_range (pgd_t *dst,pgd_t *src,int count) { -memcpy (dst, src, count *sizeof (pgd_t)); +memcpy (dst, src, count *sizeof (pgd_t)); +#ifdef CONFIG_PAGE_TABLE_ISOLATION +if (!static_cpu_has (X86_FEATURE_PTI )) +return ; +/* Clone the user space pgd as well */ +memcpy (kernel_to_user_pgdp (dst),kernel_to_user_pgdp (src), + count *sizeof (pgd_t)); +#endif }#define PTE_SHIFT ilog2(PTRS_PER_PTE)
arch/x86/include/asm/pgtable_64.h +92 -0
108 lines not on this page · raw message
arch/x86/include/asm/pgtable_64_types.h +6 -2
@@ -79,13 +79,17 @@ typedef struct { pteval_t pte; } pte_t;#define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL)#ifdef CONFIG_X86_5LEVEL -# define VMALLOC_SIZE_TB _AC(16384, UL) -# define __VMALLOC_BASE _AC(0xff92000000000000, UL) +# define VMALLOC_SIZE_TB _AC(12800, UL) +# define __VMALLOC_BASE _AC(0xffa0000000000000, UL)# define __VMEMMAP_BASE _AC(0xffd4000000000000, UL) +# define LDT_PGD_ENTRY _AC(-112, UL) +# define LDT_BASE_ADDR (LDT_PGD_ENTRY << PGDIR_SHIFT)#else # define VMALLOC_SIZE_TB _AC(32, UL)# define __VMALLOC_BASE _AC(0xffffc90000000000, UL)# define __VMEMMAP_BASE _AC(0xffffea0000000000, UL) +# define LDT_PGD_ENTRY _AC(-4, UL) +# define LDT_BASE_ADDR (LDT_PGD_ENTRY << PGDIR_SHIFT)#endif #ifdef CONFIG_RANDOMIZE_MEMORY
arch/x86/include/asm/processor-flags.h +5 -0
@@ -38,6 +38,11 @@#define CR3_ADDR_MASK __sme_clr(0x7FFFFFFFFFFFF000ull)#define CR3_PCID_MASK 0xFFFull#define CR3_NOFLUSH BIT_ULL(63) + +#ifdef CONFIG_PAGE_TABLE_ISOLATION +# define X86_CR3_PTI_SWITCH_BIT 11 +#endif +#else /* * CR3_ADDR_MASK needs at least bits 31:5 set on PAE systems, and we save
arch/x86/include/asm/processor.h +16 -7
@@ -851,13 +851,22 @@ static inline void spin_lock_prefetch(const void *x)#else /* -* User space process size. 47bits minus one guard page. The guard -* page is necessary on Intel CPUs: if a SYSCALL instruction is at -* the highest possible canonical userspace address, then that -* syscall will enter the kernel with a non-canonical return -* address, and SYSRET will explode dangerously. We avoid this -* particular problem by preventing anything from being mapped -* at the maximum canonical address. +* User space process size. This is the first address outside the user range. +* There are a few constraints that determine this: +* +* On Intel CPUs, if a SYSCALL instruction is at the highest canonical +* address, then that syscall will enter the kernel with a +* non-canonical return address, and SYSRET will explode dangerously. +* We avoid this particular problem by preventing anything executable +* from being mapped at the maximum canonical address. +* +* On AMD CPUs in the Ryzen family, there's a nasty bug in which the +* CPUs malfunction if they execute code from the highest canonical page. +* They'll speculate right off the end of the canonical space, and +* bad things happen. This is worked around in the same way as the +* Intel problem. +* +* With page table isolation enabled, we map the LDT in ... [stay tuned] */ #define TASK_SIZE_MAX ((1UL << __VIRTUAL_MASK_SHIFT) - PAGE_SIZE)
arch/x86/include/asm/pti.h new file +14 -0
@@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef _ASM_X86_PTI_H +#define _ASM_X86_PTI_H +#ifndef __ASSEMBLY__ + +#ifdef CONFIG_PAGE_TABLE_ISOLATION +extern void pti_init (void ); +extern void pti_check_boottime_disable (void ); +#else +static inline void pti_check_boottime_disable (void ) { } +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* _ASM_X86_PTI_H */
arch/x86/include/asm/tlbflush.h +175 -33
301 lines not on this page · raw message
arch/x86/include/asm/vsyscall.h +1 -0
@@ -7,6 +7,7 @@#ifdef CONFIG_X86_VSYSCALL_EMULATION extern void map_vsyscall (void ); +extern void set_vsyscall_pgtable_user_bits (pgd_t *root);/* * Called on instruction fetch fault in vsyscall page.
arch/x86/include/uapi/asm/processor-flags.h +6 -1
@@ -78,7 +78,12 @@#define X86_CR3_PWT _BITUL(X86_CR3_PWT_BIT)#define X86_CR3_PCD_BIT 4/* Page Cache Disable */ #define X86_CR3_PCD _BITUL(X86_CR3_PCD_BIT) -#define X86_CR3_PCID_MASK _AC(0x00000fff,UL)/* PCID Mask */ + +#define X86_CR3_PCID_BITS 12 +#define X86_CR3_PCID_MASK (_AC((1UL << X86_CR3_PCID_BITS) - 1, UL)) + +#define X86_CR3_PCID_NOFLUSH_BIT 63/* Preserve old PCID */ +#define X86_CR3_PCID_NOFLUSH _BITULL(X86_CR3_PCID_NOFLUSH_BIT)/* * Intel CPU features in CR4
arch/x86/kernel/asm-offsets.c +4 -0
@@ -17,6 +17,7 @@#include <asm/sigframe.h> #include <asm/bootparam.h> #include <asm/suspend.h> +#include <asm/tlbflush.h> #ifdef CONFIG_XEN #include <xen/interface/xen.h>
@@ -94,6 +95,9 @@ void common(void) {BLANK ();DEFINE (PTREGS_SIZE ,sizeof (struct pt_regs )); +/* TLB state for the entry code */ +OFFSET (TLB_STATE_user_pcid_flush_mask, tlb_state, user_pcid_flush_mask); +/* Layout info for cpu_entry_area */ OFFSET (CPU_ENTRY_AREA_tss, cpu_entry_area, tss);OFFSET (CPU_ENTRY_AREA_entry_trampoline, cpu_entry_area, entry_trampoline);
arch/x86/kernel/cpu/common.c +8 -1
@@ -898,6 +898,10 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) }setup_force_cpu_cap (X86_FEATURE_ALWAYS ); + +/* Assume for now that ALL x86 CPUs are insecure */ +setup_force_cpu_bug (X86_BUG_CPU_INSECURE ); +fpu__init_system (c);#ifdef CONFIG_X86_32
@@ -1335,7 +1339,10 @@ void syscall_init(void) (entry_SYSCALL_64_trampoline - _entry_trampoline);wrmsr (MSR_STAR ,0 , (__USER32_CS <<16 ) | __KERNEL_CS); -wrmsrl (MSR_LSTAR , SYSCALL64_entry_trampoline); +if (static_cpu_has (X86_FEATURE_PTI )) +wrmsrl (MSR_LSTAR , SYSCALL64_entry_trampoline); +else +wrmsrl (MSR_LSTAR , (unsigned long )entry_SYSCALL_64);#ifdef CONFIG_IA32_EMULATION wrmsrl (MSR_CSTAR , (unsigned long )entry_SYSCALL_compat);
arch/x86/kernel/dumpstack.c +4 -2
@@ -297,11 +297,13 @@ int __die(const char *str, struct pt_regs *regs, long err)unsigned long sp;#endif printk (KERN_DEFAULT -"%s: %04lx [#%d]%s%s%s%s\n" , str, err &0xffff , ++die_counter, +"%s: %04lx [#%d]%s%s%s%s%s\n" , str, err &0xffff , ++die_counter,IS_ENABLED (CONFIG_PREEMPT ) ?" PREEMPT" :"" ,IS_ENABLED (CONFIG_SMP ) ?" SMP" :"" ,debug_pagealloc_enabled () ?" DEBUG_PAGEALLOC" :"" , -IS_ENABLED (CONFIG_KASAN ) ?" KASAN" :"" ); +IS_ENABLED (CONFIG_KASAN ) ?" KASAN" :"" , +IS_ENABLED (CONFIG_PAGE_TABLE_ISOLATION ) ? + (boot_cpu_has (X86_FEATURE_PTI ) ?" PTI" :" NOPTI" ) :"" );if (notify_die (DIE_OOPS , str, regs, err, current->thread.trap_nr,SIGSEGV ) ==NOTIFY_STOP )
arch/x86/kernel/head_64.S +27 -3
@@ -341,6 +341,27 @@ GLOBAL(early_recursion_flag) .balign PAGE_SIZE; \ GLOBAL(name) +#ifdef CONFIG_PAGE_TABLE_ISOLATION +/* + * Each PGD needs to be 8k long and 8k aligned. We do not + * ever go out to userspace with these, so we do not + * strictly *need* the second page, but this allows us to + * have a single set_pgd() implementation that does not + * need to worry about whether it has 4k or 8k to work + * with. + * + * This ensures PGDs are 8k long: + */ +#define PTI_USER_PGD_FILL 512 +/* This ensures they are 8k-aligned: */ +#define NEXT_PGD_PAGE(name) \ + .balign 2 * PAGE_SIZE; \ +GLOBAL(name) +#else +#define NEXT_PGD_PAGE(name) NEXT_PAGE(name) +#define PTI_USER_PGD_FILL 0 +#endif + /* Automate the creation of 1 to 1 mapping pmd entries */ #define PMDS(START, PERM, COUNT) \ i = 0 ; \
@@ -350,13 +371,14 @@ GLOBAL(name) .endr __INITDATA -NEXT_PAGE(early_top_pgt) +NEXT_PGD_PAGE(early_top_pgt) .fill 511,8,0 #ifdef CONFIG_X86_5LEVEL .quad level4_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC #else .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC #endif + .fill PTI_USER_PGD_FILL,8,0 NEXT_PAGE(early_dynamic_pgts) .fill 512*EARLY_DYNAMIC_PAGE_TABLES,8,0
@@ -364,13 +386,14 @@ NEXT_PAGE(early_dynamic_pgts) .data #if defined(CONFIG_XEN_PV) || defined(CONFIG_XEN_PVH) -NEXT_PAGE(init_top_pgt) +NEXT_PGD_PAGE(init_top_pgt) .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC .org init_top_pgt + PGD_PAGE_OFFSET*8, 0 .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC .org init_top_pgt + PGD_START_KERNEL*8, 0 /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC + .fill PTI_USER_PGD_FILL,8,0 NEXT_PAGE(level3_ident_pgt) .quad level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
@@ -381,8 +404,9 @@ NEXT_PAGE(level2_ident_pgt) */ PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, PTRS_PER_PMD) #else -NEXT_PAGE(init_top_pgt) +NEXT_PGD_PAGE(init_top_pgt) .fill 512,8,0 + .fill PTI_USER_PGD_FILL,8,0 #endif #ifdef CONFIG_X86_5LEVEL
arch/x86/kernel/ldt.c +148 -3
195 lines not on this page · raw message
arch/x86/kernel/machine_kexec_32.c +1 -3
@@ -48,8 +48,6 @@ static void load_segments(void) "\tmovl $"STR(__KERNEL_DS)",%%eax\n" "\tmovl %%eax,%%ds\n" "\tmovl %%eax,%%es\n" -"\tmovl %%eax,%%fs\n" -"\tmovl %%eax,%%gs\n" "\tmovl %%eax,%%ss\n" : : : "eax", "memory");#undef STR
@@ -232,8 +230,8 @@ void machine_kexec(struct kimage *image)* The gdt & idt are now invalid. * If you want to load them you must set up your own idt & gdt. */ -set_gdt (phys_to_virt (0 ),0 );idt_invalidate (phys_to_virt (0 )); +set_gdt (phys_to_virt (0 ),0 );/* now call it */ image->start = relocate_kernel_ptr((unsigned long)image->head,
arch/x86/kernel/smpboot.c +0 -9
@@ -128,25 +128,16 @@ static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)spin_lock_irqsave (&rtc_lock, flags);CMOS_WRITE (0xa ,0xf );spin_unlock_irqrestore (&rtc_lock, flags); -local_flush_tlb (); -pr_debug ("1.\n" ); *((volatile unsigned short *)phys_to_virt (TRAMPOLINE_PHYS_HIGH )) = start_eip >>4 ; -pr_debug ("2.\n" ); *((volatile unsigned short *)phys_to_virt (TRAMPOLINE_PHYS_LOW )) = start_eip &0xf ; -pr_debug ("3.\n" ); }static inline void smpboot_restore_warm_reset_vector (void ) {unsigned long flags; -/* -* Install writable page 0 entry to set BIOS data area. -*/ -local_flush_tlb (); -/* * Paranoid: Set warm reset code and vector here back * to default values.
arch/x86/kernel/tls.c +2 -9
@@ -93,17 +93,10 @@ static void set_tls_desc(struct task_struct *p, int idx, cpu =get_cpu ();while (n-- >0 ) { -if (LDT_empty (info) ||LDT_zero (info)) { +if (LDT_empty (info) ||LDT_zero (info))memset (desc,0 ,sizeof (*desc)); - }else { +else fill_ldt (desc, info); - -/* -* Always set the accessed bit so that the CPU -* doesn't try to write to the (read-only) GDT. -*/ - desc->type |=1 ; - } ++info; ++desc; }
arch/x86/kernel/traps.c +1 -1
@@ -361,7 +361,7 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)* * No need for ist_enter here because we don't use RCU. */ -if (((long )regs->sp >>PGDIR_SHIFT ) ==ESPFIX_PGD_ENTRY && +if (((long )regs->sp >>P4D_SHIFT ) ==ESPFIX_PGD_ENTRY && regs->cs == __KERNEL_CS && regs->ip == (unsigned long )native_irq_return_iret) {
arch/x86/kernel/vmlinux.lds.S +8 -0
@@ -61,11 +61,17 @@ jiffies_64 = jiffies; . = ALIGN(HPAGE_SIZE); \ __end_rodata_hpage_align = .; +#define ALIGN_ENTRY_TEXT_BEGIN . = ALIGN(PMD_SIZE); +#define ALIGN_ENTRY_TEXT_END . = ALIGN(PMD_SIZE); + #else #define X64_ALIGN_RODATA_BEGIN #define X64_ALIGN_RODATA_END +#define ALIGN_ENTRY_TEXT_BEGIN +#define ALIGN_ENTRY_TEXT_END + #endif PHDRS {
@@ -102,8 +108,10 @@ SECTIONS CPUIDLE_TEXT LOCK_TEXT KPROBES_TEXT + ALIGN_ENTRY_TEXT_BEGIN ENTRY_TEXT IRQENTRY_TEXT + ALIGN_ENTRY_TEXT_END SOFTIRQENTRY_TEXT *(.fixup) *(.gnu.warning)
arch/x86/mm/Makefile +4 -3
@@ -43,9 +43,10 @@ obj-$(CONFIG_AMD_NUMA) += amdtopology.o obj-$(CONFIG_ACPI_NUMA) += srat.o obj-$(CONFIG_NUMA_EMU) += numa_emulation.o -obj-$(CONFIG_X86_INTEL_MPX) += mpx.o -obj-$(CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS) += pkeys.o -obj-$(CONFIG_RANDOMIZE_MEMORY) += kaslr.o +obj-$(CONFIG_X86_INTEL_MPX) += mpx.o +obj-$(CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS) += pkeys.o +obj-$(CONFIG_RANDOMIZE_MEMORY) += kaslr.o +obj-$(CONFIG_PAGE_TABLE_ISOLATION) += pti.o obj-$(CONFIG_AMD_MEM_ENCRYPT) += mem_encrypt.o obj-$(CONFIG_AMD_MEM_ENCRYPT) += mem_encrypt_boot.o
arch/x86/mm/cpu_entry_area.c +27 -0
@@ -38,6 +38,32 @@ cea_map_percpu_pages(void *cea_vaddr, void *ptr, int pages, pgprot_t prot)cea_set_pte (cea_vaddr,per_cpu_ptr_to_phys (ptr), prot); } +static void percpu_setup_debug_store (int cpu) +{ +#ifdef CONFIG_CPU_SUP_INTEL +int npages; +void *cea; + +if (boot_cpu_data.x86_vendor !=X86_VENDOR_INTEL ) +return ; + + cea = &get_cpu_entry_area (cpu)->cpu_debug_store; + npages =sizeof (struct debug_store ) /PAGE_SIZE ; +BUILD_BUG_ON (sizeof (struct debug_store ) %PAGE_SIZE !=0 ); +cea_map_percpu_pages (cea, &per_cpu (cpu_debug_store, cpu), npages, +PAGE_KERNEL ); + + cea = &get_cpu_entry_area (cpu)->cpu_debug_buffers; +/* +* Force the population of PMDs for not yet allocated per cpu +* memory like debug store buffers. +*/ + npages =sizeof (struct debug_store_buffers ) /PAGE_SIZE ; +for (; npages; npages--, cea +=PAGE_SIZE ) +cea_set_pte (cea,0 ,PAGE_NONE ); +#endif +} +/* Setup the fixmap mappings only once per-processor */ static void __init setup_cpu_entry_area (int cpu) {
@@ -109,6 +135,7 @@ static void __init setup_cpu_entry_area(int cpu)cea_set_pte (&get_cpu_entry_area (cpu)->entry_trampoline,__pa_symbol (_entry_trampoline),PAGE_KERNEL_RX );#endif +percpu_setup_debug_store (cpu); }static __init void setup_cpu_entry_area_ptes (void )
arch/x86/mm/debug_pagetables.c +74 -6
102 lines not on this page · raw message
arch/x86/mm/dump_pagetables.c +38 -5
82 lines not on this page · raw message
arch/x86/mm/init.c +49 -31
119 lines not on this page · raw message
arch/x86/mm/pgtable.c +3 -2
@@ -355,14 +355,15 @@ static inline void _pgd_free(pgd_t *pgd) kmem_cache_free(pgd_cache, pgd); }#else +static inline pgd_t *_pgd_alloc (void ) { -return (pgd_t *)__get_free_page (PGALLOC_GFP ); +return (pgd_t *)__get_free_pages (PGALLOC_GFP ,PGD_ALLOCATION_ORDER ); }static inline void _pgd_free (pgd_t *pgd) { -free_page ((unsigned long )pgd); +free_pages ((unsigned long )pgd,PGD_ALLOCATION_ORDER ); }#endif /* CONFIG_X86_PAE */
arch/x86/mm/pti.c new file +387 -0
387 lines not on this page · raw message
arch/x86/mm/tlb.c +56 -2
88 lines not on this page · raw message
arch/x86/platform/efi/efi_64.c +4 -1
@@ -195,6 +195,9 @@ static pgd_t *efi_pgd;* because we want to avoid inserting EFI region mappings (EFI_VA_END * to EFI_VA_START) into the standard kernel page tables. Everything * else can be shared, see efi_sync_low_kernel_mappings(). +* +* We don't want the pgd on the pgd_list and cannot use pgd_alloc() for the +* allocation. */ int __init efi_alloc_page_tables (void ) {
@@ -207,7 +210,7 @@ int __init efi_alloc_page_tables(void)return 0 ; gfp_mask =GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO; - efi_pgd = (pgd_t *)__get_free_page (gfp_mask); + efi_pgd = (pgd_t *)__get_free_pages (gfp_mask,PGD_ALLOCATION_ORDER );if (!efi_pgd)return -ENOMEM ;
block/blk-map.c +22 -16
@@ -12,22 +12,29 @@#include "blk.h" /* -* Append a bio to a passthrough request. Only works can be merged into -* the request based on the driver constraints. +* Append a bio to a passthrough request. Only works if the bio can be merged +* into the request based on the driver constraints. */ -int blk_rq_append_bio (struct request *rq,struct bio *bio) +int blk_rq_append_bio (struct request *rq,struct bio **bio) { -blk_queue_bounce (rq->q, &bio); +struct bio *orig_bio = *bio; + +blk_queue_bounce (rq->q, bio);if (!rq->bio) { -blk_rq_bio_prep (rq->q, rq, bio); +blk_rq_bio_prep (rq->q, rq, *bio); }else { -if (!ll_back_merge_fn (rq->q, rq, bio)) +if (!ll_back_merge_fn (rq->q, rq, *bio)) { +if (orig_bio != *bio) { +bio_put (*bio); + *bio = orig_bio; + }return -EINVAL ; + } - rq->biotail->bi_next = bio; - rq->biotail = bio; - rq->__data_len += bio->bi_iter.bi_size; + rq->biotail->bi_next = *bio; + rq->biotail = *bio; + rq->__data_len += (*bio)->bi_iter.bi_size; }return 0 ;
@@ -80,14 +87,12 @@ static int __blk_rq_map_user_iov(struct request *rq,* We link the bounce buffer in and could have to traverse it * later so we have to get a ref to prevent it from being freed */ - ret =blk_rq_append_bio (rq, bio); -bio_get (bio); + ret =blk_rq_append_bio (rq, &bio);if (ret) { -bio_endio (bio);__blk_rq_unmap_user (orig_bio); -bio_put (bio);return ret; } +bio_get (bio);return 0 ; }
@@ -220,7 +225,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,int reading =rq_data_dir (rq) ==READ ;unsigned long addr = (unsigned long ) kbuf;int do_copy =0 ; -struct bio *bio; +struct bio *bio, *orig_bio;int ret;if (len > (queue_max_hw_sectors (q) <<9 ))
@@ -243,10 +248,11 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,if (do_copy) rq->rq_flags |=RQF_COPY_USER ; - ret =blk_rq_append_bio (rq, bio); + orig_bio = bio; + ret =blk_rq_append_bio (rq, &bio);if (unlikely (ret)) {/* request is too big */ -bio_put (bio); +bio_put (orig_bio);return ret; }
block/bounce.c +4 -2
@@ -200,6 +200,7 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,unsigned i =0 ;bool bounce = false;int sectors =0 ; +bool passthrough =bio_is_passthrough (*bio_orig);bio_for_each_segment (from, *bio_orig, iter) {if (i++ <BIO_MAX_PAGES )
@@ -210,13 +211,14 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,if (!bounce)return ; -if (sectors <bio_sectors (*bio_orig)) { +if (!passthrough && sectors <bio_sectors (*bio_orig)) { bio =bio_split (*bio_orig, sectors,GFP_NOIO , bounce_bio_split);bio_chain (bio, *bio_orig);generic_make_request (*bio_orig); *bio_orig = bio; } - bio =bio_clone_bioset (*bio_orig,GFP_NOIO , bounce_bio_set); + bio =bio_clone_bioset (*bio_orig,GFP_NOIO , passthrough ?NULL : + bounce_bio_set);bio_for_each_segment_all (to, bio, i) {struct page *page = to->bv_page;
drivers/android/binder.c +31 -13
110 lines not on this page · raw message
drivers/base/cacheinfo.c +13 -0
@@ -186,6 +186,11 @@ static void cache_associativity(struct cacheinfo *this_leaf) this_leaf->ways_of_associativity = (size / nr_sets) / line_size; } +static bool cache_node_is_unified (struct cacheinfo *this_leaf) +{ +return of_property_read_bool (this_leaf->of_node,"cache-unified" ); +} +static void cache_of_override_properties (unsigned int cpu) {int index;
@@ -194,6 +199,14 @@ static void cache_of_override_properties(unsigned int cpu)for (index =0 ; index <cache_leaves (cpu); index++) { this_leaf = this_cpu_ci->info_list + index; +/* +* init_cache_level must setup the cache level correctly +* overriding the architecturally specified levels, so +* if type is NONE at this stage, it should be unified +*/ +if (this_leaf->type ==CACHE_TYPE_NOCACHE && +cache_node_is_unified (this_leaf))
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/freescale/fec_main.c +6 -0
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx5/core/en.h +1 -0
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +24 -24
48 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/fpga/sdk.c +6 -0
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx5/core/main.c +69 -6
75 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/qp.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx5/core/rl.c +11 -11
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx5/core/vxlan.c +36 -28
64 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/vxlan.h +1 -0
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +18 -0
Lines of this file are not shown. View the raw message.
drivers/phy/tegra/xusb.c +29 -29
58 lines not on this page · raw message
drivers/s390/net/qeth_l3_sys.c +41 -34
75 lines not on this page · raw message
net/ipv4/igmp.c +34 -10
44 lines not on this page · raw message
net/ipv6/ip6_gre.c +32 -25
57 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.