Merge android-4.9-q (4.9.228) into android-msm-pixel-4.9-lts
Merge 4.9.228 into android-4.9-q
Linux 4.9.228
perf symbols: Fix debuginfo search for Ubuntu
perf probe: Do not show the skipped events
w1: omap-hdq: cleanup to add missing newline for some dev_dbg
mtd: rawnand: pasemi: Fix the probe error path
mtd: rawnand: brcmnand: fix hamming oob layout
* sunrpc: clean up properly in gss_mech_unregister()
include/linux/sunrpc/gss_api.h
sunrpc: svcauth_gss_register_pseudoflavor must reject duplicate registrations.
* kbuild: force to build vmlinux if CONFIG_MODVERSION=y
Makefile
drivers/macintosh: Fix memleak in windfarm_pm112 driver
ARM: tegra: Correct PL310 Auxiliary Control Register initialization
* kernel/cpu_pm: Fix uninitted local in cpu_pm
kernel/cpu_pm.c
sparc64: fix misuses of access_process_vm() in genregs32_[sg]et()
sparc32: fix register window handling in genregs32_[gs]et()
pinctrl: samsung: Save/restore eint_mask over suspend for EINT_TYPE GPIOs
power: vexpress: add suppress_bind_attrs to true
igb: Report speed and duplex as unknown when device is runtime suspended
b43_legacy: Fix connection problem with WPA3
b43: Fix connection problem with WPA3
b43legacy: Fix case where channel status is corrupted
media: go7007: fix a miss of snd_card_free
carl9170: remove P2P_GO support
e1000e: Relax condition to trigger reset for ME workaround
* PCI: Program MPS for RCiEP devices
drivers/pci/probe.c
* blk-mq: move blk_mq_update_nr_hw_queues synchronize_rcu call
block/blk-mq.c
btrfs: fix error handling when submitting direct I/O bio
* ext4: fix race between ext4_sync_parent() and rename()
fs/ext4/fsync.c
* ext4: fix EXT_MAX_EXTENT/INDEX to check for zeroed eh_max
fs/ext4/ext4_extents.h
evm: Fix possible memory leak in evm_calc_hmac_or_hash()
ima: Directly assign the ima_default_policy pointer to ima_rules
ima: Fix ima digest hash table key calculation
mm: thp: make the THP mapcount atomic against __split_huge_pmd_locked()
btrfs: send: emit file capabilities after chown
* cpuidle: Fix three reference count leaks
drivers/cpuidle/sysfs.c
spi: dw: Return any value retrieved from the dma_transfer callback
mmc: sdhci-esdhc-imx: fix the mask for tuning start point
ixgbe: fix signed-integer-overflow warning
staging: greybus: sdio: Respect the cmd->busy_timeout from the mmc core
MIPS: Fix IRQ tracing when call handle_fpe() and handle_msa_fpe()
* PCI: Don't disable decoding when mmio_always_on is set
drivers/pci/probe.c
macvlan: Skip loopback packets in RX handler
m68k: mac: Don't call via_flush_cache() on Mac IIfx
x86/mm: Stop printing BRK addresses
mips: Add udelay lpj numbers adjustment
x86/boot: Correct relocation destination on old linkers
mwifiex: Fix memory corruption in dump_station
rtlwifi: Fix a double free in _rtl_usb_tx_urb_setup()
md: don't flush workqueue unconditionally in md_open
* kgdb: Fix spurious true from in_dbg_master()
include/linux/kgdb.h
mips: cm: Fix an invalid error code of INTVN_*_ERR
MIPS: Truncate link address into 32bit for 32bit kernel
powerpc/spufs: fix copy_to_user while atomic
net: allwinner: Fix use correct return type for ndo_start_xmit()
net: lpc-enet: fix error return code in lpc_mii_init()
* exit: Move preemption fixup up, move blocking operations down
kernel/exit.c
* lib/mpi: Fix 64-bit MIPS build with Clang
lib/mpi/longlong.h
netfilter: nft_nat: return EOPNOTSUPP if type or flags are not supported
MIPS: Make sparse_init() using top-down allocation
media: platform: fcp: Set appropriate DMA parameters
media: dvb: return -EREMOTEIO on i2c transfer failure.
dt-bindings: display: mediatek: control dpi pins mode to avoid leakage
e1000: Distribute switch variables for initialization
* staging: android: ion: use vmap instead of vm_map_ram
drivers/staging/android/ion/ion_heap.c
net: vmxnet3: fix possible buffer overflow caused by bad DMA value in vmxnet3_get_rss()
* x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit
include/uapi/linux/kvm.h
ARM: 8978/1: mm: make act_mm() respect THREAD_SIZE
btrfs: do not ignore error from btrfs_next_leaf() when inserting checksums
clocksource: dw_apb_timer_of: Fix missing clockevent timers
spi: dw: Enable interrupts in accordance with DMA xfer mode
* kgdb: Prevent infinite recursive entries to the debugger
kernel/debug/debug_core.c
* Bluetooth: Add SCO fallback for invalid LMP parameters error
net/bluetooth/hci_event.c
spi: dw: Zero DMA Tx and Rx configurations on stack
net: ena: fix error returning in ena_com_get_hash_function()
objtool: Ignore empty alternatives
media: si2157: Better check for running tuner in init
ACPI: GED: use correct trigger type field in _Exx / _Lxx handling
* media: dvb_frontend: ensure that inital front end status initialized
drivers/media/dvb-core/dvb_frontend.c
include/uapi/linux/dvb/frontend.h
can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices
agp/intel: Reinforce the barrier after GTT updates
* perf: Add cond_resched() to task_function_call()
kernel/events/core.c
* fat: don't allow to mount if the FAT length == 0
fs/fat/inode.c
* mm/slub: fix a memory leak in sysfs_slab_add()
mm/slub.c
* Smack: slab-out-of-bounds in vsscanf
security/smack/smackfs.c
ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb
ath9x: Fix stack-out-of-bounds Write in ath9k_hif_usb_rx_cb
ath9k: Fix use-after-free Write in ath9k_htc_rx_msg
ath9k: Fix use-after-free Read in ath9k_wmi_ctrl_rx
* KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts
arch/arm64/include/asm/kvm_host.h
KVM: MIPS: Fix VPN2_MASK definition for variable cpu_vmbits
KVM: MIPS: Define KVM_ENTRYHI_ASID to cpu_asid_mask(&boot_cpu_data)
KVM: nVMX: Consult only the "basic" exit reason when routing nested exit
KVM: nSVM: leave ASID aside in copy_vmcb_control_area
video: fbdev: w100fb: Fix a potential double free.
* proc: Use new_inode not new_inode_pseudo
fs/proc/inode.c
fs/proc/self.c
fs/proc/thread_self.c
* ovl: initialize error in ovl_copy_xattr
fs/overlayfs/copy_up.c
spi: bcm2835: Fix controller unregister order
spi: pxa2xx: Fix controller unregister order
* spi: Fix controller unregister order
drivers/spi/spi.c
* spi: No need to assign dummy value in spi_unregister_controller()
drivers/spi/spi.c
spi: dw: Fix controller unregister order
spi: dw: fix possible race condition
x86/speculation: PR_SPEC_FORCE_DISABLE enforcement for indirect branches.
x86/speculation: Avoid force-disabling IBPB based on STIBP and enhanced IBRS.
x86/speculation: Add support for STIBP always-on preferred mode
x86/speculation: Change misspelled STIPB to STIBP
* ALSA: pcm: disallow linking stream to itself
sound/core/pcm_native.c
spi: bcm-qspi: when tx/rx buffer is NULL set to 0
spi: bcm2835aux: Fix controller unregister order
nilfs2: fix null pointer dereference at nilfs_segctor_do_construct()
* cgroup, blkcg: Prepare some symbols for module and !CONFIG_CGROUP usages
fs/fs-writeback.c
ACPI: PM: Avoid using power resources if there are none for D0
ACPI: GED: add support for _Exx / _Lxx handler methods
ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe()
ACPI: sysfs: Fix reference count leak in acpi_sysfs_add_hotplug_profile()
* ALSA: usb-audio: Fix inconsistent card PM state after resume
sound/usb/card.c
sound/usb/usbaudio.h
ALSA: es1688: Add the missed snd_card_free()
efi/efivars: Add missing kobject_put() in sysfs entry creation error path
x86/reboot/quirks: Add MacBook6,1 reboot quirk
x86/speculation: Prevent rogue cross-process SSBD shutdown
x86/PCI: Mark Intel C620 MROMs as having non-compliant BARs
x86_64: Fix jiffies ODR violation
ath9k_htc: Silence undersized packet warnings
drivers/net/ibmvnic: Update VNIC protocol version reporting
* sched/fair: Don't NUMA balance for kthreads
kernel/sched/fair.c
ARM: 8977/1: ptrace: Fix mask for thumb breakpoint hook
crypto: talitos - fix ECB and CBC algs ivsize
* scsi: return correct blkprep status code in case scsi_init_io() fails.
drivers/scsi/scsi_lib.c
vxlan: Avoid infinite loop when suppressing NS messages with invalid options
* ipv6: fix IPV6_ADDRFORM operation logic
net/ipv6/ipv6_sockglue.c
Merge 4.9.227 into android-4.9-q
Linux 4.9.227
uprobes: ensure that uprobe->offset and ->ref_ctr_offset are properly aligned
iio: vcnl4000: Fix i2c swapped word reading.
x86/speculation: Add Ivy Bridge to affected list
x86/speculation: Add SRBDS vulnerability and mitigation documentation
* x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation
drivers/base/cpu.c
x86/cpu: Add 'table' argument to cpu_matches()
* x86/cpu: Add a steppings field to struct x86_cpu_id
include/linux/mod_devicetable.h
* nvmem: qfprom: remove incorrect write support
drivers/nvmem/qfprom.c
staging: rtl8712: Fix IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK
tty: hvc_console, fix crashes on parallel open/close
* vt: keyboard: avoid signed integer overflow in k_ascii
drivers/tty/vt/keyboard.c
usb: musb: Fix runtime PM imbalance on error
USB: serial: option: add Telit LE910C1-EUX compositions
USB: serial: usb_wwan: do not resubmit rx urb on fatal errors
USB: serial: qcserial: add DW5816e QDL support
* l2tp: add sk_family checks to l2tp_validate_socket
net/l2tp/l2tp_core.c
vsock: fix timeout in vsock_accept()
NFC: st21nfca: add missed kfree_skb() in an error path
net: usb: qmi_wwan: add Telit LE910C1-EUX composition
* l2tp: do not use inet_hash()/inet_unhash()
net/l2tp/l2tp_ip.c
net/l2tp/l2tp_ip6.c
* devinet: fix memleak in inetdev_init()
net/ipv4/devinet.c
airo: Fix read overflows sending packets
* scsi: ufs: Release clock if DMA map fails
drivers/scsi/ufs/ufshcd.c
slip: not call free_netdev before rtnl_unlock in slip_open
slcan: Fix double-free on slcan_open() error path
* mmc: fix compilation of user API
include/uapi/linux/mmc/ioctl.h
kernel/relay.c: handle alloc_percpu returning NULL in relay_open
p54usb: add AirVasT USB stick device-id
HID: i2c-hid: add Schneider SCL142ALM to descriptor override
* mm: Fix mremap not considering huge pmd devmap
mm/mremap.c
* pppoe: only process PADT targeted at local interfaces
drivers/net/ppp/pppoe.c
net: smsc911x: Fix runtime PM imbalance on error
net: ethernet: stmmac: Enable interface clocks on probe for IPQ806x
net/ethernet/freescale: rework quiesce/activate for ucc_geth
net: bmac: Fix read of MAC address from ROM
x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables
ARC: Fix ICCM & DCCM runtime size checks
s390/ftrace: save traced function caller
spi: dw: use "smp_mb()" to avoid sending spi data error
* esp6: fix memleak on error path in esp6_input
net/ipv6/esp6.c
usb: gadget: f_uac2: fix error handling in afunc_bind (again)
* scsi: scsi_devinfo: fixup string compare
drivers/scsi/scsi_devinfo.c
Merge 4.9.226 into android-4.9-q
Linux 4.9.226
scsi: zfcp: fix request object use-after-free in send path causing wrong traces
net: hns: Fixes the missing put_device in positive leg for roce reset
sc16is7xx: move label 'err_spi' to correct section
* mm/vmalloc.c: don't dereference possible NULL pointer in __vunmap()
mm/vmalloc.c
* net: rtnl_configure_link: fix dev flags changes arg to __dev_notify_flags
net/core/rtnetlink.c
genirq/generic_pending: Do not lose pending affinity update
* netfilter: nf_conntrack_pptp: fix compilation warning with W=1 build
include/linux/netfilter/nf_conntrack_pptp.h
net/netfilter/nf_conntrack_pptp.c
* bonding: Fix reference count leak in bond_sysfs_slave_add.
drivers/net/bonding/bond_sysfs_slave.c
qlcnic: fix missing release in qlcnic_83xx_interrupt_test.
* netfilter: nf_conntrack_pptp: prevent buffer overflows in debug code
include/linux/netfilter/nf_conntrack_pptp.h
net/ipv4/netfilter/nf_nat_pptp.c
net/netfilter/nf_conntrack_pptp.c
netfilter: ipset: Fix subcounter update skip
netfilter: nft_reject_bridge: enable reject with bridge vlan
* ip_vti: receive ipip packet by calling ip_tunnel_rcv
net/ipv4/ip_vti.c
* vti4: eliminated some duplicate code.
net/ipv4/ip_vti.c
* xfrm: fix a NULL-ptr deref in xfrm_local_error
net/xfrm/xfrm_output.c
* xfrm: fix a warning in xfrm_policy_insert_list
net/xfrm/xfrm_policy.c
* xfrm: allow to accept packets with ipv6 NEXTHDR_HOP in xfrm_input
net/xfrm/xfrm_input.c
x86/dma: Fix max PFN arithmetic overflow on 32 bit systems
mac80211: mesh: fix discovery timer re-arming issue / crash
parisc: Fix kernel panic in mem_init()
* iommu: Fix reference count leak in iommu_group_alloc.
drivers/iommu/iommu.c
* include/asm-generic/topology.h: guard cpumask_of_node() macro argument
include/asm-generic/topology.h
* fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
fs/binfmt_elf.c
* mm: remove VM_BUG_ON(PageSlab()) from page_mapcount()
include/linux/mm.h
libceph: ignore pool overlay and cache logic on redirects
* exec: Always set cap_ambient in cap_bprm_set_creds
security/commoncap.c
* ALSA: usb-audio: mixer: volume quirk for ESS Technology Asus USB DAC
sound/usb/mixer.c
* ALSA: hwdep: fix a left shifting 1 by 31 UB bug
sound/core/hwdep.c
ARM: dts/imx6q-bx50v3: Set display interface clock parents
ARM: dts: imx6q-bx50v3: Add internal switch
ARM: dts: imx: Correct B850v3 clock assignment
IB/qib: Call kobject_put() when kobject_init_and_add() fails
Input: synaptics-rmi4 - fix error return code in rmi_driver_probe()
Input: i8042 - add ThinkPad S230u to i8042 reset list
* Input: xpad - add custom init packet for Xbox One S controllers
drivers/input/joystick/xpad.c
* Input: evdev - call input_flush_device() on release(), not flush()
drivers/input/evdev.c
Input: usbtouchscreen - add support for BonXeon TP
cifs: Fix null pointer check in cifs_read
usb: gadget: legacy: fix redundant initialization warnings
cachefiles: Fix race between read_waiter and read_copier involving op->to_do
gfs2: move privileged user check to gfs2_quota_lock_check
net: microchip: encx24j600: add missed kthread_stop
gpio: tegra: mask GPIO IRQs during IRQ shutdown
IB/cma: Fix reference count leak when no ipv4 addresses are set
* uapi: fix linux/if_pppol2tp.h userspace compilation errors
include/uapi/linux/l2tp.h
net/mlx4_core: fix a memory leak bug.
net: sun: fix missing release regions in cas_init_one().
net/mlx5: Add command entry handling completion
net: qrtr: Fix passing invalid reference to qrtr_local_enqueue()
net/mlx5e: Update netdev txq on completions during closure
sctp: Start shutdown on association restart if in SHUTDOWN-SENT state and socket is closed
* net sched: fix reporting the first-time use timestamp
include/net/act_api.h
* net: revert "net: get rid of an signed integer overflow in ip_idents_reserve()"
net/ipv4/route.c
net: ipip: fix wrong address family in init error path
ax25: fix setsockopt(SO_BINDTODEVICE)
ANDROID: cuttlefish defconfig - enable mount/net/uts namespaces.
Merge 4.9.225 into android-4.9-q
Linux 4.9.225
iio: sca3000: Remove an erroneous 'get_device()'
rapidio: fix an error in get_user_pages_fast() error handling
mei: release me_cl object reference
iio: dac: vf610: Fix an error handling path in 'vf610_dac_probe()'
staging: greybus: Fix uninitialized scalar variable
staging: iio: ad2s1210: Fix SPI reading
Revert "gfs2: Don't demote a glock until its revokes are written"
cxgb4/cxgb4vf: Fix mac_hlist initialization and free
cxgb4: free mac_hlist properly
libnvdimm/btt: Remove unnecessary code in btt_freelist_init
platform/x86: alienware-wmi: fix kfree on potentially uninitialized pointer
* ubsan: build ubsan.c more conservatively
lib/Makefile
* x86/uaccess, ubsan: Fix UBSAN vs. SMAP
lib/Makefile
* l2tp: device MTU setup, tunnel socket needs a lock
include/linux/net.h
net/l2tp/l2tp_eth.c
net/socket.c
dmaengine: tegra210-adma: Fix an error handling path in 'tegra_adma_probe()'
* ALSA: pcm: fix incorrect hw_base increase
sound/core/pcm_lib.c
* l2tp: initialise PPP sessions before registering them
net/l2tp/l2tp_ppp.c
* l2tp: protect sock pointer of struct pppol2tp_session with RCU
net/l2tp/l2tp_ppp.c
* l2tp: initialise l2tp_eth sessions before registering them
net/l2tp/l2tp_eth.c
* l2tp: don't register sessions in l2tp_session_create()
net/l2tp/l2tp_core.c
net/l2tp/l2tp_core.h
net/l2tp/l2tp_eth.c
net/l2tp/l2tp_ppp.c
* l2tp: fix l2tp_eth module loading
net/l2tp/l2tp_eth.c
* l2tp: pass tunnel pointer to ->session_create()
net/l2tp/l2tp_core.h
net/l2tp/l2tp_eth.c
net/l2tp/l2tp_netlink.c
net/l2tp/l2tp_ppp.c
* l2tp: prevent creation of sessions on terminated tunnels
net/l2tp/l2tp_core.c
net/l2tp/l2tp_core.h
* l2tp: hold tunnel used while creating sessions with netlink
net/l2tp/l2tp_netlink.c
* l2tp: hold tunnel while handling genl TUNNEL_GET commands
net/l2tp/l2tp_netlink.c
* l2tp: hold tunnel while handling genl tunnel updates
net/l2tp/l2tp_netlink.c
* l2tp: hold tunnel while processing genl delete command
net/l2tp/l2tp_netlink.c
* l2tp: hold tunnel while looking up sessions in l2tp_netlink
net/l2tp/l2tp_core.c
net/l2tp/l2tp_core.h
net/l2tp/l2tp_netlink.c
* l2tp: initialise session's refcount before making it reachable
net/l2tp/l2tp_core.c
* l2tp: define parameters of l2tp_tunnel_find*() as "const"
net/l2tp/l2tp_core.c
net/l2tp/l2tp_core.h
* l2tp: define parameters of l2tp_session_get*() as "const"
net/l2tp/l2tp_core.c
net/l2tp/l2tp_core.h
* l2tp: remove l2tp_session_find()
net/l2tp/l2tp_core.c
net/l2tp/l2tp_core.h
* l2tp: remove useless duplicate session detection in l2tp_netlink
net/l2tp/l2tp_netlink.c
* L2TP:Adjust intf MTU, add underlay L3, L2 hdrs.
net/l2tp/l2tp_eth.c
* New kernel function to get IP overhead on a socket.
include/linux/net.h
net/socket.c
* net: l2tp: ppp: change PPPOL2TP_MSG_* => L2TP_MSG_*
net/l2tp/l2tp_ppp.c
* net: l2tp: deprecate PPPOL2TP_MSG_* in favour of L2TP_MSG_*
include/uapi/linux/if_pppol2tp.h
* net: l2tp: export debug flags to UAPI
include/uapi/linux/l2tp.h
net/l2tp/l2tp_core.h
* watchdog: Fix the race between the release of watchdog_core_data and cdev
drivers/watchdog/watchdog_dev.c
arm64: fix the flush_icache_range arguments in machine_kexec
padata: purge get_cpu and reorder_via_wq from padata_do_serial
padata: initialize pd->cpu with effective cpumask
padata: Replace delayed timer with immediate workqueue in padata_reorder
padata: set cpu_index of unused CPUs to -1
* i2c: dev: Fix the race between the release of i2c_dev and cdev
drivers/i2c/i2c-dev.c
ARM: futex: Address build warning
platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA
* USB: core: Fix misleading driver bug report
drivers/usb/core/message.c
ceph: fix double unlock in handle_cap_export()
gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp()
* component: Silence bind error on -EPROBE_DEFER
drivers/base/component.c
* configfs: fix config_item refcnt leak in configfs_rmdir()
fs/configfs/dir.c
* HID: multitouch: add eGalaxTouch P80H84 support
drivers/hid/hid-ids.h
drivers/hid/hid-multitouch.c
* gcc-common.h: Update for GCC 10
scripts/gcc-plugins/Makefile
i2c: mux: demux-pinctrl: Fix an error handling path in 'i2c_demux_pinctrl_probe()'
iommu/amd: Fix over-read of ACPI UID from IVRS table
* fix multiplication overflow in copy_fdtable()
fs/file.c
ima: Fix return value of ima_write_policy()
evm: Check also if *tfm is an error pointer in init_desc()
padata: ensure padata_do_serial() runs on the correct CPU
padata: ensure the reorder timer callback runs on the correct CPU
padata: get_next is never NULL
padata: Remove unused but set variables
igb: use igb_adapter->io_addr instead of e1000_hw->hw_addr
Merge 4.9.224 into android-4.9-q
Linux 4.9.224
* Makefile: disallow data races on gcc-10 as well
Makefile
KVM: x86: Fix off-by-one error in kvm_vcpu_ioctl_x86_setup_mce
ARM: dts: r8a7740: Add missing extal2 to CPG node
ARM: dts: r8a73a4: Add missing CMT1 interrupts
Revert "ALSA: hda/realtek: Fix pop noise on ALC225"
usb: gadget: legacy: fix error return code in cdc_bind()
usb: gadget: legacy: fix error return code in gncm_bind()
usb: gadget: audio: Fix a missing error return value in audio_bind()
usb: gadget: net2272: Fix a memory leak in an error handling path in 'net2272_plat_probe()'
* exec: Move would_dump into flush_old_exec
fs/exec.c
* x86: Fix early boot crash on gcc-10, third try
include/linux/compiler.h
init/main.c
ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries
* usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list
drivers/usb/host/xhci-ring.c
* USB: gadget: fix illegal array access in binding with UDC
drivers/usb/gadget/configfs.c
* ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset
sound/usb/quirks.c
* ALSA: rawmidi: Fix racy buffer resize under concurrent accesses
include/sound/rawmidi.h
sound/core/rawmidi.c
* ALSA: rawmidi: Initialize allocated buffers
sound/core/rawmidi.c
ALSA: hda/realtek - Limit int mic boost for Thinkpad T530
netprio_cgroup: Fix unlimited memory leak of v2 cgroups
* net: ipv4: really enforce backoff for redirects
net/ipv4/route.c
* Revert "ipv6: add mtu lock check in __ip6_rt_update_pmtu"
net/ipv6/route.c
* netlabel: cope with NULL catmap
net/ipv4/cipso_ipv4.c
net/ipv6/calipso.c
net/netlabel/netlabel_kapi.c
* net: fix a potential recursive NETDEV_FEAT_CHANGE
net/core/dev.c
* gcc-10: disable 'restrict' warning for now
Makefile
* gcc-10: disable 'stringop-overflow' warning for now
Makefile
* gcc-10: disable 'array-bounds' warning for now
Makefile
* gcc-10: disable 'zero-length-bounds' warning for now
Makefile
* gcc-10: avoid shadowing standard library 'free()' in crypto
crypto/xts.c
net: phy: micrel: Use strlcpy() for ethtool::get_strings
* Stop the ad-hoc games with -Wno-maybe-initialized
Makefile
init/Kconfig
kernel/trace/Kconfig
* kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
Makefile
init/Kconfig
kernel/trace/Kconfig
* gcc-10 warnings: fix low-hanging fruit
include/linux/fs.h
include/linux/tty.h
pnp: Use list_for_each_entry() instead of open coding
IB/mlx4: Test return value of calls to ib_get_cached_pkey
* netfilter: conntrack: avoid gcc-10 zero-length-bounds warning
include/net/netfilter/nf_conntrack.h
net/netfilter/nf_conntrack_core.c
i40iw: Fix error handling in i40iw_manage_arp_cache()
pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler
ipc/util.c: sysvipc_find_ipc() incorrectly updates position index
drm/qxl: lost qxl_bo_kunmap_atomic_page in qxl_image_init_helper()
ALSA: hda/hdmi: fix race in monitor detection during probe
dmaengine: mmp_tdma: Reset channel error on release
dmaengine: pch_dma.c: Avoid data race between probe and irq handler
cifs: Fix a race condition with cifs_echo_request
cifs: Check for timeout on Negotiate stage
spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls
* scsi: sg: add sg_remove_request in sg_write
drivers/scsi/sg.c
drop_monitor: work around gcc-10 stringop-overflow warning
net: moxa: Fix a potential double 'free_irq()'
net/sonic: Fix a resource leak in an error handling path in 'jazz_sonic_probe()'
* shmem: fix possible deadlocks on shmlock_user_lock
mm/shmem.c
ptp: free ptp device pin descriptors properly
* ptp: fix the race between the release of ptp_clock and cdev
include/linux/posix-clock.h
kernel/time/posix-clock.c
ptp: Fix pass zero to ERR_PTR() in ptp_clock_register
* chardev: add helper function to register char devs with a struct device
fs/char_dev.c
include/linux/cdev.h
ptp: create "pins" together with the rest of attributes
ptp: use is_visible method to hide unused attributes
ptp: do not explicitly set drvdata in ptp_clock_register()
* blktrace: fix dereference after null check
kernel/trace/blktrace.c
* blktrace: Protect q->blk_trace with RCU
include/linux/blkdev.h
include/linux/blktrace_api.h
kernel/trace/blktrace.c
* blktrace: fix trace mutex deadlock
kernel/trace/blktrace.c
* blktrace: fix unlocked access to init/start-stop/teardown
kernel/trace/blktrace.c
* blktrace: Fix potential deadlock between delete & sysfs ops
block/blk-core.c
include/linux/blkdev.h
kernel/trace/blktrace.c
* net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
include/net/addrconf.h
net/ipv6/addrconf_core.c
net/ipv6/af_inet6.c
* net: ipv6: add net argument to ip6_dst_lookup_flow
include/net/ipv6.h
net/ipv6/af_inet6.c
net/ipv6/datagram.c
net/ipv6/inet6_connection_sock.c
net/ipv6/ip6_output.c
net/ipv6/raw.c
net/ipv6/tcp_ipv6.c
net/l2tp/l2tp_ip6.c
* ext4: add cond_resched() to ext4_protect_reserved_inode
fs/ext4/block_validity.c
* binfmt_elf: Do not move brk for INTERP-less ET_EXEC
fs/binfmt_elf.c
scripts/decodecode: fix trapping instruction formatting
objtool: Fix stack offset tracking for indirect CFAs
batman-adv: Fix refcnt leak in batadv_v_ogm_process
batman-adv: Fix refcnt leak in batadv_store_throughput_override
batman-adv: Fix refcnt leak in batadv_show_throughput_override
batman-adv: fix batadv_nc_random_weight_tq
* mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous()
mm/page_alloc.c
* tracing: Add a vmalloc_sync_mappings() for safe measure
kernel/trace/trace.c
USB: serial: garmin_gps: add sanity checking for data length
USB: uas: add quirk for LaCie 2Big Quadra
* binfmt_elf: move brk out of mmap when doing direct loader exec
fs/binfmt_elf.c
Revert "ACPI / video: Add force_native quirk for HP Pavilion dv6"
bnxt_en: Improve AER slot reset.
net/mlx5: Fix command entry leak in Internal Error State
net/mlx5: Fix forced completion access non initialized command entry
bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features().
sch_sfq: validate silly quantum values
sch_choke: avoid potential panic in choke_reset()
net: usb: qmi_wwan: add support for DW5816e
net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc()
net: macsec: preserve ingress frame ordering
* fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks
net/sched/sch_fq_codel.c
dp83640: reverse arguments to list_add_tail
USB: serial: qcserial: Add DW5816e support
* ANDROID: hid: steam: remove BT controller matching
drivers/hid/hid-core.c
drivers/hid/hid-ids.h
* UPSTREAM: HID: steam: Fix input device disappearing
drivers/hid/hid-steam.c
Change-Id: I03104a17738ef3d28a296ca370185f58396c9262
Signed-off-by: lucaswei <lucaswei@google.com>
This commit is contained in:
@@ -358,6 +358,7 @@ What: /sys/devices/system/cpu/vulnerabilities
|
||||
/sys/devices/system/cpu/vulnerabilities/spec_store_bypass
|
||||
/sys/devices/system/cpu/vulnerabilities/l1tf
|
||||
/sys/devices/system/cpu/vulnerabilities/mds
|
||||
/sys/devices/system/cpu/vulnerabilities/srbds
|
||||
/sys/devices/system/cpu/vulnerabilities/tsx_async_abort
|
||||
/sys/devices/system/cpu/vulnerabilities/itlb_multihit
|
||||
Date: January 2018
|
||||
|
||||
@@ -16,6 +16,9 @@ Required properties:
|
||||
Documentation/devicetree/bindings/graph.txt. This port should be connected
|
||||
to the input port of an attached HDMI or LVDS encoder chip.
|
||||
|
||||
Optional properties:
|
||||
- pinctrl-names: Contain "default" and "sleep".
|
||||
|
||||
Example:
|
||||
|
||||
dpi0: dpi@1401d000 {
|
||||
@@ -26,6 +29,9 @@ dpi0: dpi@1401d000 {
|
||||
<&mmsys CLK_MM_DPI_ENGINE>,
|
||||
<&apmixedsys CLK_APMIXED_TVDPLL>;
|
||||
clock-names = "pixel", "engine", "pll";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&dpi_pin_func>;
|
||||
pinctrl-1 = <&dpi_pin_idle>;
|
||||
|
||||
port {
|
||||
dpi0_out: endpoint {
|
||||
|
||||
@@ -12,4 +12,5 @@ are configurable at compile, boot or run time.
|
||||
l1tf
|
||||
mds
|
||||
tsx_async_abort
|
||||
multihit.rst
|
||||
multihit
|
||||
special-register-buffer-data-sampling
|
||||
|
||||
149
Documentation/hw-vuln/special-register-buffer-data-sampling.rst
Normal file
149
Documentation/hw-vuln/special-register-buffer-data-sampling.rst
Normal file
@@ -0,0 +1,149 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
SRBDS - Special Register Buffer Data Sampling
|
||||
=============================================
|
||||
|
||||
SRBDS is a hardware vulnerability that allows MDS :doc:`mds` techniques to
|
||||
infer values returned from special register accesses. Special register
|
||||
accesses are accesses to off core registers. According to Intel's evaluation,
|
||||
the special register reads that have a security expectation of privacy are
|
||||
RDRAND, RDSEED and SGX EGETKEY.
|
||||
|
||||
When RDRAND, RDSEED and EGETKEY instructions are used, the data is moved
|
||||
to the core through the special register mechanism that is susceptible
|
||||
to MDS attacks.
|
||||
|
||||
Affected processors
|
||||
--------------------
|
||||
Core models (desktop, mobile, Xeon-E3) that implement RDRAND and/or RDSEED may
|
||||
be affected.
|
||||
|
||||
A processor is affected by SRBDS if its Family_Model and stepping is
|
||||
in the following list, with the exception of the listed processors
|
||||
exporting MDS_NO while Intel TSX is available yet not enabled. The
|
||||
latter class of processors are only affected when Intel TSX is enabled
|
||||
by software using TSX_CTRL_MSR otherwise they are not affected.
|
||||
|
||||
============= ============ ========
|
||||
common name Family_Model Stepping
|
||||
============= ============ ========
|
||||
IvyBridge 06_3AH All
|
||||
|
||||
Haswell 06_3CH All
|
||||
Haswell_L 06_45H All
|
||||
Haswell_G 06_46H All
|
||||
|
||||
Broadwell_G 06_47H All
|
||||
Broadwell 06_3DH All
|
||||
|
||||
Skylake_L 06_4EH All
|
||||
Skylake 06_5EH All
|
||||
|
||||
Kabylake_L 06_8EH <= 0xC
|
||||
Kabylake 06_9EH <= 0xD
|
||||
============= ============ ========
|
||||
|
||||
Related CVEs
|
||||
------------
|
||||
|
||||
The following CVE entry is related to this SRBDS issue:
|
||||
|
||||
============== ===== =====================================
|
||||
CVE-2020-0543 SRBDS Special Register Buffer Data Sampling
|
||||
============== ===== =====================================
|
||||
|
||||
Attack scenarios
|
||||
----------------
|
||||
An unprivileged user can extract values returned from RDRAND and RDSEED
|
||||
executed on another core or sibling thread using MDS techniques.
|
||||
|
||||
|
||||
Mitigation mechanism
|
||||
-------------------
|
||||
Intel will release microcode updates that modify the RDRAND, RDSEED, and
|
||||
EGETKEY instructions to overwrite secret special register data in the shared
|
||||
staging buffer before the secret data can be accessed by another logical
|
||||
processor.
|
||||
|
||||
During execution of the RDRAND, RDSEED, or EGETKEY instructions, off-core
|
||||
accesses from other logical processors will be delayed until the special
|
||||
register read is complete and the secret data in the shared staging buffer is
|
||||
overwritten.
|
||||
|
||||
This has three effects on performance:
|
||||
|
||||
#. RDRAND, RDSEED, or EGETKEY instructions have higher latency.
|
||||
|
||||
#. Executing RDRAND at the same time on multiple logical processors will be
|
||||
serialized, resulting in an overall reduction in the maximum RDRAND
|
||||
bandwidth.
|
||||
|
||||
#. Executing RDRAND, RDSEED or EGETKEY will delay memory accesses from other
|
||||
logical processors that miss their core caches, with an impact similar to
|
||||
legacy locked cache-line-split accesses.
|
||||
|
||||
The microcode updates provide an opt-out mechanism (RNGDS_MITG_DIS) to disable
|
||||
the mitigation for RDRAND and RDSEED instructions executed outside of Intel
|
||||
Software Guard Extensions (Intel SGX) enclaves. On logical processors that
|
||||
disable the mitigation using this opt-out mechanism, RDRAND and RDSEED do not
|
||||
take longer to execute and do not impact performance of sibling logical
|
||||
processors memory accesses. The opt-out mechanism does not affect Intel SGX
|
||||
enclaves (including execution of RDRAND or RDSEED inside an enclave, as well
|
||||
as EGETKEY execution).
|
||||
|
||||
IA32_MCU_OPT_CTRL MSR Definition
|
||||
--------------------------------
|
||||
Along with the mitigation for this issue, Intel added a new thread-scope
|
||||
IA32_MCU_OPT_CTRL MSR, (address 0x123). The presence of this MSR and
|
||||
RNGDS_MITG_DIS (bit 0) is enumerated by CPUID.(EAX=07H,ECX=0).EDX[SRBDS_CTRL =
|
||||
9]==1. This MSR is introduced through the microcode update.
|
||||
|
||||
Setting IA32_MCU_OPT_CTRL[0] (RNGDS_MITG_DIS) to 1 for a logical processor
|
||||
disables the mitigation for RDRAND and RDSEED executed outside of an Intel SGX
|
||||
enclave on that logical processor. Opting out of the mitigation for a
|
||||
particular logical processor does not affect the RDRAND and RDSEED mitigations
|
||||
for other logical processors.
|
||||
|
||||
Note that inside of an Intel SGX enclave, the mitigation is applied regardless
|
||||
of the value of RNGDS_MITG_DS.
|
||||
|
||||
Mitigation control on the kernel command line
|
||||
---------------------------------------------
|
||||
The kernel command line allows control over the SRBDS mitigation at boot time
|
||||
with the option "srbds=". The option for this is:
|
||||
|
||||
============= =============================================================
|
||||
off This option disables SRBDS mitigation for RDRAND and RDSEED on
|
||||
affected platforms.
|
||||
============= =============================================================
|
||||
|
||||
SRBDS System Information
|
||||
-----------------------
|
||||
The Linux kernel provides vulnerability status information through sysfs. For
|
||||
SRBDS this can be accessed by the following sysfs file:
|
||||
/sys/devices/system/cpu/vulnerabilities/srbds
|
||||
|
||||
The possible values contained in this file are:
|
||||
|
||||
============================== =============================================
|
||||
Not affected Processor not vulnerable
|
||||
Vulnerable Processor vulnerable and mitigation disabled
|
||||
Vulnerable: No microcode Processor vulnerable and microcode is missing
|
||||
mitigation
|
||||
Mitigation: Microcode Processor is vulnerable and mitigation is in
|
||||
effect.
|
||||
Mitigation: TSX disabled Processor is only vulnerable when TSX is
|
||||
enabled while this system was booted with TSX
|
||||
disabled.
|
||||
Unknown: Dependent on
|
||||
hypervisor status Running on virtual guest processor that is
|
||||
affected but with no way to know if host
|
||||
processor is mitigated or vulnerable.
|
||||
============================== =============================================
|
||||
|
||||
SRBDS Default mitigation
|
||||
------------------------
|
||||
This new microcode serializes processor access during execution of RDRAND,
|
||||
RDSEED ensures that the shared buffer is overwritten before it is released for
|
||||
reuse. Use the "srbds=off" kernel command line to disable the mitigation for
|
||||
RDRAND and RDSEED.
|
||||
@@ -4295,6 +4295,26 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
spia_pedr=
|
||||
spia_peddr=
|
||||
|
||||
srbds= [X86,INTEL]
|
||||
Control the Special Register Buffer Data Sampling
|
||||
(SRBDS) mitigation.
|
||||
|
||||
Certain CPUs are vulnerable to an MDS-like
|
||||
exploit which can leak bits from the random
|
||||
number generator.
|
||||
|
||||
By default, this issue is mitigated by
|
||||
microcode. However, the microcode fix can cause
|
||||
the RDRAND and RDSEED instructions to become
|
||||
much slower. Among other effects, this will
|
||||
result in reduced throughput from /dev/urandom.
|
||||
|
||||
The microcode mitigation can be disabled with
|
||||
the following option:
|
||||
|
||||
off: Disable mitigation and remove
|
||||
performance impact to RDRAND and RDSEED
|
||||
|
||||
ssbd= [ARM64,HW]
|
||||
Speculative Store Bypass Disable control
|
||||
|
||||
|
||||
@@ -177,10 +177,10 @@ setsockopt on the PPPoX socket to set a debug mask.
|
||||
|
||||
The following debug mask bits are available:
|
||||
|
||||
PPPOL2TP_MSG_DEBUG verbose debug (if compiled in)
|
||||
PPPOL2TP_MSG_CONTROL userspace - kernel interface
|
||||
PPPOL2TP_MSG_SEQ sequence numbers handling
|
||||
PPPOL2TP_MSG_DATA data packets
|
||||
L2TP_MSG_DEBUG verbose debug (if compiled in)
|
||||
L2TP_MSG_CONTROL userspace - kernel interface
|
||||
L2TP_MSG_SEQ sequence numbers handling
|
||||
L2TP_MSG_DATA data packets
|
||||
|
||||
If enabled, files under a l2tp debugfs directory can be used to dump
|
||||
kernel state about L2TP tunnels and sessions. To access it, the
|
||||
|
||||
@@ -3534,9 +3534,11 @@ EOI was received.
|
||||
#define KVM_EXIT_HYPERV_SYNIC 1
|
||||
#define KVM_EXIT_HYPERV_HCALL 2
|
||||
__u32 type;
|
||||
__u32 pad1;
|
||||
union {
|
||||
struct {
|
||||
__u32 msr;
|
||||
__u32 pad2;
|
||||
__u64 control;
|
||||
__u64 evt_page;
|
||||
__u64 msg_page;
|
||||
|
||||
36
Makefile
36
Makefile
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 223
|
||||
SUBLEVEL = 228
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
@@ -313,12 +313,8 @@ KBUILD_MODULES :=
|
||||
KBUILD_BUILTIN := 1
|
||||
|
||||
# If we have only "make modules", don't compile built-in objects.
|
||||
# When we're building modules with modversions, we need to consider
|
||||
# the built-in objects during the descend as well, in order to
|
||||
# make sure the checksums are up to date before we record them.
|
||||
|
||||
ifeq ($(MAKECMDGOALS),modules)
|
||||
KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1)
|
||||
KBUILD_BUILTIN :=
|
||||
endif
|
||||
|
||||
# If we have "make <whatever> modules", compile modules
|
||||
@@ -742,17 +738,10 @@ export DISABLE_SCS
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||
KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
|
||||
else
|
||||
ifdef CONFIG_PROFILE_ALL_BRANCHES
|
||||
KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
|
||||
KBUILD_CFLAGS += -Os
|
||||
else
|
||||
KBUILD_CFLAGS += -O2
|
||||
endif
|
||||
endif
|
||||
|
||||
KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
|
||||
$(call cc-disable-warning,maybe-uninitialized,))
|
||||
|
||||
ifdef CONFIG_CC_WERROR
|
||||
KBUILD_CFLAGS += -Werror
|
||||
@@ -760,6 +749,7 @@ endif
|
||||
|
||||
# Tell gcc to never replace conditional load with a non-conditional one
|
||||
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
|
||||
|
||||
# check for 'asm goto'
|
||||
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
|
||||
@@ -893,6 +883,17 @@ KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)
|
||||
# disable stringop warnings in gcc 8+
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
|
||||
|
||||
# We'll want to enable this eventually, but it's not going away for 5.7 at least
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
|
||||
|
||||
# Another good warning that we'll want to enable eventually
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
|
||||
|
||||
# Enabled with W=2, disabled by default as noisy
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
|
||||
|
||||
# disable invalid "can't wrap" optimizations for signed / pointers
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
|
||||
|
||||
@@ -1353,6 +1354,13 @@ ifdef CONFIG_MODULES
|
||||
|
||||
all: modules
|
||||
|
||||
# When we're building modules with modversions, we need to consider
|
||||
# the built-in objects during the descend as well, in order to
|
||||
# make sure the checksums are up to date before we record them.
|
||||
ifdef CONFIG_MODVERSIONS
|
||||
KBUILD_BUILTIN := 1
|
||||
endif
|
||||
|
||||
# Build modules
|
||||
#
|
||||
# A module can be listed more than once in obj-m resulting in
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <linux/root_dev.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/of.h>
|
||||
@@ -333,12 +334,12 @@ static void arc_chk_core_config(void)
|
||||
if ((unsigned int)__arc_dccm_base != cpu->dccm.base_addr)
|
||||
panic("Linux built with incorrect DCCM Base address\n");
|
||||
|
||||
if (CONFIG_ARC_DCCM_SZ != cpu->dccm.sz)
|
||||
if (CONFIG_ARC_DCCM_SZ * SZ_1K != cpu->dccm.sz)
|
||||
panic("Linux built with incorrect DCCM Size\n");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARC_HAS_ICCM
|
||||
if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz)
|
||||
if (CONFIG_ARC_ICCM_SZ * SZ_1K != cpu->iccm.sz)
|
||||
panic("Linux built with incorrect ICCM Size\n");
|
||||
#endif
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
imx27-phycard-s-rdk {
|
||||
pinctrl_i2c1: i2c1grp {
|
||||
fsl,pins = <
|
||||
MX27_PAD_I2C2_SDA__I2C2_SDA 0x0
|
||||
MX27_PAD_I2C2_SCL__I2C2_SCL 0x0
|
||||
MX27_PAD_I2C_DATA__I2C_DATA 0x0
|
||||
MX27_PAD_I2C_CLK__I2C_CLK 0x0
|
||||
>;
|
||||
};
|
||||
|
||||
|
||||
@@ -65,13 +65,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&clks {
|
||||
assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
|
||||
<&clks IMX6QDL_CLK_LDB_DI1_SEL>;
|
||||
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
|
||||
<&clks IMX6QDL_CLK_PLL3_USB_OTG>;
|
||||
};
|
||||
|
||||
&ldb {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@@ -65,13 +65,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&clks {
|
||||
assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
|
||||
<&clks IMX6QDL_CLK_LDB_DI1_SEL>;
|
||||
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
|
||||
<&clks IMX6QDL_CLK_PLL3_USB_OTG>;
|
||||
};
|
||||
|
||||
&ldb {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@@ -53,17 +53,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&clks {
|
||||
assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
|
||||
<&clks IMX6QDL_CLK_LDB_DI1_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU1_DI1_PRE_SEL>;
|
||||
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
|
||||
<&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD2_396M>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD2_396M>;
|
||||
};
|
||||
|
||||
&ldb {
|
||||
fsl,dual-channel;
|
||||
status = "okay";
|
||||
|
||||
@@ -92,6 +92,56 @@
|
||||
mux-int-port = <1>;
|
||||
mux-ext-port = <4>;
|
||||
};
|
||||
|
||||
aliases {
|
||||
mdio-gpio0 = &mdio0;
|
||||
};
|
||||
|
||||
mdio0: mdio-gpio {
|
||||
compatible = "virtual,mdio-gpio";
|
||||
gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>, /* mdc */
|
||||
<&gpio2 7 GPIO_ACTIVE_HIGH>; /* mdio */
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
switch@0 {
|
||||
compatible = "marvell,mv88e6085"; /* 88e6240*/
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <0>;
|
||||
|
||||
switch_ports: ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
mdio {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
switchphy0: switchphy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
|
||||
switchphy1: switchphy@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
switchphy2: switchphy@2 {
|
||||
reg = <2>;
|
||||
};
|
||||
|
||||
switchphy3: switchphy@3 {
|
||||
reg = <3>;
|
||||
};
|
||||
|
||||
switchphy4: switchphy@4 {
|
||||
reg = <4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ecspi5 {
|
||||
@@ -299,3 +349,30 @@
|
||||
tcxo-clock-frequency = <26000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie {
|
||||
/* Synopsys, Inc. Device */
|
||||
pci_root: root@0,0 {
|
||||
compatible = "pci16c3,abcd";
|
||||
reg = <0x00000000 0 0 0 0>;
|
||||
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
#interrupt-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&clks {
|
||||
assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
|
||||
<&clks IMX6QDL_CLK_LDB_DI1_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU1_DI1_PRE_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU2_DI0_PRE_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU2_DI1_PRE_SEL>;
|
||||
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
|
||||
<&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD0_352M>;
|
||||
};
|
||||
|
||||
@@ -135,7 +135,14 @@
|
||||
cmt1: timer@e6130000 {
|
||||
compatible = "renesas,cmt-48-r8a73a4", "renesas,cmt-48-gen2";
|
||||
reg = <0 0xe6130000 0 0x1004>;
|
||||
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&mstp3_clks R8A73A4_CLK_CMT1>;
|
||||
clock-names = "fck";
|
||||
power-domains = <&pd_c5>;
|
||||
|
||||
@@ -467,7 +467,7 @@
|
||||
cpg_clocks: cpg_clocks@e6150000 {
|
||||
compatible = "renesas,r8a7740-cpg-clocks";
|
||||
reg = <0xe6150000 0x10000>;
|
||||
clocks = <&extal1_clk>, <&extalr_clk>;
|
||||
clocks = <&extal1_clk>, <&extal2_clk>, <&extalr_clk>;
|
||||
#clock-cells = <1>;
|
||||
clock-output-names = "system", "pllc0", "pllc1",
|
||||
"pllc2", "r",
|
||||
|
||||
@@ -162,8 +162,13 @@ arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr)
|
||||
preempt_enable();
|
||||
#endif
|
||||
|
||||
if (!ret)
|
||||
*oval = oldval;
|
||||
/*
|
||||
* Store unconditionally. If ret != 0 the extra store is the least
|
||||
* of the worries but GCC cannot figure out that __futex_atomic_op()
|
||||
* is either setting ret to -EFAULT or storing the old value in
|
||||
* oldval which results in a uninitialized warning at the call site.
|
||||
*/
|
||||
*oval = oldval;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -227,8 +227,8 @@ static struct undef_hook arm_break_hook = {
|
||||
};
|
||||
|
||||
static struct undef_hook thumb_break_hook = {
|
||||
.instr_mask = 0xffff,
|
||||
.instr_val = 0xde01,
|
||||
.instr_mask = 0xffffffff,
|
||||
.instr_val = 0x0000de01,
|
||||
.cpsr_mask = PSR_T_BIT,
|
||||
.cpsr_val = PSR_T_BIT,
|
||||
.fn = break_trap,
|
||||
|
||||
@@ -137,8 +137,8 @@ static const char * const tegra_dt_board_compat[] = {
|
||||
};
|
||||
|
||||
DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
|
||||
.l2c_aux_val = 0x3c400001,
|
||||
.l2c_aux_mask = 0xc20fc3fe,
|
||||
.l2c_aux_val = 0x3c400000,
|
||||
.l2c_aux_mask = 0xc20fc3ff,
|
||||
.smp = smp_ops(tegra_smp_ops),
|
||||
.map_io = tegra_map_common_io,
|
||||
.init_early = tegra_init_early,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* VMA_VM_FLAGS
|
||||
* VM_EXEC
|
||||
*/
|
||||
#include <linux/const.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
#include <asm/thread_info.h>
|
||||
|
||||
@@ -34,7 +35,7 @@
|
||||
* act_mm - get current->active_mm
|
||||
*/
|
||||
.macro act_mm, rd
|
||||
bic \rd, sp, #8128
|
||||
bic \rd, sp, #(THREAD_SIZE - 1) & ~63
|
||||
bic \rd, \rd, #63
|
||||
ldr \rd, [\rd, #TI_TASK]
|
||||
ldr \rd, [\rd, #TSK_ACTIVE_MM]
|
||||
|
||||
@@ -290,8 +290,10 @@ struct kvm_vcpu_arch {
|
||||
* CP14 and CP15 live in the same array, as they are backed by the
|
||||
* same system registers.
|
||||
*/
|
||||
#define vcpu_cp14(v,r) ((v)->arch.ctxt.copro[(r)])
|
||||
#define vcpu_cp15(v,r) ((v)->arch.ctxt.copro[(r)])
|
||||
#define CPx_BIAS IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
|
||||
|
||||
#define vcpu_cp14(v,r) ((v)->arch.ctxt.copro[(r) ^ CPx_BIAS])
|
||||
#define vcpu_cp15(v,r) ((v)->arch.ctxt.copro[(r) ^ CPx_BIAS])
|
||||
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
#define vcpu_cp15_64_high(v,r) vcpu_cp15((v),(r))
|
||||
|
||||
@@ -177,7 +177,8 @@ void machine_kexec(struct kimage *kimage)
|
||||
/* Flush the reboot_code_buffer in preparation for its execution. */
|
||||
__flush_dcache_area(reboot_code_buffer, arm64_relocate_new_kernel_size);
|
||||
flush_icache_range((uintptr_t)reboot_code_buffer,
|
||||
arm64_relocate_new_kernel_size);
|
||||
(uintptr_t)reboot_code_buffer +
|
||||
arm64_relocate_new_kernel_size);
|
||||
|
||||
/* Flush the kimage list and its buffers. */
|
||||
kexec_list_flush(kimage);
|
||||
|
||||
@@ -256,6 +256,7 @@ extern int rbv_present,via_alt_mapping;
|
||||
|
||||
struct irq_desc;
|
||||
|
||||
extern void via_l2_flush(int writeback);
|
||||
extern void via_register_interrupts(void);
|
||||
extern void via_irq_enable(int);
|
||||
extern void via_irq_disable(int);
|
||||
|
||||
@@ -61,7 +61,6 @@ extern void iop_preinit(void);
|
||||
extern void iop_init(void);
|
||||
extern void via_init(void);
|
||||
extern void via_init_clock(irq_handler_t func);
|
||||
extern void via_flush_cache(void);
|
||||
extern void oss_init(void);
|
||||
extern void psc_init(void);
|
||||
extern void baboon_init(void);
|
||||
@@ -132,21 +131,6 @@ int __init mac_parse_bootinfo(const struct bi_record *record)
|
||||
return unknown;
|
||||
}
|
||||
|
||||
/*
|
||||
* Flip into 24bit mode for an instant - flushes the L2 cache card. We
|
||||
* have to disable interrupts for this. Our IRQ handlers will crap
|
||||
* themselves if they take an IRQ in 24bit mode!
|
||||
*/
|
||||
|
||||
static void mac_cache_card_flush(int writeback)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
via_flush_cache();
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
void __init config_mac(void)
|
||||
{
|
||||
if (!MACH_IS_MAC)
|
||||
@@ -179,9 +163,8 @@ void __init config_mac(void)
|
||||
* not.
|
||||
*/
|
||||
|
||||
if (macintosh_config->ident == MAC_MODEL_IICI
|
||||
|| macintosh_config->ident == MAC_MODEL_IIFX)
|
||||
mach_l2_flush = mac_cache_card_flush;
|
||||
if (macintosh_config->ident == MAC_MODEL_IICI)
|
||||
mach_l2_flush = via_l2_flush;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -299,10 +299,14 @@ void via_debug_dump(void)
|
||||
* the system into 24-bit mode for an instant.
|
||||
*/
|
||||
|
||||
void via_flush_cache(void)
|
||||
void via_l2_flush(int writeback)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
via2[gBufB] &= ~VIA2B_vMode32;
|
||||
via2[gBufB] |= VIA2B_vMode32;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -256,12 +256,23 @@ ifdef CONFIG_64BIT
|
||||
endif
|
||||
endif
|
||||
|
||||
# When linking a 32-bit executable the LLVM linker cannot cope with a
|
||||
# 32-bit load address that has been sign-extended to 64 bits. Simply
|
||||
# remove the upper 32 bits then, as it is safe to do so with other
|
||||
# linkers.
|
||||
ifdef CONFIG_64BIT
|
||||
load-ld = $(load-y)
|
||||
else
|
||||
load-ld = $(subst 0xffffffff,0x,$(load-y))
|
||||
endif
|
||||
|
||||
KBUILD_AFLAGS += $(cflags-y)
|
||||
KBUILD_CFLAGS += $(cflags-y)
|
||||
KBUILD_CPPFLAGS += -DVMLINUX_LOAD_ADDRESS=$(load-y)
|
||||
KBUILD_CPPFLAGS += -DVMLINUX_LOAD_ADDRESS=$(load-y) -DLINKER_LOAD_ADDRESS=$(load-ld)
|
||||
KBUILD_CPPFLAGS += -DDATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)
|
||||
|
||||
bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y) \
|
||||
LINKER_LOAD_ADDRESS=$(load-ld) \
|
||||
VMLINUX_ENTRY_ADDRESS=$(entry-y) \
|
||||
PLATFORM="$(platform-y)"
|
||||
ifdef CONFIG_32BIT
|
||||
|
||||
@@ -87,7 +87,7 @@ ifneq ($(zload-y),)
|
||||
VMLINUZ_LOAD_ADDRESS := $(zload-y)
|
||||
else
|
||||
VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \
|
||||
$(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS))
|
||||
$(obj)/vmlinux.bin $(LINKER_LOAD_ADDRESS))
|
||||
endif
|
||||
|
||||
vmlinuzobjs-y += $(obj)/piggy.o
|
||||
|
||||
@@ -243,8 +243,12 @@ enum emulation_result {
|
||||
#define MIPS3_PG_SHIFT 6
|
||||
#define MIPS3_PG_FRAME 0x3fffffc0
|
||||
|
||||
#if defined(CONFIG_64BIT)
|
||||
#define VPN2_MASK GENMASK(cpu_vmbits - 1, 13)
|
||||
#else
|
||||
#define VPN2_MASK 0xffffe000
|
||||
#define KVM_ENTRYHI_ASID MIPS_ENTRYHI_ASID
|
||||
#endif
|
||||
#define KVM_ENTRYHI_ASID cpu_asid_mask(&boot_cpu_data)
|
||||
#define TLB_IS_GLOBAL(x) ((x).tlb_lo[0] & (x).tlb_lo[1] & ENTRYLO_G)
|
||||
#define TLB_VPN2(x) ((x).tlb_hi & VPN2_MASK)
|
||||
#define TLB_ASID(x) ((x).tlb_hi & KVM_ENTRYHI_ASID)
|
||||
|
||||
@@ -429,20 +429,20 @@ NESTED(nmi_handler, PT_SIZE, sp)
|
||||
.endm
|
||||
|
||||
.macro __build_clear_fpe
|
||||
CLI
|
||||
TRACE_IRQS_OFF
|
||||
.set push
|
||||
/* gas fails to assemble cfc1 for some archs (octeon).*/ \
|
||||
.set mips1
|
||||
SET_HARDFLOAT
|
||||
cfc1 a1, fcr31
|
||||
.set pop
|
||||
CLI
|
||||
TRACE_IRQS_OFF
|
||||
.endm
|
||||
|
||||
.macro __build_clear_msa_fpe
|
||||
_cfcmsa a1, MSA_CSR
|
||||
CLI
|
||||
TRACE_IRQS_OFF
|
||||
_cfcmsa a1, MSA_CSR
|
||||
.endm
|
||||
|
||||
.macro __build_clear_ade
|
||||
|
||||
@@ -123,9 +123,9 @@ static char *cm2_causes[32] = {
|
||||
"COH_RD_ERR", "MMIO_WR_ERR", "MMIO_RD_ERR", "0x07",
|
||||
"0x08", "0x09", "0x0a", "0x0b",
|
||||
"0x0c", "0x0d", "0x0e", "0x0f",
|
||||
"0x10", "0x11", "0x12", "0x13",
|
||||
"0x14", "0x15", "0x16", "INTVN_WR_ERR",
|
||||
"INTVN_RD_ERR", "0x19", "0x1a", "0x1b",
|
||||
"0x10", "INTVN_WR_ERR", "INTVN_RD_ERR", "0x13",
|
||||
"0x14", "0x15", "0x16", "0x17",
|
||||
"0x18", "0x19", "0x1a", "0x1b",
|
||||
"0x1c", "0x1d", "0x1e", "0x1f"
|
||||
};
|
||||
|
||||
|
||||
@@ -847,7 +847,17 @@ static void __init arch_mem_init(char **cmdline_p)
|
||||
BOOTMEM_DEFAULT);
|
||||
#endif
|
||||
device_tree_init();
|
||||
|
||||
/*
|
||||
* In order to reduce the possibility of kernel panic when failed to
|
||||
* get IO TLB memory under CONFIG_SWIOTLB, it is better to allocate
|
||||
* low memory as small as possible before plat_swiotlb_setup(), so
|
||||
* make sparse_init() using top-down allocation.
|
||||
*/
|
||||
memblock_set_bottom_up(false);
|
||||
sparse_init();
|
||||
memblock_set_bottom_up(true);
|
||||
|
||||
plat_swiotlb_setup();
|
||||
|
||||
dma_contiguous_reserve(PFN_PHYS(max_low_pfn));
|
||||
|
||||
@@ -22,12 +22,82 @@
|
||||
#include <linux/smp.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/cpufreq.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include <asm/cpu-features.h>
|
||||
#include <asm/cpu-type.h>
|
||||
#include <asm/div64.h>
|
||||
#include <asm/time.h>
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
|
||||
static DEFINE_PER_CPU(unsigned long, pcp_lpj_ref);
|
||||
static DEFINE_PER_CPU(unsigned long, pcp_lpj_ref_freq);
|
||||
static unsigned long glb_lpj_ref;
|
||||
static unsigned long glb_lpj_ref_freq;
|
||||
|
||||
static int cpufreq_callback(struct notifier_block *nb,
|
||||
unsigned long val, void *data)
|
||||
{
|
||||
struct cpufreq_freqs *freq = data;
|
||||
struct cpumask *cpus = freq->policy->cpus;
|
||||
unsigned long lpj;
|
||||
int cpu;
|
||||
|
||||
/*
|
||||
* Skip lpj numbers adjustment if the CPU-freq transition is safe for
|
||||
* the loops delay. (Is this possible?)
|
||||
*/
|
||||
if (freq->flags & CPUFREQ_CONST_LOOPS)
|
||||
return NOTIFY_OK;
|
||||
|
||||
/* Save the initial values of the lpjes for future scaling. */
|
||||
if (!glb_lpj_ref) {
|
||||
glb_lpj_ref = boot_cpu_data.udelay_val;
|
||||
glb_lpj_ref_freq = freq->old;
|
||||
|
||||
for_each_online_cpu(cpu) {
|
||||
per_cpu(pcp_lpj_ref, cpu) =
|
||||
cpu_data[cpu].udelay_val;
|
||||
per_cpu(pcp_lpj_ref_freq, cpu) = freq->old;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Adjust global lpj variable and per-CPU udelay_val number in
|
||||
* accordance with the new CPU frequency.
|
||||
*/
|
||||
if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
|
||||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
|
||||
loops_per_jiffy = cpufreq_scale(glb_lpj_ref,
|
||||
glb_lpj_ref_freq,
|
||||
freq->new);
|
||||
|
||||
for_each_cpu(cpu, cpus) {
|
||||
lpj = cpufreq_scale(per_cpu(pcp_lpj_ref, cpu),
|
||||
per_cpu(pcp_lpj_ref_freq, cpu),
|
||||
freq->new);
|
||||
cpu_data[cpu].udelay_val = (unsigned int)lpj;
|
||||
}
|
||||
}
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static struct notifier_block cpufreq_notifier = {
|
||||
.notifier_call = cpufreq_callback,
|
||||
};
|
||||
|
||||
static int __init register_cpufreq_notifier(void)
|
||||
{
|
||||
return cpufreq_register_notifier(&cpufreq_notifier,
|
||||
CPUFREQ_TRANSITION_NOTIFIER);
|
||||
}
|
||||
core_initcall(register_cpufreq_notifier);
|
||||
|
||||
#endif /* CONFIG_CPU_FREQ */
|
||||
|
||||
/*
|
||||
* forward reference
|
||||
*/
|
||||
|
||||
@@ -49,7 +49,7 @@ SECTIONS
|
||||
/* . = 0xa800000000300000; */
|
||||
. = 0xffffffff80300000;
|
||||
#endif
|
||||
. = VMLINUX_LOAD_ADDRESS;
|
||||
. = LINKER_LOAD_ADDRESS;
|
||||
/* read-only */
|
||||
_text = .; /* Text and read-only data */
|
||||
.text : {
|
||||
|
||||
@@ -604,7 +604,7 @@ void __init mem_init(void)
|
||||
> BITS_PER_LONG);
|
||||
|
||||
high_memory = __va((max_pfn << PAGE_SHIFT));
|
||||
set_max_mapnr(page_to_pfn(virt_to_page(high_memory - 1)) + 1);
|
||||
set_max_mapnr(max_low_pfn);
|
||||
free_all_bootmem();
|
||||
|
||||
#ifdef CONFIG_PA11
|
||||
|
||||
@@ -2044,8 +2044,9 @@ static ssize_t __spufs_mbox_info_read(struct spu_context *ctx,
|
||||
static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf,
|
||||
size_t len, loff_t *pos)
|
||||
{
|
||||
int ret;
|
||||
struct spu_context *ctx = file->private_data;
|
||||
u32 stat, data;
|
||||
int ret;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, buf, len))
|
||||
return -EFAULT;
|
||||
@@ -2054,11 +2055,16 @@ static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf,
|
||||
if (ret)
|
||||
return ret;
|
||||
spin_lock(&ctx->csa.register_lock);
|
||||
ret = __spufs_mbox_info_read(ctx, buf, len, pos);
|
||||
stat = ctx->csa.prob.mb_stat_R;
|
||||
data = ctx->csa.prob.pu_mb_R;
|
||||
spin_unlock(&ctx->csa.register_lock);
|
||||
spu_release_saved(ctx);
|
||||
|
||||
return ret;
|
||||
/* EOF if there's no entry in the mbox */
|
||||
if (!(stat & 0x0000ff))
|
||||
return 0;
|
||||
|
||||
return simple_read_from_buffer(buf, len, pos, &data, sizeof(data));
|
||||
}
|
||||
|
||||
static const struct file_operations spufs_mbox_info_fops = {
|
||||
@@ -2085,6 +2091,7 @@ static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf,
|
||||
size_t len, loff_t *pos)
|
||||
{
|
||||
struct spu_context *ctx = file->private_data;
|
||||
u32 stat, data;
|
||||
int ret;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, buf, len))
|
||||
@@ -2094,11 +2101,16 @@ static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf,
|
||||
if (ret)
|
||||
return ret;
|
||||
spin_lock(&ctx->csa.register_lock);
|
||||
ret = __spufs_ibox_info_read(ctx, buf, len, pos);
|
||||
stat = ctx->csa.prob.mb_stat_R;
|
||||
data = ctx->csa.priv2.puint_mb_R;
|
||||
spin_unlock(&ctx->csa.register_lock);
|
||||
spu_release_saved(ctx);
|
||||
|
||||
return ret;
|
||||
/* EOF if there's no entry in the ibox */
|
||||
if (!(stat & 0xff0000))
|
||||
return 0;
|
||||
|
||||
return simple_read_from_buffer(buf, len, pos, &data, sizeof(data));
|
||||
}
|
||||
|
||||
static const struct file_operations spufs_ibox_info_fops = {
|
||||
@@ -2107,6 +2119,11 @@ static const struct file_operations spufs_ibox_info_fops = {
|
||||
.llseek = generic_file_llseek,
|
||||
};
|
||||
|
||||
static size_t spufs_wbox_info_cnt(struct spu_context *ctx)
|
||||
{
|
||||
return (4 - ((ctx->csa.prob.mb_stat_R & 0x00ff00) >> 8)) * sizeof(u32);
|
||||
}
|
||||
|
||||
static ssize_t __spufs_wbox_info_read(struct spu_context *ctx,
|
||||
char __user *buf, size_t len, loff_t *pos)
|
||||
{
|
||||
@@ -2115,7 +2132,7 @@ static ssize_t __spufs_wbox_info_read(struct spu_context *ctx,
|
||||
u32 wbox_stat;
|
||||
|
||||
wbox_stat = ctx->csa.prob.mb_stat_R;
|
||||
cnt = 4 - ((wbox_stat & 0x00ff00) >> 8);
|
||||
cnt = spufs_wbox_info_cnt(ctx);
|
||||
for (i = 0; i < cnt; i++) {
|
||||
data[i] = ctx->csa.spu_mailbox_data[i];
|
||||
}
|
||||
@@ -2128,7 +2145,8 @@ static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf,
|
||||
size_t len, loff_t *pos)
|
||||
{
|
||||
struct spu_context *ctx = file->private_data;
|
||||
int ret;
|
||||
u32 data[ARRAY_SIZE(ctx->csa.spu_mailbox_data)];
|
||||
int ret, count;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, buf, len))
|
||||
return -EFAULT;
|
||||
@@ -2137,11 +2155,13 @@ static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf,
|
||||
if (ret)
|
||||
return ret;
|
||||
spin_lock(&ctx->csa.register_lock);
|
||||
ret = __spufs_wbox_info_read(ctx, buf, len, pos);
|
||||
count = spufs_wbox_info_cnt(ctx);
|
||||
memcpy(&data, &ctx->csa.spu_mailbox_data, sizeof(data));
|
||||
spin_unlock(&ctx->csa.register_lock);
|
||||
spu_release_saved(ctx);
|
||||
|
||||
return ret;
|
||||
return simple_read_from_buffer(buf, len, pos, &data,
|
||||
count * sizeof(u32));
|
||||
}
|
||||
|
||||
static const struct file_operations spufs_wbox_info_fops = {
|
||||
@@ -2150,27 +2170,33 @@ static const struct file_operations spufs_wbox_info_fops = {
|
||||
.llseek = generic_file_llseek,
|
||||
};
|
||||
|
||||
static ssize_t __spufs_dma_info_read(struct spu_context *ctx,
|
||||
char __user *buf, size_t len, loff_t *pos)
|
||||
static void spufs_get_dma_info(struct spu_context *ctx,
|
||||
struct spu_dma_info *info)
|
||||
{
|
||||
struct spu_dma_info info;
|
||||
struct mfc_cq_sr *qp, *spuqp;
|
||||
int i;
|
||||
|
||||
info.dma_info_type = ctx->csa.priv2.spu_tag_status_query_RW;
|
||||
info.dma_info_mask = ctx->csa.lscsa->tag_mask.slot[0];
|
||||
info.dma_info_status = ctx->csa.spu_chnldata_RW[24];
|
||||
info.dma_info_stall_and_notify = ctx->csa.spu_chnldata_RW[25];
|
||||
info.dma_info_atomic_command_status = ctx->csa.spu_chnldata_RW[27];
|
||||
info->dma_info_type = ctx->csa.priv2.spu_tag_status_query_RW;
|
||||
info->dma_info_mask = ctx->csa.lscsa->tag_mask.slot[0];
|
||||
info->dma_info_status = ctx->csa.spu_chnldata_RW[24];
|
||||
info->dma_info_stall_and_notify = ctx->csa.spu_chnldata_RW[25];
|
||||
info->dma_info_atomic_command_status = ctx->csa.spu_chnldata_RW[27];
|
||||
for (i = 0; i < 16; i++) {
|
||||
qp = &info.dma_info_command_data[i];
|
||||
spuqp = &ctx->csa.priv2.spuq[i];
|
||||
struct mfc_cq_sr *qp = &info->dma_info_command_data[i];
|
||||
struct mfc_cq_sr *spuqp = &ctx->csa.priv2.spuq[i];
|
||||
|
||||
qp->mfc_cq_data0_RW = spuqp->mfc_cq_data0_RW;
|
||||
qp->mfc_cq_data1_RW = spuqp->mfc_cq_data1_RW;
|
||||
qp->mfc_cq_data2_RW = spuqp->mfc_cq_data2_RW;
|
||||
qp->mfc_cq_data3_RW = spuqp->mfc_cq_data3_RW;
|
||||
}
|
||||
}
|
||||
|
||||
static ssize_t __spufs_dma_info_read(struct spu_context *ctx,
|
||||
char __user *buf, size_t len, loff_t *pos)
|
||||
{
|
||||
struct spu_dma_info info;
|
||||
|
||||
spufs_get_dma_info(ctx, &info);
|
||||
|
||||
return simple_read_from_buffer(buf, len, pos, &info,
|
||||
sizeof info);
|
||||
@@ -2180,6 +2206,7 @@ static ssize_t spufs_dma_info_read(struct file *file, char __user *buf,
|
||||
size_t len, loff_t *pos)
|
||||
{
|
||||
struct spu_context *ctx = file->private_data;
|
||||
struct spu_dma_info info;
|
||||
int ret;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, buf, len))
|
||||
@@ -2189,11 +2216,12 @@ static ssize_t spufs_dma_info_read(struct file *file, char __user *buf,
|
||||
if (ret)
|
||||
return ret;
|
||||
spin_lock(&ctx->csa.register_lock);
|
||||
ret = __spufs_dma_info_read(ctx, buf, len, pos);
|
||||
spufs_get_dma_info(ctx, &info);
|
||||
spin_unlock(&ctx->csa.register_lock);
|
||||
spu_release_saved(ctx);
|
||||
|
||||
return ret;
|
||||
return simple_read_from_buffer(buf, len, pos, &info,
|
||||
sizeof(info));
|
||||
}
|
||||
|
||||
static const struct file_operations spufs_dma_info_fops = {
|
||||
@@ -2202,13 +2230,31 @@ static const struct file_operations spufs_dma_info_fops = {
|
||||
.llseek = no_llseek,
|
||||
};
|
||||
|
||||
static void spufs_get_proxydma_info(struct spu_context *ctx,
|
||||
struct spu_proxydma_info *info)
|
||||
{
|
||||
int i;
|
||||
|
||||
info->proxydma_info_type = ctx->csa.prob.dma_querytype_RW;
|
||||
info->proxydma_info_mask = ctx->csa.prob.dma_querymask_RW;
|
||||
info->proxydma_info_status = ctx->csa.prob.dma_tagstatus_R;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
struct mfc_cq_sr *qp = &info->proxydma_info_command_data[i];
|
||||
struct mfc_cq_sr *puqp = &ctx->csa.priv2.puq[i];
|
||||
|
||||
qp->mfc_cq_data0_RW = puqp->mfc_cq_data0_RW;
|
||||
qp->mfc_cq_data1_RW = puqp->mfc_cq_data1_RW;
|
||||
qp->mfc_cq_data2_RW = puqp->mfc_cq_data2_RW;
|
||||
qp->mfc_cq_data3_RW = puqp->mfc_cq_data3_RW;
|
||||
}
|
||||
}
|
||||
|
||||
static ssize_t __spufs_proxydma_info_read(struct spu_context *ctx,
|
||||
char __user *buf, size_t len, loff_t *pos)
|
||||
{
|
||||
struct spu_proxydma_info info;
|
||||
struct mfc_cq_sr *qp, *puqp;
|
||||
int ret = sizeof info;
|
||||
int i;
|
||||
|
||||
if (len < ret)
|
||||
return -EINVAL;
|
||||
@@ -2216,18 +2262,7 @@ static ssize_t __spufs_proxydma_info_read(struct spu_context *ctx,
|
||||
if (!access_ok(VERIFY_WRITE, buf, len))
|
||||
return -EFAULT;
|
||||
|
||||
info.proxydma_info_type = ctx->csa.prob.dma_querytype_RW;
|
||||
info.proxydma_info_mask = ctx->csa.prob.dma_querymask_RW;
|
||||
info.proxydma_info_status = ctx->csa.prob.dma_tagstatus_R;
|
||||
for (i = 0; i < 8; i++) {
|
||||
qp = &info.proxydma_info_command_data[i];
|
||||
puqp = &ctx->csa.priv2.puq[i];
|
||||
|
||||
qp->mfc_cq_data0_RW = puqp->mfc_cq_data0_RW;
|
||||
qp->mfc_cq_data1_RW = puqp->mfc_cq_data1_RW;
|
||||
qp->mfc_cq_data2_RW = puqp->mfc_cq_data2_RW;
|
||||
qp->mfc_cq_data3_RW = puqp->mfc_cq_data3_RW;
|
||||
}
|
||||
spufs_get_proxydma_info(ctx, &info);
|
||||
|
||||
return simple_read_from_buffer(buf, len, pos, &info,
|
||||
sizeof info);
|
||||
@@ -2237,17 +2272,19 @@ static ssize_t spufs_proxydma_info_read(struct file *file, char __user *buf,
|
||||
size_t len, loff_t *pos)
|
||||
{
|
||||
struct spu_context *ctx = file->private_data;
|
||||
struct spu_proxydma_info info;
|
||||
int ret;
|
||||
|
||||
ret = spu_acquire_saved(ctx);
|
||||
if (ret)
|
||||
return ret;
|
||||
spin_lock(&ctx->csa.register_lock);
|
||||
ret = __spufs_proxydma_info_read(ctx, buf, len, pos);
|
||||
spufs_get_proxydma_info(ctx, &info);
|
||||
spin_unlock(&ctx->csa.register_lock);
|
||||
spu_release_saved(ctx);
|
||||
|
||||
return ret;
|
||||
return simple_read_from_buffer(buf, len, pos, &info,
|
||||
sizeof(info));
|
||||
}
|
||||
|
||||
static const struct file_operations spufs_proxydma_info_fops = {
|
||||
|
||||
@@ -39,6 +39,7 @@ EXPORT_SYMBOL(_mcount)
|
||||
ENTRY(ftrace_caller)
|
||||
.globl ftrace_regs_caller
|
||||
.set ftrace_regs_caller,ftrace_caller
|
||||
stg %r14,(__SF_GPRS+8*8)(%r15) # save traced function caller
|
||||
lgr %r1,%r15
|
||||
#ifndef CC_USING_HOTPATCH
|
||||
aghi %r0,MCOUNT_RETURN_FIXUP
|
||||
|
||||
@@ -45,82 +45,79 @@ enum sparc_regset {
|
||||
REGSET_FP,
|
||||
};
|
||||
|
||||
static int regwindow32_get(struct task_struct *target,
|
||||
const struct pt_regs *regs,
|
||||
u32 *uregs)
|
||||
{
|
||||
unsigned long reg_window = regs->u_regs[UREG_I6];
|
||||
int size = 16 * sizeof(u32);
|
||||
|
||||
if (target == current) {
|
||||
if (copy_from_user(uregs, (void __user *)reg_window, size))
|
||||
return -EFAULT;
|
||||
} else {
|
||||
if (access_process_vm(target, reg_window, uregs, size,
|
||||
FOLL_FORCE) != size)
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int regwindow32_set(struct task_struct *target,
|
||||
const struct pt_regs *regs,
|
||||
u32 *uregs)
|
||||
{
|
||||
unsigned long reg_window = regs->u_regs[UREG_I6];
|
||||
int size = 16 * sizeof(u32);
|
||||
|
||||
if (target == current) {
|
||||
if (copy_to_user((void __user *)reg_window, uregs, size))
|
||||
return -EFAULT;
|
||||
} else {
|
||||
if (access_process_vm(target, reg_window, uregs, size,
|
||||
FOLL_FORCE | FOLL_WRITE) != size)
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int genregs32_get(struct task_struct *target,
|
||||
const struct user_regset *regset,
|
||||
unsigned int pos, unsigned int count,
|
||||
void *kbuf, void __user *ubuf)
|
||||
{
|
||||
const struct pt_regs *regs = target->thread.kregs;
|
||||
unsigned long __user *reg_window;
|
||||
unsigned long *k = kbuf;
|
||||
unsigned long __user *u = ubuf;
|
||||
unsigned long reg;
|
||||
u32 uregs[16];
|
||||
int ret;
|
||||
|
||||
if (target == current)
|
||||
flush_user_windows();
|
||||
|
||||
pos /= sizeof(reg);
|
||||
count /= sizeof(reg);
|
||||
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
|
||||
regs->u_regs,
|
||||
0, 16 * sizeof(u32));
|
||||
if (ret || !count)
|
||||
return ret;
|
||||
|
||||
if (kbuf) {
|
||||
for (; count > 0 && pos < 16; count--)
|
||||
*k++ = regs->u_regs[pos++];
|
||||
|
||||
reg_window = (unsigned long __user *) regs->u_regs[UREG_I6];
|
||||
reg_window -= 16;
|
||||
for (; count > 0 && pos < 32; count--) {
|
||||
if (get_user(*k++, ®_window[pos++]))
|
||||
return -EFAULT;
|
||||
}
|
||||
} else {
|
||||
for (; count > 0 && pos < 16; count--) {
|
||||
if (put_user(regs->u_regs[pos++], u++))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
reg_window = (unsigned long __user *) regs->u_regs[UREG_I6];
|
||||
reg_window -= 16;
|
||||
for (; count > 0 && pos < 32; count--) {
|
||||
if (get_user(reg, ®_window[pos++]) ||
|
||||
put_user(reg, u++))
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
while (count > 0) {
|
||||
switch (pos) {
|
||||
case 32: /* PSR */
|
||||
reg = regs->psr;
|
||||
break;
|
||||
case 33: /* PC */
|
||||
reg = regs->pc;
|
||||
break;
|
||||
case 34: /* NPC */
|
||||
reg = regs->npc;
|
||||
break;
|
||||
case 35: /* Y */
|
||||
reg = regs->y;
|
||||
break;
|
||||
case 36: /* WIM */
|
||||
case 37: /* TBR */
|
||||
reg = 0;
|
||||
break;
|
||||
default:
|
||||
goto finish;
|
||||
}
|
||||
|
||||
if (kbuf)
|
||||
*k++ = reg;
|
||||
else if (put_user(reg, u++))
|
||||
if (pos < 32 * sizeof(u32)) {
|
||||
if (regwindow32_get(target, regs, uregs))
|
||||
return -EFAULT;
|
||||
pos++;
|
||||
count--;
|
||||
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
|
||||
uregs,
|
||||
16 * sizeof(u32), 32 * sizeof(u32));
|
||||
if (ret || !count)
|
||||
return ret;
|
||||
}
|
||||
finish:
|
||||
pos *= sizeof(reg);
|
||||
count *= sizeof(reg);
|
||||
|
||||
return user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
|
||||
38 * sizeof(reg), -1);
|
||||
uregs[0] = regs->psr;
|
||||
uregs[1] = regs->pc;
|
||||
uregs[2] = regs->npc;
|
||||
uregs[3] = regs->y;
|
||||
uregs[4] = 0; /* WIM */
|
||||
uregs[5] = 0; /* TBR */
|
||||
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
|
||||
uregs,
|
||||
32 * sizeof(u32), 38 * sizeof(u32));
|
||||
}
|
||||
|
||||
static int genregs32_set(struct task_struct *target,
|
||||
@@ -129,82 +126,53 @@ static int genregs32_set(struct task_struct *target,
|
||||
const void *kbuf, const void __user *ubuf)
|
||||
{
|
||||
struct pt_regs *regs = target->thread.kregs;
|
||||
unsigned long __user *reg_window;
|
||||
const unsigned long *k = kbuf;
|
||||
const unsigned long __user *u = ubuf;
|
||||
unsigned long reg;
|
||||
u32 uregs[16];
|
||||
u32 psr;
|
||||
int ret;
|
||||
|
||||
if (target == current)
|
||||
flush_user_windows();
|
||||
|
||||
pos /= sizeof(reg);
|
||||
count /= sizeof(reg);
|
||||
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
|
||||
regs->u_regs,
|
||||
0, 16 * sizeof(u32));
|
||||
if (ret || !count)
|
||||
return ret;
|
||||
|
||||
if (kbuf) {
|
||||
for (; count > 0 && pos < 16; count--)
|
||||
regs->u_regs[pos++] = *k++;
|
||||
|
||||
reg_window = (unsigned long __user *) regs->u_regs[UREG_I6];
|
||||
reg_window -= 16;
|
||||
for (; count > 0 && pos < 32; count--) {
|
||||
if (put_user(*k++, ®_window[pos++]))
|
||||
return -EFAULT;
|
||||
}
|
||||
} else {
|
||||
for (; count > 0 && pos < 16; count--) {
|
||||
if (get_user(reg, u++))
|
||||
return -EFAULT;
|
||||
regs->u_regs[pos++] = reg;
|
||||
}
|
||||
|
||||
reg_window = (unsigned long __user *) regs->u_regs[UREG_I6];
|
||||
reg_window -= 16;
|
||||
for (; count > 0 && pos < 32; count--) {
|
||||
if (get_user(reg, u++) ||
|
||||
put_user(reg, ®_window[pos++]))
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
while (count > 0) {
|
||||
unsigned long psr;
|
||||
|
||||
if (kbuf)
|
||||
reg = *k++;
|
||||
else if (get_user(reg, u++))
|
||||
if (pos < 32 * sizeof(u32)) {
|
||||
if (regwindow32_get(target, regs, uregs))
|
||||
return -EFAULT;
|
||||
|
||||
switch (pos) {
|
||||
case 32: /* PSR */
|
||||
psr = regs->psr;
|
||||
psr &= ~(PSR_ICC | PSR_SYSCALL);
|
||||
psr |= (reg & (PSR_ICC | PSR_SYSCALL));
|
||||
regs->psr = psr;
|
||||
break;
|
||||
case 33: /* PC */
|
||||
regs->pc = reg;
|
||||
break;
|
||||
case 34: /* NPC */
|
||||
regs->npc = reg;
|
||||
break;
|
||||
case 35: /* Y */
|
||||
regs->y = reg;
|
||||
break;
|
||||
case 36: /* WIM */
|
||||
case 37: /* TBR */
|
||||
break;
|
||||
default:
|
||||
goto finish;
|
||||
}
|
||||
|
||||
pos++;
|
||||
count--;
|
||||
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
|
||||
uregs,
|
||||
16 * sizeof(u32), 32 * sizeof(u32));
|
||||
if (ret)
|
||||
return ret;
|
||||
if (regwindow32_set(target, regs, uregs))
|
||||
return -EFAULT;
|
||||
if (!count)
|
||||
return 0;
|
||||
}
|
||||
finish:
|
||||
pos *= sizeof(reg);
|
||||
count *= sizeof(reg);
|
||||
|
||||
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
|
||||
&psr,
|
||||
32 * sizeof(u32), 33 * sizeof(u32));
|
||||
if (ret)
|
||||
return ret;
|
||||
regs->psr = (regs->psr & ~(PSR_ICC | PSR_SYSCALL)) |
|
||||
(psr & (PSR_ICC | PSR_SYSCALL));
|
||||
if (!count)
|
||||
return 0;
|
||||
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
|
||||
®s->pc,
|
||||
33 * sizeof(u32), 34 * sizeof(u32));
|
||||
if (ret || !count)
|
||||
return ret;
|
||||
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
|
||||
®s->y,
|
||||
34 * sizeof(u32), 35 * sizeof(u32));
|
||||
if (ret || !count)
|
||||
return ret;
|
||||
return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
|
||||
38 * sizeof(reg), -1);
|
||||
35 * sizeof(u32), 38 * sizeof(u32));
|
||||
}
|
||||
|
||||
static int fpregs32_get(struct task_struct *target,
|
||||
|
||||
@@ -533,19 +533,13 @@ static int genregs32_get(struct task_struct *target,
|
||||
for (; count > 0 && pos < 32; count--) {
|
||||
if (access_process_vm(target,
|
||||
(unsigned long)
|
||||
®_window[pos],
|
||||
®_window[pos++],
|
||||
®, sizeof(reg),
|
||||
FOLL_FORCE)
|
||||
!= sizeof(reg))
|
||||
return -EFAULT;
|
||||
if (access_process_vm(target,
|
||||
(unsigned long) u,
|
||||
®, sizeof(reg),
|
||||
FOLL_FORCE | FOLL_WRITE)
|
||||
!= sizeof(reg))
|
||||
if (put_user(reg, u++))
|
||||
return -EFAULT;
|
||||
pos++;
|
||||
u++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -645,12 +639,7 @@ static int genregs32_set(struct task_struct *target,
|
||||
}
|
||||
} else {
|
||||
for (; count > 0 && pos < 32; count--) {
|
||||
if (access_process_vm(target,
|
||||
(unsigned long)
|
||||
u,
|
||||
®, sizeof(reg),
|
||||
FOLL_FORCE)
|
||||
!= sizeof(reg))
|
||||
if (get_user(reg, u++))
|
||||
return -EFAULT;
|
||||
if (access_process_vm(target,
|
||||
(unsigned long)
|
||||
|
||||
@@ -48,16 +48,17 @@
|
||||
* Position Independent Executable (PIE) so that linker won't optimize
|
||||
* R_386_GOT32X relocation to its fixed symbol address. Older
|
||||
* linkers generate R_386_32 relocations against locally defined symbols,
|
||||
* _bss, _ebss, _got and _egot, in PIE. It isn't wrong, just less
|
||||
* _bss, _ebss, _got, _egot and _end, in PIE. It isn't wrong, just less
|
||||
* optimal than R_386_RELATIVE. But the x86 kernel fails to properly handle
|
||||
* R_386_32 relocations when relocating the kernel. To generate
|
||||
* R_386_RELATIVE relocations, we mark _bss, _ebss, _got and _egot as
|
||||
* R_386_RELATIVE relocations, we mark _bss, _ebss, _got, _egot and _end as
|
||||
* hidden:
|
||||
*/
|
||||
.hidden _bss
|
||||
.hidden _ebss
|
||||
.hidden _got
|
||||
.hidden _egot
|
||||
.hidden _end
|
||||
|
||||
__HEAD
|
||||
ENTRY(startup_32)
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
.hidden _ebss
|
||||
.hidden _got
|
||||
.hidden _egot
|
||||
.hidden _end
|
||||
|
||||
__HEAD
|
||||
.code32
|
||||
|
||||
@@ -8,6 +8,33 @@
|
||||
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
||||
#define X86_STEPPINGS(mins, maxs) GENMASK(maxs, mins)
|
||||
|
||||
/**
|
||||
* X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE - Base macro for CPU matching
|
||||
* @_vendor: The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
|
||||
* The name is expanded to X86_VENDOR_@_vendor
|
||||
* @_family: The family number or X86_FAMILY_ANY
|
||||
* @_model: The model number, model constant or X86_MODEL_ANY
|
||||
* @_steppings: Bitmask for steppings, stepping constant or X86_STEPPING_ANY
|
||||
* @_feature: A X86_FEATURE bit or X86_FEATURE_ANY
|
||||
* @_data: Driver specific data or NULL. The internal storage
|
||||
* format is unsigned long. The supplied value, pointer
|
||||
* etc. is casted to unsigned long internally.
|
||||
*
|
||||
* Backport version to keep the SRBDS pile consistant. No shorter variants
|
||||
* required for this.
|
||||
*/
|
||||
#define X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE(_vendor, _family, _model, \
|
||||
_steppings, _feature, _data) { \
|
||||
.vendor = X86_VENDOR_##_vendor, \
|
||||
.family = _family, \
|
||||
.model = _model, \
|
||||
.steppings = _steppings, \
|
||||
.feature = _feature, \
|
||||
.driver_data = (unsigned long) _data \
|
||||
}
|
||||
|
||||
extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -273,6 +273,7 @@
|
||||
#define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */
|
||||
#define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */
|
||||
#define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */
|
||||
#define X86_FEATURE_AMD_STIBP_ALWAYS_ON (13*32+17) /* "" Single Thread Indirect Branch Predictors always-on preferred */
|
||||
#define X86_FEATURE_AMD_SSBD (13*32+24) /* "" Speculative Store Bypass Disable */
|
||||
#define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */
|
||||
#define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */
|
||||
@@ -312,10 +313,10 @@
|
||||
#define X86_FEATURE_SUCCOR (17*32+1) /* Uncorrectable error containment and recovery */
|
||||
#define X86_FEATURE_SMCA (17*32+3) /* Scalable MCA */
|
||||
|
||||
|
||||
/* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
|
||||
#define X86_FEATURE_AVX512_4VNNIW (18*32+ 2) /* AVX-512 Neural Network Instructions */
|
||||
#define X86_FEATURE_AVX512_4FMAPS (18*32+ 3) /* AVX-512 Multiply Accumulation Single precision */
|
||||
#define X86_FEATURE_SRBDS_CTRL (18*32+ 9) /* "" SRBDS mitigation MSR available */
|
||||
#define X86_FEATURE_TSX_FORCE_ABORT (18*32+13) /* "" TSX_FORCE_ABORT */
|
||||
#define X86_FEATURE_MD_CLEAR (18*32+10) /* VERW clears CPU buffers */
|
||||
#define X86_FEATURE_PCONFIG (18*32+18) /* Intel PCONFIG */
|
||||
@@ -346,19 +347,20 @@
|
||||
*/
|
||||
#define X86_BUG_ESPFIX X86_BUG(9) /* "" IRET to 16-bit SS corrupts ESP/RSP high bits */
|
||||
#endif
|
||||
#define X86_BUG_NULL_SEG X86_BUG(10) /* Nulling a selector preserves the base */
|
||||
#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_MELTDOWN X86_BUG(14) /* CPU is affected by meltdown attack and needs kernel page table isolation */
|
||||
#define X86_BUG_SPECTRE_V1 X86_BUG(15) /* CPU is affected by Spectre variant 1 attack with conditional branches */
|
||||
#define X86_BUG_SPECTRE_V2 X86_BUG(16) /* CPU is affected by Spectre variant 2 attack with indirect branches */
|
||||
#define X86_BUG_SPEC_STORE_BYPASS X86_BUG(17) /* CPU is affected by speculative store bypass attack */
|
||||
#define X86_BUG_L1TF X86_BUG(18) /* CPU is affected by L1 Terminal Fault */
|
||||
#define X86_BUG_MDS X86_BUG(19) /* CPU is affected by Microarchitectural data sampling */
|
||||
#define X86_BUG_MSBDS_ONLY X86_BUG(20) /* CPU is only affected by the MSDBS variant of BUG_MDS */
|
||||
#define X86_BUG_SWAPGS X86_BUG(21) /* CPU is affected by speculation through SWAPGS */
|
||||
#define X86_BUG_TAA X86_BUG(22) /* CPU is affected by TSX Async Abort(TAA) */
|
||||
#define X86_BUG_ITLB_MULTIHIT X86_BUG(23) /* CPU may incur MCE during certain page attribute changes */
|
||||
#define X86_BUG_NULL_SEG X86_BUG(10) /* Nulling a selector preserves the base */
|
||||
#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_MELTDOWN X86_BUG(14) /* CPU is affected by meltdown attack and needs kernel page table isolation */
|
||||
#define X86_BUG_SPECTRE_V1 X86_BUG(15) /* CPU is affected by Spectre variant 1 attack with conditional branches */
|
||||
#define X86_BUG_SPECTRE_V2 X86_BUG(16) /* CPU is affected by Spectre variant 2 attack with indirect branches */
|
||||
#define X86_BUG_SPEC_STORE_BYPASS X86_BUG(17) /* CPU is affected by speculative store bypass attack */
|
||||
#define X86_BUG_L1TF X86_BUG(18) /* CPU is affected by L1 Terminal Fault */
|
||||
#define X86_BUG_MDS X86_BUG(19) /* CPU is affected by Microarchitectural data sampling */
|
||||
#define X86_BUG_MSBDS_ONLY X86_BUG(20) /* CPU is only affected by the MSDBS variant of BUG_MDS */
|
||||
#define X86_BUG_SWAPGS X86_BUG(21) /* CPU is affected by speculation through SWAPGS */
|
||||
#define X86_BUG_TAA X86_BUG(22) /* CPU is affected by TSX Async Abort(TAA) */
|
||||
#define X86_BUG_ITLB_MULTIHIT X86_BUG(23) /* CPU may incur MCE during certain page attribute changes */
|
||||
#define X86_BUG_SRBDS X86_BUG(24) /* CPU may leak RNG bits if not mitigated */
|
||||
|
||||
#endif /* _ASM_X86_CPUFEATURES_H */
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
#define MAX_DMA_PFN ((16UL * 1024 * 1024) >> PAGE_SHIFT)
|
||||
|
||||
/* 4GB broken PCI/AGP hardware bus master zone */
|
||||
#define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT)
|
||||
#define MAX_DMA32_PFN (1UL << (32 - PAGE_SHIFT))
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
/* The maximum address that we can perform a DMA transfer to on this platform */
|
||||
|
||||
@@ -103,6 +103,10 @@
|
||||
#define TSX_CTRL_RTM_DISABLE BIT(0) /* Disable RTM feature */
|
||||
#define TSX_CTRL_CPUID_CLEAR BIT(1) /* Disable TSX enumeration */
|
||||
|
||||
/* SRBDS support */
|
||||
#define MSR_IA32_MCU_OPT_CTRL 0x00000123
|
||||
#define RNGDS_MITG_DIS BIT(0)
|
||||
|
||||
#define MSR_IA32_SYSENTER_CS 0x00000174
|
||||
#define MSR_IA32_SYSENTER_ESP 0x00000175
|
||||
#define MSR_IA32_SYSENTER_EIP 0x00000176
|
||||
|
||||
@@ -223,6 +223,7 @@ enum spectre_v2_mitigation {
|
||||
enum spectre_v2_user_mitigation {
|
||||
SPECTRE_V2_USER_NONE,
|
||||
SPECTRE_V2_USER_STRICT,
|
||||
SPECTRE_V2_USER_STRICT_PREFERRED,
|
||||
SPECTRE_V2_USER_PRCTL,
|
||||
SPECTRE_V2_USER_SECCOMP,
|
||||
};
|
||||
|
||||
@@ -203,6 +203,7 @@ static inline int pmd_large(pmd_t pte)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
/* NOTE: when predicate huge page, consider also pmd_devmap, or use pmd_large */
|
||||
static inline int pmd_trans_huge(pmd_t pmd)
|
||||
{
|
||||
return (pmd_val(pmd) & (_PAGE_PSE|_PAGE_DEVMAP)) == _PAGE_PSE;
|
||||
|
||||
@@ -54,8 +54,13 @@
|
||||
/*
|
||||
* Initialize the stackprotector canary value.
|
||||
*
|
||||
* NOTE: this must only be called from functions that never return,
|
||||
* NOTE: this must only be called from functions that never return
|
||||
* and it must always be inlined.
|
||||
*
|
||||
* In addition, it should be called from a compilation unit for which
|
||||
* stack protector is disabled. Alternatively, the caller should not end
|
||||
* with a function call which gets tail-call optimized as that would
|
||||
* lead to checking a modified canary value.
|
||||
*/
|
||||
static __always_inline void boot_init_stack_canary(void)
|
||||
{
|
||||
|
||||
@@ -40,6 +40,7 @@ static void __init l1tf_select_mitigation(void);
|
||||
static void __init mds_select_mitigation(void);
|
||||
static void __init mds_print_mitigation(void);
|
||||
static void __init taa_select_mitigation(void);
|
||||
static void __init srbds_select_mitigation(void);
|
||||
|
||||
/* The base value of the SPEC_CTRL MSR that always has to be preserved. */
|
||||
u64 x86_spec_ctrl_base;
|
||||
@@ -59,7 +60,7 @@ static u64 __ro_after_init x86_spec_ctrl_mask = SPEC_CTRL_IBRS;
|
||||
u64 __ro_after_init x86_amd_ls_cfg_base;
|
||||
u64 __ro_after_init x86_amd_ls_cfg_ssbd_mask;
|
||||
|
||||
/* Control conditional STIPB in switch_to() */
|
||||
/* Control conditional STIBP in switch_to() */
|
||||
DEFINE_STATIC_KEY_FALSE(switch_to_cond_stibp);
|
||||
/* Control conditional IBPB in switch_mm() */
|
||||
DEFINE_STATIC_KEY_FALSE(switch_mm_cond_ibpb);
|
||||
@@ -107,6 +108,7 @@ void __init check_bugs(void)
|
||||
l1tf_select_mitigation();
|
||||
mds_select_mitigation();
|
||||
taa_select_mitigation();
|
||||
srbds_select_mitigation();
|
||||
|
||||
/*
|
||||
* As MDS and TAA mitigations are inter-related, print MDS
|
||||
@@ -389,6 +391,97 @@ static int __init tsx_async_abort_parse_cmdline(char *str)
|
||||
}
|
||||
early_param("tsx_async_abort", tsx_async_abort_parse_cmdline);
|
||||
|
||||
#undef pr_fmt
|
||||
#define pr_fmt(fmt) "SRBDS: " fmt
|
||||
|
||||
enum srbds_mitigations {
|
||||
SRBDS_MITIGATION_OFF,
|
||||
SRBDS_MITIGATION_UCODE_NEEDED,
|
||||
SRBDS_MITIGATION_FULL,
|
||||
SRBDS_MITIGATION_TSX_OFF,
|
||||
SRBDS_MITIGATION_HYPERVISOR,
|
||||
};
|
||||
|
||||
static enum srbds_mitigations srbds_mitigation __ro_after_init = SRBDS_MITIGATION_FULL;
|
||||
|
||||
static const char * const srbds_strings[] = {
|
||||
[SRBDS_MITIGATION_OFF] = "Vulnerable",
|
||||
[SRBDS_MITIGATION_UCODE_NEEDED] = "Vulnerable: No microcode",
|
||||
[SRBDS_MITIGATION_FULL] = "Mitigation: Microcode",
|
||||
[SRBDS_MITIGATION_TSX_OFF] = "Mitigation: TSX disabled",
|
||||
[SRBDS_MITIGATION_HYPERVISOR] = "Unknown: Dependent on hypervisor status",
|
||||
};
|
||||
|
||||
static bool srbds_off;
|
||||
|
||||
void update_srbds_msr(void)
|
||||
{
|
||||
u64 mcu_ctrl;
|
||||
|
||||
if (!boot_cpu_has_bug(X86_BUG_SRBDS))
|
||||
return;
|
||||
|
||||
if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
|
||||
return;
|
||||
|
||||
if (srbds_mitigation == SRBDS_MITIGATION_UCODE_NEEDED)
|
||||
return;
|
||||
|
||||
rdmsrl(MSR_IA32_MCU_OPT_CTRL, mcu_ctrl);
|
||||
|
||||
switch (srbds_mitigation) {
|
||||
case SRBDS_MITIGATION_OFF:
|
||||
case SRBDS_MITIGATION_TSX_OFF:
|
||||
mcu_ctrl |= RNGDS_MITG_DIS;
|
||||
break;
|
||||
case SRBDS_MITIGATION_FULL:
|
||||
mcu_ctrl &= ~RNGDS_MITG_DIS;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
wrmsrl(MSR_IA32_MCU_OPT_CTRL, mcu_ctrl);
|
||||
}
|
||||
|
||||
static void __init srbds_select_mitigation(void)
|
||||
{
|
||||
u64 ia32_cap;
|
||||
|
||||
if (!boot_cpu_has_bug(X86_BUG_SRBDS))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Check to see if this is one of the MDS_NO systems supporting
|
||||
* TSX that are only exposed to SRBDS when TSX is enabled.
|
||||
*/
|
||||
ia32_cap = x86_read_arch_cap_msr();
|
||||
if ((ia32_cap & ARCH_CAP_MDS_NO) && !boot_cpu_has(X86_FEATURE_RTM))
|
||||
srbds_mitigation = SRBDS_MITIGATION_TSX_OFF;
|
||||
else if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
|
||||
srbds_mitigation = SRBDS_MITIGATION_HYPERVISOR;
|
||||
else if (!boot_cpu_has(X86_FEATURE_SRBDS_CTRL))
|
||||
srbds_mitigation = SRBDS_MITIGATION_UCODE_NEEDED;
|
||||
else if (cpu_mitigations_off() || srbds_off)
|
||||
srbds_mitigation = SRBDS_MITIGATION_OFF;
|
||||
|
||||
update_srbds_msr();
|
||||
pr_info("%s\n", srbds_strings[srbds_mitigation]);
|
||||
}
|
||||
|
||||
static int __init srbds_parse_cmdline(char *str)
|
||||
{
|
||||
if (!str)
|
||||
return -EINVAL;
|
||||
|
||||
if (!boot_cpu_has_bug(X86_BUG_SRBDS))
|
||||
return 0;
|
||||
|
||||
srbds_off = !strcmp(str, "off");
|
||||
return 0;
|
||||
}
|
||||
early_param("srbds", srbds_parse_cmdline);
|
||||
|
||||
#undef pr_fmt
|
||||
#define pr_fmt(fmt) "Spectre V1 : " fmt
|
||||
|
||||
@@ -487,7 +580,9 @@ early_param("nospectre_v1", nospectre_v1_cmdline);
|
||||
static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init =
|
||||
SPECTRE_V2_NONE;
|
||||
|
||||
static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init =
|
||||
static enum spectre_v2_user_mitigation spectre_v2_user_stibp __ro_after_init =
|
||||
SPECTRE_V2_USER_NONE;
|
||||
static enum spectre_v2_user_mitigation spectre_v2_user_ibpb __ro_after_init =
|
||||
SPECTRE_V2_USER_NONE;
|
||||
|
||||
#ifdef RETPOLINE
|
||||
@@ -539,10 +634,11 @@ enum spectre_v2_user_cmd {
|
||||
};
|
||||
|
||||
static const char * const spectre_v2_user_strings[] = {
|
||||
[SPECTRE_V2_USER_NONE] = "User space: Vulnerable",
|
||||
[SPECTRE_V2_USER_STRICT] = "User space: Mitigation: STIBP protection",
|
||||
[SPECTRE_V2_USER_PRCTL] = "User space: Mitigation: STIBP via prctl",
|
||||
[SPECTRE_V2_USER_SECCOMP] = "User space: Mitigation: STIBP via seccomp and prctl",
|
||||
[SPECTRE_V2_USER_NONE] = "User space: Vulnerable",
|
||||
[SPECTRE_V2_USER_STRICT] = "User space: Mitigation: STIBP protection",
|
||||
[SPECTRE_V2_USER_STRICT_PREFERRED] = "User space: Mitigation: STIBP always-on protection",
|
||||
[SPECTRE_V2_USER_PRCTL] = "User space: Mitigation: STIBP via prctl",
|
||||
[SPECTRE_V2_USER_SECCOMP] = "User space: Mitigation: STIBP via seccomp and prctl",
|
||||
};
|
||||
|
||||
static const struct {
|
||||
@@ -654,23 +750,36 @@ spectre_v2_user_select_mitigation(enum spectre_v2_mitigation_cmd v2_cmd)
|
||||
pr_info("mitigation: Enabling %s Indirect Branch Prediction Barrier\n",
|
||||
static_key_enabled(&switch_mm_always_ibpb) ?
|
||||
"always-on" : "conditional");
|
||||
|
||||
spectre_v2_user_ibpb = mode;
|
||||
}
|
||||
|
||||
/* If enhanced IBRS is enabled no STIPB required */
|
||||
if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)
|
||||
/*
|
||||
* If enhanced IBRS is enabled or SMT impossible, STIBP is not
|
||||
* required.
|
||||
*/
|
||||
if (!smt_possible || spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)
|
||||
return;
|
||||
|
||||
/*
|
||||
* If SMT is not possible or STIBP is not available clear the STIPB
|
||||
* mode.
|
||||
* At this point, an STIBP mode other than "off" has been set.
|
||||
* If STIBP support is not being forced, check if STIBP always-on
|
||||
* is preferred.
|
||||
*/
|
||||
if (!smt_possible || !boot_cpu_has(X86_FEATURE_STIBP))
|
||||
if (mode != SPECTRE_V2_USER_STRICT &&
|
||||
boot_cpu_has(X86_FEATURE_AMD_STIBP_ALWAYS_ON))
|
||||
mode = SPECTRE_V2_USER_STRICT_PREFERRED;
|
||||
|
||||
/*
|
||||
* If STIBP is not available, clear the STIBP mode.
|
||||
*/
|
||||
if (!boot_cpu_has(X86_FEATURE_STIBP))
|
||||
mode = SPECTRE_V2_USER_NONE;
|
||||
|
||||
spectre_v2_user_stibp = mode;
|
||||
|
||||
set_mode:
|
||||
spectre_v2_user = mode;
|
||||
/* Only print the STIBP mode when SMT possible */
|
||||
if (smt_possible)
|
||||
pr_info("%s\n", spectre_v2_user_strings[mode]);
|
||||
pr_info("%s\n", spectre_v2_user_strings[mode]);
|
||||
}
|
||||
|
||||
static const char * const spectre_v2_strings[] = {
|
||||
@@ -910,10 +1019,11 @@ void arch_smt_update(void)
|
||||
{
|
||||
mutex_lock(&spec_ctrl_mutex);
|
||||
|
||||
switch (spectre_v2_user) {
|
||||
switch (spectre_v2_user_stibp) {
|
||||
case SPECTRE_V2_USER_NONE:
|
||||
break;
|
||||
case SPECTRE_V2_USER_STRICT:
|
||||
case SPECTRE_V2_USER_STRICT_PREFERRED:
|
||||
update_stibp_strict();
|
||||
break;
|
||||
case SPECTRE_V2_USER_PRCTL:
|
||||
@@ -1142,13 +1252,19 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
|
||||
{
|
||||
switch (ctrl) {
|
||||
case PR_SPEC_ENABLE:
|
||||
if (spectre_v2_user == SPECTRE_V2_USER_NONE)
|
||||
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE &&
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_NONE)
|
||||
return 0;
|
||||
/*
|
||||
* Indirect branch speculation is always disabled in strict
|
||||
* mode.
|
||||
* mode. It can neither be enabled if it was force-disabled
|
||||
* by a previous prctl call.
|
||||
|
||||
*/
|
||||
if (spectre_v2_user == SPECTRE_V2_USER_STRICT)
|
||||
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED ||
|
||||
task_spec_ib_force_disable(task))
|
||||
return -EPERM;
|
||||
task_clear_spec_ib_disable(task);
|
||||
task_update_spec_tif(task);
|
||||
@@ -1159,9 +1275,12 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
|
||||
* Indirect branch speculation is always allowed when
|
||||
* mitigation is force disabled.
|
||||
*/
|
||||
if (spectre_v2_user == SPECTRE_V2_USER_NONE)
|
||||
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE &&
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_NONE)
|
||||
return -EPERM;
|
||||
if (spectre_v2_user == SPECTRE_V2_USER_STRICT)
|
||||
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED)
|
||||
return 0;
|
||||
task_set_spec_ib_disable(task);
|
||||
if (ctrl == PR_SPEC_FORCE_DISABLE)
|
||||
@@ -1192,7 +1311,8 @@ void arch_seccomp_spec_mitigate(struct task_struct *task)
|
||||
{
|
||||
if (ssb_mode == SPEC_STORE_BYPASS_SECCOMP)
|
||||
ssb_prctl_set(task, PR_SPEC_FORCE_DISABLE);
|
||||
if (spectre_v2_user == SPECTRE_V2_USER_SECCOMP)
|
||||
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_SECCOMP ||
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_SECCOMP)
|
||||
ib_prctl_set(task, PR_SPEC_FORCE_DISABLE);
|
||||
}
|
||||
#endif
|
||||
@@ -1221,21 +1341,24 @@ static int ib_prctl_get(struct task_struct *task)
|
||||
if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V2))
|
||||
return PR_SPEC_NOT_AFFECTED;
|
||||
|
||||
switch (spectre_v2_user) {
|
||||
case SPECTRE_V2_USER_NONE:
|
||||
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE &&
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_NONE)
|
||||
return PR_SPEC_ENABLE;
|
||||
case SPECTRE_V2_USER_PRCTL:
|
||||
case SPECTRE_V2_USER_SECCOMP:
|
||||
else if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED)
|
||||
return PR_SPEC_DISABLE;
|
||||
else if (spectre_v2_user_ibpb == SPECTRE_V2_USER_PRCTL ||
|
||||
spectre_v2_user_ibpb == SPECTRE_V2_USER_SECCOMP ||
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_PRCTL ||
|
||||
spectre_v2_user_stibp == SPECTRE_V2_USER_SECCOMP) {
|
||||
if (task_spec_ib_force_disable(task))
|
||||
return PR_SPEC_PRCTL | PR_SPEC_FORCE_DISABLE;
|
||||
if (task_spec_ib_disable(task))
|
||||
return PR_SPEC_PRCTL | PR_SPEC_DISABLE;
|
||||
return PR_SPEC_PRCTL | PR_SPEC_ENABLE;
|
||||
case SPECTRE_V2_USER_STRICT:
|
||||
return PR_SPEC_DISABLE;
|
||||
default:
|
||||
} else
|
||||
return PR_SPEC_NOT_AFFECTED;
|
||||
}
|
||||
}
|
||||
|
||||
int arch_prctl_spec_ctrl_get(struct task_struct *task, unsigned long which)
|
||||
@@ -1476,11 +1599,13 @@ static char *stibp_state(void)
|
||||
if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)
|
||||
return "";
|
||||
|
||||
switch (spectre_v2_user) {
|
||||
switch (spectre_v2_user_stibp) {
|
||||
case SPECTRE_V2_USER_NONE:
|
||||
return ", STIBP: disabled";
|
||||
case SPECTRE_V2_USER_STRICT:
|
||||
return ", STIBP: forced";
|
||||
case SPECTRE_V2_USER_STRICT_PREFERRED:
|
||||
return ", STIBP: always-on";
|
||||
case SPECTRE_V2_USER_PRCTL:
|
||||
case SPECTRE_V2_USER_SECCOMP:
|
||||
if (static_key_enabled(&switch_to_cond_stibp))
|
||||
@@ -1501,6 +1626,11 @@ static char *ibpb_state(void)
|
||||
return "";
|
||||
}
|
||||
|
||||
static ssize_t srbds_show_state(char *buf)
|
||||
{
|
||||
return sprintf(buf, "%s\n", srbds_strings[srbds_mitigation]);
|
||||
}
|
||||
|
||||
static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr,
|
||||
char *buf, unsigned int bug)
|
||||
{
|
||||
@@ -1542,6 +1672,9 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
|
||||
case X86_BUG_ITLB_MULTIHIT:
|
||||
return itlb_multihit_show_state(buf);
|
||||
|
||||
case X86_BUG_SRBDS:
|
||||
return srbds_show_state(buf);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1588,4 +1721,9 @@ ssize_t cpu_show_itlb_multihit(struct device *dev, struct device_attribute *attr
|
||||
{
|
||||
return cpu_show_common(dev, attr, buf, X86_BUG_ITLB_MULTIHIT);
|
||||
}
|
||||
|
||||
ssize_t cpu_show_srbds(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return cpu_show_common(dev, attr, buf, X86_BUG_SRBDS);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -956,9 +956,30 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = {
|
||||
{}
|
||||
};
|
||||
|
||||
static bool __init cpu_matches(unsigned long which)
|
||||
#define VULNBL_INTEL_STEPPINGS(model, steppings, issues) \
|
||||
X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE(INTEL, 6, \
|
||||
INTEL_FAM6_##model, steppings, \
|
||||
X86_FEATURE_ANY, issues)
|
||||
|
||||
#define SRBDS BIT(0)
|
||||
|
||||
static const struct x86_cpu_id cpu_vuln_blacklist[] __initconst = {
|
||||
VULNBL_INTEL_STEPPINGS(IVYBRIDGE, X86_STEPPING_ANY, SRBDS),
|
||||
VULNBL_INTEL_STEPPINGS(HASWELL_CORE, X86_STEPPING_ANY, SRBDS),
|
||||
VULNBL_INTEL_STEPPINGS(HASWELL_ULT, X86_STEPPING_ANY, SRBDS),
|
||||
VULNBL_INTEL_STEPPINGS(HASWELL_GT3E, X86_STEPPING_ANY, SRBDS),
|
||||
VULNBL_INTEL_STEPPINGS(BROADWELL_GT3E, X86_STEPPING_ANY, SRBDS),
|
||||
VULNBL_INTEL_STEPPINGS(BROADWELL_CORE, X86_STEPPING_ANY, SRBDS),
|
||||
VULNBL_INTEL_STEPPINGS(SKYLAKE_MOBILE, X86_STEPPING_ANY, SRBDS),
|
||||
VULNBL_INTEL_STEPPINGS(SKYLAKE_DESKTOP, X86_STEPPING_ANY, SRBDS),
|
||||
VULNBL_INTEL_STEPPINGS(KABYLAKE_MOBILE, X86_STEPPINGS(0x0, 0xC), SRBDS),
|
||||
VULNBL_INTEL_STEPPINGS(KABYLAKE_DESKTOP,X86_STEPPINGS(0x0, 0xD), SRBDS),
|
||||
{}
|
||||
};
|
||||
|
||||
static bool __init cpu_matches(const struct x86_cpu_id *table, unsigned long which)
|
||||
{
|
||||
const struct x86_cpu_id *m = x86_match_cpu(cpu_vuln_whitelist);
|
||||
const struct x86_cpu_id *m = x86_match_cpu(table);
|
||||
|
||||
return m && !!(m->driver_data & which);
|
||||
}
|
||||
@@ -978,29 +999,32 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
|
||||
u64 ia32_cap = x86_read_arch_cap_msr();
|
||||
|
||||
/* Set ITLB_MULTIHIT bug if cpu is not in the whitelist and not mitigated */
|
||||
if (!cpu_matches(NO_ITLB_MULTIHIT) && !(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO))
|
||||
if (!cpu_matches(cpu_vuln_whitelist, NO_ITLB_MULTIHIT) &&
|
||||
!(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO))
|
||||
setup_force_cpu_bug(X86_BUG_ITLB_MULTIHIT);
|
||||
|
||||
if (cpu_matches(NO_SPECULATION))
|
||||
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION))
|
||||
return;
|
||||
|
||||
setup_force_cpu_bug(X86_BUG_SPECTRE_V1);
|
||||
setup_force_cpu_bug(X86_BUG_SPECTRE_V2);
|
||||
|
||||
if (!cpu_matches(NO_SSB) && !(ia32_cap & ARCH_CAP_SSB_NO) &&
|
||||
if (!cpu_matches(cpu_vuln_whitelist, NO_SSB) &&
|
||||
!(ia32_cap & ARCH_CAP_SSB_NO) &&
|
||||
!cpu_has(c, X86_FEATURE_AMD_SSB_NO))
|
||||
setup_force_cpu_bug(X86_BUG_SPEC_STORE_BYPASS);
|
||||
|
||||
if (ia32_cap & ARCH_CAP_IBRS_ALL)
|
||||
setup_force_cpu_cap(X86_FEATURE_IBRS_ENHANCED);
|
||||
|
||||
if (!cpu_matches(NO_MDS) && !(ia32_cap & ARCH_CAP_MDS_NO)) {
|
||||
if (!cpu_matches(cpu_vuln_whitelist, NO_MDS) &&
|
||||
!(ia32_cap & ARCH_CAP_MDS_NO)) {
|
||||
setup_force_cpu_bug(X86_BUG_MDS);
|
||||
if (cpu_matches(MSBDS_ONLY))
|
||||
if (cpu_matches(cpu_vuln_whitelist, MSBDS_ONLY))
|
||||
setup_force_cpu_bug(X86_BUG_MSBDS_ONLY);
|
||||
}
|
||||
|
||||
if (!cpu_matches(NO_SWAPGS))
|
||||
if (!cpu_matches(cpu_vuln_whitelist, NO_SWAPGS))
|
||||
setup_force_cpu_bug(X86_BUG_SWAPGS);
|
||||
|
||||
/*
|
||||
@@ -1018,7 +1042,16 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
|
||||
(ia32_cap & ARCH_CAP_TSX_CTRL_MSR)))
|
||||
setup_force_cpu_bug(X86_BUG_TAA);
|
||||
|
||||
if (cpu_matches(NO_MELTDOWN))
|
||||
/*
|
||||
* SRBDS affects CPUs which support RDRAND or RDSEED and are listed
|
||||
* in the vulnerability blacklist.
|
||||
*/
|
||||
if ((cpu_has(c, X86_FEATURE_RDRAND) ||
|
||||
cpu_has(c, X86_FEATURE_RDSEED)) &&
|
||||
cpu_matches(cpu_vuln_blacklist, SRBDS))
|
||||
setup_force_cpu_bug(X86_BUG_SRBDS);
|
||||
|
||||
if (cpu_matches(cpu_vuln_whitelist, NO_MELTDOWN))
|
||||
return;
|
||||
|
||||
/* Rogue Data Cache Load? No! */
|
||||
@@ -1027,7 +1060,7 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
|
||||
|
||||
setup_force_cpu_bug(X86_BUG_CPU_MELTDOWN);
|
||||
|
||||
if (cpu_matches(NO_L1TF))
|
||||
if (cpu_matches(cpu_vuln_whitelist, NO_L1TF))
|
||||
return;
|
||||
|
||||
setup_force_cpu_bug(X86_BUG_L1TF);
|
||||
@@ -1450,6 +1483,7 @@ void identify_secondary_cpu(struct cpuinfo_x86 *c)
|
||||
mtrr_ap_init();
|
||||
validate_apic_and_package_id(c);
|
||||
x86_spec_ctrl_setup_ap();
|
||||
update_srbds_msr();
|
||||
}
|
||||
|
||||
struct msr_range {
|
||||
|
||||
@@ -66,6 +66,7 @@ extern int detect_extended_topology_early(struct cpuinfo_x86 *c);
|
||||
extern int detect_ht_early(struct cpuinfo_x86 *c);
|
||||
|
||||
extern void x86_spec_ctrl_setup_ap(void);
|
||||
extern void update_srbds_msr(void);
|
||||
|
||||
extern u64 x86_read_arch_cap_msr(void);
|
||||
|
||||
|
||||
@@ -33,13 +33,18 @@ const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match)
|
||||
const struct x86_cpu_id *m;
|
||||
struct cpuinfo_x86 *c = &boot_cpu_data;
|
||||
|
||||
for (m = match; m->vendor | m->family | m->model | m->feature; m++) {
|
||||
for (m = match;
|
||||
m->vendor | m->family | m->model | m->steppings | m->feature;
|
||||
m++) {
|
||||
if (m->vendor != X86_VENDOR_ANY && c->x86_vendor != m->vendor)
|
||||
continue;
|
||||
if (m->family != X86_FAMILY_ANY && c->x86 != m->family)
|
||||
continue;
|
||||
if (m->model != X86_MODEL_ANY && c->x86_model != m->model)
|
||||
continue;
|
||||
if (m->steppings != X86_STEPPING_ANY &&
|
||||
!(BIT(c->x86_stepping) & m->steppings))
|
||||
continue;
|
||||
if (m->feature != X86_FEATURE_ANY && !cpu_has(c, m->feature))
|
||||
continue;
|
||||
return m;
|
||||
|
||||
@@ -324,28 +324,20 @@ static __always_inline void __speculation_ctrl_update(unsigned long tifp,
|
||||
u64 msr = x86_spec_ctrl_base;
|
||||
bool updmsr = false;
|
||||
|
||||
/*
|
||||
* If TIF_SSBD is different, select the proper mitigation
|
||||
* method. Note that if SSBD mitigation is disabled or permanentely
|
||||
* enabled this branch can't be taken because nothing can set
|
||||
* TIF_SSBD.
|
||||
*/
|
||||
if (tif_diff & _TIF_SSBD) {
|
||||
if (static_cpu_has(X86_FEATURE_VIRT_SSBD)) {
|
||||
/* Handle change of TIF_SSBD depending on the mitigation method. */
|
||||
if (static_cpu_has(X86_FEATURE_VIRT_SSBD)) {
|
||||
if (tif_diff & _TIF_SSBD)
|
||||
amd_set_ssb_virt_state(tifn);
|
||||
} else if (static_cpu_has(X86_FEATURE_LS_CFG_SSBD)) {
|
||||
} else if (static_cpu_has(X86_FEATURE_LS_CFG_SSBD)) {
|
||||
if (tif_diff & _TIF_SSBD)
|
||||
amd_set_core_ssb_state(tifn);
|
||||
} else if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) ||
|
||||
static_cpu_has(X86_FEATURE_AMD_SSBD)) {
|
||||
msr |= ssbd_tif_to_spec_ctrl(tifn);
|
||||
updmsr = true;
|
||||
}
|
||||
} else if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) ||
|
||||
static_cpu_has(X86_FEATURE_AMD_SSBD)) {
|
||||
updmsr |= !!(tif_diff & _TIF_SSBD);
|
||||
msr |= ssbd_tif_to_spec_ctrl(tifn);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only evaluate TIF_SPEC_IB if conditional STIBP is enabled,
|
||||
* otherwise avoid the MSR write.
|
||||
*/
|
||||
/* Only evaluate TIF_SPEC_IB if conditional STIBP is enabled. */
|
||||
if (IS_ENABLED(CONFIG_SMP) &&
|
||||
static_branch_unlikely(&switch_to_cond_stibp)) {
|
||||
updmsr |= !!(tif_diff & _TIF_SPEC_IB);
|
||||
|
||||
@@ -19,7 +19,7 @@ static inline void switch_to_extra(struct task_struct *prev,
|
||||
if (IS_ENABLED(CONFIG_SMP)) {
|
||||
/*
|
||||
* Avoid __switch_to_xtra() invocation when conditional
|
||||
* STIPB is disabled and the only different bit is
|
||||
* STIBP is disabled and the only different bit is
|
||||
* TIF_SPEC_IB. For CONFIG_SMP=n TIF_SPEC_IB is not
|
||||
* in the TIF_WORK_CTXSW masks.
|
||||
*/
|
||||
|
||||
@@ -198,6 +198,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
|
||||
},
|
||||
},
|
||||
{ /* Handle problems with rebooting on Apple MacBook6,1 */
|
||||
.callback = set_pci_reboot,
|
||||
.ident = "Apple MacBook6,1",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook6,1"),
|
||||
},
|
||||
},
|
||||
{ /* Handle problems with rebooting on Apple MacBookPro5 */
|
||||
.callback = set_pci_reboot,
|
||||
.ident = "Apple MacBookPro5",
|
||||
|
||||
@@ -249,6 +249,14 @@ static void notrace start_secondary(void *unused)
|
||||
|
||||
wmb();
|
||||
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
|
||||
|
||||
/*
|
||||
* Prevent tail call to cpu_startup_entry() because the stack protector
|
||||
* guard has been changed a couple of function calls up, in
|
||||
* boot_init_stack_canary() and must not be checked before tail calling
|
||||
* another function.
|
||||
*/
|
||||
prevent_tail_call_optimization();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,10 +23,6 @@
|
||||
#include <asm/hpet.h>
|
||||
#include <asm/time.h>
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
__visible volatile unsigned long jiffies __cacheline_aligned_in_smp = INITIAL_JIFFIES;
|
||||
#endif
|
||||
|
||||
unsigned long profile_pc(struct pt_regs *regs)
|
||||
{
|
||||
unsigned long pc = instruction_pointer(regs);
|
||||
|
||||
@@ -34,13 +34,13 @@ OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)
|
||||
#ifdef CONFIG_X86_32
|
||||
OUTPUT_ARCH(i386)
|
||||
ENTRY(phys_startup_32)
|
||||
jiffies = jiffies_64;
|
||||
#else
|
||||
OUTPUT_ARCH(i386:x86-64)
|
||||
ENTRY(phys_startup_64)
|
||||
jiffies_64 = jiffies;
|
||||
#endif
|
||||
|
||||
jiffies = jiffies_64;
|
||||
|
||||
#if defined(CONFIG_X86_64)
|
||||
/*
|
||||
* On 64-bit, align RODATA to 2MB so we retain large page mappings for
|
||||
|
||||
@@ -2734,7 +2734,7 @@ static inline void copy_vmcb_control_area(struct vmcb *dst_vmcb, struct vmcb *fr
|
||||
dst->iopm_base_pa = from->iopm_base_pa;
|
||||
dst->msrpm_base_pa = from->msrpm_base_pa;
|
||||
dst->tsc_offset = from->tsc_offset;
|
||||
dst->asid = from->asid;
|
||||
/* asid not copied, it is handled manually for svm->vmcb. */
|
||||
dst->tlb_ctl = from->tlb_ctl;
|
||||
dst->int_ctl = from->int_ctl;
|
||||
dst->int_vector = from->int_vector;
|
||||
|
||||
@@ -8207,7 +8207,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (exit_reason) {
|
||||
switch ((u16)exit_reason) {
|
||||
case EXIT_REASON_EXCEPTION_NMI:
|
||||
if (is_nmi(intr_info))
|
||||
return false;
|
||||
|
||||
@@ -3128,7 +3128,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
|
||||
unsigned bank_num = mcg_cap & 0xff, bank;
|
||||
|
||||
r = -EINVAL;
|
||||
if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS)
|
||||
if (!bank_num || bank_num > KVM_MAX_MCE_BANKS)
|
||||
goto out;
|
||||
if (mcg_cap & ~(kvm_mce_cap_supported | 0xff | 0xff0000))
|
||||
goto out;
|
||||
|
||||
@@ -110,8 +110,6 @@ __ref void *alloc_low_pages(unsigned int num)
|
||||
} else {
|
||||
pfn = pgt_buf_end;
|
||||
pgt_buf_end += num;
|
||||
printk(KERN_DEBUG "BRK [%#010lx, %#010lx] PGTABLE\n",
|
||||
pfn << PAGE_SHIFT, (pgt_buf_end << PAGE_SHIFT) - 1);
|
||||
}
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
|
||||
@@ -385,7 +385,7 @@ static void enter_uniprocessor(void)
|
||||
int cpu;
|
||||
int err;
|
||||
|
||||
if (downed_cpus == NULL &&
|
||||
if (!cpumask_available(downed_cpus) &&
|
||||
!alloc_cpumask_var(&downed_cpus, GFP_KERNEL)) {
|
||||
pr_notice("Failed to allocate mask\n");
|
||||
goto out;
|
||||
@@ -415,7 +415,7 @@ static void leave_uniprocessor(void)
|
||||
int cpu;
|
||||
int err;
|
||||
|
||||
if (downed_cpus == NULL || cpumask_weight(downed_cpus) == 0)
|
||||
if (!cpumask_available(downed_cpus) || cpumask_weight(downed_cpus) == 0)
|
||||
return;
|
||||
pr_notice("Re-enabling CPUs...\n");
|
||||
for_each_cpu(cpu, downed_cpus) {
|
||||
|
||||
@@ -571,6 +571,10 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, pci_invalid_bar);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6f60, pci_invalid_bar);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fa0, pci_invalid_bar);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fc0, pci_invalid_bar);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0xa1ec, pci_invalid_bar);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0xa1ed, pci_invalid_bar);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0xa26c, pci_invalid_bar);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0xa26d, pci_invalid_bar);
|
||||
|
||||
/*
|
||||
* Device [1022:7914]
|
||||
|
||||
@@ -116,6 +116,7 @@ asmlinkage __visible void cpu_bringup_and_idle(int cpu)
|
||||
#endif
|
||||
cpu_bringup();
|
||||
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
|
||||
prevent_tail_call_optimization();
|
||||
}
|
||||
|
||||
void xen_smp_intr_free(unsigned int cpu)
|
||||
|
||||
@@ -713,6 +713,9 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
|
||||
|
||||
kobject_init(&q->kobj, &blk_queue_ktype);
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_IO_TRACE
|
||||
mutex_init(&q->blk_trace_mutex);
|
||||
#endif
|
||||
mutex_init(&q->sysfs_lock);
|
||||
spin_lock_init(&q->__queue_lock);
|
||||
|
||||
|
||||
@@ -2309,6 +2309,10 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues)
|
||||
|
||||
list_for_each_entry(q, &set->tag_list, tag_set_list)
|
||||
blk_mq_freeze_queue(q);
|
||||
/*
|
||||
* Sync with blk_mq_queue_tag_busy_iter.
|
||||
*/
|
||||
synchronize_rcu();
|
||||
|
||||
set->nr_hw_queues = nr_hw_queues;
|
||||
list_for_each_entry(q, &set->tag_list, tag_set_list) {
|
||||
@@ -2324,10 +2328,6 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues)
|
||||
|
||||
list_for_each_entry(q, &set->tag_list, tag_set_list)
|
||||
blk_mq_unfreeze_queue(q);
|
||||
/*
|
||||
* Sync with blk_mq_queue_tag_busy_iter.
|
||||
*/
|
||||
synchronize_rcu();
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(blk_mq_update_nr_hw_queues);
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@ out_put_alg:
|
||||
return inst;
|
||||
}
|
||||
|
||||
static void free(struct crypto_instance *inst)
|
||||
static void free_inst(struct crypto_instance *inst)
|
||||
{
|
||||
crypto_drop_spawn(crypto_instance_ctx(inst));
|
||||
kfree(inst);
|
||||
@@ -386,7 +386,7 @@ static void free(struct crypto_instance *inst)
|
||||
static struct crypto_template crypto_tmpl = {
|
||||
.name = "lrw",
|
||||
.alloc = alloc,
|
||||
.free = free,
|
||||
.free = free_inst,
|
||||
.module = THIS_MODULE,
|
||||
};
|
||||
|
||||
|
||||
@@ -329,7 +329,7 @@ out_put_alg:
|
||||
return inst;
|
||||
}
|
||||
|
||||
static void free(struct crypto_instance *inst)
|
||||
static void free_inst(struct crypto_instance *inst)
|
||||
{
|
||||
crypto_drop_spawn(crypto_instance_ctx(inst));
|
||||
kfree(inst);
|
||||
@@ -338,7 +338,7 @@ static void free(struct crypto_instance *inst)
|
||||
static struct crypto_template crypto_tmpl = {
|
||||
.name = "xts",
|
||||
.alloc = alloc,
|
||||
.free = free,
|
||||
.free = free_inst,
|
||||
.module = THIS_MODULE,
|
||||
};
|
||||
|
||||
|
||||
@@ -793,8 +793,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
|
||||
|
||||
ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,
|
||||
"acpi_cppc");
|
||||
if (ret)
|
||||
if (ret) {
|
||||
kobject_put(&cpc_ptr->kobj);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
kfree(output.pointer);
|
||||
return 0;
|
||||
|
||||
@@ -171,7 +171,7 @@ int acpi_device_set_power(struct acpi_device *device, int state)
|
||||
* possibly drop references to the power resources in use.
|
||||
*/
|
||||
state = ACPI_STATE_D3_HOT;
|
||||
/* If _PR3 is not available, use D3hot as the target state. */
|
||||
/* If D3cold is not supported, use D3hot as the target state. */
|
||||
if (!device->power.states[ACPI_STATE_D3_COLD].flags.valid)
|
||||
target_state = state;
|
||||
} else if (!device->power.states[state].flags.valid) {
|
||||
|
||||
@@ -82,6 +82,8 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
|
||||
struct resource r;
|
||||
struct acpi_resource_irq *p = &ares->data.irq;
|
||||
struct acpi_resource_extended_irq *pext = &ares->data.extended_irq;
|
||||
char ev_name[5];
|
||||
u8 trigger;
|
||||
|
||||
if (ares->type == ACPI_RESOURCE_TYPE_END_TAG)
|
||||
return AE_OK;
|
||||
@@ -90,14 +92,28 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
|
||||
dev_err(dev, "unable to parse IRQ resource\n");
|
||||
return AE_ERROR;
|
||||
}
|
||||
if (ares->type == ACPI_RESOURCE_TYPE_IRQ)
|
||||
if (ares->type == ACPI_RESOURCE_TYPE_IRQ) {
|
||||
gsi = p->interrupts[0];
|
||||
else
|
||||
trigger = p->triggering;
|
||||
} else {
|
||||
gsi = pext->interrupts[0];
|
||||
trigger = pext->triggering;
|
||||
}
|
||||
|
||||
irq = r.start;
|
||||
|
||||
if (ACPI_FAILURE(acpi_get_handle(handle, "_EVT", &evt_handle))) {
|
||||
switch (gsi) {
|
||||
case 0 ... 255:
|
||||
sprintf(ev_name, "_%c%02hhX",
|
||||
trigger == ACPI_EDGE_SENSITIVE ? 'E' : 'L', gsi);
|
||||
|
||||
if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
|
||||
break;
|
||||
/* fall through */
|
||||
default:
|
||||
if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))
|
||||
break;
|
||||
|
||||
dev_err(dev, "cannot locate _EVT method\n");
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
||||
@@ -927,12 +927,9 @@ static void acpi_bus_init_power_state(struct acpi_device *device, int state)
|
||||
|
||||
if (buffer.length && package
|
||||
&& package->type == ACPI_TYPE_PACKAGE
|
||||
&& package->package.count) {
|
||||
int err = acpi_extract_power_resources(package, 0,
|
||||
&ps->resources);
|
||||
if (!err)
|
||||
device->power.flags.power_resources = 1;
|
||||
}
|
||||
&& package->package.count)
|
||||
acpi_extract_power_resources(package, 0, &ps->resources);
|
||||
|
||||
ACPI_FREE(buffer.pointer);
|
||||
}
|
||||
|
||||
@@ -979,14 +976,27 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
|
||||
acpi_bus_init_power_state(device, i);
|
||||
|
||||
INIT_LIST_HEAD(&device->power.states[ACPI_STATE_D3_COLD].resources);
|
||||
if (!list_empty(&device->power.states[ACPI_STATE_D3_HOT].resources))
|
||||
device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
|
||||
|
||||
/* Set defaults for D0 and D3hot states (always valid) */
|
||||
/* Set the defaults for D0 and D3hot (always supported). */
|
||||
device->power.states[ACPI_STATE_D0].flags.valid = 1;
|
||||
device->power.states[ACPI_STATE_D0].power = 100;
|
||||
device->power.states[ACPI_STATE_D3_HOT].flags.valid = 1;
|
||||
|
||||
/*
|
||||
* Use power resources only if the D0 list of them is populated, because
|
||||
* some platforms may provide _PR3 only to indicate D3cold support and
|
||||
* in those cases the power resources list returned by it may be bogus.
|
||||
*/
|
||||
if (!list_empty(&device->power.states[ACPI_STATE_D0].resources)) {
|
||||
device->power.flags.power_resources = 1;
|
||||
/*
|
||||
* D3cold is supported if the D3hot list of power resources is
|
||||
* not empty.
|
||||
*/
|
||||
if (!list_empty(&device->power.states[ACPI_STATE_D3_HOT].resources))
|
||||
device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
|
||||
}
|
||||
|
||||
if (acpi_bus_init_power(device))
|
||||
device->flags.power_manageable = 0;
|
||||
}
|
||||
|
||||
@@ -900,8 +900,10 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,
|
||||
|
||||
error = kobject_init_and_add(&hotplug->kobj,
|
||||
&acpi_hotplug_profile_ktype, hotplug_kobj, "%s", name);
|
||||
if (error)
|
||||
if (error) {
|
||||
kobject_put(&hotplug->kobj);
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
kobject_uevent(&hotplug->kobj, KOBJ_ADD);
|
||||
return;
|
||||
|
||||
@@ -314,17 +314,6 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* https://bugzilla.redhat.com/show_bug.cgi?id=1204476 */
|
||||
/* https://bugs.launchpad.net/ubuntu/+source/linux-lts-trusty/+bug/1416940 */
|
||||
.callback = video_detect_force_native,
|
||||
.ident = "HP Pavilion dv6",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv6 Notebook PC"),
|
||||
},
|
||||
},
|
||||
|
||||
{ },
|
||||
};
|
||||
|
||||
|
||||
@@ -162,7 +162,8 @@ static int try_to_bring_up_master(struct master *master,
|
||||
ret = master->ops->bind(master->dev);
|
||||
if (ret < 0) {
|
||||
devres_release_group(master->dev, NULL);
|
||||
dev_info(master->dev, "master bind failed: %d\n", ret);
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_info(master->dev, "master bind failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -431,8 +432,9 @@ static int component_bind(struct component *component, struct master *master,
|
||||
devres_release_group(component->dev, NULL);
|
||||
devres_release_group(master->dev, NULL);
|
||||
|
||||
dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
|
||||
dev_name(component->dev), component->ops, ret);
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
|
||||
dev_name(component->dev), component->ops, ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -641,6 +641,12 @@ ssize_t __weak cpu_show_itlb_multihit(struct device *dev,
|
||||
return sprintf(buf, "Not affected\n");
|
||||
}
|
||||
|
||||
ssize_t __weak cpu_show_srbds(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return sprintf(buf, "Not affected\n");
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL);
|
||||
static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL);
|
||||
static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL);
|
||||
@@ -649,6 +655,7 @@ static DEVICE_ATTR(l1tf, 0444, cpu_show_l1tf, NULL);
|
||||
static DEVICE_ATTR(mds, 0444, cpu_show_mds, NULL);
|
||||
static DEVICE_ATTR(tsx_async_abort, 0444, cpu_show_tsx_async_abort, NULL);
|
||||
static DEVICE_ATTR(itlb_multihit, 0444, cpu_show_itlb_multihit, NULL);
|
||||
static DEVICE_ATTR(srbds, 0444, cpu_show_srbds, NULL);
|
||||
|
||||
static struct attribute *cpu_root_vulnerabilities_attrs[] = {
|
||||
&dev_attr_meltdown.attr,
|
||||
@@ -659,6 +666,7 @@ static struct attribute *cpu_root_vulnerabilities_attrs[] = {
|
||||
&dev_attr_mds.attr,
|
||||
&dev_attr_tsx_async_abort.attr,
|
||||
&dev_attr_itlb_multihit.attr,
|
||||
&dev_attr_srbds.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -845,6 +845,7 @@ void intel_gtt_insert_page(dma_addr_t addr,
|
||||
unsigned int flags)
|
||||
{
|
||||
intel_private.driver->write_entry(addr, pg, flags);
|
||||
readl(intel_private.gtt + pg);
|
||||
if (intel_private.driver->chipset_flush)
|
||||
intel_private.driver->chipset_flush();
|
||||
}
|
||||
@@ -870,7 +871,7 @@ void intel_gtt_insert_sg_entries(struct sg_table *st,
|
||||
j++;
|
||||
}
|
||||
}
|
||||
wmb();
|
||||
readl(intel_private.gtt + j - 1);
|
||||
if (intel_private.driver->chipset_flush)
|
||||
intel_private.driver->chipset_flush();
|
||||
}
|
||||
@@ -1104,6 +1105,7 @@ static void i9xx_cleanup(void)
|
||||
|
||||
static void i9xx_chipset_flush(void)
|
||||
{
|
||||
wmb();
|
||||
if (intel_private.i9xx_flush_page)
|
||||
writel(1, intel_private.i9xx_flush_page);
|
||||
}
|
||||
|
||||
@@ -146,10 +146,6 @@ static int num_called;
|
||||
static int __init dw_apb_timer_init(struct device_node *timer)
|
||||
{
|
||||
switch (num_called) {
|
||||
case 0:
|
||||
pr_debug("%s: found clockevent timer\n", __func__);
|
||||
add_clockevent(timer);
|
||||
break;
|
||||
case 1:
|
||||
pr_debug("%s: found clocksource timer\n", __func__);
|
||||
add_clocksource(timer);
|
||||
@@ -160,6 +156,8 @@ static int __init dw_apb_timer_init(struct device_node *timer)
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
pr_debug("%s: found clockevent timer\n", __func__);
|
||||
add_clockevent(timer);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ static int cpuidle_add_state_sysfs(struct cpuidle_device *device)
|
||||
ret = kobject_init_and_add(&kobj->kobj, &ktype_state_cpuidle,
|
||||
&kdev->kobj, "state%d", i);
|
||||
if (ret) {
|
||||
kfree(kobj);
|
||||
kobject_put(&kobj->kobj);
|
||||
goto error_state;
|
||||
}
|
||||
kobject_uevent(&kobj->kobj, KOBJ_ADD);
|
||||
@@ -542,7 +542,7 @@ static int cpuidle_add_driver_sysfs(struct cpuidle_device *dev)
|
||||
ret = kobject_init_and_add(&kdrv->kobj, &ktype_driver_cpuidle,
|
||||
&kdev->kobj, "driver");
|
||||
if (ret) {
|
||||
kfree(kdrv);
|
||||
kobject_put(&kdrv->kobj);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -636,7 +636,7 @@ int cpuidle_add_sysfs(struct cpuidle_device *dev)
|
||||
error = kobject_init_and_add(&kdev->kobj, &ktype_cpuidle, &cpu_dev->kobj,
|
||||
"cpuidle");
|
||||
if (error) {
|
||||
kfree(kdev);
|
||||
kobject_put(&kdev->kobj);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -2636,7 +2636,6 @@ static struct talitos_alg_template driver_algs[] = {
|
||||
.cra_ablkcipher = {
|
||||
.min_keysize = AES_MIN_KEY_SIZE,
|
||||
.max_keysize = AES_MAX_KEY_SIZE,
|
||||
.ivsize = AES_BLOCK_SIZE,
|
||||
}
|
||||
},
|
||||
.desc_hdr_template = DESC_HDR_TYPE_COMMON_NONSNOOP_NO_AFEU |
|
||||
@@ -2670,6 +2669,7 @@ static struct talitos_alg_template driver_algs[] = {
|
||||
.cra_ablkcipher = {
|
||||
.min_keysize = AES_MIN_KEY_SIZE,
|
||||
.max_keysize = AES_MAX_KEY_SIZE,
|
||||
.ivsize = AES_BLOCK_SIZE,
|
||||
.setkey = ablkcipher_aes_setkey,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -362,6 +362,8 @@ static void mmp_tdma_free_descriptor(struct mmp_tdma_chan *tdmac)
|
||||
gen_pool_free(gpool, (unsigned long)tdmac->desc_arr,
|
||||
size);
|
||||
tdmac->desc_arr = NULL;
|
||||
if (tdmac->status == DMA_ERROR)
|
||||
tdmac->status = DMA_COMPLETE;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -876,6 +876,7 @@ static int pch_dma_probe(struct pci_dev *pdev,
|
||||
}
|
||||
|
||||
pci_set_master(pdev);
|
||||
pd->dma.dev = &pdev->dev;
|
||||
|
||||
err = request_irq(pdev->irq, pd_irq, IRQF_SHARED, DRV_NAME, pd);
|
||||
if (err) {
|
||||
@@ -891,7 +892,6 @@ static int pch_dma_probe(struct pci_dev *pdev,
|
||||
goto err_free_irq;
|
||||
}
|
||||
|
||||
pd->dma.dev = &pdev->dev;
|
||||
|
||||
INIT_LIST_HEAD(&pd->dma.channels);
|
||||
|
||||
|
||||
@@ -793,7 +793,7 @@ static int tegra_adma_probe(struct platform_device *pdev)
|
||||
ret = dma_async_device_register(&tdma->dma_dev);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "ADMA registration failed: %d\n", ret);
|
||||
goto irq_dispose;
|
||||
goto rpm_put;
|
||||
}
|
||||
|
||||
ret = of_dma_controller_register(pdev->dev.of_node,
|
||||
|
||||
@@ -586,8 +586,10 @@ efivar_create_sysfs_entry(struct efivar_entry *new_var)
|
||||
ret = kobject_init_and_add(&new_var->kobj, &efivar_ktype,
|
||||
NULL, "%s", short_name);
|
||||
kfree(short_name);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
kobject_put(&new_var->kobj);
|
||||
return ret;
|
||||
}
|
||||
|
||||
kobject_uevent(&new_var->kobj, KOBJ_ADD);
|
||||
if (efivar_entry_add(new_var, &efivar_sysfs_list)) {
|
||||
|
||||
@@ -341,6 +341,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d)
|
||||
struct tegra_gpio_info *tgi = bank->tgi;
|
||||
int gpio = d->hwirq;
|
||||
|
||||
tegra_gpio_irq_mask(d);
|
||||
gpiochip_unlock_as_irq(&tgi->gc, gpio);
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,8 @@ qxl_image_init_helper(struct qxl_device *qdev,
|
||||
break;
|
||||
default:
|
||||
DRM_ERROR("unsupported image bit depth\n");
|
||||
return -EINVAL; /* TODO: cleanup */
|
||||
qxl_bo_kunmap_atomic_page(qdev, image_bo, ptr);
|
||||
return -EINVAL;
|
||||
}
|
||||
image->u.bitmap.flags = QXL_BITMAP_TOP_DOWN;
|
||||
image->u.bitmap.x = width;
|
||||
|
||||
@@ -354,6 +354,7 @@
|
||||
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7349 0x7349
|
||||
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_73F7 0x73f7
|
||||
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001 0xa001
|
||||
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002 0xc002
|
||||
|
||||
#define USB_VENDOR_ID_ELAN 0x04f3
|
||||
|
||||
|
||||
@@ -1332,6 +1332,9 @@ static const struct hid_device_id mt_devices[] = {
|
||||
{ .driver_data = MT_CLS_EGALAX_SERIAL,
|
||||
MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
|
||||
USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001) },
|
||||
{ .driver_data = MT_CLS_EGALAX,
|
||||
MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
|
||||
USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002) },
|
||||
|
||||
/* Elitegroup panel */
|
||||
{ .driver_data = MT_CLS_SERIAL,
|
||||
|
||||
@@ -381,6 +381,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = {
|
||||
},
|
||||
.driver_data = (void *)&sipodev_desc
|
||||
},
|
||||
{
|
||||
.ident = "Schneider SCL142ALM",
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SCHNEIDER"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SCL142ALM"),
|
||||
},
|
||||
.driver_data = (void *)&sipodev_desc
|
||||
},
|
||||
{ } /* Terminate list */
|
||||
};
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
struct i2c_dev {
|
||||
struct list_head list;
|
||||
struct i2c_adapter *adap;
|
||||
struct device *dev;
|
||||
struct device dev;
|
||||
struct cdev cdev;
|
||||
};
|
||||
|
||||
@@ -91,12 +91,14 @@ static struct i2c_dev *get_free_i2c_dev(struct i2c_adapter *adap)
|
||||
return i2c_dev;
|
||||
}
|
||||
|
||||
static void put_i2c_dev(struct i2c_dev *i2c_dev)
|
||||
static void put_i2c_dev(struct i2c_dev *i2c_dev, bool del_cdev)
|
||||
{
|
||||
spin_lock(&i2c_dev_list_lock);
|
||||
list_del(&i2c_dev->list);
|
||||
spin_unlock(&i2c_dev_list_lock);
|
||||
kfree(i2c_dev);
|
||||
if (del_cdev)
|
||||
cdev_device_del(&i2c_dev->cdev, &i2c_dev->dev);
|
||||
put_device(&i2c_dev->dev);
|
||||
}
|
||||
|
||||
static ssize_t name_show(struct device *dev,
|
||||
@@ -542,6 +544,14 @@ static const struct file_operations i2cdev_fops = {
|
||||
|
||||
static struct class *i2c_dev_class;
|
||||
|
||||
static void i2cdev_dev_release(struct device *dev)
|
||||
{
|
||||
struct i2c_dev *i2c_dev;
|
||||
|
||||
i2c_dev = container_of(dev, struct i2c_dev, dev);
|
||||
kfree(i2c_dev);
|
||||
}
|
||||
|
||||
static int i2cdev_attach_adapter(struct device *dev, void *dummy)
|
||||
{
|
||||
struct i2c_adapter *adap;
|
||||
@@ -558,27 +568,23 @@ static int i2cdev_attach_adapter(struct device *dev, void *dummy)
|
||||
|
||||
cdev_init(&i2c_dev->cdev, &i2cdev_fops);
|
||||
i2c_dev->cdev.owner = THIS_MODULE;
|
||||
res = cdev_add(&i2c_dev->cdev, MKDEV(I2C_MAJOR, adap->nr), 1);
|
||||
if (res)
|
||||
goto error_cdev;
|
||||
|
||||
/* register this i2c device with the driver core */
|
||||
i2c_dev->dev = device_create(i2c_dev_class, &adap->dev,
|
||||
MKDEV(I2C_MAJOR, adap->nr), NULL,
|
||||
"i2c-%d", adap->nr);
|
||||
if (IS_ERR(i2c_dev->dev)) {
|
||||
res = PTR_ERR(i2c_dev->dev);
|
||||
goto error;
|
||||
device_initialize(&i2c_dev->dev);
|
||||
i2c_dev->dev.devt = MKDEV(I2C_MAJOR, adap->nr);
|
||||
i2c_dev->dev.class = i2c_dev_class;
|
||||
i2c_dev->dev.parent = &adap->dev;
|
||||
i2c_dev->dev.release = i2cdev_dev_release;
|
||||
dev_set_name(&i2c_dev->dev, "i2c-%d", adap->nr);
|
||||
|
||||
res = cdev_device_add(&i2c_dev->cdev, &i2c_dev->dev);
|
||||
if (res) {
|
||||
put_i2c_dev(i2c_dev, false);
|
||||
return res;
|
||||
}
|
||||
|
||||
pr_debug("i2c-dev: adapter [%s] registered as minor %d\n",
|
||||
adap->name, adap->nr);
|
||||
return 0;
|
||||
error:
|
||||
cdev_del(&i2c_dev->cdev);
|
||||
error_cdev:
|
||||
put_i2c_dev(i2c_dev);
|
||||
return res;
|
||||
}
|
||||
|
||||
static int i2cdev_detach_adapter(struct device *dev, void *dummy)
|
||||
@@ -594,9 +600,7 @@ static int i2cdev_detach_adapter(struct device *dev, void *dummy)
|
||||
if (!i2c_dev) /* attach_adapter must have failed */
|
||||
return 0;
|
||||
|
||||
cdev_del(&i2c_dev->cdev);
|
||||
put_i2c_dev(i2c_dev);
|
||||
device_destroy(i2c_dev_class, MKDEV(I2C_MAJOR, adap->nr));
|
||||
put_i2c_dev(i2c_dev, true);
|
||||
|
||||
pr_debug("i2c-dev: adapter [%s] unregistered\n", adap->name);
|
||||
return 0;
|
||||
|
||||
@@ -270,6 +270,7 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev)
|
||||
err_rollback_available:
|
||||
device_remove_file(&pdev->dev, &dev_attr_available_masters);
|
||||
err_rollback:
|
||||
i2c_demux_deactivate_master(priv);
|
||||
for (j = 0; j < i; j++) {
|
||||
of_node_put(priv->chan[j].parent_np);
|
||||
of_changeset_destroy(&priv->chan[j].chgset);
|
||||
|
||||
@@ -235,6 +235,7 @@ static int vf610_dac_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
|
||||
error_iio_device_register:
|
||||
vf610_dac_exit(info);
|
||||
clk_disable_unprepare(info->clk);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -61,7 +61,6 @@ static int vcnl4000_measure(struct vcnl4000_data *data, u8 req_mask,
|
||||
u8 rdy_mask, u8 data_reg, int *val)
|
||||
{
|
||||
int tries = 20;
|
||||
__be16 buf;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
@@ -88,13 +87,12 @@ static int vcnl4000_measure(struct vcnl4000_data *data, u8 req_mask,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = i2c_smbus_read_i2c_block_data(data->client,
|
||||
data_reg, sizeof(buf), (u8 *) &buf);
|
||||
ret = i2c_smbus_read_word_swapped(data->client, data_reg);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
mutex_unlock(&data->lock);
|
||||
*val = be16_to_cpu(buf);
|
||||
*val = ret;
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -453,16 +453,15 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
|
||||
struct flowi6 fl6;
|
||||
struct dst_entry *dst;
|
||||
struct rt6_info *rt;
|
||||
int ret;
|
||||
|
||||
memset(&fl6, 0, sizeof fl6);
|
||||
fl6.daddr = dst_in->sin6_addr;
|
||||
fl6.saddr = src_in->sin6_addr;
|
||||
fl6.flowi6_oif = addr->bound_dev_if;
|
||||
|
||||
ret = ipv6_stub->ipv6_dst_lookup(addr->net, NULL, &dst, &fl6);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
dst = ipv6_stub->ipv6_dst_lookup_flow(addr->net, NULL, &fl6, NULL);
|
||||
if (IS_ERR(dst))
|
||||
return PTR_ERR(dst);
|
||||
|
||||
rt = (struct rt6_info *)dst;
|
||||
if (ipv6_addr_any(&src_in->sin6_addr)) {
|
||||
@@ -552,6 +551,7 @@ static int addr_resolve(struct sockaddr *src_in,
|
||||
const struct sockaddr_in6 *dst_in6 =
|
||||
(const struct sockaddr_in6 *)dst_in;
|
||||
|
||||
dst = NULL;
|
||||
ret = addr6_resolve((struct sockaddr_in6 *)src_in,
|
||||
dst_in6, addr,
|
||||
&dst);
|
||||
|
||||
@@ -479,7 +479,7 @@ void i40iw_manage_arp_cache(struct i40iw_device *iwdev,
|
||||
int arp_index;
|
||||
|
||||
arp_index = i40iw_arp_table(iwdev, ip_addr, ipv4, mac_addr, action);
|
||||
if (arp_index == -1)
|
||||
if (arp_index < 0)
|
||||
return;
|
||||
cqp_request = i40iw_get_cqp_request(&iwdev->cqp, false);
|
||||
if (!cqp_request)
|
||||
|
||||
@@ -2307,6 +2307,7 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp,
|
||||
int send_size;
|
||||
int header_size;
|
||||
int spc;
|
||||
int err;
|
||||
int i;
|
||||
|
||||
if (wr->wr.opcode != IB_WR_SEND)
|
||||
@@ -2341,7 +2342,9 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp,
|
||||
|
||||
sqp->ud_header.lrh.virtual_lane = 0;
|
||||
sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags & IB_SEND_SOLICITED);
|
||||
ib_get_cached_pkey(ib_dev, sqp->qp.port, 0, &pkey);
|
||||
err = ib_get_cached_pkey(ib_dev, sqp->qp.port, 0, &pkey);
|
||||
if (err)
|
||||
return err;
|
||||
sqp->ud_header.bth.pkey = cpu_to_be16(pkey);
|
||||
if (sqp->qp.mlx4_ib_qp_type == MLX4_IB_QPT_TUN_SMI_OWNER)
|
||||
sqp->ud_header.bth.destination_qpn = cpu_to_be32(wr->remote_qpn);
|
||||
@@ -2618,9 +2621,14 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_ud_wr *wr,
|
||||
}
|
||||
sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags & IB_SEND_SOLICITED);
|
||||
if (!sqp->qp.ibqp.qp_num)
|
||||
ib_get_cached_pkey(ib_dev, sqp->qp.port, sqp->pkey_index, &pkey);
|
||||
err = ib_get_cached_pkey(ib_dev, sqp->qp.port, sqp->pkey_index,
|
||||
&pkey);
|
||||
else
|
||||
ib_get_cached_pkey(ib_dev, sqp->qp.port, wr->pkey_index, &pkey);
|
||||
err = ib_get_cached_pkey(ib_dev, sqp->qp.port, wr->pkey_index,
|
||||
&pkey);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
sqp->ud_header.bth.pkey = cpu_to_be16(pkey);
|
||||
sqp->ud_header.bth.destination_qpn = cpu_to_be32(wr->remote_qpn);
|
||||
sqp->ud_header.bth.psn = cpu_to_be32((sqp->send_psn++) & ((1 << 24) - 1));
|
||||
|
||||
@@ -756,7 +756,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
|
||||
qib_dev_err(dd,
|
||||
"Skipping linkcontrol sysfs info, (err %d) port %u\n",
|
||||
ret, port_num);
|
||||
goto bail;
|
||||
goto bail_link;
|
||||
}
|
||||
kobject_uevent(&ppd->pport_kobj, KOBJ_ADD);
|
||||
|
||||
@@ -766,7 +766,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
|
||||
qib_dev_err(dd,
|
||||
"Skipping sl2vl sysfs info, (err %d) port %u\n",
|
||||
ret, port_num);
|
||||
goto bail_link;
|
||||
goto bail_sl;
|
||||
}
|
||||
kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD);
|
||||
|
||||
@@ -776,7 +776,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
|
||||
qib_dev_err(dd,
|
||||
"Skipping diag_counters sysfs info, (err %d) port %u\n",
|
||||
ret, port_num);
|
||||
goto bail_sl;
|
||||
goto bail_diagc;
|
||||
}
|
||||
kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD);
|
||||
|
||||
@@ -789,7 +789,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
|
||||
qib_dev_err(dd,
|
||||
"Skipping Congestion Control sysfs info, (err %d) port %u\n",
|
||||
ret, port_num);
|
||||
goto bail_diagc;
|
||||
goto bail_cc;
|
||||
}
|
||||
|
||||
kobject_uevent(&ppd->pport_cc_kobj, KOBJ_ADD);
|
||||
@@ -871,6 +871,7 @@ void qib_verbs_unregister_sysfs(struct qib_devdata *dd)
|
||||
&cc_table_bin_attr);
|
||||
kobject_put(&ppd->pport_cc_kobj);
|
||||
}
|
||||
kobject_put(&ppd->diagc_kobj);
|
||||
kobject_put(&ppd->sl2vl_kobj);
|
||||
kobject_put(&ppd->pport_kobj);
|
||||
}
|
||||
|
||||
@@ -182,10 +182,12 @@ static struct dst_entry *rxe_find_route6(struct net_device *ndev,
|
||||
memcpy(&fl6.daddr, daddr, sizeof(*daddr));
|
||||
fl6.flowi6_proto = IPPROTO_UDP;
|
||||
|
||||
if (unlikely(ipv6_stub->ipv6_dst_lookup(sock_net(recv_sockets.sk6->sk),
|
||||
recv_sockets.sk6->sk, &ndst, &fl6))) {
|
||||
ndst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(recv_sockets.sk6->sk),
|
||||
recv_sockets.sk6->sk, &fl6,
|
||||
NULL);
|
||||
if (unlikely(IS_ERR(ndst))) {
|
||||
pr_err_ratelimited("no route to %pI6\n", daddr);
|
||||
goto put;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (unlikely(ndst->error)) {
|
||||
|
||||
@@ -326,20 +326,6 @@ static int evdev_fasync(int fd, struct file *file, int on)
|
||||
return fasync_helper(fd, file, on, &client->fasync);
|
||||
}
|
||||
|
||||
static int evdev_flush(struct file *file, fl_owner_t id)
|
||||
{
|
||||
struct evdev_client *client = file->private_data;
|
||||
struct evdev *evdev = client->evdev;
|
||||
|
||||
mutex_lock(&evdev->mutex);
|
||||
|
||||
if (evdev->exist && !client->revoked)
|
||||
input_flush_device(&evdev->handle, file);
|
||||
|
||||
mutex_unlock(&evdev->mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void evdev_free(struct device *dev)
|
||||
{
|
||||
struct evdev *evdev = container_of(dev, struct evdev, dev);
|
||||
@@ -453,6 +439,10 @@ static int evdev_release(struct inode *inode, struct file *file)
|
||||
unsigned int i;
|
||||
|
||||
mutex_lock(&evdev->mutex);
|
||||
|
||||
if (evdev->exist && !client->revoked)
|
||||
input_flush_device(&evdev->handle, file);
|
||||
|
||||
evdev_ungrab(evdev, client);
|
||||
mutex_unlock(&evdev->mutex);
|
||||
|
||||
@@ -1315,7 +1305,6 @@ static const struct file_operations evdev_fops = {
|
||||
.compat_ioctl = evdev_ioctl_compat,
|
||||
#endif
|
||||
.fasync = evdev_fasync,
|
||||
.flush = evdev_flush,
|
||||
.llseek = no_llseek,
|
||||
};
|
||||
|
||||
|
||||
@@ -475,6 +475,16 @@ static const u8 xboxone_fw2015_init[] = {
|
||||
0x05, 0x20, 0x00, 0x01, 0x00
|
||||
};
|
||||
|
||||
/*
|
||||
* This packet is required for Xbox One S (0x045e:0x02ea)
|
||||
* and Xbox One Elite Series 2 (0x045e:0x0b00) pads to
|
||||
* initialize the controller that was previously used in
|
||||
* Bluetooth mode.
|
||||
*/
|
||||
static const u8 xboxone_s_init[] = {
|
||||
0x05, 0x20, 0x00, 0x0f, 0x06
|
||||
};
|
||||
|
||||
/*
|
||||
* This packet is required for the Titanfall 2 Xbox One pads
|
||||
* (0x0e6f:0x0165) to finish initialization and for Hori pads
|
||||
@@ -533,6 +543,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
|
||||
XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
|
||||
XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
|
||||
XBOXONE_INIT_PKT(0x045e, 0x02ea, xboxone_s_init),
|
||||
XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user