Skip to contentSkip to conversation

MDSv6

PATCH In review Andi Kleen 6 participants 68 messages Feb 24, 2019 – Feb 25, 2019 Page 1 of 2

Subsystems (248)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

v6 cover MDSv6

Here's a new version of flushing CPU buffers for group 4 for single thread.

I would be mainly interested in feedback on the lazy approach, so please focus on the later patches.

There didn't seem to be much interest in it, so I wonder if it still makes sense to continue with it? Or could we just stay with the full approach?

The lazy approach is faster, but not by that much and may not be worth the short and long term impact all over the tree.

This version is based on my earlier base patches, with the mds=full implementation being at the beginning, and a lazy implementation building on top of it. The patch can be rebased on the rewrite once it matures.

Even the base has some features not in Thomas' version which would need to be ported (e.g. more complete virtualization support and EBPF mitigation)

This patch implements the "full tree audit" approach that was suggested by several reviewers. We (me and Mark Gross) went through most asynchronous code in the kernel and marked the functions that touch user or IO data. This leaves most asynchronous interrupts etc. to not schedule a clear. However this would need to be continuously enforced for new code too.

It also implements various other review suggestions and improvements. clearcpu.txt is now clarified in many ways.

Before reviewing please read Documentation/clearcpu.txt

Some performance data for lazy:

Kernel build: ~+1% (slightly faster, but that's within noise)
loopback apache -1% (within noise)
ebizzy -0.3% (within noise)
aim7 -5.0%
netperf rr -0.7%
netperf stream 0.0%

In comparison an older version of mds=full showed:

kernel build -2.4%
ebizzy -3.3%
apache loopback -10.0%

For networking workloads there is practically no regression now. AIM7 is showing some regression. I assume this is due to the context switch overhead.

mds=full is a bit slower, but not that much. The only real outlier is apache loopback, which is probably not too realistic a workload because it mainly does tight loops over some syscalls.

No changelog against previous versions, too many changes.

Andi Kleen (42):
x86/speculation/mds: Add basic bug infrastructure for MDS x86/speculation/mds: Clear CPU on every kernel exit x86/speculation/mds: Clear CPU buffers on entering idle x86/speculation/mds: Add command line options to control mds x86/speculation/mds: Add sysfs reporting
mds: Add some administrator documentation x86/speculation/mds: Export MD_CLEAR CPUID to KVM guests. x86/cpufeatures: Add word 20 for additional features x86/speculation/mds: Handle VMENTRY clear for CPUs without l1tf
mds: Add documentation for clear cpu usage x86/speculation/mds: Introduce lazy_clear_cpu x86/speculation/mds: Add basic implementation of mds=full x86/speculation/mds: Check lazy clear in kernel exit x86/speculation/mds: Add tracing for clear_cpu x86/speculation/mds: Schedule cpu clear on context switch
mds: Force clear cpu on kernel preemption
mds: Clear cpu in memzero_explicit and kzfree
mds: Support cpu clear in interrupts
mds: Support cpu clear after tasklets
mds: Support cpu clearing in timers
mds: Clear cpu for string io/memcpy_*io in interrupts
mds: Schedule clear cpu in swiotlb
mds: Instrument skb functions to clear cpu automatically
mds: Clear cpu for kmap_atomic in interrupts
mds: Support cpu clearing for BPF
mds sweep: Schedule clear cpus in sound core
mds sweep: Make MPU401 interrupts clear cpu
mds sweep: Clear cpu on processing input layer data mds sweep: Clear cpu for tty input
mds sweep: Clear cpu for usbmon intercepts
mds sweep: Clear cpu in some Xen drivers
mds sweep: Clear cpu in DVB software filters
mds sweep: Mark all DRM interrupts to clear cpu
mds sweep: Make all old style IDE driver interrupts clear cpu mds sweep: Make Amazon ena driver management interrupt clear cpu mds sweep: Make all PCMCIA interrupts clear cpu
mds sweep: Mark common functions in comedi as clear cpu mds sweep: Make usb hcd poll clear cpu x86/speculation/mds: Switch mds=auto to lazy
mds sweep: Mark interrupts that touch user data
mds sweep: Mark timer handlers that touch user data mds sweep: Mark tasklets that touch user data

Mark Gross (1):
mds sweep: Clear cpu in sg_copy_from_buffer for SCSI

 .../ABI/testing/sysfs-devices-system-cpu      |   1 +
 .../admin-guide/kernel-parameters.txt         |  11 +
 Documentation/admin-guide/mds.rst             |  95 +++++++
 Documentation/clearcpu.txt                    | 261 ++++++++++++++++++
 arch/Kconfig                                  |   3 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/entry/common.c                       |   8 +
 arch/x86/events/intel/uncore.c                |   3 +-
 arch/x86/include/asm/clearbpf.h               |  29 ++
 arch/x86/include/asm/clearcpu.h               |  83 ++++++
 arch/x86/include/asm/cpufeature.h             |   6 +-
 arch/x86/include/asm/cpufeatures.h            |   9 +-
 arch/x86/include/asm/disabled-features.h      |   3 +-
 arch/x86/include/asm/floppy.h                 |   6 +-
 arch/x86/include/asm/io.h                     |   3 +
 arch/x86/include/asm/msr-index.h              |   1 +
 arch/x86/include/asm/required-features.h      |   3 +-
 arch/x86/include/asm/trace/clearcpu.h         |  27 ++
 arch/x86/kernel/acpi/cstate.c                 |   2 +
 arch/x86/kernel/cpu/bugs.c                    |  82 ++++++
 arch/x86/kernel/cpu/common.c                  |  25 ++
 arch/x86/kernel/kvm.c                         |   3 +
 arch/x86/kernel/nmi.c                         |   6 +-
 arch/x86/kernel/process.c                     |   5 +
 arch/x86/kernel/process.h                     |   1 +
 arch/x86/kernel/smpboot.c                     |   3 +
 arch/x86/kvm/cpuid.c                          |   3 +-
 arch/x86/kvm/vmx/vmx.c                        |  20 +-
 arch/x86/mm/highmem_32.c                      |   3 +
 arch/x86/mm/tlb.c                             |  14 +
 drivers/acpi/acpi_pad.c                       |   2 +
 drivers/acpi/processor_idle.c                 |   3 +
 drivers/atm/eni.c                             |   3 +-
 drivers/atm/he.c                              |   3 +-
 drivers/atm/lanai.c                           |   4 +-
 drivers/atm/nicstar.c                         |   4 +-
 drivers/auxdisplay/img-ascii-lcd.c            |   2 +-
 drivers/base/cpu.c                            |   8 +
 drivers/block/xsysace.c                       |   5 +-
 drivers/char/ipmi/ipmi_si_intf.c              |   6 +-
 drivers/char/sonypi.c                         |   3 +-
 drivers/crypto/ixp4xx_crypto.c                |   3 +-
 drivers/crypto/qat/qat_common/adf_isr.c       |   7 +-
 drivers/crypto/qat/qat_common/adf_sriov.c     |   6 +-
 drivers/crypto/qat/qat_common/adf_vf_isr.c    |  10 +-
 drivers/dma/dw/core.c                         |   3 +-
 drivers/dma/ioat/init.c                       |   3 +-
 drivers/dma/virt-dma.c                        |   3 +-
 drivers/firewire/core-transaction.c           |   5 +-
 drivers/firewire/nosy.c                       |   3 +-
 drivers/gpu/drm/drm_irq.c                     |   3 +-
 drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c    |   3 +-
 drivers/gpu/drm/i915/i915_pmu.c               |   3 +-
 drivers/gpu/drm/i915/intel_lrc.c              |   5 +-
 .../gpu/drm/nouveau/nvkm/subdev/pci/base.c    |   3 +-
 drivers/hv/channel_mgmt.c                     |   4 +-
 drivers/hv/hv.c                               |   4 +-
 drivers/i2c/busses/i2c-emev2.c                |   5 +-
 drivers/i2c/busses/i2c-i801.c                 |   2 +-
 drivers/i2c/busses/i2c-pxa.c                  |   4 +-
 drivers/i2c/busses/i2c-rk3x.c                 |   3 +-
 drivers/ide/ide-probe.c                       |   5 +-
 drivers/idle/intel_idle.c                     |   5 +
 drivers/iio/trigger/iio-trig-hrtimer.c        |   3 +-
 drivers/infiniband/hw/bnxt_re/qplib_fp.c      |   4 +-
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c    |   4 +-
 drivers/infiniband/hw/i40iw/i40iw_main.c      |   9 +-
 drivers/infiniband/hw/mthca/mthca_eq.c        |  14 +-
 drivers/infiniband/hw/qib/qib_sdma.c          |   4 +-
 drivers/infiniband/sw/rxe/rxe_cq.c            |   3 +-
 drivers/input/ff-memless.c                    |   2 +-
 drivers/input/input.c                         |   5 +-
 drivers/input/misc/xen-kbdfront.c             |   3 +-
 drivers/input/serio/hil_mlc.c                 |   2 +-
 drivers/input/serio/i8042.c                   |  13 +-
 drivers/input/serio/serio.c                   |   3 +
 drivers/ipack/carriers/tpci200.c              |   6 +-
 drivers/isdn/capi/capidrv.c                   |   2 +-
 drivers/isdn/gigaset/bas-gigaset.c            |   8 +-
 drivers/isdn/gigaset/common.c                 |   4 +-
 drivers/isdn/gigaset/ser-gigaset.c            |   4 +-
 drivers/isdn/gigaset/usb-gigaset.c            |   4 +-
 drivers/isdn/hardware/avm/b1isa.c             |   4 +-
 drivers/isdn/hardware/avm/b1pci.c             |   6 +-
 drivers/isdn/hardware/avm/b1pcmcia.c          |   3 +-
 drivers/isdn/hardware/avm/c4.c                |   3 +-
 drivers/isdn/hardware/avm/t1isa.c             |   4 +-
 drivers/isdn/hardware/avm/t1pci.c             |   3 +-
 drivers/isdn/hardware/mISDN/avmfritz.c        |   4 +-
 drivers/isdn/hardware/mISDN/hfcmulti.c        |   3 +-
 drivers/isdn/hardware/mISDN/hfcpci.c          |   2 +-
 drivers/isdn/hardware/mISDN/mISDNinfineon.c   |   3 +-
 drivers/isdn/hardware/mISDN/netjet.c          |   2 +-
 drivers/isdn/hardware/mISDN/speedfax.c        |   3 +-
 drivers/isdn/hardware/mISDN/w6692.c           |   2 +-
 drivers/isdn/hisax/config.c                   |   2 +-
 drivers/isdn/hisax/hfc4s8s_l1.c               |   3 +-
 drivers/isdn/hisax/hisax_fcpcipnp.c           |  13 +-
 drivers/isdn/i4l/isdn_common.c                |   2 +-
 drivers/media/cec/cec-pin.c                   |   3 +-
 drivers/media/common/saa7146/saa7146_core.c   |   4 +-
 drivers/media/dvb-core/dvb_demux.c            |   3 +
 drivers/media/pci/b2c2/flexcop-pci.c          |   3 +-
 drivers/media/pci/bt8xx/bttv-driver.c         |   2 +-
 drivers/media/pci/bt8xx/bttv-input.c          |   5 +-
 drivers/media/pci/bt8xx/dvb-bt8xx.c           |   3 +-
 drivers/media/pci/cobalt/cobalt-driver.c      |   3 +-
 drivers/media/pci/cx18/cx18-driver.c          |   3 +-
 drivers/media/pci/cx25821/cx25821-core.c      |   2 +-
 drivers/media/pci/cx88/cx88-alsa.c            |   3 +-
 drivers/media/pci/cx88/cx88-mpeg.c            |   2 +-
 drivers/media/pci/cx88/cx88-video.c           |   2 +-
 drivers/media/pci/dt3155/dt3155.c             |   2 +-
 drivers/media/pci/intel/ipu3/ipu3-cio2.c      |   2 +-
 drivers/media/pci/ivtv/ivtv-driver.c          |   3 +-
 drivers/media/pci/mantis/mantis_dvb.c         |   3 +-
 drivers/media/pci/meye/meye.c                 |   3 +-
 .../pci/netup_unidvb/netup_unidvb_core.c      |   3 +-
 drivers/media/pci/ngene/ngene-core.c          |   5 +-
 drivers/media/pci/pluto2/pluto2.c             |   3 +-
 drivers/media/pci/saa7134/saa7134-alsa.c      |   4 +-
 drivers/media/pci/saa7134/saa7134-core.c      |   2 +-
 drivers/media/pci/saa7134/saa7134-input.c     |   3 +-
 drivers/media/pci/saa7134/saa7134-ts.c        |   3 +-
 drivers/media/pci/saa7134/saa7134-vbi.c       |   3 +-
 drivers/media/pci/saa7134/saa7134-video.c     |   3 +-
 drivers/media/pci/saa7164/saa7164-core.c      |   7 +-
 drivers/media/pci/smipcie/smipcie-main.c      |   3 +-
 drivers/media/pci/solo6x10/solo6x10-core.c    |   4 +-
 drivers/media/pci/sta2x11/sta2x11_vip.c       |   5 +-
 drivers/media/pci/ttpci/av7110.c              |  12 +-
 drivers/media/pci/ttpci/av7110_ir.c           |   3 +-
 drivers/media/pci/ttpci/budget-ci.c           |   9 +-
 drivers/media/pci/ttpci/budget-core.c         |   3 +-
 drivers/media/pci/tw5864/tw5864-video.c       |   4 +-
 drivers/media/pci/tw68/tw68-core.c            |   2 +-
 drivers/media/pci/tw686x/tw686x-core.c        |   4 +-
 drivers/media/platform/aspeed-video.c         |   5 +-
 .../media/platform/marvell-ccic/cafe-driver.c |   3 +-
 .../media/platform/marvell-ccic/mcam-core.c   |   4 +-
 drivers/media/radio/radio-cadet.c             |   2 +-
 drivers/media/radio/wl128x/fmdrv_common.c     |   9 +-
 drivers/media/rc/fintek-cir.c                 |   3 +-
 drivers/media/rc/gpio-ir-recv.c               |   2 +-
 drivers/media/rc/img-ir/img-ir-raw.c          |   2 +-
 drivers/media/rc/ir-hix5hd2.c                 |   3 +-
 drivers/media/rc/ir-rx51.c                    |   3 +-
 drivers/media/rc/ite-cir.c                    |   3 +-
 drivers/media/rc/nuvoton-cir.c                |   3 +-
 drivers/media/rc/serial_ir.c                  |   2 +-
 drivers/media/rc/sir_ir.c                     |   3 +-
 drivers/media/rc/winbond-cir.c                |   2 +-
 drivers/media/usb/au0828/au0828-video.c       |   6 +-
 drivers/media/usb/ttusb-dec/ttusb_dec.c       |   5 +-
 drivers/memstick/host/jmb38x_ms.c             |   6 +-
 drivers/message/fusion/mptbase.c              |   3 +-
 drivers/mfd/ezx-pcap.c                        |   4 +-
 drivers/misc/ibmasm/module.c                  |   4 +-
 drivers/misc/sgi-gru/grufile.c                |   7 +-
 drivers/misc/sgi-xp/xpc_uv.c                  |   3 +-
 drivers/misc/vmw_vmci/vmci_guest.c            |   8 +-
 drivers/mmc/host/mtk-sd.c                     |   3 +-
 drivers/mmc/host/wbsd.c                       |  20 +-
 drivers/net/appletalk/cops.c                  |   2 +-
 drivers/net/arcnet/arc-rimi.c                 |   2 +-
 drivers/net/arcnet/com20020.c                 |   3 +-
 drivers/net/arcnet/com90io.c                  |   3 +-
 drivers/net/arcnet/com90xx.c                  |   2 +-
 drivers/net/caif/caif_hsi.c                   |   9 +-
 drivers/net/can/cc770/cc770.c                 |   4 +-
 drivers/net/can/peak_canfd/peak_pciefd_main.c |   8 +-
 drivers/net/can/sja1000/ems_pcmcia.c          |   4 +-
 drivers/net/can/sja1000/peak_pcmcia.c         |   3 +-
 drivers/net/can/sja1000/sja1000.c             |   5 +-
 drivers/net/ethernet/3com/3c509.c             |   3 +-
 drivers/net/ethernet/3com/3c515.c             |   6 +-
 drivers/net/ethernet/8390/axnet_cs.c          |   3 +-
 drivers/net/ethernet/8390/ne.c                |   3 +-
 drivers/net/ethernet/8390/ne2k-pci.c          |   3 +-
 drivers/net/ethernet/8390/pcnet_cs.c          |   3 +-
 drivers/net/ethernet/8390/smc-ultra.c         |   3 +-
 drivers/net/ethernet/8390/wd.c                |   3 +-
 drivers/net/ethernet/agere/et131x.c           |   4 +-
 drivers/net/ethernet/amazon/ena/ena_netdev.c  |   5 +-
 drivers/net/ethernet/amazon/ena/ena_netdev.h  |   1 +
 drivers/net/ethernet/amd/lance.c              |   2 +-
 drivers/net/ethernet/amd/ni65.c               |   5 +-
 drivers/net/ethernet/atheros/atlx/atl1.c      |   4 +-
 drivers/net/ethernet/atheros/atlx/atl2.c      |   4 +-
 drivers/net/ethernet/broadcom/cnic.c          |   8 +-
 drivers/net/ethernet/cadence/macb_main.c      |   4 +-
 .../net/ethernet/chelsio/cxgb3/cxgb3_main.c   |  16 +-
 drivers/net/ethernet/micrel/ks8842.c          |   7 +-
 drivers/net/ethernet/micrel/ks8851_mll.c      |   3 +-
 drivers/net/ethernet/microchip/lan743x_main.c |   7 +-
 drivers/net/ethernet/realtek/atp.c            |   3 +-
 drivers/net/fddi/skfp/skfddi.c                |   4 +-
 drivers/net/hamradio/6pack.c                  |   4 +-
 drivers/net/hamradio/baycom_ser_fdx.c         |   3 +-
 drivers/net/hamradio/baycom_ser_hdx.c         |   3 +-
 drivers/net/hamradio/scc.c                    |   8 +-
 drivers/net/hamradio/yam.c                    |   6 +-
 drivers/net/hippi/rrunner.c                   |   2 +-
 drivers/net/ieee802154/at86rf230.c            |   6 +-
 drivers/net/ieee802154/ca8210.c               |  10 +-
 drivers/net/ieee802154/mcr20a.c               |   3 +-
 drivers/net/ieee802154/mrf24j40.c             |   3 +-
 drivers/net/ppp/ppp_async.c                   |   3 +-
 drivers/net/ppp/ppp_synctty.c                 |   3 +-
 drivers/net/slip/slip.c                       |   4 +-
 drivers/net/usb/cdc_ncm.c                     |   3 +-
 drivers/net/usb/hso.c                         |   6 +-
 drivers/net/wan/cosa.c                        |   2 +-
 drivers/net/wan/farsync.c                     |   6 +-
 drivers/net/wan/hostess_sv11.c                |   3 +-
 drivers/net/wan/sbni.c                        |   2 +-
 drivers/net/wan/sdla.c                        |   4 +-
 drivers/net/wan/sealevel.c                    |   3 +-
 drivers/net/wireless/ath/ath9k/init.c         |   5 +-
 drivers/net/wireless/ath/carl9170/usb.c       |   4 +-
 .../net/wireless/broadcom/b43legacy/main.c    |   8 +-
 drivers/net/wireless/broadcom/b43legacy/pio.c |   4 +-
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |   7 +-
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c |   3 +-
 drivers/net/wireless/cisco/airo.c             |   4 +-
 drivers/net/wireless/intel/ipw2x00/ipw2100.c  |   9 +-
 drivers/net/wireless/intel/ipw2x00/ipw2200.c  |   8 +-
 .../net/wireless/intel/iwlegacy/3945-mac.c    |   9 +-
 .../net/wireless/intel/iwlegacy/4965-mac.c    |   9 +-
 .../net/wireless/intersil/hostap/hostap_ap.c  |   2 +-
 .../net/wireless/intersil/hostap/hostap_pci.c |   3 +-
 .../net/wireless/intersil/hostap/hostap_plx.c |   3 +-
 drivers/net/wireless/intersil/orinoco/main.c  |   4 +-
 .../intersil/orinoco/orinoco_nortel.c         |   4 +-
 .../wireless/intersil/orinoco/orinoco_pci.c   |   4 +-
 .../wireless/intersil/orinoco/orinoco_plx.c   |   4 +-
 .../wireless/intersil/orinoco/orinoco_tmd.c   |   4 +-
 drivers/net/wireless/intersil/p54/p54pci.c    |   2 +-
 drivers/net/wireless/intersil/p54/p54spi.c    |   4 +-
 .../intersil/prism54/islpci_hotplug.c         |   2 +-
 drivers/net/wireless/mac80211_hwsim.c         |   6 +-
 drivers/net/wireless/marvell/libertas/if_cs.c |   2 +-
 .../net/wireless/marvell/libertas/if_spi.c    |   3 +-
 .../wireless/marvell/mwifiex/11n_rxreorder.c  |   3 +-
 drivers/net/wireless/marvell/mwifiex/main.c   |   5 +-
 drivers/net/wireless/marvell/mwifiex/pcie.c   |   8 +-
 drivers/net/wireless/marvell/mwifiex/usb.c    |   2 +-
 drivers/net/wireless/marvell/mwl8k.c          |  10 +-
 .../net/wireless/mediatek/mt76/mt76x0/pci.c   |   3 +-
 .../net/wireless/mediatek/mt76/mt76x2/pci.c   |   3 +-
 .../quantenna/qtnfmac/pcie/pearl_pcie.c       |   3 +-
 .../quantenna/qtnfmac/pcie/topaz_pcie.c       |   3 +-
 .../net/wireless/ralink/rt2x00/rt2x00mmio.c   |   6 +-
 .../wireless/realtek/rtl818x/rtl8180/dev.c    |   6 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c    |  16 +-
 drivers/net/wireless/ti/wl1251/sdio.c         |   4 +-
 drivers/net/wireless/ti/wl1251/spi.c          |   5 +-
 drivers/ntb/hw/amd/ntb_hw_amd.c               |  12 +-
 drivers/ntb/hw/intel/ntb_hw_gen1.c            |  12 +-
 drivers/ntb/hw/mscc/ntb_hw_switchtec.c        |   8 +-
 drivers/parport/parport_ax88796.c             |   3 +-
 drivers/parport/parport_pc.c                  |   3 +-
 drivers/pci/controller/pcie-xilinx.c          |   2 +-
 drivers/pci/controller/vmd.c                  |  11 +-
 drivers/pci/hotplug/cpci_hotplug_core.c       |   6 +-
 drivers/pci/hotplug/cpqphp_core.c             |   3 +-
 drivers/pci/hotplug/shpchp_hpc.c              |   5 +-
 drivers/pci/pcie/pme.c                        |   3 +-
 drivers/pci/switch/switchtec.c                |  10 +-
 drivers/pcmcia/i82092.c                       |   2 +-
 drivers/pcmcia/i82365.c                       |   9 +-
 drivers/pcmcia/pcmcia_resource.c              |   9 +-
 drivers/pcmcia/pd6729.c                       |   8 +-
 drivers/pcmcia/tcic.c                         |   7 +-
 drivers/pcmcia/yenta_socket.c                 |   7 +-
 drivers/pinctrl/intel/pinctrl-intel.c         |   2 +-
 drivers/pinctrl/pinctrl-amd.c                 |   3 +-
 drivers/pinctrl/pinctrl-single.c              |   3 +-
 drivers/platform/goldfish/goldfish_pipe.c     |   6 +-
 drivers/platform/mellanox/mlxreg-hotplug.c    |   5 +-
 drivers/platform/x86/fujitsu-tablet.c         |   3 +-
 drivers/platform/x86/intel_int0002_vgpio.c    |   2 +-
 drivers/platform/x86/intel_ips.c              |   3 +-
 drivers/platform/x86/intel_pmc_ipc.c          |   8 +-
 drivers/platform/x86/intel_punit_ipc.c        |   4 +-
 drivers/platform/x86/intel_scu_ipc.c          |   5 +-
 drivers/platform/x86/sony-laptop.c            |   5 +-
 drivers/pnp/resource.c                        |   3 +-
 drivers/power/reset/ltc2952-poweroff.c        |   6 +-
 drivers/power/supply/act8945a_charger.c       |   6 +-
 drivers/power/supply/goldfish_battery.c       |   5 +-
 .../power/supply/max14656_charger_detector.c  |   2 +-
 drivers/power/supply/pda_power.c              |   6 +-
 drivers/power/supply/wm97xx_battery.c         |   5 +-
 drivers/pps/clients/pps-gpio.c                |   3 +-
 drivers/ptp/ptp_pch.c                         |   3 +-
 drivers/rapidio/devices/tsi721.c              |  25 +-
 drivers/rapidio/devices/tsi721_dma.c          |   8 +-
 drivers/regulator/qcom_spmi-regulator.c       |   5 +-
 drivers/rpmsg/qcom_glink_native.c             |   5 +-
 drivers/rtc/rtc-cmos.c                        |   5 +-
 drivers/rtc/rtc-ds1305.c                      |   3 +-
 drivers/rtc/rtc-ds1374.c                      |   5 +-
 drivers/rtc/rtc-ds1511.c                      |   3 +-
 drivers/rtc/rtc-ds1553.c                      |   4 +-
 drivers/rtc/rtc-ds1685.c                      |   3 +-
 drivers/rtc/rtc-ftrtc010.c                    |   2 +-
 drivers/rtc/rtc-m48t59.c                      |   5 +-
 drivers/rtc/rtc-mrst.c                        |   3 +-
 drivers/rtc/rtc-pcap.c                        |  10 +-
 drivers/rtc/rtc-r7301.c                       |   3 +-
 drivers/rtc/rtc-snvs.c                        |   3 +-
 drivers/rtc/rtc-stk17ta8.c                    |   5 +-
 drivers/rtc/rtc-zynqmp.c                      |   6 +-
 drivers/scsi/3w-9xxx.c                        |   6 +-
 drivers/scsi/3w-sas.c                         |   6 +-
 drivers/scsi/3w-xxxx.c                        |   3 +-
 drivers/scsi/BusLogic.c                       |   3 +-
 drivers/scsi/a100u2w.c                        |   4 +-
 drivers/scsi/aacraid/commsup.c                |   8 +-
 drivers/scsi/aacraid/rx.c                     |   3 +-
 drivers/scsi/aacraid/sa.c                     |   3 +-
 drivers/scsi/aacraid/src.c                    |   3 +-
 drivers/scsi/advansys.c                       |   4 +-
 drivers/scsi/aha152x.c                        |   4 +-
 drivers/scsi/aha1542.c                        |   2 +-
 drivers/scsi/aha1740.c                        |   3 +-
 drivers/scsi/aic7xxx/aic7770_osm.c            |   3 +-
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c        |   2 +-
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c        |   2 +-
 drivers/scsi/aic94xx/aic94xx_hwi.c            |   4 +-
 drivers/scsi/aic94xx/aic94xx_init.c           |   5 +-
 drivers/scsi/am53c974.c                       |   4 +-
 drivers/scsi/arcmsr/arcmsr_hba.c              |   3 +-
 drivers/scsi/atp870u.c                        |   3 +-
 drivers/scsi/be2iscsi/be_main.c               |  12 +-
 drivers/scsi/bfa/bfad.c                       |   9 +-
 drivers/scsi/csiostor/csio_isr.c              |  16 +-
 drivers/scsi/dpt_i2o.c                        |   2 +-
 drivers/scsi/esas2r/esas2r_init.c             |   8 +-
 drivers/scsi/fnic/fnic_isr.c                  |  13 +-
 drivers/scsi/g_NCR5380.c                      |   7 +-
 drivers/scsi/gdth.c                           |   8 +-
 drivers/scsi/hpsa.c                           |  19 +-
 drivers/scsi/hptiop.c                         |   3 +-
 drivers/scsi/initio.c                         |   3 +-
 drivers/scsi/ipr.c                            |  23 +-
 drivers/scsi/ips.c                            |   4 +-
 drivers/scsi/isci/init.c                      |   8 +-
 drivers/scsi/lpfc/lpfc_init.c                 |  35 ++-
 drivers/scsi/megaraid.c                       |   4 +-
 drivers/scsi/megaraid/megaraid_mbox.c         |   3 +-
 drivers/scsi/megaraid/megaraid_sas_base.c     |   8 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c           |   2 +-
 drivers/scsi/mvsas/mv_init.c                  |   4 +-
 drivers/scsi/mvumi.c                          |   8 +-
 drivers/scsi/myrb.c                           |   2 +-
 drivers/scsi/myrs.c                           |   2 +-
 drivers/scsi/nsp32.c                          |   3 +-
 drivers/scsi/pcmcia/qlogic_stub.c             |   2 +-
 drivers/scsi/pcmcia/sym53c500_cs.c            |   2 +-
 drivers/scsi/pm8001/pm8001_init.c             |  10 +-
 drivers/scsi/pmcraid.c                        |   5 +-
 drivers/scsi/qedf/qedf_main.c                 |   4 +-
 drivers/scsi/qedi/qedi_main.c                 |   3 +-
 drivers/scsi/qla1280.c                        |   3 +-
 drivers/scsi/qla2xxx/qla_isr.c                |  22 +-
 drivers/scsi/qla4xxx/ql4_isr.c                |   5 +-
 drivers/scsi/qla4xxx/ql4_nx.c                 |  10 +-
 drivers/scsi/qlogicfas.c                      |   2 +-
 drivers/scsi/sim710.c                         |   2 +-
 drivers/scsi/smartpqi/smartpqi_init.c         |  11 +-
 drivers/scsi/snic/snic_isr.c                  |   5 +-
 drivers/scsi/stex.c                           |   4 +-
 drivers/scsi/sym53c8xx_2/sym_glue.c           |   3 +-
 drivers/scsi/ufs/ufshcd.c                     |   7 +-
 drivers/scsi/vmw_pvscsi.c                     |   9 +-
 drivers/scsi/wd719x.c                         |   4 +-
 drivers/slimbus/qcom-ctrl.c                   |   3 +-
 drivers/spi/spi-altera.c                      |   3 +-
 drivers/spi/spi-axi-spi-engine.c              |   3 +-
 drivers/spi/spi-cadence.c                     |   3 +-
 drivers/spi/spi-dw.c                          |   4 +-
 drivers/spi/spi-fsl-spi.c                     |   3 +-
 drivers/spi/spi-oc-tiny.c                     |   3 +-
 drivers/spi/spi-pxa2xx.c                      |   4 +-
 drivers/spi/spi-topcliff-pch.c                |   5 +-
 drivers/spi/spi-xilinx.c                      |   5 +-
 drivers/spi/spi-zynqmp-gqspi.c                |   3 +-
 drivers/staging/android/vsoc.c                |   3 +-
 drivers/staging/axis-fifo/axis-fifo.c         |   3 +-
 drivers/staging/comedi/comedi_buf.c           |   5 +
 .../staging/comedi/drivers/addi_apci_1032.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_1500.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_1564.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_2032.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_3120.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_3xxx.c   |   3 +-
 drivers/staging/comedi/drivers/adl_pci9111.c  |   3 +-
 drivers/staging/comedi/drivers/adl_pci9118.c  |   3 +-
 drivers/staging/comedi/drivers/adv_pci1710.c  |   3 +-
 drivers/staging/comedi/drivers/aio_iiro_16.c  |   3 +-
 .../comedi/drivers/amplc_dio200_common.c      |   3 +-
 .../comedi/drivers/amplc_pc236_common.c       |   3 +-
 drivers/staging/comedi/drivers/amplc_pci224.c |   3 +-
 drivers/staging/comedi/drivers/amplc_pci230.c |   3 +-
 drivers/staging/comedi/drivers/cb_pcidas.c    |   4 +-
 drivers/staging/comedi/drivers/cb_pcidas64.c  |   5 +-
 .../staging/comedi/drivers/comedi_parport.c   |   3 +-
 drivers/staging/comedi/drivers/comedi_test.c  |   6 +-
 drivers/staging/comedi/drivers/das16m1.c      |   3 +-
 drivers/staging/comedi/drivers/das1800.c      |   3 +-
 drivers/staging/comedi/drivers/das6402.c      |   3 +-
 drivers/staging/comedi/drivers/das800.c       |   5 +-
 drivers/staging/comedi/drivers/dmm32at.c      |   3 +-
 drivers/staging/comedi/drivers/dt2811.c       |   3 +-
 drivers/staging/comedi/drivers/dt2814.c       |   3 +-
 drivers/staging/comedi/drivers/dt282x.c       |   2 +-
 drivers/staging/comedi/drivers/dt3000.c       |   3 +-
 drivers/staging/comedi/drivers/gsc_hpdi.c     |   3 +-
 drivers/staging/comedi/drivers/jr3_pci.c      |   2 +-
 drivers/staging/comedi/drivers/me4000.c       |   3 +-
 drivers/staging/comedi/drivers/ni_6527.c      |   4 +-
 drivers/staging/comedi/drivers/ni_65xx.c      |   3 +-
 drivers/staging/comedi/drivers/ni_660x.c      |   4 +-
 drivers/staging/comedi/drivers/ni_at_a2150.c  |   2 +-
 drivers/staging/comedi/drivers/ni_atmio.c     |   3 +-
 drivers/staging/comedi/drivers/ni_atmio16d.c  |   3 +-
 .../staging/comedi/drivers/ni_labpc_common.c  |   5 +-
 drivers/staging/comedi/drivers/ni_pcidio.c    |   3 +-
 drivers/staging/comedi/drivers/ni_pcimio.c    |   3 +-
 drivers/staging/comedi/drivers/pcl711.c       |   3 +-
 drivers/staging/comedi/drivers/pcl726.c       |   3 +-
 drivers/staging/comedi/drivers/pcl812.c       |   3 +-
 drivers/staging/comedi/drivers/pcl816.c       |   2 +-
 drivers/staging/comedi/drivers/pcl818.c       |   3 +-
 drivers/staging/comedi/drivers/pcmmio.c       |   3 +-
 drivers/staging/comedi/drivers/pcmuio.c       |   6 +-
 drivers/staging/comedi/drivers/rtd520.c       |   3 +-
 drivers/staging/comedi/drivers/s626.c         |   3 +-
 drivers/staging/gasket/gasket_interrupt.c     |   3 +-
 drivers/staging/goldfish/goldfish_audio.c     |   5 +-
 drivers/staging/iio/adc/ad7606.c              |   3 +-
 drivers/staging/ks7010/ks_hostif.c            |   3 +-
 drivers/staging/media/bcm2048/radio-bcm2048.c |   4 +-
 drivers/staging/media/zoran/zoran_card.c      |   2 +-
 drivers/staging/most/dim2/dim2.c              |   6 +-
 drivers/staging/most/i2c/i2c.c                |   3 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c    |   2 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c  |   2 +-
 drivers/staging/pi433/pi433_if.c              |   6 +-
 drivers/staging/rtl8188eu/core/rtw_recv.c     |   2 +-
 .../staging/rtl8188eu/hal/rtl8188eu_recv.c    |   6 +-
 .../staging/rtl8188eu/hal/rtl8188eu_xmit.c    |   6 +-
 drivers/staging/rtl8188eu/os_dep/mlme_linux.c |  17 +-
 drivers/staging/rtl8188eu/os_dep/recv_linux.c |   2 +-
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c  |  20 +-
 drivers/staging/rtl8192e/rtllib_softmac.c     |   6 +-
 .../rtl8192u/ieee80211/ieee80211_module.c     |   2 +-
 .../rtl8192u/ieee80211/ieee80211_softmac.c    |   6 +-
 drivers/staging/rtl8712/rtl8712_recv.c        |   6 +-
 drivers/staging/rtl8712/rtl871x_xmit.c        |   6 +-
 .../staging/rtl8723bs/hal/rtl8723bs_recv.c    |   8 +-
 drivers/staging/rtl8723bs/os_dep/mlme_linux.c |  22 +-
 drivers/staging/rtl8723bs/os_dep/recv_linux.c |   2 +-
 drivers/staging/rtlwifi/pci.c                 |   4 +-
 drivers/staging/rts5208/rtsx.c                |   4 +-
 drivers/staging/speakup/main.c                |   2 +-
 drivers/staging/speakup/serialio.c            |   5 +-
 drivers/staging/vt6655/device_main.c          |   2 +-
 drivers/thermal/ti-soc-thermal/ti-bandgap.c   |   6 +-
 drivers/thunderbolt/nhi.c                     |   6 +-
 drivers/tty/cyclades.c                        |   9 +-
 drivers/tty/goldfish.c                        |   4 +-
 drivers/tty/hvc/hvc_irq.c                     |   4 +-
 drivers/tty/ipwireless/hardware.c             |   3 +-
 drivers/tty/isicom.c                          |   4 +-
 drivers/tty/moxa.c                            |   2 +-
 drivers/tty/mxser.c                           |   4 +-
 drivers/tty/n_gsm.c                           |   5 +-
 drivers/tty/n_r3964.c                         |   2 +-
 drivers/tty/rocket.c                          |   2 +-
 drivers/tty/serial/8250/8250_core.c           |   6 +-
 drivers/tty/serial/8250/8250_exar.c           |   2 +-
 drivers/tty/serial/8250/8250_port.c           |   4 +-
 drivers/tty/serial/altera_jtaguart.c          |   4 +-
 drivers/tty/serial/altera_uart.c              |   5 +-
 drivers/tty/serial/arc_uart.c                 |   2 +-
 drivers/tty/serial/digicolor-usart.c          |   3 +-
 drivers/tty/serial/fsl_lpuart.c               |  12 +-
 drivers/tty/serial/ifx6x60.c                  |  11 +-
 drivers/tty/serial/jsm/jsm_driver.c           |   3 +-
 drivers/tty/serial/max3100.c                  |   5 +-
 drivers/tty/serial/men_z135_uart.c            |   4 +-
 drivers/tty/serial/mux.c                      |   2 +-
 drivers/tty/serial/pch_uart.c                 |   4 +-
 drivers/tty/serial/pnx8xxx_uart.c             |   3 +-
 drivers/tty/serial/rp2.c                      |   2 +-
 drivers/tty/serial/sc16is7xx.c                |   2 +-
 drivers/tty/serial/sccnxp.c                   |   2 +-
 drivers/tty/serial/sh-sci.c                   |   9 +-
 drivers/tty/serial/timbuart.c                 |   4 +-
 drivers/tty/serial/uartlite.c                 |   3 +-
 drivers/tty/serial/xilinx_uartps.c            |   4 +-
 drivers/tty/synclink.c                        |   3 +-
 drivers/tty/synclink_gt.c                     |   6 +-
 drivers/tty/synclinkmp.c                      |   7 +-
 drivers/tty/tty_buffer.c                      |   5 +-
 drivers/tty/vcc.c                             |   4 +-
 drivers/tty/vt/keyboard.c                     |   2 +-
 drivers/uio/uio.c                             |   3 +-
 drivers/usb/atm/usbatm.c                      |   6 +-
 drivers/usb/c67x00/c67x00-drv.c               |   3 +-
 drivers/usb/chipidea/core.c                   |   5 +-
 drivers/usb/chipidea/otg_fsm.c                |   3 +-
 drivers/usb/core/hcd.c                        |   8 +-
 drivers/usb/dwc2/gadget.c                     |   3 +-
 drivers/usb/dwc2/hcd_queue.c                  |   6 +-
 drivers/usb/dwc2/platform.c                   |   3 +-
 drivers/usb/gadget/function/f_midi.c          |   3 +-
 drivers/usb/gadget/function/f_ncm.c           |   3 +-
 drivers/usb/gadget/udc/amd5536udc_pci.c       |   2 +-
 drivers/usb/gadget/udc/bdc/bdc_udc.c          |   3 +-
 drivers/usb/gadget/udc/dummy_hcd.c            |   4 +-
 drivers/usb/gadget/udc/fotg210-udc.c          |   4 +-
 drivers/usb/gadget/udc/fusb300_udc.c          |   6 +-
 drivers/usb/gadget/udc/goku_udc.c             |   3 +-
 drivers/usb/gadget/udc/m66592-udc.c           |   6 +-
 drivers/usb/gadget/udc/mv_u3d_core.c          |   3 +-
 drivers/usb/gadget/udc/mv_udc_core.c          |   3 +-
 drivers/usb/gadget/udc/net2272.c              |   3 +-
 drivers/usb/gadget/udc/net2280.c              |   3 +-
 drivers/usb/gadget/udc/pch_udc.c              |   8 +-
 drivers/usb/gadget/udc/pxa27x_udc.c           |   3 +-
 drivers/usb/gadget/udc/r8a66597-udc.c         |   7 +-
 drivers/usb/gadget/udc/snps_udc_plat.c        |   4 +-
 drivers/usb/gadget/udc/udc-xilinx.c           |   3 +-
 drivers/usb/host/max3421-hcd.c                |   3 +-
 drivers/usb/host/xhci.c                       |  12 +-
 drivers/usb/isp1760/isp1760-udc.c             |   3 +-
 drivers/usb/musb/musb_core.c                  |   2 +-
 drivers/usb/phy/phy-gpio-vbus-usb.c           |   4 +-
 drivers/usb/serial/mos7720.c                  |   4 +-
 drivers/usb/usbip/vudc_transfer.c             |   2 +-
 drivers/uwb/neh.c                             |   2 +-
 drivers/uwb/rsv.c                             |   5 +-
 drivers/uwb/whc-rc.c                          |   5 +-
 drivers/vfio/pci/vfio_pci_intrs.c             |   5 +-
 drivers/video/fbdev/arcfb.c                   |   3 +-
 drivers/video/fbdev/aty/atyfb_base.c          |   2 +-
 drivers/video/fbdev/goldfishfb.c              |   4 +-
 drivers/video/fbdev/matrox/matroxfb_base.c    |   3 +-
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c    |   7 +-
 drivers/video/fbdev/via/via-core.c            |   3 +-
 drivers/video/fbdev/xen-fbfront.c             |   2 +
 drivers/virt/vboxguest/vboxguest_linux.c      |   5 +-
 drivers/virtio/virtio_mmio.c                  |   4 +-
 drivers/virtio/virtio_pci_common.c            |  20 +-
 drivers/visorbus/visorbus_main.c              |   2 +-
 drivers/vme/bridges/vme_ca91cx42.c            |   5 +-
 drivers/vme/bridges/vme_tsi148.c              |   7 +-
 drivers/w1/masters/ds1wm.c                    |   3 +-
 drivers/xen/events/events_base.c              |  12 +-
 drivers/xen/platform-pci.c                    |   4 +-
 drivers/xen/pvcalls-front.c                   |   2 +
 drivers/xen/xen-pciback/pciback_ops.c         |   6 +-
 include/asm-generic/io.h                      |   3 +
 include/linux/clearcpu.h                      |  36 +++
 include/linux/filter.h                        |  21 +-
 include/linux/highmem.h                       |   2 +
 include/linux/hrtimer.h                       |   4 +
 include/linux/interrupt.h                     |  18 +-
 include/linux/skbuff.h                        |   2 +
 include/linux/timer.h                         |  14 +-
 include/linux/tty_flip.h                      |   4 +
 include/linux/usb/hcd.h                       |   5 +-
 kernel/bpf/core.c                             |   2 +
 kernel/bpf/cpumap.c                           |   3 +
 kernel/dma/swiotlb.c                          |   2 +
 kernel/irq/handle.c                           |   4 +
 kernel/irq/manage.c                           |   1 +
 kernel/sched/core.c                           |   9 +
 kernel/softirq.c                              |  25 +-
 kernel/time/alarmtimer.c                      |   2 +-
 kernel/time/hrtimer.c                         |   5 +
 kernel/time/timer.c                           |   8 +
 lib/random32.c                                |   2 +-
 lib/scatterlist.c                             |   2 +
 lib/string.c                                  |   6 +
 mm/slab_common.c                              |   5 +-
 net/atm/pppoatm.c                             |   2 +-
 net/core/skbuff.c                             |  32 +++
 net/mac80211/main.c                           |  14 +-
 net/rds/ib_cm.c                               |   8 +-
 net/wireless/lib80211.c                       |   2 +-
 net/xfrm/xfrm_state.c                         |   3 +-
 samples/v4l/v4l2-pci-skeleton.c               |   5 +-
 security/keys/gc.c                            |   2 +-
 sound/core/hrtimer.c                          |   3 +-
 sound/core/pcm_lib.c                          |   3 +
 sound/core/rawmidi.c                          |   3 +
 sound/core/timer.c                            |   7 +-
 sound/drivers/mpu401/mpu401_uart.c            |   8 +-
 sound/drivers/mtpav.c                         |   5 +-
 sound/drivers/pcsp/pcsp.c                     |   3 +-
 sound/drivers/serial-u16550.c                 |   6 +-
 sound/isa/ad1816a/ad1816a_lib.c               |   2 +-
 sound/isa/es1688/es1688_lib.c                 |   4 +-
 sound/isa/es18xx.c                            |   3 +-
 sound/isa/gus/gus_main.c                      |   2 +-
 sound/isa/gus/gusmax.c                        |   2 +-
 sound/isa/gus/interwave.c                     |   3 +-
 sound/isa/msnd/msnd_pinnacle.c                |   3 +-
 sound/isa/opl3sa2.c                           |   4 +-
 sound/isa/opti9xx/opti92x-ad1848.c            |   3 +-
 sound/isa/sb/emu8000_pcm.c                    |   2 +-
 sound/isa/sb/sb8_midi.c                       |   3 +-
 sound/isa/sb/sb_common.c                      |   6 +-
 sound/isa/wavefront/wavefront.c               |   3 +-
 sound/isa/wavefront/wavefront_midi.c          |   4 +-
 sound/isa/wss/wss_lib.c                       |   3 +-
 sound/pci/ad1889.c                            |   3 +-
 sound/pci/ali5451/ali5451.c                   |   3 +-
 sound/pci/als300.c                            |   3 +-
 sound/pci/asihpi/asihpi.c                     |   4 +-
 sound/pci/asihpi/hpioctl.c                    |   3 +-
 sound/pci/atiixp.c                            |   3 +-
 sound/pci/atiixp_modem.c                      |   3 +-
 sound/pci/aw2/aw2-alsa.c                      |   3 +-
 sound/pci/azt3328.c                           |   3 +-
 sound/pci/bt87x.c                             |   4 +-
 sound/pci/ca0106/ca0106_main.c                |   3 +-
 sound/pci/cmipci.c                            |   3 +-
 sound/pci/cs4281.c                            |   3 +-
 sound/pci/cs46xx/cs46xx_lib.c                 |   3 +-
 sound/pci/cs5535audio/cs5535audio.c           |   3 +-
 sound/pci/ctxfi/cthw20k1.c                    |   3 +-
 sound/pci/ctxfi/cthw20k2.c                    |   3 +-
 sound/pci/echoaudio/midi.c                    |   2 +-
 sound/pci/emu10k1/emu10k1_main.c              |   3 +-
 sound/pci/emu10k1/emu10k1x.c                  |   3 +-
 sound/pci/ens1370.c                           |   3 +-
 sound/pci/es1938.c                            |   6 +-
 sound/pci/es1968.c                            |   3 +-
 sound/pci/fm801.c                             |   3 +-
 sound/pci/hda/hda_intel.c                     |   4 +-
 sound/pci/ice1712/ice1712.c                   |   3 +-
 sound/pci/ice1712/ice1724.c                   |   3 +-
 sound/pci/intel8x0.c                          |   6 +-
 sound/pci/intel8x0m.c                         |   6 +-
 sound/pci/korg1212/korg1212.c                 |   4 +-
 sound/pci/lola/lola.c                         |   3 +-
 sound/pci/maestro3.c                          |   3 +-
 sound/pci/nm256/nm256.c                       |   3 +-
 sound/pci/oxygen/oxygen_lib.c                 |   4 +-
 sound/pci/riptide/riptide.c                   |   3 +-
 sound/pci/rme32.c                             |   3 +-
 sound/pci/rme96.c                             |   3 +-
 sound/pci/rme9652/hdsp.c                      |   8 +-
 sound/pci/rme9652/hdspm.c                     |  10 +-
 sound/pci/rme9652/rme9652.c                   |   3 +-
 sound/pci/sis7019.c                           |   7 +-
 sound/pci/sonicvibes.c                        |   3 +-
 sound/pci/trident/trident_main.c              |   3 +-
 sound/pci/via82xx.c                           |   6 +-
 sound/pci/via82xx_modem.c                     |   3 +-
 sound/pci/ymfpci/ymfpci_main.c                |   3 +-
 sound/soc/amd/acp-pcm-dma.c                   |   3 +-
 sound/soc/amd/raven/acp3x-pcm-dma.c           |   3 +-
 sound/soc/codecs/rt5640.c                     |   4 +-
 sound/soc/codecs/rt5651.c                     |   4 +-
 sound/soc/codecs/rt5663.c                     |   4 +-
 sound/soc/dwc/dwc-i2s.c                       |   5 +-
 sound/soc/fsl/fsl_asrc.c                      |   3 +-
 sound/soc/fsl/fsl_esai.c                      |   3 +-
 sound/soc/fsl/fsl_sai.c                       |   3 +-
 sound/soc/fsl/fsl_spdif.c                     |   3 +-
 sound/soc/fsl/fsl_ssi.c                       |   3 +-
 sound/usb/midi.c                              |   6 +-
 sound/usb/misc/ua101.c                        |   4 +-
 sound/x86/intel_hdmi_audio.c                  |   5 +-
 681 files changed, 2457 insertions(+), 1308 deletions(-)
 create mode 100644 Documentation/admin-guide/mds.rst
 create mode 100644 Documentation/clearcpu.txt
 create mode 100644 arch/x86/include/asm/clearbpf.h
 create mode 100644 arch/x86/include/asm/clearcpu.h
 create mode 100644 arch/x86/include/asm/trace/clearcpu.h
 create mode 100644 include/linux/clearcpu.h
Signature · 1 line
2.17.2
author
#1 lore raw

PATCH v6 1/43 MDSv6

From: Andi Kleen <[email protected]>
Subject: x86/speculation/mds: Add basic bug infrastructure
for MDS

MDS is micro architectural data sampling, which is a side channel attack on internal buffers in Intel CPUs.

MDS consists of multiple sub-vulnerabilities:
Microarchitectural Store Buffer Data Sampling (MSBDS) (CVE-2018-12126) Microarchitectual Fill Buffer Data Sampling (MFBDS) (CVE-2018-12130) Microarchitectual Load Port Data (MLPDS) (CVE-2018-12127), with the first leaking store data, and the second loads and sometimes store data, and the third load data.

They all have the same mitigations for single thread, so we lump them all together as a single MDS issue.

This patch adds the basic infrastructure to detect if the current CPU is affected by MDS, and if yes set the right BUG bits.

---
 arch/x86/include/asm/cpufeatures.h |  1 +
 arch/x86/include/asm/msr-index.h   |  1 +
 arch/x86/kernel/cpu/common.c       | 13 +++++++++++++
 3 files changed, 15 insertions(+)
arch/x86/include/asm/cpufeatures.h +1 -0
index 6d6122524711..9ef6c5dc00dc 100644
@@ -381,5 +381,6 @@
 #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 */
 
 #endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/include/asm/msr-index.h +1 -0
index 8e40c2446fd1..3e486d9d6e6c 100644
@@ -77,6 +77,7 @@
 						    * attack, so no Speculative Store Bypass
 						    * control required.
 						    */
+#define ARCH_CAP_MDS_NO			(1 << 5)   /* No Microarchitectural data sampling */
 
 #define MSR_IA32_FLUSH_CMD		0x0000010b
 #define L1D_FLUSH			(1 << 0)   /*
arch/x86/kernel/cpu/common.c +13 -0
index cb28e98a0659..bac5a3a38f0d 100644
@@ -998,6 +998,14 @@ static const __initconst struct x86_cpu_id cpu_no_l1tf[] = {
 	{}
 };
 
+static const __initconst struct x86_cpu_id cpu_no_mds[] = {
+	/* in addition to cpu_no_speculation */
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_GOLDMONT	},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_GOLDMONT_X	},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_GOLDMONT_PLUS	},
+	{}
+};
+
 static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 {
 	u64 ia32_cap = 0;
@@ -1019,6 +1027,11 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 	if (ia32_cap & ARCH_CAP_IBRS_ALL)
 		setup_force_cpu_cap(X86_FEATURE_IBRS_ENHANCED);
 
+	if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
+	    !x86_match_cpu(cpu_no_mds)) &&
+	    !(ia32_cap & ARCH_CAP_MDS_NO))
+		setup_force_cpu_bug(X86_BUG_MDS);
+
 	if (x86_match_cpu(cpu_no_meltdown))
 		return;
 
Signature · 1 line
2.17.2
author
#2 lore raw

PATCH v6 2/43 MDSv6

In reply to Andi Kleen

Add basic code to clear unconditonally on every kernel exit.

The flushing is provided by new microcode as a new side effect of the otherwise unused VERW instruction.

Future patches will provide more sophisticated policies on when to clear.

---
 arch/x86/entry/common.c            |  3 +++
 arch/x86/include/asm/clearcpu.h    | 23 +++++++++++++++++++++++
 arch/x86/include/asm/cpufeatures.h |  1 +
 arch/x86/kernel/nmi.c              |  5 ++++-
 4 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/include/asm/clearcpu.h
arch/x86/entry/common.c +3 -0
index 7bc105f47d21..dfd51d97d683 100644
@@ -29,6 +29,7 @@
 #include <asm/desc.h>
 #include <asm/traps.h>
 #include <asm/vdso.h>
+#include <asm/clearcpu.h>
 #include <linux/uaccess.h>
 #include <asm/cpufeature.h>
 
@@ -211,6 +212,8 @@ __visible inline void prepare_exit_to_usermode(struct pt_regs *regs)
 	ti->status &= ~(TS_COMPAT|TS_I386_REGS_POKED);
 #endif
 
+	clear_cpu();
+
 	user_enter_irqoff();
 }
 
arch/x86/include/asm/clearcpu.h new file +23 -0
new file mode 100644
index 000000000000..1da885793805
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_CLEARCPU_H
+#define _ASM_CLEARCPU_H 1
+
+#include <linux/jump_label.h>
+#include <linux/sched/smt.h>
+#include <asm/alternative.h>
+#include <linux/thread_info.h>
+
+/*
+ * Clear CPU buffers to avoid side channels.
+ * We use microcode as a side effect of the obsolete VERW instruction
+ */
+
+static inline void clear_cpu(void)
+{
+	unsigned kernel_ds = __KERNEL_DS;
+	/* Has to be memory form, don't modify to use an register */
+	alternative_input("", "verw %[kernelds]", X86_BUG_MDS,
+		[kernelds] "m" (kernel_ds));
+}
+
+#endif
arch/x86/include/asm/cpufeatures.h +1 -0
index 9ef6c5dc00dc..233ca598826f 100644
@@ -344,6 +344,7 @@
 /* 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_MD_CLEAR		(18*32+10) /* Flush state on VERW */
 #define X86_FEATURE_PCONFIG		(18*32+18) /* Intel PCONFIG */
 #define X86_FEATURE_SPEC_CTRL		(18*32+26) /* "" Speculation Control (IBRS + IBPB) */
 #define X86_FEATURE_INTEL_STIBP		(18*32+27) /* "" Single Thread Indirect Branch Predictors */
arch/x86/kernel/nmi.c +4 -1
index 18bc9b51ac9b..1c5507400089 100644
@@ -494,7 +494,7 @@ do_nmi(struct pt_regs *regs, long error_code)
 {
 	if (this_cpu_read(nmi_state) != NMI_NOT_RUNNING) {
 		this_cpu_write(nmi_state, NMI_LATCHED);
-		return;
+		goto out;
 	}
 	this_cpu_write(nmi_state, NMI_EXECUTING);
 	this_cpu_write(nmi_cr2, read_cr2());
@@ -533,6 +533,9 @@ do_nmi(struct pt_regs *regs, long error_code)
 		write_cr2(this_cpu_read(nmi_cr2));
 	if (this_cpu_dec_return(nmi_state))
 		goto nmi_restart;
+
+out:
+	clear_cpu();
 }
 NOKPROBE_SYMBOL(do_nmi);
 
Signature · 1 line
2.17.2
author
#3 lore raw

PATCH v6 3/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: x86/speculation/mds: Clear CPU buffers on entering
idle

When entering idle the internal state of the current CPU might become visible to the thread sibling because the CPU "frees" some internal resources.

To ensure there is no MDS leakage always clear the CPU state before doing any idling. We only do this if SMT is enabled, as otherwise there is no leakage possible.

Not needed for idle poll because it does not share resources.

In a Hypervisor we might not know the true SMT state, but in this case idle does exit, and we assume the hypervisor takes care of any needed clears during the next entry.

---
 arch/x86/include/asm/clearcpu.h | 18 ++++++++++++++++++
 arch/x86/kernel/acpi/cstate.c   |  2 ++
 arch/x86/kernel/kvm.c           |  3 +++
 arch/x86/kernel/process.c       |  5 +++++
 arch/x86/kernel/smpboot.c       |  3 +++
 drivers/acpi/acpi_pad.c         |  2 ++
 drivers/acpi/processor_idle.c   |  3 +++
 drivers/idle/intel_idle.c       |  5 +++++
 8 files changed, 41 insertions(+)
arch/x86/include/asm/clearcpu.h +18 -0
index 1da885793805..d4a5e43311a8 100644
@@ -20,4 +20,22 @@ static inline void clear_cpu(void)
 		[kernelds] "m" (kernel_ds));
 }
 
+/*
+ * Clear CPU buffers before going idle, so that no state is leaked to SMT
+ * siblings taking over thread resources.
+ * Out of line to avoid include hell.
+ *
+ * Assumes that interrupts are disabled and only get reenabled
+ * before idle, otherwise the data from a racing interrupt might not
+ * get cleared. There are some callers who violate this,
+ * but they are only used in unattackable cases, like CPU
+ * offlining.
+ */
+
+static inline void clear_cpu_idle(void)
+{
+	if (sched_smt_active())
+		clear_cpu();
+}
+
 #endif
arch/x86/kernel/acpi/cstate.c +2 -0
index 158ad1483c43..48adea5afacf 100644
@@ -14,6 +14,7 @@
 #include <acpi/processor.h>
 #include <asm/mwait.h>
 #include <asm/special_insns.h>
+#include <asm/clearcpu.h>
 
 /*
  * Initialize bm_flags based on the CPU cache properties
@@ -157,6 +158,7 @@ void __cpuidle acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cx)
 	unsigned int cpu = smp_processor_id();
 	struct cstate_entry *percpu_entry;
 
+	clear_cpu_idle();
 	percpu_entry = per_cpu_ptr(cpu_cstate_entry, cpu);
 	mwait_idle_with_hints(percpu_entry->states[cx->index].eax,
 	                      percpu_entry->states[cx->index].ecx);
arch/x86/kernel/kvm.c +3 -0
index 5c93a65ee1e5..5352a60a3b9b 100644
@@ -159,6 +159,7 @@ void kvm_async_pf_task_wait(u32 token, int interrupt_kernel)
 			/*
 			 * We cannot reschedule. So halt.
 			 */
+			clear_cpu_idle();
 			native_safe_halt();
 			local_irq_disable();
 		}
@@ -788,6 +789,8 @@ static void kvm_wait(u8 *ptr, u8 val)
 	if (READ_ONCE(*ptr) != val)
 		goto out;
 
+	clear_cpu_idle();
+
 	/*
 	 * halt until it's our turn and kicked. Note that we do safe halt
 	 * for irq enabled case to avoid hang when lock info is overwritten
arch/x86/kernel/process.c +5 -0
index 90ae0ca51083..9d9f2d2b209d 100644
@@ -42,6 +42,7 @@
 #include <asm/prctl.h>
 #include <asm/spec-ctrl.h>
 #include <asm/proto.h>
+#include <asm/clearcpu.h>
 
 #include "process.h"
 
@@ -589,6 +590,8 @@ void stop_this_cpu(void *dummy)
 	disable_local_APIC();
 	mcheck_cpu_clear(this_cpu_ptr(&cpu_info));
 
+	clear_cpu_idle();
+
 	/*
 	 * Use wbinvd on processors that support SME. This provides support
 	 * for performing a successful kexec when going from SME inactive
@@ -675,6 +678,8 @@ static __cpuidle void mwait_idle(void)
 			mb(); /* quirk */
 		}
 
+		clear_cpu_idle();
+
 		__monitor((void *)&current_thread_info()->flags, 0, 0);
 		if (!need_resched())
 			__sti_mwait(0, 0);
arch/x86/kernel/smpboot.c +3 -0
index ccd1f2a8e557..c7fff6b09253 100644
@@ -81,6 +81,7 @@
 #include <asm/cpu_device_id.h>
 #include <asm/spec-ctrl.h>
 #include <asm/hw_irq.h>
+#include <asm/clearcpu.h>
 
 /* representing HT siblings of each logical CPU */
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map);
@@ -1635,6 +1636,7 @@ static inline void mwait_play_dead(void)
 	wbinvd();
 
 	while (1) {
+		clear_cpu_idle();
 		/*
 		 * The CLFLUSH is a workaround for erratum AAI65 for
 		 * the Xeon 7400 series.  It's not clear it is actually
@@ -1662,6 +1664,7 @@ void hlt_play_dead(void)
 		wbinvd();
 
 	while (1) {
+		clear_cpu_idle();
 		native_halt();
 		/*
 		 * If NMI wants to wake up CPU0, start CPU0.
drivers/acpi/acpi_pad.c +2 -0
index a47676a55b84..a9b24637f1a8 100644
@@ -26,6 +26,7 @@
 #include <linux/tick.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
+#include <linux/clearcpu.h>
 #include <asm/mwait.h>
 #include <xen/xen.h>
 
@@ -175,6 +176,7 @@ static int power_saving_thread(void *data)
 			tick_broadcast_enable();
 			tick_broadcast_enter();
 			stop_critical_timings();
+			clear_cpu_idle();
 
 			mwait_idle_with_hints(power_saving_mwait_eax, 1);
 
drivers/acpi/processor_idle.c +3 -0
index b2131c4ea124..b4406ca1dfd7 100644
@@ -33,6 +33,7 @@
 #include <linux/cpuidle.h>
 #include <linux/cpu.h>
 #include <acpi/processor.h>
+#include <asm/clearcpu.h>
 
 /*
  * Include the apic definitions for x86 to have the APIC timer related defines
@@ -121,6 +122,7 @@ static const struct dmi_system_id processor_power_dmi_table[] = {
 static void __cpuidle acpi_safe_halt(void)
 {
 	if (!tif_need_resched()) {
+		clear_cpu_idle();
 		safe_halt();
 		local_irq_disable();
 	}
@@ -681,6 +683,7 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
 
 	ACPI_FLUSH_CPU_CACHE();
 
+	clear_cpu_idle();
 	while (1) {
 
 		if (cx->entry_method == ACPI_CSTATE_HALT)
drivers/idle/intel_idle.c +5 -0
index 8b5d85c91e9d..ddaa7603d53a 100644
@@ -65,6 +65,7 @@
 #include <asm/intel-family.h>
 #include <asm/mwait.h>
 #include <asm/msr.h>
+#include <asm/clearcpu.h>
 
 #define INTEL_IDLE_VERSION "0.4.1"
 
@@ -933,6 +934,8 @@ static __cpuidle int intel_idle(struct cpuidle_device *dev,
 		}
 	}
 
+	clear_cpu_idle();
+
 	mwait_idle_with_hints(eax, ecx);
 
 	if (!static_cpu_has(X86_FEATURE_ARAT) && tick)
@@ -953,6 +956,8 @@ static void intel_idle_s2idle(struct cpuidle_device *dev,
 	unsigned long ecx = 1; /* break on interrupt flag */
 	unsigned long eax = flg2MWAIT(drv->states[index].flags);
 
+	clear_cpu_idle();
+
 	mwait_idle_with_hints(eax, ecx);
 }
 
Signature · 1 line
2.17.2
author
#4 lore raw

PATCH v6 4/43 MDSv6

In reply to Andi Kleen

Parse mds=off / mds=auto / mds=full on the kernel command line.

Only mds=off has an effect, mds=auto is equal to mds=full and is default currently.

---
 .../admin-guide/kernel-parameters.txt         | 11 +++++++
 arch/x86/include/asm/clearcpu.h               |  2 +-
 arch/x86/include/asm/cpufeatures.h            |  1 +
 arch/x86/kernel/cpu/bugs.c                    | 31 +++++++++++++++++++
 4 files changed, 44 insertions(+), 1 deletion(-)
Documentation/admin-guide/kernel-parameters.txt +11 -0
index 858b6c0b9a15..753b8982770e 100644
@@ -2356,6 +2356,17 @@
 			Format: <first>,<last>
 			Specifies range of consoles to be captured by the MDA.
 
+	mds=off		[X86, Intel]
+			Disable workarounds for Micro-architectural Data Sampling.
+
+	mds=auto	[X86, Intel]
+			Automatically select default for MDS mitigation.
+			Currently this always flushes on kernel exit.
+
+	mds=full	[X86, Intel]
+			Always flush cpu buffers when exiting kernel for MDS
+			without any heuristics.
+
 	mem=nn[KMG]	[KNL,BOOT] Force usage of a specific amount of memory
 			Amount of memory to be used when the kernel is not able
 			to see the whole system memory or for test.
arch/x86/include/asm/clearcpu.h +1 -1
index d4a5e43311a8..88ab27694aa6 100644
@@ -16,7 +16,7 @@ static inline void clear_cpu(void)
 {
 	unsigned kernel_ds = __KERNEL_DS;
 	/* Has to be memory form, don't modify to use an register */
-	alternative_input("", "verw %[kernelds]", X86_BUG_MDS,
+	alternative_input("", "verw %[kernelds]", X86_FEATURE_VERW,
 		[kernelds] "m" (kernel_ds));
 }
 
arch/x86/include/asm/cpufeatures.h +1 -0
index 233ca598826f..27735ae3c3a2 100644
@@ -221,6 +221,7 @@
 #define X86_FEATURE_ZEN			( 7*32+28) /* "" CPU is AMD family 0x17 (Zen) */
 #define X86_FEATURE_L1TF_PTEINV		( 7*32+29) /* "" L1TF workaround PTE inversion */
 #define X86_FEATURE_IBRS_ENHANCED	( 7*32+30) /* Enhanced IBRS */
+#define X86_FEATURE_VERW		( 7*32+31) /* "" VERW for MDS on kernel exit */
 
 /* Virtualization flags: Linux defined, word 8 */
 #define X86_FEATURE_TPR_SHADOW		( 8*32+ 0) /* Intel TPR Shadow */
arch/x86/kernel/cpu/bugs.c +31 -0
index 01874d54f4fd..b93565ab20b3 100644
@@ -37,6 +37,7 @@
 static void __init spectre_v2_select_mitigation(void);
 static void __init ssb_select_mitigation(void);
 static void __init l1tf_select_mitigation(void);
+static void __init mds_select_mitigation(void);
 
 /* The base value of the SPEC_CTRL MSR that always has to be preserved. */
 u64 x86_spec_ctrl_base;
@@ -101,6 +102,8 @@ void __init check_bugs(void)
 
 	l1tf_select_mitigation();
 
+	mds_select_mitigation();
+
 #ifdef CONFIG_X86_32
 	/*
 	 * Check whether we are able to run this kernel safely on SMP.
@@ -1058,6 +1061,34 @@ early_param("l1tf", l1tf_cmdline);
 
 #undef pr_fmt
 
+static void mds_select_mitigation(void)
+{
+	if (!boot_cpu_has(X86_BUG_MDS))
+		return;
+
+	/*
+	 * Use VERW even if the CPUID does not report MD_CLEAR,
+	 * in case we're running in a legacy hypervisor that
+	 * doesn't pass through CPUID properly.
+	 *
+	 * This causes some extra overhead on CPUs that don't need
+	 * VERW.
+	 *
+	 * This is supposed to handle the slow release cycle
+	 * of VMware who doesn't update CPUIDs timely in 2019.
+	 * If the year is 2020 and you still see this please
+	 * guard this with
+	 * if (boot_cpu_has(X86_FEATURE_MD_CLEAR)) setup_force ... VERW
+	 */
+	setup_force_cpu_cap(X86_FEATURE_VERW);
+	if (cmdline_find_option_bool(boot_command_line, "mds=off"))
+		setup_clear_cpu_cap(X86_FEATURE_VERW);
+	/* Nop currently because this is default for now. */
+	if (cmdline_find_option_bool(boot_command_line, "mds=full") ||
+	     cmdline_find_option_bool(boot_command_line, "mds=auto"))
+		setup_force_cpu_cap(X86_FEATURE_VERW);
+}
+
 #ifdef CONFIG_SYSFS
 
 #define L1TF_DEFAULT_MSG "Mitigation: PTE Inversion"
Signature · 1 line
2.17.2
author
#5 lore raw

PATCH v6 5/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: x86/speculation/mds: Add sysfs reporting

Report mds mitigation state in sysfs vulnerabilities.

---
 .../ABI/testing/sysfs-devices-system-cpu      |  1 +
 arch/x86/kernel/cpu/bugs.c                    | 24 +++++++++++++++++++
 drivers/base/cpu.c                            |  8 +++++++
 3 files changed, 33 insertions(+)
Documentation/ABI/testing/sysfs-devices-system-cpu +1 -0
index 9605dbd4b5b5..2db5c3407fd6 100644
@@ -484,6 +484,7 @@ What:		/sys/devices/system/cpu/vulnerabilities
 		/sys/devices/system/cpu/vulnerabilities/spectre_v2
 		/sys/devices/system/cpu/vulnerabilities/spec_store_bypass
 		/sys/devices/system/cpu/vulnerabilities/l1tf
+		/sys/devices/system/cpu/vulnerabilities/mds
 Date:		January 2018
 Contact:	Linux kernel mailing list <[email protected]>
 Description:	Information about CPU vulnerabilities
arch/x86/kernel/cpu/bugs.c +24 -0
index b93565ab20b3..4114b4f94c1d 100644
@@ -1192,6 +1192,24 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
 		if (boot_cpu_has(X86_FEATURE_L1TF_PTEINV))
 			return l1tf_show_state(buf);
 		break;
+
+	case X86_BUG_MDS:
+		if (boot_cpu_has(X86_FEATURE_VERW) &&
+		    boot_cpu_has(X86_FEATURE_MD_CLEAR)) {
+			if (cpu_smt_control != CPU_SMT_ENABLED) {
+				/*
+				 * Avoid lying when a hypervisor didn't export
+				 * the SMT state.
+				 */
+				if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
+					return sprintf(buf,
+						"Mitigation: microcode, SMT potentially vulnerable\n");
+				return sprintf(buf, "Mitigation: microcode\n");
+			}
+			return sprintf(buf, "Mitigation: microcode, SMT vulnerable\n");
+		}
+		return sprintf(buf, "Vulnerable\n");
+
 	default:
 		break;
 	}
@@ -1223,4 +1241,10 @@ ssize_t cpu_show_l1tf(struct device *dev, struct device_attribute *attr, char *b
 {
 	return cpu_show_common(dev, attr, buf, X86_BUG_L1TF);
 }
+
+ssize_t cpu_show_mds(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	return cpu_show_common(dev, attr, buf, X86_BUG_MDS);
+}
+
 #endif
drivers/base/cpu.c +8 -0
index eb9443d5bae1..2fd6ca1021c2 100644
@@ -546,11 +546,18 @@ ssize_t __weak cpu_show_l1tf(struct device *dev,
 	return sprintf(buf, "Not affected\n");
 }
 
+ssize_t __weak cpu_show_mds(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);
 static DEVICE_ATTR(spec_store_bypass, 0444, cpu_show_spec_store_bypass, NULL);
 static DEVICE_ATTR(l1tf, 0444, cpu_show_l1tf, NULL);
+static DEVICE_ATTR(mds, 0444, cpu_show_mds, NULL);
 
 static struct attribute *cpu_root_vulnerabilities_attrs[] = {
 	&dev_attr_meltdown.attr,
@@ -558,6 +565,7 @@ static struct attribute *cpu_root_vulnerabilities_attrs[] = {
 	&dev_attr_spectre_v2.attr,
 	&dev_attr_spec_store_bypass.attr,
 	&dev_attr_l1tf.attr,
+	&dev_attr_mds.attr,
 	NULL
 };
 
Signature · 1 line
2.17.2
author
#6 lore raw

PATCH v6 6/43 MDSv6

In reply to Andi Kleen

Add a Documentation file for administrators that describes MDS on a high level.

Needs updates later for public URLs of supporting documentation.

---
 Documentation/admin-guide/mds.rst | 95 +++++++++++++++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644 Documentation/admin-guide/mds.rst
Documentation/admin-guide/mds.rst new file +95 -0
new file mode 100644
index 000000000000..045ecf8f37f0
@@ -0,0 +1,95 @@
+MDS - Microarchitectural Data Sampling)
+=======================================
+
+Microarchitectural Data Sampling is a side channel vulnerability that
+allows an attacker to sample data that has been earlier used during
+program execution. Internal buffers in the CPU may keep old data
+for some limited time, which can the later be determined by an attacker
+with side channel analysis. MDS can be used to occasionaly observe
+some values accessed earlier, but it cannot be used to observe values
+not recently touched by other code running on the same core.
+
+It is difficult to target particular data on a system using MDS,
+but attackers may be able to infer secrets by collecting
+and analyzing large amounts of data. MDS does not modify
+memory.
+
+MDS consists of multiple sub-vulnerabilities:
+Microarchitectural Store Buffer Data Sampling (MSBDS) (CVE-2018-12126)
+Microarchitectual Fill Buffer Data Sampling (MFBDS) (CVE-2018-12130)
+Microarchitectual Load Port Data (MLPDS) (CVE-2018-12127),
+with the first leaking store data, and the second loads and sometimes
+store data, and the third load data.
+
+The effects and mitigations are similar for all three, so the Linux
+kernel handles and reports them all as a single vulnerability called
+MDS. This also reduces the number of acronyms in use.
+
+Affected processors
+-------------------
+
+This vulnerability affects a wide range of Intel processors.
+Not all CPUs are affected by all of the sub vulnerabilities,
+however the kernel handles it always the same.
+
+The vulnerability is not present in
+
+    - Some Atoms (Bonnell, Saltwell, Goldmont, GoldmontPlus)
+
+The kernel will automatically detect future CPUs with hardware
+mitigations for these issues and disable any workarounds.
+
+The kernel reports if the current CPU is vulnerable and any
+mitigations used in
+
+/sys/devices/system/cpu/vulnerabilities/mds
+
+Kernel mitigation
+-----------------
+
+The mitigation is automatically enabled, but can be further controlled
+with the command line options documented below.
+
+The kernel clears the CPU buffers at every kernel exit.
+
+The mitigation can be done with microcode support, requiring
+updated microcode.
+
+The microcode should be loaded at early boot using the initrd. Hot
+updating microcode will not enable the mitigations.
+
+Virtual machine mitigation
+--------------------------
+
+The mitigation is enabled by default and controlled by the same options
+as L1TF cache clearing. See l1tf.rst for more details. In the default
+setting MDS for leaking data out of the guest into other processes
+will be mitigated.
+
+Kernel command line options
+---------------------------
+
+Normally the kernel selects reasonable defaults and no special configuration
+is needed. The default behavior can be overriden by the mds= kernel
+command line options.
+
+These options can be specified in the boot loader. Any changes require a reboot.
+
+When the system only runs trusted code, MDS mitigation can be disabled with
+mds=off as a performance optimization.
+
+   - mds=off      Disable workarounds if the CPU is not affected.
+
+   - mds=auto     Automatically select mitigation.
+
+   - mds=full	  Currently equivalent to default.
+
+References
+----------
+
+Fore more details on the kernel internal implementation of the MDS mitigations,
+please see Documentation/clearcpu.txt
+
+TBD Add URL for Intel white paper
+
+TBD add reference to microcodes
Signature · 1 line
2.17.2
author
#7 lore raw

PATCH v6 7/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: x86/speculation/mds: Export MD_CLEAR CPUID to KVM
guests.

Export the MD_CLEAR CPUID set by new microcode to signal that VERW implements the clear cpu side effect to KVM guests.

Also requires corresponding qemu patches

---
 arch/x86/kvm/cpuid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kvm/cpuid.c +2 -1
index bbffa6c54697..d61272f50aed 100644
@@ -409,7 +409,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 	/* cpuid 7.0.edx*/
 	const u32 kvm_cpuid_7_0_edx_x86_features =
 		F(AVX512_4VNNIW) | F(AVX512_4FMAPS) | F(SPEC_CTRL) |
-		F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP);
+		F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP) |
+		F(MD_CLEAR);
 
 	/* all calls to cpuid_count() should be made on the same cpu */
 	get_cpu();
Signature · 1 line
2.17.2
author
#8 lore raw

PATCH v6 8/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: x86/cpufeatures: Add word 20 for additional features

We're running out of bits for Linux CPU features, so add a features word 20 for new features. Used in later patches.

---
 arch/x86/include/asm/cpufeature.h        | 6 ++++--
 arch/x86/include/asm/cpufeatures.h       | 2 +-
 arch/x86/include/asm/disabled-features.h | 3 ++-
 arch/x86/include/asm/required-features.h | 3 ++-
 4 files changed, 9 insertions(+), 5 deletions(-)
arch/x86/include/asm/cpufeature.h +4 -2
index ce95b8cbd229..a9e280782d25 100644
@@ -81,8 +81,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
 	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 16, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 17, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 18, feature_bit) ||	\
+	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 19, feature_bit) ||	\
 	   REQUIRED_MASK_CHECK					  ||	\
-	   BUILD_BUG_ON_ZERO(NCAPINTS != 19))
+	   BUILD_BUG_ON_ZERO(NCAPINTS != 20))
 
 #define DISABLED_MASK_BIT_SET(feature_bit)				\
 	 ( CHECK_BIT_IN_MASK_WORD(DISABLED_MASK,  0, feature_bit) ||	\
@@ -104,8 +105,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
 	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 16, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 17, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 18, feature_bit) ||	\
+	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 19, feature_bit) ||	\
 	   DISABLED_MASK_CHECK					  ||	\
-	   BUILD_BUG_ON_ZERO(NCAPINTS != 19))
+	   BUILD_BUG_ON_ZERO(NCAPINTS != 20))
 
 #define cpu_has(c, bit)							\
 	(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 :	\
arch/x86/include/asm/cpufeatures.h +1 -1
index 27735ae3c3a2..9e934626ea88 100644
@@ -13,7 +13,7 @@
 /*
  * Defines x86 CPU feature bits
  */
-#define NCAPINTS			19	   /* N 32-bit words worth of info */
+#define NCAPINTS			20	   /* N 32-bit words worth of info */
 #define NBUGINTS			1	   /* N 32-bit bug flags */
 
 /*
arch/x86/include/asm/disabled-features.h +2 -1
index a5ea841cc6d2..f0f935f8d917 100644
@@ -84,6 +84,7 @@
 #define DISABLED_MASK16	(DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP)
 #define DISABLED_MASK17	0
 #define DISABLED_MASK18	0
-#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)
+#define DISABLED_MASK19	0
+#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20)
 
 #endif /* _ASM_X86_DISABLED_FEATURES_H */
arch/x86/include/asm/required-features.h +2 -1
index 6847d85400a8..fa5700097f64 100644
@@ -101,6 +101,7 @@
 #define REQUIRED_MASK16	0
 #define REQUIRED_MASK17	0
 #define REQUIRED_MASK18	0
-#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)
+#define REQUIRED_MASK19	0
+#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20)
 
 #endif /* _ASM_X86_REQUIRED_FEATURES_H */
Signature · 1 line
2.17.2
author
#9 lore raw

PATCH v6 9/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: x86/speculation/mds: Handle VMENTRY clear for CPUs
without l1tf

Some Atom CPUs don't have L1TF, but have (parts of) MDS.

Normally we rely on the L1TF L1D clear on vm entry to avoid leaking data to the guest. But these Atom CPUs don't support the L1D clear MSR. Add special code to trigger VERW explicitly on KVM guest entry.

We use similar logic as the conditional l1d flush, which is default and currently cannot be overriden.

---
 arch/x86/include/asm/cpufeatures.h |  4 ++++
 arch/x86/kernel/cpu/bugs.c         |  3 +++
 arch/x86/kernel/cpu/common.c       | 14 +++++++++++++-
 arch/x86/kvm/vmx/vmx.c             | 20 +++++++++++++++-----
 4 files changed, 35 insertions(+), 6 deletions(-)
arch/x86/include/asm/cpufeatures.h +4 -0
index 9e934626ea88..80ab5d026157 100644
@@ -353,6 +353,9 @@
 #define X86_FEATURE_ARCH_CAPABILITIES	(18*32+29) /* IA32_ARCH_CAPABILITIES MSR (Intel) */
 #define X86_FEATURE_SPEC_CTRL_SSBD	(18*32+31) /* "" Speculative Store Bypass Disable */
 
+/* Linux defined features, word 19 */
+#define X86_FEATURE_MDS_VMENTRY_FLUSH	(19*32+0) /* MDS needs extra flush for vmentry */
+
 /*
  * BUG word(s)
  */
@@ -384,5 +387,6 @@
 #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_MDS_NO_L1TF		X86_BUG(20) /* MDS but no L1TF L1D flush */
 
 #endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/kernel/cpu/bugs.c +3 -0
index 4114b4f94c1d..26b890f18239 100644
@@ -1087,6 +1087,9 @@ static void mds_select_mitigation(void)
 	if (cmdline_find_option_bool(boot_command_line, "mds=full") ||
 	     cmdline_find_option_bool(boot_command_line, "mds=auto"))
 		setup_force_cpu_cap(X86_FEATURE_VERW);
+
+	if (boot_cpu_has(X86_FEATURE_VERW) && boot_cpu_has_bug(X86_BUG_MDS_NO_L1TF))
+		setup_force_cpu_cap(X86_FEATURE_MDS_VMENTRY_FLUSH);
 }
 
 #ifdef CONFIG_SYSFS
arch/x86/kernel/cpu/common.c +13 -1
index bac5a3a38f0d..94d0eeb0a94b 100644
@@ -1006,6 +1006,15 @@ static const __initconst struct x86_cpu_id cpu_no_mds[] = {
 	{}
 };
 
+/* CPUs with MDS, but not L1TF, that don't have L1D flush */
+static const __initconst struct x86_cpu_id cpu_mds_no_l1d[] = {
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_AIRMONT		},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_AIRMONT_MID	},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_SILVERMONT	},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_SILVERMONT_X	},
+	{}
+};
+
 static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 {
 	u64 ia32_cap = 0;
@@ -1029,8 +1038,11 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 
 	if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
 	    !x86_match_cpu(cpu_no_mds)) &&
-	    !(ia32_cap & ARCH_CAP_MDS_NO))
+	    !(ia32_cap & ARCH_CAP_MDS_NO)) {
 		setup_force_cpu_bug(X86_BUG_MDS);
+		if (x86_match_cpu(cpu_mds_no_l1d))
+			setup_force_cpu_bug(X86_BUG_MDS_NO_L1TF);
+	}
 
 	if (x86_match_cpu(cpu_no_meltdown))
 		return;
arch/x86/kvm/vmx/vmx.c +15 -5
index 30a6bcd735ec..fb2be25a4aa6 100644
@@ -5866,27 +5866,36 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
 static void vmx_l1d_flush(struct kvm_vcpu *vcpu)
 {
 	int size = PAGE_SIZE << L1D_CACHE_ORDER;
+	bool flush_l1d = vcpu->arch.l1tf_flush_l1d;
+
+	flush_l1d |= kvm_get_cpu_l1tf_flush_l1d();
+
+	/* CPUs with MDS_VMENTRY_FLUSH never use the L1D flush below. */
+	if (static_cpu_has(X86_FEATURE_MDS_VMENTRY_FLUSH)) {
+		vcpu->arch.l1tf_flush_l1d = false;
+		kvm_clear_cpu_l1tf_flush_l1d();
+		if (!flush_l1d && !static_key_enabled(&force_cpu_clear))
+			return;
+		clear_cpu();
+		return;
+	}
 
 	/*
 	 * This code is only executed when the the flush mode is 'cond' or
 	 * 'always'
 	 */
 	if (static_branch_likely(&vmx_l1d_flush_cond)) {
-		bool flush_l1d;
-
 		/*
 		 * Clear the per-vcpu flush bit, it gets set again
 		 * either from vcpu_run() or from one of the unsafe
 		 * VMEXIT handlers.
 		 */
-		flush_l1d = vcpu->arch.l1tf_flush_l1d;
 		vcpu->arch.l1tf_flush_l1d = false;
 
 		/*
 		 * Clear the per-cpu flush bit, it gets set again from
 		 * the interrupt handlers.
 		 */
-		flush_l1d |= kvm_get_cpu_l1tf_flush_l1d();
 		kvm_clear_cpu_l1tf_flush_l1d();
 
 		if (!flush_l1d)
@@ -6369,7 +6378,8 @@ static void __vmx_vcpu_run(struct kvm_vcpu *vcpu, struct vcpu_vmx *vmx)
 	evmcs_rsp = static_branch_unlikely(&enable_evmcs) ?
 		(unsigned long)&current_evmcs->host_rsp : 0;
 
-	if (static_branch_unlikely(&vmx_l1d_should_flush))
+	if (static_branch_unlikely(&vmx_l1d_should_flush) ||
+	    static_cpu_has(X86_FEATURE_MDS_VMENTRY_FLUSH))
 		vmx_l1d_flush(vcpu);
 
 	asm(
Signature · 1 line
2.17.2
author
#10 lore raw

PATCH v6 10/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds: Add documentation for clear cpu usage

Including the theory, and some guide lines for subsystem/driver maintainers.

---
 Documentation/clearcpu.txt | 261 +++++++++++++++++++++++++++++++++++++
 1 file changed, 261 insertions(+)
 create mode 100644 Documentation/clearcpu.txt
Documentation/clearcpu.txt new file +261 -0
new file mode 100644
index 000000000000..a45e5d82868a
@@ -0,0 +1,261 @@
+
+Security model for Microarchitectural Data Sampling
+===================================================
+
+Some CPUs can leave read or written data in internal buffers,
+which then later might be sampled through side effects.
+For more details see CVE-2018-12126 CVE-2018-12130 CVE-2018-12127
+
+This can be avoided by explicitly clearing the CPU state.
+
+We attempt to avoid leaking data between different processes,
+and also some sensitive data, like cryptographic data, to
+user space.
+
+We support three modes:
+
+(1) mitigation off (mds=off)
+(2) clear only when needed (default)
+(3) clear on every kernel exit, or guest entry (mds=full)
+
+(1) and (3) are trivial, the rest of the document discusses (2)
+
+In general option (3) is the most conservative choice. It does
+not make ST assumptions about leaking data.
+
+Basic requirements and assumptions
+----------------------------------
+
+Kernel addresses and kernel temporary data are not sensitive.
+
+User data is sensitive, but only for other processes.
+
+User data is anything in the user address space, or data buffers
+directly copied from/to the user (e.g. read/write). It does not
+include metadata, or flag settings. For example packet headers
+or file names are not sensitive in this model.
+
+Block IO data (but not meta data) is sensitive.
+
+Most data structures in the kernel are not sensitive.
+
+Kernel data is sensitive when it involves cryptographic keys.
+
+We consider data from input devices (such as key presses)
+sensitive. We also consider sound data or terminal
+data sensitive.
+
+We assume that only data actually accessed by the kernel by explicit
+instructions can be leaked.  Note that this may not be always
+true, in theory prefetching or speculation may touch more. The assumption
+is that if any such happens it will be very low bandwidth and hard
+to control due to the existing Spectre and other mitigations,
+such as memory randomization.  If a user is concerned about this they
+need to use mds=full.
+
+Guidance for driver/subsystem developers
+----------------------------------------
+
+[These generally need to be enforced in code review for new code now]
+
+When you touch user supplied data of *other* processes in system call
+context add lazy_clear_cpu().
+
+For the cases below we care only about data from other processes.
+Touching non cryptographic data from the current process is always allowed.
+
+Touching only pointers to user data is always allowed.
+
+When your interrupt does touch user data directly mark it with IRQF_USER_DATA.
+
+When your tasklet does touch user data directly, mark it TASKLET_USER_DATA
+using tasklet_init_flags/or DECLARE_TASKLET_USERDATA*.
+
+When your timer does touch user data mark it with TIMER_USER_DATA
+If it is a hrtimer and touches user data, mark it with HRTIMER_MODE_USER_DATA.
+
+When your irq poll handler does touch user data, mark it lazy_clear_cpu().
+
+For networking code, make sure to only touch user data through
+skb_push/put/copy [add more], unless it is data from the current
+process. If that is not ensured add lazy_clear_cpu or
+lazy_clear_cpu_interrupt.
+
+Any cryptographic code touching key data should use memzero_explicit
+or kzfree to free the data.
+
+If your RCU callback touches user data add lazy_clear_cpu().
+
+These steps are currently only needed for code that runs on MDS affected
+CPUs, which is currently only x86. But might be worth being prepared
+if other architectures become affected too.
+
+Implementation details/assumptions
+----------------------------------
+
+Any buffer clearing is done lazily on next kernel exit. lazy_clear*
+is only a few fast instructions with no cache misses setting
+a flag and can be used frequently even in fast paths.
+
+Protecting process data
+-----------------------
+
+If a system call touches data of its own process, CPU state does not
+need to be cleared, because it has already access to it.
+
+On context switching we clear data, unless the context switch is
+inside a process. We also clear after any context switches from kernel
+threads.
+
+Cryptographic keys inside the kernel should be protected.
+We assume they use kzfree() or memzero_explicit() to clear
+state, so these functions trigger a cpu clear.
+
+Hard Interrupts and tasklets
+----------------------------
+
+Most interrupt handlers for modern devices do not touch
+user data, because they rely on DMA and only manipulate
+pointers. They have been audited.
+
+Some handlers copy data, but often use strategic
+functions which can be marked with a lazy clear.
+For example memcpy_from/to_io, swiotlb (see below
+for a full list)
+
+Some handlers touch user data without using these strategic
+functions, these have to be marked with IRQF_USER_DATA.
+All in tree handlers have been audited.
+
+Softirqs
+--------
+
+Softirqs are handled case by case:
+
+        TIMER: see timers below.
+        NET_*: see networking below.
+        BLOCK: do not touch user data, except
+	for a few using kmap_atomic. We have a lazy_clear_cpu_interrupt()
+	in kmap_atomic for this case.
+
+        IRQ_POLL: generally do not touch user data
+        TASKLET: see tasklets below
+        SCHED:   only touches scheduler metadata
+        RCU:	RCU handlers generally only free.
+
+Networking
+----------
+
+This is only about network code running in hard interrupt
+or softirq or timer context. Per process network code
+generally only touches data for the current process,
+so does not need any changes.
+
+In principle packet data should be encrypted anyways for the wire,
+but we try to avoid leaking it anyways.
+
+For networking code, any skb functions that are likely
+touching non header packet data schedule a clear cpu at next
+kernel exit. This includes skb_copy and related, skb_put/push,
+checksum functions.  We assume that any networking code touching
+packet data uses these functions.
+
+NMIs / machine checks
+---------------------
+
+Assume they don't touch other processes user data. Most NMI
+handlers are fairly simple and trivial and only concerned with
+some non user hardware state. The machine check handlers and perf PMI
+handlers are complicated (e.g. perf can touch user stack), but they
+never touch any data not of the current process.
+
+Other interrupts
+----------------
+
+SMP function interrupt call backs have been audited and don't touch
+any user data.
+
+Clear points
+------------
+
+We schedule clears in some centralized functions to minimize impact
+on the  overall code.
+
+Always clear:
+
+kernel preemption		undefined state, need to always clear
+context switch			protect user / kernel thread data
+VM entry			protect host against guest
+
+Always schedule clear for next kernel exit:
+
+kzfree / memzero_explicit	keys and crypto data
+
+Only schedule clear for next exit when called in interrupts:
+
+kmap_atomic			block drivers touching user process data
+memcpy_from/to_io		drivers copying IO data
+insw*, outs*
+input_event			input drivers touching user IO data
+serio_interrupt
+tty_insert_*			tty drivers touching user input IO data
+swiotlb				bounce buffers touching IO data
+sg_copy_*			scsi drivers touching IO data in interrupts
+skb_put, skb_copy_*		networking code touching IO data
+skb_*csum*
+snd_pcm_period_elapsed,		sound drivers touching IO data
+snd_rawmidi_transmit/receive
+snd_timer_interrupt
+
+Sandboxes
+---------
+
+We don't do anything special for seccomp processes
+
+If there is a sandbox inside the process the process should take care
+itself of clearing its own sensitive data before running sandbox
+code. This would include data touched by system calls.
+
+BPF
+---
+
+Assume BPF execution does not touch other user's data, so does
+not need to schedule a clear for itself.
+
+BPF could attack the rest of the kernel if it can successfully
+measure side channel side effects.
+
+When the BPF program was loaded unprivileged, always clear the CPU
+to prevent any exploits written in BPF using side channels to read
+data leaked from other kernel code
+
+We only do this when running in an interrupt, or if an clear cpu is
+already scheduled (which means for example there was a context
+switch, or crypto operation before)
+
+In process context we assume the code only accesses data of the
+current user and check that the BPF running was loaded by the
+same user so even if data leaked it would not cross privilege
+boundaries.
+
+Technically we would only need to do this if the BPF program
+contains conditional branches and loads dominated by them, but
+let's assume that nearly all do.
+
+This could be further optimized by batching clears for
+many similar EBPF executions in a row (e.g. for packet
+processing). This would need ensuring that no sensitive
+data is touched inbetween the EBPF executions, and also
+that all EBPF scripts are set up by the same uid.
+We could add such optimizations later based on
+profile data.
+
+Virtualization
+--------------
+
+When entering a guest in KVM we clear to avoid any leakage to a guest.
+Normally this is done implicitly as part of the L1TF mitigation,
+except on a few CPUs that are not vulnerable to L1TF and need
+explicit clear. It relies on L1TF being enabled. It also uses the
+"fast exit" optimization that only clears if an interrupt or context switch
+happened during a VMexit, unless mds=full is used.
Signature · 1 line
2.17.2
maintainer
#11 lore raw
Quoted 5 lines · speck for Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds: Add documentation for clear cpu usage

Including the theory, and some guide lines for subsystem/driver maintainers.

Ah, I finally found this patch in the pile...

Quoted 48 lines
---
 Documentation/clearcpu.txt | 261 +++++++++++++++++++++++++++++++++++++
 1 file changed, 261 insertions(+)
 create mode 100644 Documentation/clearcpu.txt
Documentation/clearcpu.txt new file +36 -0
new file mode 100644
index 000000000000..a45e5d82868a
@@ -0,0 +1,261 @@
+
+Security model for Microarchitectural Data Sampling
+===================================================
+
+Some CPUs can leave read or written data in internal buffers,
+which then later might be sampled through side effects.
+For more details see CVE-2018-12126 CVE-2018-12130 CVE-2018-12127
+
+This can be avoided by explicitly clearing the CPU state.
+
+We attempt to avoid leaking data between different processes,
+and also some sensitive data, like cryptographic data, to
+user space.
+
+We support three modes:
+
+(1) mitigation off (mds=off)
+(2) clear only when needed (default)
+(3) clear on every kernel exit, or guest entry (mds=full)
+
+(1) and (3) are trivial, the rest of the document discusses (2)
+
+In general option (3) is the most conservative choice. It does
+not make ST assumptions about leaking data.
+
+Basic requirements and assumptions
+----------------------------------
+
+Kernel addresses and kernel temporary data are not sensitive.
+
+User data is sensitive, but only for other processes.
+
+User data is anything in the user address space, or data buffers
+directly copied from/to the user (e.g. read/write). It does not
+include metadata, or flag settings. For example packet headers
+or file names are not sensitive in this model.

Documentation/clearcpu.txt line 46

Quoted 10 lines
Documentation/clearcpu.txt new file +10 -0
+
+Block IO data (but not meta data) is sensitive.
+
+Most data structures in the kernel are not sensitive.
+
+Kernel data is sensitive when it involves cryptographic keys.
+
+We consider data from input devices (such as key presses)
+sensitive. We also consider sound data or terminal
+data sensitive.

What do you mean by "terminal data"?

And by including stuff like "input devices", I think you need a much better definition of what you are now calling "user data".

You have two types of data now, "sensitive" and "not sensitive". Don't confuse things by trying to say "user", as the data coming from "outside" of the system (i.e. random events) might somehow be classified as "sensitive" in your world view here (i.e. usb random number generators).

Documentation/clearcpu.txt line 48

Quoted 2 lines
Documentation/clearcpu.txt new file +2 -0
+We assume that only data actually accessed by the kernel by explicit
+instructions can be leaked.

What do you mean by "explicit"? A memcpy? Setting up a DMA channel and processing the data afterward in userspace? Gazing wistfully as it flows through the unipro fabric to and from a camera?

Documentation/clearcpu.txt line 54

Quoted 6 lines

Note that this may not be always

Documentation/clearcpu.txt new file +5 -0
+true, in theory prefetching or speculation may touch more. The assumption
+is that if any such happens it will be very low bandwidth and hard
+to control due to the existing Spectre and other mitigations,
+such as memory randomization.  If a user is concerned about this they
+need to use mds=full.

Let me shorten this paragraph for you:
We really have no idea what data might be touched by the processor or read by anyone else. If you happen to care if some other process on the physical system can read your data, use mds=full.

Is that a better summary?

thanks,

greg k-h

#12 lore raw
Quoted 4 lines

What do you mean by "terminal data"?

And by including stuff like "input devices", I think you need a much better definition of what you are now calling "user data".

It seems clear to me. Can you elaborate what exactly is unclear and how you would define it?

Quoted 5 lines

You have two types of data now, "sensitive" and "not sensitive". Don't confuse things by trying to say "user", as the data coming from "outside" of the system (i.e. random events) might somehow be classified as "sensitive" in your world view here (i.e. usb random number generators).

Ok can change the terminology.

Quoted 21 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+We assume that only data actually accessed by the kernel by explicit
+instructions can be leaked.

What do you mean by "explicit"? A memcpy? Setting up a DMA channel and processing the data afterward in userspace? Gazing wistfully as it flows through the unipro fabric to and from a camera?

Documentation/clearcpu.txt line 54

Quoted 6 lines

Note that this may not be always

Documentation/clearcpu.txt new file +5 -0
+true, in theory prefetching or speculation may touch more. The assumption
+is that if any such happens it will be very low bandwidth and hard
+to control due to the existing Spectre and other mitigations,
+such as memory randomization.  If a user is concerned about this they
+need to use mds=full.

Let me shorten this paragraph for you:
We really have no idea what data might be touched by the processor or read by anyone else. If you happen to care if some other process on the physical system can read your data, use mds=full.

Quoted 1 line

Is that a better summary?

I don't think so. It's a quantitative argument. It's about rising the bar enough, while still having good performance.

For all the side channel mitigations (like Spectre v1) we used those.

But anyways so you seem to disagree with Linus' here. I'm just implementing what he suggested. Please argue it out with him!

-Andi

maintainer
#13 lore raw
In reply to Andi Kleen

I'm sorry, I just can't stop...

Documentation/clearcpu.txt line 62

Quoted 7 lines · speck for Andi Kleen
Documentation/clearcpu.txt new file +7 -0
+Guidance for driver/subsystem developers
+----------------------------------------
+
+[These generally need to be enforced in code review for new code now]
+
+When you touch user supplied data of *other* processes in system call
+context add lazy_clear_cpu().

What do you mean by "user supplied data of *other* processes"? I think I understand the kernel, and I have no idea what this means.

Documentation/clearcpu.txt line 65

Quoted 2 lines
Documentation/clearcpu.txt new file +2 -0
+For the cases below we care only about data from other processes.
+Touching non cryptographic data from the current process is always allowed.

Define "non cryptographic data". Is data coming across a serial port crypto data? From a camera?

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+Touching only pointers to user data is always allowed.

But not touching the data the pointer points to?

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+When your interrupt does touch user data directly mark it with IRQF_USER_DATA.

I still don't know what "user data" means. Is a serial stream coming from a bluetooth device "user data"? Is a program that talks directly to a USB data without a special kernel driver reading "user data"? Is a serial port data stream "user data"?

Documentation/clearcpu.txt line 72

Quoted 3 lines
Documentation/clearcpu.txt new file +3 -0
+
+When your tasklet does touch user data directly, mark it TASKLET_USER_DATA
+using tasklet_init_flags/or DECLARE_TASKLET_USERDATA*.

Same as above.

Documentation/clearcpu.txt line 75

Quoted 3 lines
Documentation/clearcpu.txt new file +3 -0
+
+When your timer does touch user data mark it with TIMER_USER_DATA
+If it is a hrtimer and touches user data, mark it with HRTIMER_MODE_USER_DATA.

Mark what, the timer function?

Quoted 1 line

+When your irq poll handler does touch user data, mark it lazy_clear_cpu().

Mark what? That's a function call?

Documentation/clearcpu.txt line 82

Quoted 4 lines
Documentation/clearcpu.txt new file +4 -0
+For networking code, make sure to only touch user data through
+skb_push/put/copy [add more], unless it is data from the current
+process. If that is not ensured add lazy_clear_cpu or
+lazy_clear_cpu_interrupt.

How do you know if data coming across the network is for the "current" process? What does "current process" even mean here?

How about UIO drivers, how does their data get classified? Lots of networking stacks use UIO now... virtual io channels?

Documentation/clearcpu.txt line 85

Quoted 2 lines
Documentation/clearcpu.txt new file +2 -0
+Any cryptographic code touching key data should use memzero_explicit
+or kzfree to free the data.

We do that today, right? If not, that needs to be done regardless.

And what about password data? I _think_ we got most of that now out of the tty layer, but we could be wrong :)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+If your RCU callback touches user data add lazy_clear_cpu().

Ugh, really?

Documentation/clearcpu.txt line 91

Quoted 4 lines
Documentation/clearcpu.txt new file +4 -0
+
+These steps are currently only needed for code that runs on MDS affected
+CPUs, which is currently only x86. But might be worth being prepared
+if other architectures become affected too.

As someone who probably reviews more new drivers than anyone else right now, my first recommendation is going to be, "Buy a non-Intel processor, we have no idea what they expect from driver writers now, just give up trying to appease them." Because if I, the person that is responsible for reviewing those drivers has no idea what to do here, how can some random driver author be expected to know?

Seriously, this is crazy.

And if you all are going to expect me to start auditing all new drivers based on these new rules, I need a _big_ raise. I somehow doubt you are asking all other OS vendors to do all of this crud.

Documentation/clearcpu.txt line 98

Quoted 6 lines
Documentation/clearcpu.txt new file +6 -0
+Implementation details/assumptions
+----------------------------------
+
+Any buffer clearing is done lazily on next kernel exit. lazy_clear*
+is only a few fast instructions with no cache misses setting
+a flag and can be used frequently even in fast paths.

I can not parse this paragraph at all, what are you trying to say?

Documentation/clearcpu.txt line 104

Quoted 5 lines
Documentation/clearcpu.txt new file +5 -0
+Protecting process data
+-----------------------
+
+If a system call touches data of its own process, CPU state does not
+need to be cleared, because it has already access to it.

How do you know if it is it's own process or not?

What about something like IPC data?

Documentation/clearcpu.txt line 110

Quoted 5 lines
Documentation/clearcpu.txt new file +5 -0
+On context switching we clear data, unless the context switch is
+inside a process. We also clear after any context switches from kernel
+threads.
+
+Cryptographic keys inside the kernel should be protected.

"Protected"? How? Huh? ugh.

<big snip as I got tired>

Documentation/clearcpu.txt line 217

Quoted 8 lines
Documentation/clearcpu.txt new file +8 -0
+Sandboxes
+---------
+
+We don't do anything special for seccomp processes
+
+If there is a sandbox inside the process the process should take care
+itself of clearing its own sensitive data before running sandbox
+code. This would include data touched by system calls.

i.e. "Userspace code is hosed, sorry."?

Documentation/clearcpu.txt line 223

Quoted 5 lines
Documentation/clearcpu.txt new file +5 -0
+BPF
+---
+
+Assume BPF execution does not touch other user's data, so does
+not need to schedule a clear for itself.

Can you assume that?

Documentation/clearcpu.txt line 226

Quoted 2 lines
Documentation/clearcpu.txt new file +2 -0
+BPF could attack the rest of the kernel if it can successfully
+measure side channel side effects.

Can it do such a measurement?

Quoted 14 lines
Documentation/clearcpu.txt new file +14 -0
+When the BPF program was loaded unprivileged, always clear the CPU
+to prevent any exploits written in BPF using side channels to read
+data leaked from other kernel code
+
+We only do this when running in an interrupt, or if an clear cpu is
+already scheduled (which means for example there was a context
+switch, or crypto operation before)
+
+In process context we assume the code only accesses data of the
+current user and check that the BPF running was loaded by the
+same user so even if data leaked it would not cross privilege
+boundaries.
+
+Technically we would only need to do this if the BPF program

Documentation/clearcpu.txt line 251

Quoted 10 lines
Documentation/clearcpu.txt new file +10 -0
+contains conditional branches and loads dominated by them, but
+let's assume that nearly all do.
+
+This could be further optimized by batching clears for
+many similar EBPF executions in a row (e.g. for packet
+processing). This would need ensuring that no sensitive
+data is touched inbetween the EBPF executions, and also
+that all EBPF scripts are set up by the same uid.
+We could add such optimizations later based on
+profile data.

Please contact the BPF people before writing any of the above. The fact that you all have not done so is scandalous.

greg k-h

#14 lore raw

[MODERATED] Encrypted Message

From: Jon Masters <[email protected]>
To: speck for Greg KH <[email protected]>
Subject: Re: [PATCH v6 10/43] MDSv6

Quoted 4 lines · speck for Greg KH

Documentation/clearcpu.txt line 226

Quoted 2 lines
Documentation/clearcpu.txt new file +2 -0
+BPF could attack the rest of the kernel if it can successfully
+measure side channel side effects.

Can it do such a measurement?

The researchers involved in MDS are actively working on an exploit using BPF as well, so I expect we'll know soon. My assumption is "yes".

Jon.

Signature · 1 line
Computer Architect | Sent with my Fedora powered laptop
#15 lore raw
In reply to Greg KH

Ok I feel like a lawyer now, but ... Let's see if we can draft a contract.

Quoted 11 lines · speck for Greg KH

Documentation/clearcpu.txt line 62

Quoted 7 lines · speck for Andi Kleen
Documentation/clearcpu.txt new file +7 -0
+Guidance for driver/subsystem developers
+----------------------------------------
+
+[These generally need to be enforced in code review for new code now]
+
+When you touch user supplied data of *other* processes in system call
+context add lazy_clear_cpu().

What do you mean by "user supplied data of *other* processes"? I think I understand the kernel, and I have no idea what this means.

*other* here means a process which is not current.

Anything that would be copied from/to the other process.

It's actually fairly rare.

Or rather in all situations I know about the process has access to the other process' data anyways (e.g. ptrace or process_vm_read/write)

It happens in special situations like the context switch today.

Here's a hypothetical situation where it could happen:

You have a driver which processes a shared input queue which contains data for multiple processes. The processing happens with the CPU so touches data, and does not only read metadata, but actually has to read the full data.

It runs some code in process context to go through the queue and pick out data items that belong to a process. It skips data for other processes, but still has to read it.

That would be touching other processes' data.

Does it actually happen anywhere in the code? I'm not sure. But I wanted to document it anyways.

Quoted 6 lines

Documentation/clearcpu.txt line 65

Quoted 3 lines
Documentation/clearcpu.txt new file +2 -0
+For the cases below we care only about data from other processes.
+Touching non cryptographic data from the current process is always allowed.

Define "non cryptographic data". Is data coming across a serial port crypto data? From a camera?

That's IO data which is sensitive.

Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+
+Touching only pointers to user data is always allowed.

But not touching the data the pointer points to?

Right.

Quoted 4 lines

I still don't know what "user data" means. Is a serial stream coming from a bluetooth device "user data"? Is a program that talks directly to a USB data without a special kernel driver reading "user data"? Is a serial port data stream "user data"?

These are all IO (but not meta) data.

Quoted 7 lines

Documentation/clearcpu.txt line 82

Quoted 4 lines
Documentation/clearcpu.txt new file +4 -0
+For networking code, make sure to only touch user data through
+skb_push/put/copy [add more], unless it is data from the current
+process. If that is not ensured add lazy_clear_cpu or
+lazy_clear_cpu_interrupt.

How do you know if data coming across the network is for the "current" process? What does "current process" even mean here?

Current process is "current". You know it if you're in process context and you only process data for your process.

For example recvmsg() doesn't need to worry because it only processes a queue of data that is for the current process context.

Quoted 2 lines

How about UIO drivers, how does their data get classified? Lots of networking stacks use UIO now... virtual io channels?

It's all sensitive I guess. These will clear after the process context switch anyways.

Quoted 2 lines

We do that today, right? If not, that needs to be done regardless.

Yes.

Quoted 3 lines

And what about password data? I _think_ we got most of that now out of the tty layer, but we could be wrong :)

I don't think the kernel processes passwords directly.

If it's in the tty later it's IO data. If it's in the user program it's user data. When it's uploaded to the kernel as a processed key it's cryptographic data.

Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+
+If your RCU callback touches user data add lazy_clear_cpu().

Ugh, really?

Yes. But none need it currently, so it's very unlikely.

BTW you seem to think that lazy_clear_cpu is very expensive. It is not. And it is done after all process context switches anyways.

Quoted 7 lines

Documentation/clearcpu.txt line 104

Quoted 5 lines
Documentation/clearcpu.txt new file +5 -0
+Protecting process data
+-----------------------
+
+If a system call touches data of its own process, CPU state does not
+need to be cleared, because it has already access to it.

How do you know if it is it's own process or not?

See above.

Quoted 2 lines

What about something like IPC data?

You already have access to that, so no need to clear.

Quoted 6 lines

Documentation/clearcpu.txt line 217

Quoted 4 lines
Documentation/clearcpu.txt new file +4 -0
+
+If there is a sandbox inside the process the process should take care
+itself of clearing its own sensitive data before running sandbox
+code. This would include data touched by system calls.

i.e. "Userspace code is hosed, sorry."?

User space has lots of own ways to mitigate. Most code which doesn't use run untrusted code sandboxes doesn't need to worry.

Quoted 9 lines

Documentation/clearcpu.txt line 223

Quoted 6 lines
Documentation/clearcpu.txt new file +5 -0
+BPF
+---
+
+Assume BPF execution does not touch other user's data, so does
+not need to schedule a clear for itself.

Can you assume that?

Quoted 4 lines

Documentation/clearcpu.txt line 226

Quoted 2 lines
Documentation/clearcpu.txt new file +2 -0
+BPF could attack the rest of the kernel if it can successfully
+measure side channel side effects.

Can it do such a measurement?

For Spectre it could, so likely it can for MDS too.

-Andi

#16 lore raw
In reply to Andi Kleen

I haven't been paying super-close attention to all this MDS stuff, but I have written a bunch of docs on all these things, so here are some suggestions if you find them valuable. Take 'em or leave 'em. :)

Documentation/clearcpu.txt line 7

Quoted 3 lines
Documentation/clearcpu.txt new file +3 -0
+Some CPUs can leave read or written data in internal buffers,
+which then later might be sampled through side effects.
+For more details see CVE-2018-12126 CVE-2018-12130 CVE-2018-12127

Maybe:

Some CPUs can leave data in internal buffers which might later be leaked. For more details see CVE-2018-12126 CVE-2018-12130 CVE-2018-12127

Quoted 1 line

+This can be avoided by explicitly clearing the CPU state.

If you say "buffers" in the previous paragraph, it's probably good to be consistent in the next paragraph.

Documentation/clearcpu.txt line 13

Quoted 3 lines
Documentation/clearcpu.txt new file +3 -0
+We attempt to avoid leaking data between different processes,
+and also some sensitive data, like cryptographic data, to
+user space.

The kernel attempts to avoid leaking sensitive data from inside the kernel to applications and also between applications.

Documentation/clearcpu.txt line 24

Quoted 10 lines
Documentation/clearcpu.txt new file +10 -0
+We support three modes:
+
+(1) mitigation off (mds=off)
+(2) clear only when needed (default)
+(3) clear on every kernel exit, or guest entry (mds=full)
+
+(1) and (3) are trivial, the rest of the document discusses (2)
+
+In general option (3) is the most conservative choice. It does
+not make ST assumptions about leaking data.

ST?

Do we need to say anything about why you might make one choice or another?

Documentation/clearcpu.txt line 29

Quoted 4 lines
Documentation/clearcpu.txt new file +4 -0
+Basic requirements and assumptions
+----------------------------------
+
+Kernel addresses and kernel temporary data are not sensitive.

Should we say something more about the implications? Basically, picking mode-1 or mode-2 weakens KASLR.

Quoted 1 line

+User data is sensitive, but only for other processes.

I thought we went to some trouble with Spectre-v2 to at least have some minimal checks for app-to-app trust. This makes it sound like we consider all apps untrusted whether they are from the same user or not.

Documentation/clearcpu.txt line 38

Quoted 6 lines
Documentation/clearcpu.txt new file +6 -0
+User data is anything in the user address space, or data buffers
+directly copied from/to the user (e.g. read/write). It does not
+include metadata, or flag settings. For example packet headers
+or file names are not sensitive in this model.
+
+Block IO data (but not meta data) is sensitive.

Aren't filenames part of metadata? We go to the trouble of encrypting them for ecryptfs. I thought that's because they can be sensitive.

Documentation/clearcpu.txt line 46

Quoted 7 lines
Documentation/clearcpu.txt new file +7 -0
+Most data structures in the kernel are not sensitive.
+
+Kernel data is sensitive when it involves cryptographic keys.
+
+We consider data from input devices (such as key presses)
+sensitive. We also consider sound data or terminal
+data sensitive.

One problem I have with the tone of this documentation is that it seems to state fact after fact with none of the backing logic. For instance, I think you're saying that the terminals are sensitive because folks type passwords into them. But, it would be wonderful to actually say that.

That way, folks can actually check the logic of the author or expand on it.

Review

Quoted 2 lines
(quoted diff) +2 -0
+We assume that only data actually accessed by the kernel by explicit
+instructions can be leaked.

I'm not a fan of saying "explicit instructions". Explicit to me means an instruction in the code base. I think you mean something closer to "instructions with architectural effects" or "retired instructions" or something.

I'd also think that a gadget formed out of the middle of an instruction that comes from the codebase wouldn't be "explicit", but this model doesn't seem to comprehend those.

Documentation/clearcpu.txt line 54

Quoted 6 lines

Note that this may not be always

Documentation/clearcpu.txt new file +5 -0
+true, in theory prefetching or speculation may touch more. The assumption
+is that if any such happens it will be very low bandwidth and hard
+to control due to the existing Spectre and other mitigations,
+such as memory randomization.  If a user is concerned about this they
+need to use mds=full.

What is "memory randomization"? Do you mean user and kernel ASLR?

Should this maybe say something like:

This approach does not mitigate leaks that originate from non- architectural data access such as speculation or prefetching.

I also have a hard time restating the "low-bandwidth" bits, mostly because I don't know enough about it to say if such a channel would be high or low-bandwidh. I *hope* it would be low-bandwidth, and that's obviously required by the model here, but I just don't know what we're supposed to take away from this.

Why even bother to mention "Spectre and other mitigations"?

Documentation/clearcpu.txt line 61

Quoted 6 lines
Documentation/clearcpu.txt new file +6 -0
+Guidance for driver/subsystem developers
+----------------------------------------
+
+[These generally need to be enforced in code review for new code now]
+
+When you touch user supplied data of *other* processes in system call

Nit: needs to be "user-supplied"

Quoted 1 line

+context add lazy_clear_cpu().

An example here would be nice. I can't think of one of these of the top of my head other than ptrace, and *that* is actually a counter-example.

Documentation/clearcpu.txt line 65

Quoted 2 lines
Documentation/clearcpu.txt new file +2 -0
+For the cases below we care only about data from other processes.
+Touching non cryptographic data from the current process is always allowed.

Nit: needs to be "non-cryptographic"

Quoted 1 line

+Touching only pointers to user data is always allowed.

Is this referring to the pointer or the data pointed to? But, I usually think of "touching a pointer" as dereferencing it.

Documentation/clearcpu.txt line 75

Quoted 7 lines
Documentation/clearcpu.txt new file +7 -0
+When your interrupt does touch user data directly mark it with IRQF_USER_DATA.
+
+When your tasklet does touch user data directly, mark it TASKLET_USER_DATA
+using tasklet_init_flags/or DECLARE_TASKLET_USERDATA*.
+
+When your timer does touch user data mark it with TIMER_USER_DATA
+If it is a hrtimer and touches user data, mark it with HRTIMER_MODE_USER_DATA.

This all looks good and straightforward.

Quoted 1 line

+When your irq poll handler does touch user data, mark it lazy_clear_cpu().

This is different than the others. This is a *call* you have to make, and it has to be done in a specific order versus touching the data. If you clear before touching the data, it's no good. This is backwards from some of the other mitigations, so probably really good to mention.

Documentation/clearcpu.txt line 82

Quoted 4 lines
Documentation/clearcpu.txt new file +4 -0
+For networking code, make sure to only touch user data through
+skb_push/put/copy [add more], unless it is data from the current
+process. If that is not ensured add lazy_clear_cpu or
+lazy_clear_cpu_interrupt.

Nit: lazy_clear_cpu has parenthesis in the previous paragraph but not here. Consistency would be nice.

Documentation/clearcpu.txt line 85

Quoted 2 lines
Documentation/clearcpu.txt new file +2 -0
+Any cryptographic code touching key data should use memzero_explicit
+or kzfree to free the data.

Is it just key data? I would think the plaintext is just as sensitive as the key data.

Documentation/clearcpu.txt line 89

Quoted 3 lines
Documentation/clearcpu.txt new file +3 -0
+If your RCU callback touches user data add lazy_clear_cpu().
+
+These steps are currently only needed for code that runs on MDS affected

Nit: MDS-affected

Documentation/clearcpu.txt line 91

Quoted 2 lines
Documentation/clearcpu.txt new file +2 -0
+CPUs, which is currently only x86. But might be worth being prepared
+if other architectures become affected too.

I think you're trying to say that even code that can't or doesn't run on x86 can add these mitigations. They might want to do this in the case that similar vulnerabilities appear in the future.

Documentation/clearcpu.txt line 98

Quoted 6 lines
Documentation/clearcpu.txt new file +6 -0
+Implementation details/assumptions
+----------------------------------
+
+Any buffer clearing is done lazily on next kernel exit. lazy_clear*
+is only a few fast instructions with no cache misses setting
+a flag and can be used frequently even in fast paths.

This is a bit overzealous. :)

It's not like we're using some magic instructions that never miss the caches. Maybe:

lazy_clear* is designed to be low-cost and can be used frequently even in performance-sensitive paths.

author
#17 lore raw

PATCH v6 11/43 MDSv6

In reply to Andi Kleen

Add basic infrastructure for code to request CPU buffer clearing on the next kernel exit.

We have two functions lazy_clear_cpu to request clearing, and lazy_clear_cpu_interrupt to request clearing if running in an interrupt.

Non architecture specific code can include linux/clearcpu.h and use lazy_clear_cpu / lazy_clear_interrupt. On x86 we provide low level implementations that sets a per cpu flag to request cpu clearing on the next kernel exit.

---
 arch/Kconfig                    |  3 +++
 arch/x86/Kconfig                |  1 +
 arch/x86/include/asm/clearcpu.h | 12 +++++++++--
 arch/x86/kernel/cpu/bugs.c      |  3 +++
 include/linux/clearcpu.h        | 36 +++++++++++++++++++++++++++++++++
 5 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 include/linux/clearcpu.h
arch/Kconfig +3 -0
index 4cfb6de48f79..e6b7bf9174aa 100644
@@ -808,6 +808,9 @@ config VMAP_STACK
 	  the stack to map directly to the KASAN shadow map using a formula
 	  that is incorrect if the stack is in vmalloc space.
 
+config ARCH_HAS_CLEAR_CPU
+	def_bool n
+
 config ARCH_OPTIONAL_KERNEL_RWX
 	def_bool n
 
arch/x86/Kconfig +1 -0
index 68261430fe6e..1b837b61d07b 100644
@@ -84,6 +84,7 @@ config X86
 	select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
 	select ARCH_WANTS_DYNAMIC_TASK_STRUCT
 	select ARCH_WANTS_THP_SWAP		if X86_64
+	select ARCH_HAS_CLEAR_CPU
 	select BUILDTIME_EXTABLE_SORT
 	select CLKEVT_I8253
 	select CLOCKSOURCE_VALIDATE_LAST_CYCLE
arch/x86/include/asm/clearcpu.h +10 -2
index 88ab27694aa6..15d25c2436da 100644
@@ -5,7 +5,8 @@
 #include <linux/jump_label.h>
 #include <linux/sched/smt.h>
 #include <asm/alternative.h>
-#include <linux/thread_info.h>
+
+DECLARE_PER_CPU(bool, clear_cpu_flag);
 
 /*
  * Clear CPU buffers to avoid side channels.
@@ -34,8 +35,15 @@ static inline void clear_cpu(void)
 
 static inline void clear_cpu_idle(void)
 {
-	if (sched_smt_active())
+	if (sched_smt_active()) {
+		__this_cpu_write(clear_cpu_flag, false);
 		clear_cpu();
+	}
+}
+
+static inline void lazy_clear_cpu(void)
+{
+	__this_cpu_write(clear_cpu_flag, true);
 }
 
 #endif
arch/x86/kernel/cpu/bugs.c +3 -0
index 26b890f18239..067309190a6a 100644
@@ -1061,6 +1061,9 @@ early_param("l1tf", l1tf_cmdline);
 
 #undef pr_fmt
 
+DEFINE_PER_CPU(bool, clear_cpu_flag);
+EXPORT_PER_CPU_SYMBOL(clear_cpu_flag);
+
 static void mds_select_mitigation(void)
 {
 	if (!boot_cpu_has(X86_BUG_MDS))
include/linux/clearcpu.h new file +36 -0
new file mode 100644
index 000000000000..63a6952b46fa
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_CLEARCPU_H
+#define _LINUX_CLEARCPU_H 1
+
+#include <linux/preempt.h>
+
+#ifdef CONFIG_ARCH_HAS_CLEAR_CPU
+#include <asm/clearcpu.h>
+#else
+static inline void lazy_clear_cpu(void)
+{
+}
+#endif
+
+/*
+ * Use this function when potentially touching (reading or writing)
+ * user data in an interrupt. In this case schedule to clear the
+ * CPU buffers on kernel exit to avoid any potential side channels.
+ *
+ * If not in an interrupt we assume the touched data belongs to the
+ * current process and doesn't need to be cleared.
+ *
+ * This version is for code who might be in an interrupt.
+ * If you know for sure you're in interrupt context call
+ * lazy_clear_cpu directly.
+ *
+ * lazy_clear_cpu is reasonably cheap (just sets a bit) and
+ * can be used in fast paths.
+ */
+static inline void lazy_clear_cpu_interrupt(void)
+{
+	if (in_interrupt())
+		lazy_clear_cpu();
+}
+
+#endif
Signature · 1 line
2.17.2
author
#18 lore raw

PATCH v6 12/43 MDSv6

In reply to Andi Kleen

Add a static key to guard clear_cpus on kernel exit and vm entry, so that we can implement a mds=full implementation later, once we have a new lazy policy.

Right now the static key is enabled by default, so there is no behavior change.

---
 arch/x86/entry/common.c         |  3 ++-
 arch/x86/include/asm/clearcpu.h |  2 ++
 arch/x86/kernel/cpu/bugs.c      | 10 ++++++++--
 arch/x86/kernel/nmi.c           |  3 ++-
 4 files changed, 14 insertions(+), 4 deletions(-)
arch/x86/entry/common.c +2 -1
index dfd51d97d683..ffcc24620ec9 100644
@@ -212,7 +212,8 @@ __visible inline void prepare_exit_to_usermode(struct pt_regs *regs)
 	ti->status &= ~(TS_COMPAT|TS_I386_REGS_POKED);
 #endif
 
-	clear_cpu();
+	if (static_key_enabled(&force_cpu_clear))
+		clear_cpu();
 
 	user_enter_irqoff();
 }
arch/x86/include/asm/clearcpu.h +2 -0
index 15d25c2436da..30e802bae2ca 100644
@@ -46,4 +46,6 @@ static inline void lazy_clear_cpu(void)
 	__this_cpu_write(clear_cpu_flag, true);
 }
 
+DECLARE_STATIC_KEY_FALSE(force_cpu_clear);
+
 #endif
arch/x86/kernel/cpu/bugs.c +8 -2
index 067309190a6a..a756c57979be 100644
@@ -1064,6 +1064,9 @@ early_param("l1tf", l1tf_cmdline);
 DEFINE_PER_CPU(bool, clear_cpu_flag);
 EXPORT_PER_CPU_SYMBOL(clear_cpu_flag);
 
+DEFINE_STATIC_KEY_FALSE(force_cpu_clear);
+EXPORT_SYMBOL(force_cpu_clear);
+
 static void mds_select_mitigation(void)
 {
 	if (!boot_cpu_has(X86_BUG_MDS))
@@ -1086,9 +1089,12 @@ static void mds_select_mitigation(void)
 	setup_force_cpu_cap(X86_FEATURE_VERW);
 	if (cmdline_find_option_bool(boot_command_line, "mds=off"))
 		setup_clear_cpu_cap(X86_FEATURE_VERW);
-	/* Nop currently because this is default for now. */
+	/* Default to old behavior for now */
 	if (cmdline_find_option_bool(boot_command_line, "mds=full") ||
-	     cmdline_find_option_bool(boot_command_line, "mds=auto"))
+		true)
+		static_branch_enable(&force_cpu_clear);
+	/* Nop currently because this is default for now. */
+	if (cmdline_find_option_bool(boot_command_line, "mds=auto"))
 		setup_force_cpu_cap(X86_FEATURE_VERW);
 
 	if (boot_cpu_has(X86_FEATURE_VERW) && boot_cpu_has_bug(X86_BUG_MDS_NO_L1TF))
arch/x86/kernel/nmi.c +2 -1
index 1c5507400089..eb6e39238d1d 100644
@@ -535,7 +535,8 @@ do_nmi(struct pt_regs *regs, long error_code)
 		goto nmi_restart;
 
 out:
-	clear_cpu();
+	if (static_key_enabled(&force_cpu_clear))
+		clear_cpu();
 }
 NOKPROBE_SYMBOL(do_nmi);
 
Signature · 1 line
2.17.2
author
#19 lore raw

PATCH v6 13/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: x86/speculation/mds: Check lazy clear in kernel exit

Add support for only clearing on kernel exit when the per cpu clear flag is set. This will be the base of lazy clearing.

Right now this is a nop because mds=full is still default.

---
 arch/x86/entry/common.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/x86/entry/common.c +5 -1
index ffcc24620ec9..cd6e044d6599 100644
@@ -212,8 +212,12 @@ __visible inline void prepare_exit_to_usermode(struct pt_regs *regs)
 	ti->status &= ~(TS_COMPAT|TS_I386_REGS_POKED);
 #endif
 
-	if (static_key_enabled(&force_cpu_clear))
+	if (static_cpu_has(X86_BUG_MDS) &&
+		(static_key_enabled(&force_cpu_clear) ||
+		 __this_cpu_read(clear_cpu_flag))) {
 		clear_cpu();
+		__this_cpu_write(clear_cpu_flag, false);
+	}
 
 	user_enter_irqoff();
 }
Signature · 1 line
2.17.2
author
#20 lore raw

PATCH v6 14/43 MDSv6

In reply to Andi Kleen

Add trace points for clear_cpu and lazy_clear_cpu. This is useful for debugging and performance testing.

The trace points have to be partially out of line to avoid include loops, but the fast path jump labels are inlined.

The idle case cannot be traced because trace points don't like idle context.

---
 arch/x86/include/asm/clearcpu.h       | 36 +++++++++++++++++++++++++--
 arch/x86/include/asm/trace/clearcpu.h | 27 ++++++++++++++++++++
 arch/x86/kernel/cpu/bugs.c            | 17 +++++++++++++
 3 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/include/asm/trace/clearcpu.h
arch/x86/include/asm/clearcpu.h +34 -2
index 30e802bae2ca..b6f3a7184531 100644
@@ -6,6 +6,29 @@
 #include <linux/sched/smt.h>
 #include <asm/alternative.h>
 
+/*
+ * We cannot directly include the trace point header here
+ * because it leads to include loops with other trace point
+ * files pulling this one in. Define the static
+ * key manually here, which handles noping the fast path,
+ * and the actual tracing is done out of line.
+ */
+#ifdef CONFIG_TRACEPOINTS
+#include <asm/atomic.h>
+#include <linux/tracepoint-defs.h>
+
+extern struct tracepoint __tracepoint_clear_cpu;
+extern struct tracepoint __tracepoint_lazy_clear_cpu;
+#define cc_tracepoint_active(t) static_key_false(&(t).key)
+
+extern void do_trace_clear_cpu(void);
+extern void do_trace_lazy_clear_cpu(void);
+#else
+#define cc_tracepoint_active(t) false
+static inline void do_trace_clear_cpu(void) {}
+static inline void do_trace_lazy_clear_cpu(void) {}
+#endif
+
 DECLARE_PER_CPU(bool, clear_cpu_flag);
 
 /*
@@ -13,7 +36,7 @@ DECLARE_PER_CPU(bool, clear_cpu_flag);
  * We use microcode as a side effect of the obsolete VERW instruction
  */
 
-static inline void clear_cpu(void)
+static inline void __clear_cpu(void)
 {
 	unsigned kernel_ds = __KERNEL_DS;
 	/* Has to be memory form, don't modify to use an register */
@@ -21,6 +44,13 @@ static inline void clear_cpu(void)
 		[kernelds] "m" (kernel_ds));
 }
 
+static inline void clear_cpu(void)
+{
+	if (cc_tracepoint_active(__tracepoint_clear_cpu))
+		do_trace_clear_cpu();
+	__clear_cpu();
+}
+
 /*
  * Clear CPU buffers before going idle, so that no state is leaked to SMT
  * siblings taking over thread resources.
@@ -37,12 +67,14 @@ static inline void clear_cpu_idle(void)
 {
 	if (sched_smt_active()) {
 		__this_cpu_write(clear_cpu_flag, false);
-		clear_cpu();
+		__clear_cpu();
 	}
 }
 
 static inline void lazy_clear_cpu(void)
 {
+	if (cc_tracepoint_active(__tracepoint_lazy_clear_cpu))
+		do_trace_lazy_clear_cpu();
 	__this_cpu_write(clear_cpu_flag, true);
 }
 
arch/x86/include/asm/trace/clearcpu.h new file +27 -0
new file mode 100644
index 000000000000..e742b5cd8ee9
@@ -0,0 +1,27 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM clearcpu
+
+#if !defined(_TRACE_CLEARCPU_H) || defined(TRACE_HEADER_MULTI_READ)
+
+#include <linux/tracepoint.h>
+
+DECLARE_EVENT_CLASS(clear_cpu,
+		    TP_PROTO(int dummy),
+		    TP_ARGS(dummy),
+		    TP_STRUCT__entry(__field(int, dummy)),
+		    TP_fast_assign(),
+		    TP_printk("%d", __entry->dummy));
+
+DEFINE_EVENT(clear_cpu, clear_cpu, TP_PROTO(int dummy), TP_ARGS(dummy));
+DEFINE_EVENT(clear_cpu, lazy_clear_cpu, TP_PROTO(int dummy), TP_ARGS(dummy));
+
+#define _TRACE_CLEARCPU_H
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH asm/trace/
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_FILE clearcpu
+#endif /* _TRACE_CLEARCPU_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
arch/x86/kernel/cpu/bugs.c +17 -0
index a756c57979be..146f9abc1931 100644
@@ -1061,6 +1061,23 @@ early_param("l1tf", l1tf_cmdline);
 
 #undef pr_fmt
 
+#define CREATE_TRACE_POINTS
+#include <asm/trace/clearcpu.h>
+
+void do_trace_clear_cpu(void)
+{
+	trace_clear_cpu(0);
+}
+EXPORT_SYMBOL(do_trace_clear_cpu);
+EXPORT_TRACEPOINT_SYMBOL(clear_cpu);
+
+void do_trace_lazy_clear_cpu(void)
+{
+	trace_lazy_clear_cpu(0);
+}
+EXPORT_SYMBOL(do_trace_lazy_clear_cpu);
+EXPORT_TRACEPOINT_SYMBOL(lazy_clear_cpu);
+
 DEFINE_PER_CPU(bool, clear_cpu_flag);
 EXPORT_PER_CPU_SYMBOL(clear_cpu_flag);
 
Signature · 1 line
2.17.2
author
#21 lore raw

PATCH v6 15/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: x86/speculation/mds: Schedule cpu clear on context
switch

On context switch we need to schedule a cpu clear on the next kernel exit when:

- We're switching between different processes
- We're switching from a kernel thread

For kernel threads like work queue assume they might contain sensitive (other user's or crypto) data.

switch_mm already distinguishes these cases. We either schedule a flush when the mm is different, or we were in lazy mm mode, which means a kernel thread ran before.

---
 arch/x86/kernel/process.h |  1 +
 arch/x86/mm/tlb.c         | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
arch/x86/kernel/process.h +1 -0
index 320ab978fb1f..976722d8b537 100644
@@ -2,6 +2,7 @@
 //
 // Code shared between 32 and 64 bit
 
+#include <linux/clearcpu.h>
 #include <asm/spec-ctrl.h>
 
 void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p);
arch/x86/mm/tlb.c +14 -0
index 999d6d8f0bef..995420034f57 100644
@@ -342,6 +342,13 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
 				 !cpumask_test_cpu(cpu, mm_cpumask(next))))
 			cpumask_set_cpu(cpu, mm_cpumask(next));
 
+		/*
+		 * We switched through a kernel thread, so schedule
+		 * a cpu clear to protect the thread.
+		 */
+		if (static_cpu_has_bug(X86_BUG_MDS) && was_lazy)
+			lazy_clear_cpu();
+
 		/*
 		 * If the CPU is not in lazy TLB mode, we are just switching
 		 * from one thread in a process to another thread in the same
@@ -376,6 +383,13 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
 		 */
 		cond_ibpb(tsk);
 
+		/*
+		 * We're switching to a different process, so schedule
+		 * a cpu clear.
+		 */
+		if (static_cpu_has_bug(X86_BUG_MDS))
+			lazy_clear_cpu();
+
 		if (IS_ENABLED(CONFIG_VMAP_STACK)) {
 			/*
 			 * If our current stack is in vmalloc space and isn't
Signature · 1 line
2.17.2
author
#22 lore raw

PATCH v6 16/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds: Force clear cpu on kernel preemption

When the kernel is preempted we need to force a cpu clear, because the preemption might happen before the code has a chance to set TIF_CPU_CLEAR later.

We cannot rely on kernel code setting the flag before touching sensitive data: the flag setting could be implicit, like in memzero_explicit, which is always called later.

---
 kernel/sched/core.c | 9 +++++++++
 1 file changed, 9 insertions(+)
kernel/sched/core.c +9 -0
index d8d76a65cfdd..38e57235f4b7 100644
@@ -11,6 +11,8 @@
 
 #include <linux/kcov.h>
 
+#include <linux/clearcpu.h>
+
 #include <asm/switch_to.h>
 #include <asm/tlb.h>
 
@@ -3632,6 +3634,13 @@ asmlinkage __visible void __sched notrace preempt_schedule(void)
 	if (likely(!preemptible()))
 		return;
 
+	/*
+	 * For kernel preemption we need to force a cpu clear
+	 * because it could happen before the code has a chance
+	 * to set TIF_CLEAR_CPU.
+	 */
+	lazy_clear_cpu();
+
 	preempt_schedule_common();
 }
 NOKPROBE_SYMBOL(preempt_schedule);
Signature · 1 line
2.17.2
author
#23 lore raw

PATCH v6 17/43 MDSv6

In reply to Andi Kleen

Assume that any code using these functions is sensitive and shouldn't leak any data.

This handles clearing for key and cryptographic data used in the kernel.

It also schedules a clear after each get_random_bytes, which while being slightly overkill, may protect some hash table key secrets.

---
 lib/string.c     | 6 ++++++
 mm/slab_common.c | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
lib/string.c +6 -0
index 38e4ca08e757..9ce59dd86541 100644
@@ -28,6 +28,7 @@
 #include <linux/bug.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
+#include <linux/clearcpu.h>
 
 #include <asm/byteorder.h>
 #include <asm/word-at-a-time.h>
@@ -715,12 +716,17 @@ EXPORT_SYMBOL(memset);
  * necessary, memzero_explicit() should be used instead in
  * order to prevent the compiler from optimising away zeroing.
  *
+ * As a side effect this may also trigger extra cleaning
+ * of CPU state before the next kernel exit to avoid
+ * side channels.
+ *
  * memzero_explicit() doesn't need an arch-specific version as
  * it just invokes the one of memset() implicitly.
  */
 void memzero_explicit(void *s, size_t count)
 {
 	memset(s, 0, count);
+	lazy_clear_cpu();
 	barrier_data(s);
 }
 EXPORT_SYMBOL(memzero_explicit);
mm/slab_common.c +4 -1
index 81732d05e74a..7b5e2e1318a2 100644
@@ -1576,6 +1576,9 @@ EXPORT_SYMBOL(krealloc);
  * Note: this function zeroes the whole allocated buffer which can be a good
  * deal bigger than the requested buffer size passed to kmalloc(). So be
  * careful when using this function in performance sensitive code.
+ *
+ * As a side effect this may also clear CPU state later before the
+ * next kernel exit to avoid side channels.
  */
 void kzfree(const void *p)
 {
@@ -1585,7 +1588,7 @@ void kzfree(const void *p)
 	if (unlikely(ZERO_OR_NULL_PTR(mem)))
 		return;
 	ks = ksize(mem);
-	memset(mem, 0, ks);
+	memzero_explicit(mem, ks);
 	kfree(mem);
 }
 EXPORT_SYMBOL(kzfree);
Signature · 1 line
2.17.2
author
#24 lore raw

PATCH v6 18/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds: Support cpu clear in interrupts

According to an audit the majority of interrupt handlers do not touch user data.

But some do. Add a IRQ_F_USER_DATA flag to enable clearing after an interrupt.

Future patches will add this flag to interrupts that need it.

---
 include/linux/interrupt.h | 2 ++
 kernel/irq/handle.c       | 4 ++++
 kernel/irq/manage.c       | 1 +
 3 files changed, 7 insertions(+)
include/linux/interrupt.h +2 -0
index 4a728dba02e2..0f8ddb7ba09b 100644
@@ -61,6 +61,7 @@
  *                interrupt handler after suspending interrupts. For system
  *                wakeup devices users need to implement wakeup detection in
  *                their interrupt handlers.
+ * IRQF_USER_DATA - Interrupt does touch user data
  */
 #define IRQF_SHARED		0x00000080
 #define IRQF_PROBE_SHARED	0x00000100
@@ -74,6 +75,7 @@
 #define IRQF_NO_THREAD		0x00010000
 #define IRQF_EARLY_RESUME	0x00020000
 #define IRQF_COND_SUSPEND	0x00040000
+#define IRQF_USER_DATA		0x00080000
 
 #define IRQF_TIMER		(__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
 
kernel/irq/handle.c +4 -0
index 38554bc35375..46895311e849 100644
@@ -13,6 +13,7 @@
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
+#include <linux/clearcpu.h>
 
 #include <trace/events/irq.h>
 
@@ -149,6 +150,9 @@ irqreturn_t __handle_irq_event_percpu(struct irq_desc *desc, unsigned int *flags
 		res = action->handler(irq, action->dev_id);
 		trace_irq_handler_exit(irq, action, res);
 
+		if (action->flags & IRQF_USER_DATA)
+			lazy_clear_cpu();
+
 		if (WARN_ONCE(!irqs_disabled(),"irq %u handler %pF enabled interrupts\n",
 			      irq, action->handler))
 			local_irq_disable();
kernel/irq/manage.c +1 -0
index 84b54a17b95d..d1de8d797fc8 100644
@@ -1796,6 +1796,7 @@ EXPORT_SYMBOL(free_irq);
  *
  *	IRQF_SHARED		Interrupt is shared
  *	IRQF_TRIGGER_*		Specify active edge(s) or level
+ *	IRQF_USER_DATA		Handler touches user data with CPU.
  *
  */
 int request_threaded_irq(unsigned int irq, irq_handler_t handler,
Signature · 1 line
2.17.2
author
#25 lore raw

PATCH v6 19/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds: Support cpu clear after tasklets

tasklets run asynchronously to user processes.

Most tasklets don't touch user data, but some do. Add a per tasklet flag to request CPU clearing after the tasklet executes.

Later patches will use this to mark tasklets that need it.

---
 include/linux/interrupt.h | 16 +++++++++++++++-
 kernel/softirq.c          | 25 +++++++++++++++++++------
 2 files changed, 34 insertions(+), 7 deletions(-)
include/linux/interrupt.h +15 -1
index 0f8ddb7ba09b..df795f2f5f34 100644
@@ -572,11 +572,22 @@ struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }
 #define DECLARE_TASKLET_DISABLED(name, func, data) \
 struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
 
+#define DECLARE_TASKLET_USERDATA(name, func, data) \
+struct tasklet_struct name = { NULL, TASKLET_USER_DATA, ATOMIC_INIT(0), func, data }
+
+#define DECLARE_TASKLET_USERDATA_DISABLED(name, func, data) \
+struct tasklet_struct name = { NULL, TASKLET_USER_DATA, ATOMIC_INIT(1), func, data }
 
 enum
 {
 	TASKLET_STATE_SCHED,	/* Tasklet is scheduled for execution */
-	TASKLET_STATE_RUN	/* Tasklet is running (SMP only) */
+	TASKLET_STATE_RUN,	/* Tasklet is running (SMP only) */
+
+	/*
+	 * Set this flag when the tasklet is known to touch user data,
+	 * so needs extra CPU state clearing.
+	 */
+	TASKLET_USER_DATA	= 1 << 5,
 };
 
 #ifdef CONFIG_SMP
@@ -640,6 +651,9 @@ extern void tasklet_kill(struct tasklet_struct *t);
 extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
 extern void tasklet_init(struct tasklet_struct *t,
 			 void (*func)(unsigned long), unsigned long data);
+extern void tasklet_init_flags(struct tasklet_struct *t,
+			 void (*func)(unsigned long), unsigned long data,
+			 unsigned flags);
 
 struct tasklet_hrtimer {
 	struct hrtimer		timer;
kernel/softirq.c +19 -6
index d28813306b2c..b2d348cc8b2e 100644
@@ -26,6 +26,7 @@
 #include <linux/smpboot.h>
 #include <linux/tick.h>
 #include <linux/irq.h>
+#include <linux/clearcpu.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/irq.h>
@@ -522,6 +523,8 @@ static void tasklet_action_common(struct softirq_action *a,
 					BUG();
 				t->func(t->data);
 				tasklet_unlock(t);
+				if (t->state & TASKLET_USER_DATA)
+					lazy_clear_cpu();
 				continue;
 			}
 			tasklet_unlock(t);
@@ -546,15 +549,23 @@ static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
 	tasklet_action_common(a, this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ);
 }
 
-void tasklet_init(struct tasklet_struct *t,
-		  void (*func)(unsigned long), unsigned long data)
+void tasklet_init_flags(struct tasklet_struct *t,
+		  void (*func)(unsigned long), unsigned long data,
+		  unsigned flags)
 {
 	t->next = NULL;
-	t->state = 0;
+	t->state = flags;
 	atomic_set(&t->count, 0);
 	t->func = func;
 	t->data = data;
 }
+EXPORT_SYMBOL(tasklet_init_flags);
+
+void tasklet_init(struct tasklet_struct *t,
+		  void (*func)(unsigned long), unsigned long data)
+{
+	tasklet_init_flags(t, func, data, 0);
+}
 EXPORT_SYMBOL(tasklet_init);
 
 void tasklet_kill(struct tasklet_struct *t)
@@ -609,7 +620,8 @@ static void __tasklet_hrtimer_trampoline(unsigned long data)
  * @ttimer:	 tasklet_hrtimer which is initialized
  * @function:	 hrtimer callback function which gets called from softirq context
  * @which_clock: clock id (CLOCK_MONOTONIC/CLOCK_REALTIME)
- * @mode:	 hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL)
+ * @mode:	 hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL),
+ *		 HRTIMER_MODE_NO_USER
  */
 void tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
 			  enum hrtimer_restart (*function)(struct hrtimer *),
@@ -617,8 +629,9 @@ void tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
 {
 	hrtimer_init(&ttimer->timer, which_clock, mode);
 	ttimer->timer.function = __hrtimer_tasklet_trampoline;
-	tasklet_init(&ttimer->tasklet, __tasklet_hrtimer_trampoline,
-		     (unsigned long)ttimer);
+	tasklet_init_flags(&ttimer->tasklet, __tasklet_hrtimer_trampoline,
+		     (unsigned long)ttimer,
+		     (mode & HRTIMER_MODE_USER_DATA) ? TASKLET_USER_DATA : 0);
 	ttimer->function = function;
 }
 EXPORT_SYMBOL_GPL(tasklet_hrtimer_init);
Signature · 1 line
2.17.2
author
#26 lore raw

PATCH v6 20/43 MDSv6

In reply to Andi Kleen

Timers run asynchronously to user processes.

According to an audit most timer handlers do not touch user data, so don't need to clear. But some do.

Add flags to normal and hrtimers to request clearing.

Future patches will use these flags to mark timers that touch user data.

Note this takes one bit from the timer wheel index field away, but it seems there are less wheels available anyways, so that should be ok.

---
 include/linux/hrtimer.h |  4 ++++
 include/linux/timer.h   | 14 +++++++++++---
 kernel/time/hrtimer.c   |  5 +++++
 kernel/time/timer.c     |  8 ++++++++
 4 files changed, 28 insertions(+), 3 deletions(-)
include/linux/hrtimer.h +4 -0
index 2e8957eac4d4..c8e3db15e55b 100644
@@ -32,6 +32,7 @@ struct hrtimer_cpu_base;
  *				  when starting the timer)
  * HRTIMER_MODE_SOFT		- Timer callback function will be executed in
  *				  soft irq context
+ * HRTIMER_MODE_USER_DATA	- Handler does touch user data.
  */
 enum hrtimer_mode {
 	HRTIMER_MODE_ABS	= 0x00,
@@ -48,6 +49,7 @@ enum hrtimer_mode {
 	HRTIMER_MODE_ABS_PINNED_SOFT = HRTIMER_MODE_ABS_PINNED | HRTIMER_MODE_SOFT,
 	HRTIMER_MODE_REL_PINNED_SOFT = HRTIMER_MODE_REL_PINNED | HRTIMER_MODE_SOFT,
 
+	HRTIMER_MODE_USER_DATA	= 0x08,
 };
 
 /*
@@ -101,6 +103,7 @@ enum hrtimer_restart {
  * @state:	state information (See bit values above)
  * @is_rel:	Set if the timer was armed relative
  * @is_soft:	Set if hrtimer will be expired in soft interrupt context.
+ * @user_data:	function does touch user data.
  *
  * The hrtimer structure must be initialized by hrtimer_init()
  */
@@ -112,6 +115,7 @@ struct hrtimer {
 	u8				state;
 	u8				is_rel;
 	u8				is_soft;
+	u8				user_data;
 };
 
 /**
include/linux/timer.h +11 -3
index 7b066fd38248..78ae3602fbcd 100644
@@ -56,10 +56,13 @@ struct timer_list {
 #define TIMER_DEFERRABLE	0x00080000
 #define TIMER_PINNED		0x00100000
 #define TIMER_IRQSAFE		0x00200000
-#define TIMER_ARRAYSHIFT	22
-#define TIMER_ARRAYMASK		0xFFC00000
+#define TIMER_USER_DATA		0x00400000
+#define TIMER_ARRAYSHIFT	23
+#define TIMER_ARRAYMASK		0xFF800000
 
-#define TIMER_TRACE_FLAGMASK	(TIMER_MIGRATING | TIMER_DEFERRABLE | TIMER_PINNED | TIMER_IRQSAFE)
+#define TIMER_TRACE_FLAGMASK	\
+	(TIMER_MIGRATING | TIMER_DEFERRABLE | TIMER_PINNED | TIMER_IRQSAFE | \
+	 TIMER_USER_DATA)
 
 #define __TIMER_INITIALIZER(_function, _flags) {		\
 		.entry = { .next = TIMER_ENTRY_STATIC },	\
@@ -73,6 +76,11 @@ struct timer_list {
 	struct timer_list _name =				\
 		__TIMER_INITIALIZER(_function, 0)
 
+#define DEFINE_TIMER_USERDATA(_name, _function)			\
+	struct timer_list _name =				\
+		__TIMER_INITIALIZER(_function, TIMER_USER_DATA)
+
+
 /*
  * LOCKDEP and DEBUG timer interfaces.
  */
kernel/time/hrtimer.c +5 -0
index f5cfa1b73d6f..4d8f419ab55f 100644
@@ -42,6 +42,7 @@
 #include <linux/timer.h>
 #include <linux/freezer.h>
 #include <linux/compat.h>
+#include <linux/clearcpu.h>
 
 #include <linux/uaccess.h>
 
@@ -1276,6 +1277,7 @@ static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
 		clock_id = CLOCK_MONOTONIC;
 
 	base += hrtimer_clockid_to_base(clock_id);
+	timer->user_data = !!(mode & HRTIMER_MODE_USER_DATA);
 	timer->is_soft = softtimer;
 	timer->base = &cpu_base->clock_base[base];
 	timerqueue_init(&timer->node);
@@ -1390,6 +1392,9 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
 	trace_hrtimer_expire_exit(timer);
 	raw_spin_lock_irq(&cpu_base->lock);
 
+	if (timer->user_data)
+		lazy_clear_cpu();
+
 	/*
 	 * Note: We clear the running state after enqueue_hrtimer and
 	 * we do not reprogram the event hardware. Happens either in
kernel/time/timer.c +8 -0
index 444156debfa0..caaa87b91268 100644
@@ -43,6 +43,7 @@
 #include <linux/sched/debug.h>
 #include <linux/slab.h>
 #include <linux/compat.h>
+#include <linux/clearcpu.h>
 
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
@@ -1338,6 +1339,13 @@ static void call_timer_fn(struct timer_list *timer, void (*fn)(struct timer_list
 		 */
 		preempt_count_set(count);
 	}
+
+	/*
+	 * The timer might have touched user data. Schedule
+	 * a cpu clear on the next kernel exit.
+	 */
+	if (timer->flags & TIMER_USER_DATA)
+		lazy_clear_cpu();
 }
 
 static void expire_timers(struct timer_base *base, struct hlist_head *head)
Signature · 1 line
2.17.2
author
#27 lore raw

PATCH v6 21/43 MDSv6

In reply to Andi Kleen

Schedule a clear cpu on next kernel exit for string PIO or memcpy_from/to_io calls, when they are called in interrupts.

The PIO case is likely already handled by old drivers not opting in their interrupt handlers to not clear, but let's do it just to be sure.

---
 arch/x86/include/asm/io.h | 3 +++
 include/asm-generic/io.h  | 3 +++
 2 files changed, 6 insertions(+)
arch/x86/include/asm/io.h +3 -0
index 686247db3106..19e2208eaa94 100644
@@ -40,6 +40,7 @@
 
 #include <linux/string.h>
 #include <linux/compiler.h>
+#include <linux/clearcpu.h>
 #include <asm/page.h>
 #include <asm/early_ioremap.h>
 #include <asm/pgtable_types.h>
@@ -321,6 +322,7 @@ static inline void outs##bwl(int port, const void *addr, unsigned long count) \
 			     : "+S"(addr), "+c"(count)			\
 			     : "d"(port) : "memory");			\
 	}								\
+	lazy_clear_cpu_interrupt();					\
 }									\
 									\
 static inline void ins##bwl(int port, void *addr, unsigned long count)	\
@@ -337,6 +339,7 @@ static inline void ins##bwl(int port, void *addr, unsigned long count)	\
 			     : "+D"(addr), "+c"(count)			\
 			     : "d"(port) : "memory");			\
 	}								\
+	lazy_clear_cpu_interrupt();					\
 }
 
 BUILDIO(b, b, char)
include/asm-generic/io.h +3 -0
index d356f802945a..cf58bceea042 100644
@@ -14,6 +14,7 @@
 #include <asm/page.h> /* I/O is all done through memory accesses */
 #include <linux/string.h> /* for memset() and memcpy() */
 #include <linux/types.h>
+#include <linux/clearcpu.h>
 
 #ifdef CONFIG_GENERIC_IOMAP
 #include <asm-generic/iomap.h>
@@ -1115,6 +1116,7 @@ static inline void memcpy_fromio(void *buffer,
 				 size_t size)
 {
 	memcpy(buffer, __io_virt(addr), size);
+	lazy_clear_cpu_interrupt();
 }
 #endif
 
@@ -1132,6 +1134,7 @@ static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer,
 			       size_t size)
 {
 	memcpy(__io_virt(addr), buffer, size);
+	lazy_clear_cpu_interrupt();
 }
 #endif
 
Signature · 1 line
2.17.2
author
#28 lore raw

PATCH v6 22/43 MDSv6

In reply to Andi Kleen

Schedule a cpu clear on next kernel exit for swiotlb running in interrupt context, since it touches user data with the CPU.

---
 kernel/dma/swiotlb.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/dma/swiotlb.c +2 -0
index 1fb6fd68b9c7..6123174a5f2c 100644
@@ -34,6 +34,7 @@
 #include <linux/scatterlist.h>
 #include <linux/mem_encrypt.h>
 #include <linux/set_memory.h>
+#include <linux/clearcpu.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -422,6 +423,7 @@ static void swiotlb_bounce(phys_addr_t orig_addr, phys_addr_t tlb_addr,
 	} else {
 		memcpy(phys_to_virt(orig_addr), vaddr, size);
 	}
+	lazy_clear_cpu_interrupt();
 }
 
 phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
Signature · 1 line
2.17.2
author
#29 lore raw

PATCH v6 23/43 MDSv6

In reply to Andi Kleen

Instrument some strategic skbuff functions that either touch packet data directly, or are likely followed by a user data touch like a memcpy, to schedule a cpu clear on next kernel exit. This is only done inside interrupts, outside we assume it only touches the current processes' data.

In principle network data should be encrypted anyways, but it's better to not leak it.

This provides protection for the network softirq.

Needs more auditing.

---
 include/linux/skbuff.h |  2 ++
 net/core/skbuff.c      | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
include/linux/skbuff.h +2 -0
index 95d25b010a25..7cd26e7b15d5 100644
@@ -40,6 +40,7 @@
 #include <linux/in6.h>
 #include <linux/if_packet.h>
 #include <net/flow.h>
+#include <linux/clearcpu.h>
 
 /* The interface for checksum offload between the stack and networking drivers
  * is as follows...
@@ -2093,6 +2094,7 @@ static inline void *__skb_put(struct sk_buff *skb, unsigned int len)
 	SKB_LINEAR_ASSERT(skb);
 	skb->tail += len;
 	skb->len  += len;
+	lazy_clear_cpu_interrupt();
 	return tmp;
 }
 
net/core/skbuff.c +32 -0
index 26d848484912..bd30d79b894d 100644
@@ -63,6 +63,7 @@
 #include <linux/errqueue.h>
 #include <linux/prefetch.h>
 #include <linux/if_vlan.h>
+#include <linux/clearcpu.h>
 
 #include <net/protocol.h>
 #include <net/dst.h>
@@ -1189,6 +1190,9 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
 	if (!num_frags)
 		goto release;
 
+	/* Likely to copy user data */
+	lazy_clear_cpu_interrupt();
+
 	new_frags = (__skb_pagelen(skb) + PAGE_SIZE - 1) >> PAGE_SHIFT;
 	for (i = 0; i < new_frags; i++) {
 		page = alloc_page(gfp_mask);
@@ -1353,6 +1357,9 @@ struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask)
 	if (!n)
 		return NULL;
 
+	/* Copies user data */
+	lazy_clear_cpu_interrupt();
+
 	/* Set the data pointer */
 	skb_reserve(n, headerlen);
 	/* Set the tail pointer and length */
@@ -1460,6 +1467,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 
 	size = SKB_DATA_ALIGN(size);
 
+	lazy_clear_cpu_interrupt();
 	if (skb_pfmemalloc(skb))
 		gfp_mask |= __GFP_MEMALLOC;
 	data = kmalloc_reserve(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
@@ -1524,6 +1532,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 	if (!skb->sk || skb->destructor == sock_edemux)
 		skb->truesize += size - osize;
 
+
 	return 0;
 
 nofrags:
@@ -1588,6 +1597,9 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
 	if (!n)
 		return NULL;
 
+	/* May copy user data */
+	lazy_clear_cpu_interrupt();
+
 	skb_reserve(n, newheadroom);
 
 	/* Set the tail pointer and length */
@@ -1676,6 +1688,8 @@ EXPORT_SYMBOL(__skb_pad);
 
 void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
 {
+	/* Likely to be followed by a user data copy */
+	lazy_clear_cpu_interrupt();
 	if (tail != skb) {
 		skb->data_len += len;
 		skb->len += len;
@@ -1701,6 +1715,8 @@ void *skb_put(struct sk_buff *skb, unsigned int len)
 	skb->len  += len;
 	if (unlikely(skb->tail > skb->end))
 		skb_over_panic(skb, len, __builtin_return_address(0));
+	/* Likely to be followed by a user data copy */
+	lazy_clear_cpu_interrupt();
 	return tmp;
 }
 EXPORT_SYMBOL(skb_put);
@@ -1720,6 +1736,7 @@ void *skb_push(struct sk_buff *skb, unsigned int len)
 	skb->len  += len;
 	if (unlikely(skb->data < skb->head))
 		skb_under_panic(skb, len, __builtin_return_address(0));
+	/* No clear cpu, assume this is only header data */
 	return skb->data;
 }
 EXPORT_SYMBOL(skb_push);
@@ -2026,6 +2043,9 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len)
 	struct sk_buff *frag_iter;
 	int i, copy;
 
+	/* Copies user data */
+	lazy_clear_cpu_interrupt();
+
 	if (offset > (int)skb->len - len)
 		goto fault;
 
@@ -2113,6 +2133,8 @@ static struct page *linear_to_page(struct page *page, unsigned int *len,
 {
 	struct page_frag *pfrag = sk_page_frag(sk);
 
+	lazy_clear_cpu_interrupt();
+
 	if (!sk_page_frag_refill(sk, pfrag))
 		return NULL;
 
@@ -2387,6 +2409,9 @@ int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len)
 	struct sk_buff *frag_iter;
 	int i, copy;
 
+	/* Copies user data */
+	lazy_clear_cpu_interrupt();
+
 	if (offset > (int)skb->len - len)
 		goto fault;
 
@@ -2467,6 +2492,9 @@ __wsum __skb_checksum(const struct sk_buff *skb, int offset, int len,
 	struct sk_buff *frag_iter;
 	int pos = 0;
 
+	/* Reads packet data */
+	lazy_clear_cpu_interrupt();
+
 	/* Checksum header. */
 	if (copy > 0) {
 		if (copy > len)
@@ -2559,6 +2587,9 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
 	struct sk_buff *frag_iter;
 	int pos = 0;
 
+	/* Reads packet data */
+	lazy_clear_cpu_interrupt();
+
 	/* Copy header. */
 	if (copy > 0) {
 		if (copy > len)
@@ -3445,6 +3476,7 @@ void *skb_pull_rcsum(struct sk_buff *skb, unsigned int len)
 	BUG_ON(len > skb->len);
 	__skb_pull(skb, len);
 	skb_postpull_rcsum(skb, data, len);
+	lazy_clear_cpu_interrupt();
 	return skb->data;
 }
 EXPORT_SYMBOL_GPL(skb_pull_rcsum);
Signature · 1 line
2.17.2
author
#30 lore raw

PATCH v6 24/43 MDSv6

In reply to Andi Kleen

Some block drivers do kmap_atomic to access user data in interrupts. Add lazy_clear_cpu_interrupt to kmap_atomic to avoid having to patch these drivers.

---
 arch/x86/mm/highmem_32.c | 3 +++
 include/linux/highmem.h  | 2 ++
 2 files changed, 5 insertions(+)
arch/x86/mm/highmem_32.c +3 -0
index 0d4bdcb84da5..1a0898fa29a9 100644
@@ -2,6 +2,7 @@
 #include <linux/export.h>
 #include <linux/swap.h> /* for totalram_pages */
 #include <linux/memblock.h>
+#include <linux/clearcpu.h>
 
 void *kmap(struct page *page)
 {
@@ -38,6 +39,8 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
 	preempt_disable();
 	pagefault_disable();
 
+	lazy_clear_cpu_interrupt();
+
 	if (!PageHighMem(page))
 		return page_address(page);
 
include/linux/highmem.h +2 -0
index ea5cdbd8c2c3..6dd4a719b0c7 100644
@@ -8,6 +8,7 @@
 #include <linux/mm.h>
 #include <linux/uaccess.h>
 #include <linux/hardirq.h>
+#include <linux/clearcpu.h>
 
 #include <asm/cacheflush.h>
 
@@ -92,6 +93,7 @@ static inline void *kmap_atomic(struct page *page)
 {
 	preempt_disable();
 	pagefault_disable();
+	lazy_clear_cpu_interrupt();
 	return page_address(page);
 }
 #define kmap_atomic_prot(page, prot)	kmap_atomic(page)
Signature · 1 line
2.17.2
author
#31 lore raw

PATCH v6 25/43 MDSv6

In reply to Andi Kleen

BPF allows the user to run untrusted code in the kernel.

Normally MDS would allow some information leakage either from other processes or sensitive kernel code to the user controlled BPF code. We cannot rule out that BPF code contains an MDS exploit and it is difficult to pattern match gadgets.

The patch aims to add limited number of clear cpus before BPF executions to guarantee EBPF executions cannot leak data.

Assume BPF execution does not touch other user's data, so does not need to schedule a clear for itself.

For EBPF programs loaded privileged (by root) we never clear, because we already assume they are trusted.

When the BPF program was loaded unprivileged clear the CPU before the BPF execution, depending on the context it is running in:

We only do this when running in an interrupt, or if an clear cpu is already scheduled (which means for example there was a context switch, or crypto operation before)

In process context we check if the current process context has the same userns+euid as the process who created the BPF.

This handles the common seccomp filter case without
any extra clears, but still adds clears when e.g. a socket filter runs on a socket inherited to a process with different user id. It also handles various other common cases.

Technically we would only need to do this if the BPF program contains conditional branches and loads dominated by them, but let's assume that near all do.

For example for running chromium with seccomp filters I see only 15-18% of all sandbox system calls have a clear, most are likely caused by context switches

Unprivileged EBPF usages in interrupts currently always clear.

This could be further optimized by allowing callers that do a lot of individual BPF runs and are sure they don't touch other user's data (that is not accessible to the EBPF anyways) inbetween to do the clear only once at the beginning. We can add such optimizations later based on profile data.

---
 arch/x86/include/asm/clearbpf.h | 29 +++++++++++++++++++++++++++++
 include/linux/filter.h          | 21 +++++++++++++++++++--
 kernel/bpf/core.c               |  2 ++
 kernel/bpf/cpumap.c             |  3 +++
 4 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/include/asm/clearbpf.h
arch/x86/include/asm/clearbpf.h new file +29 -0
new file mode 100644
index 000000000000..3da885e4eb29
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_CLEARBPF_H
+#define _ASM_CLEARBPF_H 1
+
+#include <linux/clearcpu.h>
+#include <linux/cred.h>
+#include <asm/cpufeatures.h>
+
+/*
+ * When the BPF program was loaded unprivileged, clear the CPU
+ * to prevent any exploits written in BPF using side channels to read
+ * data leaked from other kernel code. In some cases, like
+ * process context with the same uid, we can avoid it.
+ *
+ * See Documentation/clearcpu.txt for more details.
+ */
+static inline void arch_bpf_prepare_nonpriv(kuid_t uid)
+{
+	if (!static_cpu_has(X86_BUG_MDS))
+		return;
+	if (in_interrupt() ||
+	    __this_cpu_read(clear_cpu_flag) ||
+	    !uid_eq(current_euid(), uid)) {
+		clear_cpu();
+		__this_cpu_write(clear_cpu_flag, 0);
+	}
+}
+
+#endif
include/linux/filter.h +19 -2
index e532fcc6e4b5..2c7f62f8047a 100644
@@ -20,12 +20,21 @@
 #include <linux/set_memory.h>
 #include <linux/kallsyms.h>
 #include <linux/if_vlan.h>
+#include <linux/clearcpu.h>
 
 #include <net/sch_generic.h>
 
 #include <uapi/linux/filter.h>
 #include <uapi/linux/bpf.h>
 
+#ifdef CONFIG_ARCH_HAS_CLEAR_CPU
+#include <asm/clearbpf.h>
+#else
+static inline void arch_bpf_prepare_nonpriv(kuid_t uid)
+{
+}
+#endif
+
 struct sk_buff;
 struct sock;
 struct seccomp_data;
@@ -490,7 +499,9 @@ struct bpf_prog {
 				blinded:1,	/* Was blinded */
 				is_func:1,	/* program is a bpf function */
 				kprobe_override:1, /* Do we override a kprobe? */
-				has_callchain_buf:1; /* callchain buffer allocated? */
+				has_callchain_buf:1, /* callchain buffer allocated? */
+				priv:1;		/* Was loaded privileged */
+	kuid_t			uid;		/* Original uid who created it */
 	enum bpf_prog_type	type;		/* Type of BPF program */
 	enum bpf_attach_type	expected_attach_type; /* For some prog types */
 	u32			len;		/* Number of filter blocks */
@@ -513,7 +524,13 @@ struct sk_filter {
 	struct bpf_prog	*prog;
 };
 
-#define BPF_PROG_RUN(filter, ctx)  (*(filter)->bpf_func)(ctx, (filter)->insnsi)
+static inline unsigned _bpf_prog_run(const struct bpf_prog *bp, const void *ctx)
+{
+	if (!bp->priv)
+		arch_bpf_prepare_nonpriv(bp->uid);
+	return bp->bpf_func(ctx, bp->insnsi);
+}
+#define BPF_PROG_RUN(filter, ctx) _bpf_prog_run(filter, ctx)
 
 #define BPF_SKB_CB_LEN QDISC_CB_PRIV_LEN
 
kernel/bpf/core.c +2 -0
index f908b9356025..67d845229d46 100644
@@ -99,6 +99,8 @@ struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags)
 	fp->aux = aux;
 	fp->aux->prog = fp;
 	fp->jit_requested = ebpf_jit_enabled();
+	fp->priv = !!capable(CAP_SYS_ADMIN);
+	fp->uid = current_euid();
 
 	INIT_LIST_HEAD_RCU(&fp->aux->ksym_lnode);
 
kernel/bpf/cpumap.c +3 -0
index 8974b3755670..a5c9764168f9 100644
@@ -376,6 +376,9 @@ static void __cpu_map_entry_free(struct rcu_head *rcu)
 
 		/* No concurrent bq_enqueue can run at this point */
 		bq_flush_to_queue(rcpu, bq, false);
+
+		/* Do lazy_clear_cpu_interrupt here? */
+
 	}
 	free_percpu(rcpu->bulkq);
 	/* Cannot kthread_stop() here, last put free rcpu resources */
Signature · 1 line
2.17.2
author
#32 lore raw

PATCH v6 26/43 MDSv6

In reply to Andi Kleen

Whenever a driver isr touches memory that is likely to go to some user mode process, there is a slight risk of a speculative exploit leaking the last read or write to an attacker. This patch adds a call to set the flag to clear the exploitable buffer upon return to user mode to handle drivers using scatter gather DMA processing from their ISR.

---
 lib/scatterlist.c | 2 ++
 1 file changed, 2 insertions(+)
lib/scatterlist.c +2 -0
index 9ba349e775ef..8fdcf78efcbe 100644
@@ -11,6 +11,7 @@
 #include <linux/scatterlist.h>
 #include <linux/highmem.h>
 #include <linux/kmemleak.h>
+#include <linux/clearcpu.h>
 
 /**
  * sg_next - return the next scatterlist entry in a list
@@ -831,6 +832,7 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
 
 		offset += len;
 	}
+	lazy_clear_cpu_interrupt();
 
 	sg_miter_stop(&miter);
 
Signature · 1 line
2.17.2
author
#33 lore raw

PATCH v6 27/43 MDSv6

In reply to Andi Kleen

Add lazy_clear_cpu_interrupt() in sound core functions that are generally associated with touching user data in interrupt handlers. We consider all actual sound data as user data.

---
 sound/core/pcm_lib.c | 3 +++
 sound/core/rawmidi.c | 3 +++
 sound/core/timer.c   | 3 +++
 3 files changed, 9 insertions(+)
sound/core/pcm_lib.c +3 -0
index 6c0b30391ba9..d05599a8c660 100644
@@ -25,6 +25,7 @@
 #include <linux/time.h>
 #include <linux/math64.h>
 #include <linux/export.h>
+#include <linux/clearcpu.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/tlv.h>
@@ -1801,6 +1802,8 @@ void snd_pcm_period_elapsed(struct snd_pcm_substream *substream)
 		return;
 	runtime = substream->runtime;
 
+	lazy_clear_cpu();
+
 	snd_pcm_stream_lock_irqsave(substream, flags);
 	if (!snd_pcm_running(substream) ||
 	    snd_pcm_update_hw_ptr0(substream, 1) < 0)
sound/core/rawmidi.c +3 -0
index ee601d7f0926..5edd3f0eb114 100644
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/mm.h>
+#include <linux/clearcpu.h>
 #include <sound/rawmidi.h>
 #include <sound/info.h>
 #include <sound/control.h>
@@ -946,6 +947,7 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
 			wake_up(&runtime->sleep);
 	}
 	spin_unlock_irqrestore(&runtime->lock, flags);
+	lazy_clear_cpu();
 	return result;
 }
 EXPORT_SYMBOL(snd_rawmidi_receive);
@@ -1232,6 +1234,7 @@ int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
 			result = __snd_rawmidi_transmit_ack(substream, count);
 	}
 	spin_unlock_irqrestore(&runtime->lock, flags);
+	lazy_clear_cpu();
 	return result;
 }
 EXPORT_SYMBOL(snd_rawmidi_transmit);
sound/core/timer.c +3 -0
index 61a0cec6e1f6..c8a39813f609 100644
@@ -27,6 +27,7 @@
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/string.h>
+#include <linux/clearcpu.h>
 #include <linux/sched/signal.h>
 #include <sound/core.h>
 #include <sound/timer.h>
@@ -863,6 +864,8 @@ void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
 
 	if (use_tasklet)
 		tasklet_schedule(&timer->task_queue);
+
+	lazy_clear_cpu();
 }
 EXPORT_SYMBOL(snd_timer_interrupt);
 
Signature · 1 line
2.17.2
author
#34 lore raw

PATCH v6 28/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Make MPU401 interrupts clear cpu

A lot of mpu401 based sound cards use PIO or copying. Make the common interrupt handler schedule a CPU clear.

---
 sound/drivers/mpu401/mpu401_uart.c | 2 ++
 1 file changed, 2 insertions(+)
sound/drivers/mpu401/mpu401_uart.c +2 -0
index dae26e856b26..85610cdcde9f 100644
@@ -36,6 +36,7 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/errno.h>
+#include <linux/clearcpu.h>
 #include <sound/core.h>
 #include <sound/mpu401.h>
 
@@ -139,6 +140,7 @@ irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id)
 	if (!mpu)
 		return IRQ_NONE;
 	_snd_mpu401_uart_interrupt(mpu);
+	lazy_clear_cpu();
 	return IRQ_HANDLED;
 }
 
Signature · 1 line
2.17.2
author
#35 lore raw

PATCH v6 29/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Clear cpu on processing input layer data

Schedule a clear cpu if input layer data is processed from an interrupt or timer. User key presses and mouse data is considered sensitive. We patch some strategic places in the input subsystem
to avoid touching a lot of drivers.

---
 drivers/input/input.c       | 3 +++
 drivers/input/serio/serio.c | 3 +++
 2 files changed, 6 insertions(+)
drivers/input/input.c +3 -0
index 3304aaaffe87..c22e8e167025 100644
@@ -27,6 +27,7 @@
 #include <linux/device.h>
 #include <linux/mutex.h>
 #include <linux/rcupdate.h>
+#include <linux/clearcpu.h>
 #include "input-compat.h"
 
 MODULE_AUTHOR("Vojtech Pavlik <[email protected]>");
@@ -436,6 +437,7 @@ void input_event(struct input_dev *dev,
 		input_handle_event(dev, type, code, value);
 		spin_unlock_irqrestore(&dev->event_lock, flags);
 	}
+	lazy_clear_cpu_interrupt();
 }
 EXPORT_SYMBOL(input_event);
 
@@ -468,6 +470,7 @@ void input_inject_event(struct input_handle *handle,
 
 		spin_unlock_irqrestore(&dev->event_lock, flags);
 	}
+	lazy_clear_cpu_interrupt();
 }
 EXPORT_SYMBOL(input_inject_event);
 
drivers/input/serio/serio.c +3 -0
index 2e1fb0649260..9b3af41dc05b 100644
@@ -32,6 +32,7 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 #include <linux/mutex.h>
+#include <linux/clearcpu.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <[email protected]>");
 MODULE_DESCRIPTION("Serio abstraction core");
@@ -1017,6 +1018,8 @@ irqreturn_t serio_interrupt(struct serio *serio,
 		ret = IRQ_HANDLED;
 	}
 
+	lazy_clear_cpu_interrupt();
+
 	spin_unlock_irqrestore(&serio->lock, flags);
 
 	return ret;
Signature · 1 line
2.17.2
author
#36 lore raw

PATCH v6 30/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Clear cpu for tty input

Schedule a clear cpu when input data is passed to the tty layer in a interrupt. We consider tty data sensitive. This avoids patching lots of serial drivers.

---
 drivers/tty/tty_buffer.c | 5 ++++-
 include/linux/tty_flip.h | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/tty/tty_buffer.c +4 -1
index 77070c2d1240..71f6dd698968 100644
@@ -17,6 +17,7 @@
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/ratelimit.h>
+#include <linux/clearcpu.h>
 
 
 #define MIN_TTYB_SIZE	256
@@ -328,6 +329,7 @@ int tty_insert_flip_string_fixed_flag(struct tty_port *port,
 		/* There is a small chance that we need to split the data over
 		   several buffers. If this is the case we must loop */
 	} while (unlikely(size > copied));
+	lazy_clear_cpu_interrupt();
 	return copied;
 }
 EXPORT_SYMBOL(tty_insert_flip_string_fixed_flag);
@@ -363,6 +365,7 @@ int tty_insert_flip_string_flags(struct tty_port *port,
 		/* There is a small chance that we need to split the data over
 		   several buffers. If this is the case we must loop */
 	} while (unlikely(size > copied));
+	lazy_clear_cpu_interrupt();
 	return copied;
 }
 EXPORT_SYMBOL(tty_insert_flip_string_flags);
@@ -388,7 +391,7 @@ int __tty_insert_flip_char(struct tty_port *port, unsigned char ch, char flag)
 	if (~tb->flags & TTYB_NORMAL)
 		*flag_buf_ptr(tb, tb->used) = flag;
 	*char_buf_ptr(tb, tb->used++) = ch;
-
+	lazy_clear_cpu_interrupt();
 	return 1;
 }
 EXPORT_SYMBOL(__tty_insert_flip_char);
include/linux/tty_flip.h +4 -0
index 767f62086bd9..41ae39e339b9 100644
@@ -2,6 +2,8 @@
 #ifndef _LINUX_TTY_FLIP_H
 #define _LINUX_TTY_FLIP_H
 
+#include <linux/clearcpu.h>
+
 extern int tty_buffer_set_limit(struct tty_port *port, int limit);
 extern int tty_buffer_space_avail(struct tty_port *port);
 extern int tty_buffer_request_room(struct tty_port *port, size_t size);
@@ -21,6 +23,8 @@ static inline int tty_insert_flip_char(struct tty_port *port,
 	struct tty_buffer *tb = port->buf.tail;
 	int change;
 
+	lazy_clear_cpu_interrupt();
+
 	change = (tb->flags & TTYB_NORMAL) && (flag != TTY_NORMAL);
 	if (!change && tb->used < tb->size) {
 		if (~tb->flags & TTYB_NORMAL)
Signature · 1 line
2.17.2
author
#37 lore raw

PATCH v6 31/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Clear cpu for usbmon intercepts

usbmon touches user data in interrupts that otherwise don't touch user data. Automatically schedule a clear cpu if usbmon is called from an interrupt.

---
 include/linux/usb/hcd.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/linux/usb/hcd.h +4 -1
index 7dc3a411bece..7f37056fe973 100644
@@ -25,6 +25,7 @@
 #include <linux/rwsem.h>
 #include <linux/interrupt.h>
 #include <linux/idr.h>
+#include <linux/clearcpu.h>
 
 #define MAX_TOPO_LEVEL		6
 
@@ -688,8 +689,10 @@ static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
 static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
 		int status)
 {
-	if (bus->monitored)
+	if (bus->monitored) {
 		(*mon_ops->urb_complete)(bus, urb, status);
+		lazy_clear_cpu_interrupt();
+	}
 }
 
 int usb_mon_register(const struct usb_mon_operations *ops);
Signature · 1 line
2.17.2
maintainer
#38 lore raw
Quoted 6 lines · speck for Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Clear cpu for usbmon intercepts

usbmon touches user data in interrupts that otherwise don't touch user data. Automatically schedule a clear cpu if usbmon is called from an interrupt.

I have written a long and very satisfying rant about this patch, that I than deleted, as it made me feel very better, but probably would not have helped anyone else out.

In turn, I need you to properly justify this patch as these two tiny sentences, and this small patch make no sense to me at all. Please explain _WHY_ this is needed in this specific location. Before responding, I would strongly recommend reading up on exactly what usbmon is and who is allowed to use it. If after doing that, you still feel this patch is needed (and it might be, I still can not tell for sure), please reply with enough detail that anyone who does not know what usbmon is, or what mds really is, can understand why this patch is needed.

thanks,

greg k-h

#39 lore raw
Quoted 12 lines · speck for Greg KH
Quoted 6 lines · speck for Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Clear cpu for usbmon intercepts

usbmon touches user data in interrupts that otherwise don't touch user data. Automatically schedule a clear cpu if usbmon is called from an interrupt.

I have written a long and very satisfying rant about this patch, that I than deleted, as it made me feel very better, but probably would not have helped anyone else out.

Quoted 5 lines

In turn, I need you to properly justify this patch as these two tiny sentences, and this small patch make no sense to me at all. Please explain _WHY_ this is needed in this specific location. Before responding, I would strongly recommend reading up on exactly what usbmon is and who is allowed to use it. If after doing that, you still feel

Right it's root only.

But this is not about leaking data to the root monitoring user (who can see the data anyways), but to unrelated processes which are not root, but happen to be interrupted by the USB interrupt.

Quoted 1 line

this patch is needed (and it might be, I still can not tell for sure),

Anything that touches user data in an interrupt needs to be marked with the lazy approach.

I can write more on this instance.

However I will probably not be able to write a detailed description for each of the interrupt handlers changed because there are just too many.

-Andi

maintainer
#40 lore raw
Quoted 19 lines · speck for Andi Kleen
Quoted 12 lines · speck for Greg KH
Quoted 6 lines · speck for Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Clear cpu for usbmon intercepts

usbmon touches user data in interrupts that otherwise don't touch user data. Automatically schedule a clear cpu if usbmon is called from an interrupt.

I have written a long and very satisfying rant about this patch, that I than deleted, as it made me feel very better, but probably would not have helped anyone else out.

Quoted 5 lines

In turn, I need you to properly justify this patch as these two tiny sentences, and this small patch make no sense to me at all. Please explain _WHY_ this is needed in this specific location. Before responding, I would strongly recommend reading up on exactly what usbmon is and who is allowed to use it. If after doing that, you still feel

Quoted 6 lines

Right it's root only.

But this is not about leaking data to the root monitoring user (who can see the data anyways), but to unrelated processes which are not root, but happen to be interrupted by the USB interrupt.

Then why are you messing around with the usbmon callback? It has nothing to do with anything here. By hooking it here, you now have 2 calls to this function on the USB urb callback path.

The fact that a root process happens to be watching the USB data flowing through the system, or not, should have no affect on anything here, as the data flow is still the same (with the exception an extra copy in the irq could happen). Does multiple copys matter or not? I can't find anything in the documentation we have about this, am I missing it?

Quoted 4 lines
Quoted 1 line

this patch is needed (and it might be, I still can not tell for sure),

Anything that touches user data in an interrupt needs to be marked with the lazy approach.

As I asked with the hcd change, what is "user data"?

Quoted 1 line

I can write more on this instance.

I nicely asked for that in the past but was ignored twice. Do I need to ask for it again in a non-nice manner?

Without that information, this patchset is pretty impossible to review.

Quoted 3 lines

However I will probably not be able to write a detailed description for each of the interrupt handlers changed because there are just too many.

Then how do you expect each subsystem / driver author to know if this is an acceptable change or not? How do you expect to educate driver authors to have them determine if they need to do this on their new drivers or not? Are you going to hand-audit each new driver that gets added to the kernel for forever?

Without this type of information, this seems like a futile exercise.

greg k-h

#41 lore raw

[MODERATED] Encrypted Message

From: Jon Masters <[email protected]>
To: speck for Greg KH <[email protected]>
Subject: Re: [PATCH v6 31/43] MDSv6

Quoted 7 lines · speck for Greg KH
Quoted 3 lines · speck for Andi Kleen

However I will probably not be able to write a detailed description for each of the interrupt handlers changed because there are just too many.

Quoted 7 lines

Then how do you expect each subsystem / driver author to know if this is an acceptable change or not? How do you expect to educate driver authors to have them determine if they need to do this on their new drivers or not? Are you going to hand-audit each new driver that gets added to the kernel for forever?

Without this type of information, this seems like a futile exercise.

Forgive me if I'm being too cautious here, but it seems to make most sense to have the basic MDS infrastructure in place at unembargo. Unless it's very clear how the auto stuff can be safe, and the audit comprehensive, I wonder if that shouldn't just be done after.

Jon.

Signature · 1 line
Computer Architect | Sent with my Fedora powered laptop
maintainer
#42 lore raw

[MODERATED] Re: Encrypted Message

Quoted 18 lines · speck for Jon Masters

From: Jon Masters <[email protected]>
To: speck for Greg KH <[email protected]>
Subject: Re: [PATCH v6 31/43] MDSv6

Quoted 13 lines · speck for Greg KH
Quoted 3 lines · speck for Andi Kleen

However I will probably not be able to write a detailed description for each of the interrupt handlers changed because there are just too many.

Then how do you expect each subsystem / driver author to know if this is an acceptable change or not? How do you expect to educate driver authors to have them determine if they need to do this on their new drivers or not? Are you going to hand-audit each new driver that gets added to the kernel for forever?

Quoted 6 lines
Quoted 1 line

Without this type of information, this seems like a futile exercise.

Forgive me if I'm being too cautious here, but it seems to make most sense to have the basic MDS infrastructure in place at unembargo. Unless it's very clear how the auto stuff can be safe, and the audit comprehensive, I wonder if that shouldn't just be done after.

I thought that was what Thomas's patchset provided and is what was alluded to in patch 00/43 of this series.

greg k-h

#43 lore raw

[MODERATED] Encrypted Message

From: Jon Masters <[email protected]>
To: speck for Greg KH <[email protected]>
Subject: Re: Encrypted Message

Quoted 21 lines · speck for Greg KH
Quoted 20 lines · speck for Jon Masters

From: Jon Masters <[email protected]>
To: speck for Greg KH <[email protected]>
Subject: Re: [PATCH v6 31/43] MDSv6

Quoted 14 lines · speck for Greg KH
Quoted 3 lines · speck for Andi Kleen

However I will probably not be able to write a detailed description for each of the interrupt handlers changed because there are just too many.

Then how do you expect each subsystem / driver author to know if this is an acceptable change or not? How do you expect to educate driver authors to have them determine if they need to do this on their new drivers or not? Are you going to hand-audit each new driver that gets added to the kernel for forever?

Without this type of information, this seems like a futile exercise.

Quoted 7 lines
Quoted 4 lines

Forgive me if I'm being too cautious here, but it seems to make most sense to have the basic MDS infrastructure in place at unembargo. Unless it's very clear how the auto stuff can be safe, and the audit comprehensive, I wonder if that shouldn't just be done after.

I thought that was what Thomas's patchset provided and is what was alluded to in patch 00/43 of this series.

Indeed. I'm asking whether we're trying to figure out the "auto" stuff as well before unembargo or is the other discussion just for planning?

Jon.

Signature · 1 line
Computer Architect | Sent with my Fedora powered laptop
#44 lore raw
In reply to Greg KH
Quoted 3 lines

Then why are you messing around with the usbmon callback? It has nothing to do with anything here. By hooking it here, you now have 2 calls to this function on the USB urb callback path.

Ok so where should it be hooked instead?

Quoted 4 lines

The fact that a root process happens to be watching the USB data flowing through the system, or not, should have no affect on anything here, as the data flow is still the same (with the exception an extra copy in the irq could happen).

My impression was that the usbmon copy is the only copy in interrupt context? Was that wrong? If there's another copy in interrupt context yes it would need to be instrumented too.

Quoted 1 line

As I asked with the hcd change, what is "user data"?

Here's the latest definition from clearcpu.txt

In this case I assume it includes non header data, so would need to be protected.

User data is sensitive, but only for other processes.

User data is anything in the user address space, or data buffers directly copied from/to the user (e.g. read/write). It does not include metadata, or flag settings. For example packet headers or file names are not sensitive in this model.

Block IO data (but not meta data) is sensitive.

We consider data from input devices (such as key presses) sensitive. We also consider sound data or terminal data sensitive.

-Andi

#45 lore raw
In reply to Greg KH
Quoted 37 lines · speck for Greg KH
Quoted 19 lines · speck for Andi Kleen
Quoted 12 lines · speck for Greg KH
Quoted 6 lines · speck for Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Clear cpu for usbmon intercepts

usbmon touches user data in interrupts that otherwise don't touch user data. Automatically schedule a clear cpu if usbmon is called from an interrupt.

I have written a long and very satisfying rant about this patch, that I than deleted, as it made me feel very better, but probably would not have helped anyone else out.

Quoted 5 lines

In turn, I need you to properly justify this patch as these two tiny sentences, and this small patch make no sense to me at all. Please explain _WHY_ this is needed in this specific location. Before responding, I would strongly recommend reading up on exactly what usbmon is and who is allowed to use it. If after doing that, you still feel

Quoted 6 lines

Right it's root only.

But this is not about leaking data to the root monitoring user (who can see the data anyways), but to unrelated processes which are not root, but happen to be interrupted by the USB interrupt.

Then why are you messing around with the usbmon callback? It has nothing to do with anything here. By hooking it here, you now have 2 calls to this function on the USB urb callback path.

The fact that a root process happens to be watching the USB data flowing through the system, or not, should have no affect on anything here, as the data flow is still the same (with the exception an extra copy in the irq could happen). Does multiple copys matter or not? I can't find anything in the documentation we have about this, am I missing it?

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

this patch is needed (and it might be, I still can not tell for sure),

Anything that touches user data in an interrupt needs to be marked with the lazy approach.

As I asked with the hcd change, what is "user data"?

FWIW when I started my review of the SCSI drivers (which I'm not super confident about) I was looking for anthing that copied non-meta data that could land in a cache line on all possible code paths while in interrupt context.

My understanding of MDS (which might not be as correct as others) is that the internal uArch buffers (fill, load, store) used when populating the cache lines can leak stale data to a attacking process doing a "sampling" looking for interesting data patterns. Such as secret key's or something. The attacker will need to be lucky and gather data over time but, over time some data could be useful.

Quoted 11 lines
Quoted 1 line

I can write more on this instance.

I nicely asked for that in the past but was ignored twice. Do I need to ask for it again in a non-nice manner?

Without that information, this patchset is pretty impossible to review.

Quoted 3 lines

However I will probably not be able to write a detailed description for each of the interrupt handlers changed because there are just too many.

Quoted 5 lines

Then how do you expect each subsystem / driver author to know if this is an acceptable change or not? How do you expect to educate driver authors to have them determine if they need to do this on their new drivers or not? Are you going to hand-audit each new driver that gets added to the kernel for forever?

Athough Andi's patch does include some Documentation changes that help explain what a driver author needs to look out for I think this approach will be hard to sustain (and backport).

--mark

Quoted 3 lines

Without this type of information, this seems like a futile exercise.

greg k-h

#46 lore raw
In reply to Greg KH

Sorry didn't answer the second part of the message.

Quoted 7 lines · speck for Greg KH
Quoted 4 lines

However I will probably not be able to write a detailed description for each of the interrupt handlers changed because there are just too many.

Then how do you expect each subsystem / driver author to know if this is an acceptable change or not? How do you expect to educate driver

They will need to read clearcpu.txt at some point. They will need to do that anyways to learn what they need to know for future code reviews.

If there's something missing in that file please point it out and I'll try to address it.

In theory we could duplicate clearcpu.txt into every patch, but I don't that would be a good approach

I can perhaps add some standard disclaimer as in "Please see Documentation/clearcpu.txt for more details"

Quoted 3 lines

authors to have them determine if they need to do this on their new drivers or not? Are you going to hand-audit each new driver that gets added to the kernel for forever?

Yes ongoing audit is needed. See 00/00.
That's the drawback of "really lazy".

The earlier "opt in" patch kits didn't need that, but Linus didn't like it.

-Andi

author
#47 lore raw

PATCH v6 32/43 MDSv6

In reply to Andi Kleen

Xen has its own call back system that multiplexes a single interrupt.

Most Xen handlers do not touch user data, but a few non performance critical ones do. Add explicit clearing to those. The fast paths for block and network IO are not impacted.

---
 drivers/input/misc/xen-kbdfront.c | 3 ++-
 drivers/video/fbdev/xen-fbfront.c | 2 ++
 drivers/xen/pvcalls-front.c       | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)
drivers/input/misc/xen-kbdfront.c +2 -1
index 24bc5c5d876f..e7cf4fffcc8b 100644
@@ -19,6 +19,7 @@
 #include <linux/input.h>
 #include <linux/input/mt.h>
 #include <linux/slab.h>
+#include <linux/clearcpu.h>
 
 #include <asm/xen/hypervisor.h>
 
@@ -193,7 +194,7 @@ static irqreturn_t input_handler(int rq, void *dev_id)
 	mb();			/* ensure we got ring contents */
 	page->in_cons = cons;
 	notify_remote_via_irq(info->irq);
-
+	lazy_clear_cpu();
 	return IRQ_HANDLED;
 }
 
drivers/video/fbdev/xen-fbfront.c +2 -0
index 6a4bbc9e1fb0..55c4cefd6a24 100644
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
+#include <linux/clearcpu.h>
 
 #include <asm/xen/hypervisor.h>
 
@@ -358,6 +359,7 @@ static irqreturn_t xenfb_event_handler(int rq, void *dev_id)
 	/* Flush dirty rectangle: */
 	xenfb_refresh(info, INT_MAX, INT_MAX, -INT_MAX, -INT_MAX);
 
+	lazy_clear_cpu();
 	return IRQ_HANDLED;
 }
 
drivers/xen/pvcalls-front.c +2 -0
index 8a249c95c193..e01eb88cddfd 100644
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/net.h>
 #include <linux/socket.h>
+#include <linux/clearcpu.h>
 
 #include <net/sock.h>
 
@@ -219,6 +220,7 @@ static irqreturn_t pvcalls_front_event_handler(int irq, void *dev_id)
 			 */
 			smp_wmb();
 			bedata->rsp[req_id].req_id = req_id;
+			lazy_clear_cpu();
 		}
 
 		done = 1;
Signature · 1 line
2.17.2
author
#48 lore raw

PATCH v6 33/43 MDSv6

In reply to Andi Kleen

For DVB we consider image data sensitive.

Most DVB drivers do not touch user data in interrupts / timers, but when the software filter is active it might. Schedule a clear cpu from the filter code.

---
 drivers/media/dvb-core/dvb_demux.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/dvb-core/dvb_demux.c +3 -0
index 39a2c6ccf31d..7f0d847ca501 100644
@@ -28,6 +28,7 @@
 #include <linux/string.h>
 #include <linux/crc32.h>
 #include <linux/uaccess.h>
+#include <linux/clearcpu.h>
 #include <asm/div64.h>
 
 #include <media/dvb_demux.h>
@@ -515,6 +516,8 @@ void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf,
 	}
 
 	spin_unlock_irqrestore(&demux->lock, flags);
+
+	lazy_clear_cpu_interrupt();
 }
 
 EXPORT_SYMBOL(dvb_dmx_swfilter_packets);
Signature · 1 line
2.17.2
author
#49 lore raw

PATCH v6 34/43 MDSv6

In reply to Andi Kleen

These interrupts are all complicated, and should be not performance critical, so mark them to clear the CPU.

---
 drivers/gpu/drm/drm_irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_irq.c +2 -1
index 45a07652fa00..e075c3fdb81a 100644
@@ -128,7 +128,8 @@ int drm_irq_install(struct drm_device *dev, int irq)
 		sh_flags = IRQF_SHARED;
 
 	ret = request_irq(irq, dev->driver->irq_handler,
-			  sh_flags, dev->driver->name, dev);
+			  sh_flags | IRQF_USER_DATA,
+			  dev->driver->name, dev);
 
 	if (ret < 0) {
 		dev->irq_enabled = false;
Signature · 1 line
2.17.2
author
#50 lore raw

PATCH v6 35/43 MDSv6

In reply to Andi Kleen

Old style IDE drivers sometimes do PIO, and are really slow anyways, so default them all the clear the CPU.

---
 drivers/ide/ide-probe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ide/ide-probe.c +2 -1
index 5aeaca24a28f..17e9f447472c 100644
@@ -881,7 +881,8 @@ static int init_irq (ide_hwif_t *hwif)
 		irq_handler = ide_intr;
 
 	if (!host->get_lock)
-		if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
+		if (request_irq(hwif->irq, irq_handler, sa | IRQF_USER_DATA,
+					hwif->name, hwif))
 			goto out_up;
 
 #if !defined(__mc68000__)
Signature · 1 line
2.17.2
author
#51 lore raw

PATCH v6 36/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Make Amazon ena driver management
interrupt clear cpu

Most of the Amazon ena interrupt handlers do not touch user data, but the management interrupt does complicated things and should not be performance critical. Mark the management interrupt only as clear cpu. This needs some minor changes to the table driven interrupt setup.

---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 +++--
 drivers/net/ethernet/amazon/ena/ena_netdev.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +3 -2
index a6eacf2099c3..b13611a203c6 100644
@@ -1357,6 +1357,7 @@ static void ena_setup_mgmnt_intr(struct ena_adapter *adapter)
 	snprintf(adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].name,
 		 ENA_IRQNAME_SIZE, "ena-mgmnt@pci:%s",
 		 pci_name(adapter->pdev));
+	adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].flags = IRQF_USER_DATA;
 	adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].handler =
 		ena_intr_msix_mgmnt;
 	adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].data = adapter;
@@ -1381,6 +1382,7 @@ static void ena_setup_io_intr(struct ena_adapter *adapter)
 
 		snprintf(adapter->irq_tbl[irq_idx].name, ENA_IRQNAME_SIZE,
 			 "%s-Tx-Rx-%d", netdev->name, i);
+		adapter->irq_tbl[irq_idx].flags = 0;
 		adapter->irq_tbl[irq_idx].handler = ena_intr_msix_io;
 		adapter->irq_tbl[irq_idx].data = &adapter->ena_napi[i];
 		adapter->irq_tbl[irq_idx].vector =
@@ -1394,12 +1396,11 @@ static void ena_setup_io_intr(struct ena_adapter *adapter)
 
 static int ena_request_mgmnt_irq(struct ena_adapter *adapter)
 {
-	unsigned long flags = 0;
 	struct ena_irq *irq;
 	int rc;
 
 	irq = &adapter->irq_tbl[ENA_MGMNT_IRQ_IDX];
-	rc = request_irq(irq->vector, irq->handler, flags, irq->name,
+	rc = request_irq(irq->vector, irq->handler, irq->flags, irq->name,
 			 irq->data);
 	if (rc) {
 		netif_err(adapter, probe, adapter->netdev,
drivers/net/ethernet/amazon/ena/ena_netdev.h +1 -0
index 63870072cbbd..8e8394553dc7 100644
@@ -140,6 +140,7 @@
 
 struct ena_irq {
 	irq_handler_t handler;
+	unsigned flags;
 	void *data;
 	int cpu;
 	u32 vector;
Signature · 1 line
2.17.2
author
#52 lore raw

PATCH v6 37/43 MDSv6

In reply to Andi Kleen

PCMCIA devices are usually slow, and sometimes do PIO, so mark them all as clearing the cpu.

---
 drivers/pcmcia/pcmcia_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pcmcia/pcmcia_resource.c +1 -1
index 41ce410f7f97..99a778b022e5 100644
@@ -702,7 +702,7 @@ int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
 	if (!p_dev->irq)
 		return -EINVAL;
 
-	ret = request_irq(p_dev->irq, handler, IRQF_SHARED,
+	ret = request_irq(p_dev->irq, handler, IRQF_SHARED | IRQF_USER_DATA,
 			p_dev->devname, p_dev->priv);
 	if (!ret)
 		p_dev->_irq = 1;
Signature · 1 line
2.17.2
author
#53 lore raw

PATCH v6 38/43 MDSv6

In reply to Andi Kleen

The comedi drivers have a lot of interrupt handlers, many of them touching user data in some form. But they all use common library functions, so we can schedule a CPU clear in them.

---
 drivers/staging/comedi/comedi_buf.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/staging/comedi/comedi_buf.c +5 -0
index f693c2c0bec3..a1e94386f940 100644
@@ -9,6 +9,7 @@
 
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
+#include <linux/clearcpu.h>
 
 #include "comedidev.h"
 #include "comedi_internal.h"
@@ -597,6 +598,8 @@ unsigned int comedi_buf_write_samples(struct comedi_subdevice *s,
 	comedi_inc_scan_progress(s, nbytes);
 	s->async->events |= COMEDI_CB_BLOCK;
 
+	lazy_clear_cpu_interrupt();
+
 	return nbytes;
 }
 EXPORT_SYMBOL_GPL(comedi_buf_write_samples);
@@ -637,6 +640,8 @@ unsigned int comedi_buf_read_samples(struct comedi_subdevice *s,
 	comedi_inc_scan_progress(s, nbytes);
 	s->async->events |= COMEDI_CB_BLOCK;
 
+	lazy_clear_cpu_interrupt();
+
 	return nbytes;
 }
 EXPORT_SYMBOL_GPL(comedi_buf_read_samples);
Signature · 1 line
2.17.2
author
#54 lore raw

PATCH v6 39/43 MDSv6

In reply to Andi Kleen

Most USB interrupt handlers do not touch user data, except in some cases hcd poll is called which can copy a user buffer. Instead of marking all the USB interrupts and timers as clear cpu only clear it when the user data touching actually happens.

---
 drivers/usb/core/hcd.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/core/hcd.c +3 -0
index 015b126ce455..be47f96e810d 100644
@@ -29,6 +29,7 @@
 #include <linux/workqueue.h>
 #include <linux/pm_runtime.h>
 #include <linux/types.h>
+#include <linux/clearcpu.h>
 
 #include <linux/phy/phy.h>
 #include <linux/usb.h>
@@ -770,6 +771,8 @@ void usb_hcd_poll_rh_status(struct usb_hcd *hcd)
 			urb->actual_length = length;
 			memcpy(urb->transfer_buffer, buffer, length);
 
+			lazy_clear_cpu_interrupt();
+
 			usb_hcd_unlink_urb_from_ep(hcd, urb);
 			usb_hcd_giveback_urb(hcd, urb, 0);
 		} else {
Signature · 1 line
2.17.2
maintainer
#55 lore raw
Quoted 5 lines · speck for Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Make usb hcd poll clear cpu

Most USB interrupt handlers do not touch user data, except in some cases hcd poll is called which can copy a user buffer.

This does not make sense to me. From a USB driver point of view, there are very _few_ irqs that do _not_ contain "user data".

Quoted 2 lines

Instead of marking all the USB interrupts and timers as clear cpu only clear it when the user data touching actually happens.

Um, almost all irqs here _do_ receive data across the wire, and your patch shows this happening. The text here is all wrong.

Also, why are you classifying USB data as "user data"? It's coming from some random piece of hardware. I don't see a definition of what you are calling "user data" anywhere in this patchset, did I miss that somewhere?

I know I asked previously for this, without that defintion, this huge patchset is pretty much impossible to review.

greg k-h

#56 lore raw
Quoted 5 lines
Quoted 2 lines

Instead of marking all the USB interrupts and timers as clear cpu only clear it when the user data touching actually happens.

Um, almost all irqs here _do_ receive data across the wire, and your patch shows this happening. The text here is all wrong.

Just to be clear touching here it means "access with the CPU" especially copying. Just manipulating data addresses is fine.

Quoted 4 lines

Also, why are you classifying USB data as "user data"? It's coming from some random piece of hardware. I don't see a definition of what you are calling "user data" anywhere in this patchset, did I miss that somewhere?

user data includes IO data (but not metadata)

USB could be key presses (e.g. your password) or mouse movements or block IO data

These are all considered sensitive.

-Andi

maintainer
#57 lore raw
Quoted 10 lines · speck for Andi Kleen
Quoted 5 lines
Quoted 2 lines

Instead of marking all the USB interrupts and timers as clear cpu only clear it when the user data touching actually happens.

Um, almost all irqs here _do_ receive data across the wire, and your patch shows this happening. The text here is all wrong.

Just to be clear touching here it means "access with the CPU" especially copying. Just manipulating data addresses is fine.

Quoted 6 lines
Quoted 4 lines

Also, why are you classifying USB data as "user data"? It's coming from some random piece of hardware. I don't see a definition of what you are calling "user data" anywhere in this patchset, did I miss that somewhere?

user data includes IO data (but not metadata)

What is "metadata" when you are dealing with a stream of scsi data over a random physical layer?

Quoted 3 lines

USB could be key presses (e.g. your password) or mouse movements or block IO data

These are all considered sensitive.

So, all USB data is sensitive, great, document that crazyness! What about thunderbolt data? Unipro data? amba bus data?

Do you care about the physical layer (USB, unipro, amba, thunderbolt), or do you care about the "class" of data (keyboard, block, input, hid, camera)? Right now you seem to be mixing the two up in horridly complex ways that is guaranteed to drive you, and us, crazy.

greg k-h

#58 lore raw
Quoted 16 lines · speck for Greg KH
Quoted 15 lines · speck for Andi Kleen
Quoted 5 lines
Quoted 2 lines

Instead of marking all the USB interrupts and timers as clear cpu only clear it when the user data touching actually happens.

Um, almost all irqs here _do_ receive data across the wire, and your patch shows this happening. The text here is all wrong.

Just to be clear touching here it means "access with the CPU" especially copying. Just manipulating data addresses is fine.

Quoted 4 lines

Also, why are you classifying USB data as "user data"? It's coming from some random piece of hardware. I don't see a definition of what you are calling "user data" anywhere in this patchset, did I miss that somewhere?

Quoted 4 lines
Quoted 1 line

user data includes IO data (but not metadata)

What is "metadata" when you are dealing with a stream of scsi data over a random physical layer?

Anything that's not the user visible data on disk.

(ok perhaps checksums too, but I didn't find any driver that handles those)

Quoted 7 lines
Quoted 4 lines

USB could be key presses (e.g. your password) or mouse movements or block IO data

These are all considered sensitive.

So, all USB data is sensitive, great, document that crazyness! What about thunderbolt data? Unipro data? amba bus data?

Only the payloads, not the metadata.

Quoted 4 lines

Do you care about the physical layer (USB, unipro, amba, thunderbolt), or do you care about the "class" of data (keyboard, block, input, hid, camera)? Right now you seem to be mixing the two up in horridly complex ways that is guaranteed to drive you, and us, crazy.

Please just use your common sense, on't play the lawyer.

Would an attacker care about e.g. a sequence number or flags bit in some USB header? Likely no.

Would an attacker care about the keypress containing parts of your password? Yes

So we're trying to protect that part.

I'm trying to define a model that is secure enough, but still implementable.

If everyone thinks we should just go with mds=full I'm happy to drop these patches. It certainly makes everything a lot simpler! It's not that I like doing all of this personally.

But as long as people think the performance
benefits of the lazy approach are needed, we'll need some model like this, and some variant of these patches.

-Andi

maintainer
#59 lore raw
Quoted 17 lines · speck for Andi Kleen
Quoted 16 lines · speck for Greg KH
Quoted 15 lines · speck for Andi Kleen
Quoted 5 lines
Quoted 2 lines

Instead of marking all the USB interrupts and timers as clear cpu only clear it when the user data touching actually happens.

Um, almost all irqs here _do_ receive data across the wire, and your patch shows this happening. The text here is all wrong.

Just to be clear touching here it means "access with the CPU" especially copying. Just manipulating data addresses is fine.

Quoted 4 lines

Also, why are you classifying USB data as "user data"? It's coming from some random piece of hardware. I don't see a definition of what you are calling "user data" anywhere in this patchset, did I miss that somewhere?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

user data includes IO data (but not metadata)

What is "metadata" when you are dealing with a stream of scsi data over a random physical layer?

Anything that's not the user visible data on disk.

(ok perhaps checksums too, but I didn't find any driver that handles those)

But typically transports mix those up, so you are going to have a hard time here if you wish to tease them apart, as Mark mentioned.

Quoted 14 lines
Quoted 6 lines
Quoted 3 lines

USB could be key presses (e.g. your password) or mouse movements or block IO data

These are all considered sensitive.

So, all USB data is sensitive, great, document that crazyness! What about thunderbolt data? Unipro data? amba bus data?

Only the payloads, not the metadata.

Quoted 4 lines

Do you care about the physical layer (USB, unipro, amba, thunderbolt), or do you care about the "class" of data (keyboard, block, input, hid, camera)? Right now you seem to be mixing the two up in horridly complex ways that is guaranteed to drive you, and us, crazy.

Quoted 7 lines

Please just use your common sense, on't play the lawyer.

Would an attacker care about e.g. a sequence number or flags bit in some USB header? Likely no.

Would an attacker care about the keypress containing parts of your password? Yes

I am not trying to be a lawyer, I am trying to make this simpler and actually figure out what needs to be done here.

You obviously do not care about all bus data, only some. So which "some"? As we have class drivers, why not focus on the type of data you feel is an issue? That way you have a chance to keep on top of this thing.

If you only focus on a bus, then you will miss those types of things that do not use a bus. If you focus on the type of data, then you have a chance to do this right.

If you can't determine this then mds=full is going to have to be the only solution.

What are other operating systems going to do about all of this? Are they just punting and doing the "full" protection, or are they actually trying to mitigate this by focusing on what data types need to be protected?

thanks,

greg k-h

#60 lore raw
Quoted 2 lines

You obviously do not care about all bus data, only some. So which "some"? As we have class drivers, why not focus on the type of data you

For most drivers anything that would end up being copy_*_user()ed.

(modulo some corner cases like a network address. While I would like to protect those too, I don't see a practical way to do so. And they're already visible on the network)

Quoted 2 lines

feel is an issue? That way you have a chance to keep on top of this thing.

Ok so the problem is the terminology?

We should call it sensitive data?

I'll not be able to list all the cases explicitely in the document (this would require understanding all drivers and all subsystems which I certainly don't), there has to be some discretion.

Quoted 3 lines

If you only focus on a bus, then you will miss those types of things that do not use a bus. If you focus on the type of data, then you have a chance to do this right.

I wasn't really looking for busses, or anything like that, mainly just going through the code and looking for copies or direct data access.

-Andi

maintainer
#61 lore raw
Quoted 20 lines · speck for Andi Kleen
Quoted 2 lines

You obviously do not care about all bus data, only some. So which "some"? As we have class drivers, why not focus on the type of data you

For most drivers anything that would end up being copy_*_user()ed.

(modulo some corner cases like a network address. While I would like to protect those too, I don't see a practical way to do so. And they're already visible on the network)

Quoted 2 lines

feel is an issue? That way you have a chance to keep on top of this thing.

Ok so the problem is the terminology?

We should call it sensitive data?

I'll not be able to list all the cases explicitely in the document (this would require understanding all drivers and all subsystems which I certainly don't), there has to be some discretion.

Quoted 6 lines
Quoted 3 lines

If you only focus on a bus, then you will miss those types of things that do not use a bus. If you focus on the type of data, then you have a chance to do this right.

I wasn't really looking for busses, or anything like that, mainly just going through the code and looking for copies or direct data access.

To make this clearer to me, is this a better definition of the problem:

- Whenever the kernel touches data that userspace will eventually see, but does not want any other userspace process to see, the CPU buffers need to be flushed before returning from the kernel to userspace.

Is that correct? If not, how would you rephrase this in a single sentence?

If this statement is true, do you care about multiple copies of that data, or only the "last" one as you just need to flush things when returning to userspace?

I ask as your patchset, for the USB data flow cases, calls lazy_clear_cpu_interrupt() twice on the same irq, each time after the buffer was copied off, which is very odd to me.

So do we care about the first copy, every copy, the last copy, or do we just need to call lazy_clear_cpu_interrupt() at least once per data flow?

As an example, here's the data coming in from a USB keyboard through to userspace:
- USB irq
- USB data potentially copied from USB controller buffer -> usbmon buffer
- USB data copied from USB controller buffer -> HID driver buffer
- HID driver parsing and copying -> input data buffer
- input data buffer copied -> input event buffer(s)
- irq return

So we have USB layer copying once, maybe twice, HID layer copying, and input layer copying (at least once, maybe multiple times as you can multiplex input streams together). Where do we care about calling lazy_clear_cpu_interrupt() on this call chain? Everywhere, or just at least once?

If only once, why not just care about the input layer, as that is where things get sent to userspace and that is the _type_ of data you are concerned about.

[Note, I'm not sure about the input layer, it's just an example, things could be better than it used to be, but you get the idea here.]

Same goes for USB storage data. Sometimes that uses dma bounce buffers, do we care about those? If not, do we care later if the SCSI layer strips things off and reconstructs data paths and feeds that to the block layer? If so, shouldn't we only care about the block layer and not scsi or USB?

I'm asking you to think of the data either at the physical layer (USB, PCI, DMA, MIPI, I2C, etc.) or at the logical layer (tty, bluetooth, mouse, sound input, block, etc.) or both. Right now it's not obvious from your patchset what the correct thing is at all.

thanks,

greg k-h

maintainer
#62 lore raw
Quoted 30 lines · speck for Greg KH
Quoted 20 lines · speck for Andi Kleen
Quoted 2 lines

You obviously do not care about all bus data, only some. So which "some"? As we have class drivers, why not focus on the type of data you

For most drivers anything that would end up being copy_*_user()ed.

(modulo some corner cases like a network address. While I would like to protect those too, I don't see a practical way to do so. And they're already visible on the network)

Quoted 2 lines

feel is an issue? That way you have a chance to keep on top of this thing.

Ok so the problem is the terminology?

We should call it sensitive data?

I'll not be able to list all the cases explicitely in the document (this would require understanding all drivers and all subsystems which I certainly don't), there has to be some discretion.

Quoted 6 lines
Quoted 3 lines

If you only focus on a bus, then you will miss those types of things that do not use a bus. If you focus on the type of data, then you have a chance to do this right.

I wasn't really looking for busses, or anything like that, mainly just going through the code and looking for copies or direct data access.

To make this clearer to me, is this a better definition of the problem:

Quoted 7 lines

- Whenever the kernel touches data that userspace will eventually see, but does not want any other userspace process to see, the CPU buffers need to be flushed before returning from the kernel to userspace.

Is that correct? If not, how would you rephrase this in a single sentence?

Ok, I just read the "Deep Dive: Intel Analysis of MSBDS" pdf that Intel gave me last weekend, and I think the above sentence is correct. But it would be great for someone to verify it.

Quoted 3 lines

If this statement is true, do you care about multiple copies of that data, or only the "last" one as you just need to flush things when returning to userspace?

And to answer myself, I think that all is needed is to flush when returning from userspace, which lazy_clear_cpu_interrupt() _should_ be marking to have happen.

So my original point remains for the usbmon patch, it's pointless :)

Quoted 37 lines

I ask as your patchset, for the USB data flow cases, calls lazy_clear_cpu_interrupt() twice on the same irq, each time after the buffer was copied off, which is very odd to me.

So do we care about the first copy, every copy, the last copy, or do we just need to call lazy_clear_cpu_interrupt() at least once per data flow?

As an example, here's the data coming in from a USB keyboard through to userspace:
- USB irq
- USB data potentially copied from USB controller buffer -> usbmon buffer
- USB data copied from USB controller buffer -> HID driver buffer
- HID driver parsing and copying -> input data buffer
- input data buffer copied -> input event buffer(s)
- irq return

So we have USB layer copying once, maybe twice, HID layer copying, and input layer copying (at least once, maybe multiple times as you can multiplex input streams together). Where do we care about calling lazy_clear_cpu_interrupt() on this call chain? Everywhere, or just at least once?

If only once, why not just care about the input layer, as that is where things get sent to userspace and that is the _type_ of data you are concerned about.

[Note, I'm not sure about the input layer, it's just an example, things could be better than it used to be, but you get the idea here.]

Same goes for USB storage data. Sometimes that uses dma bounce buffers, do we care about those? If not, do we care later if the SCSI layer strips things off and reconstructs data paths and feeds that to the block layer? If so, shouldn't we only care about the block layer and not scsi or USB?

Quoted 4 lines

I'm asking you to think of the data either at the physical layer (USB, PCI, DMA, MIPI, I2C, etc.) or at the logical layer (tty, bluetooth, mouse, sound input, block, etc.) or both. Right now it's not obvious from your patchset what the correct thing is at all.

After reading the paper, I think you need to focus on the logical layer, when possible, and for busses that copy data in an irq, care about them _IFF_ they are carrying data for a logical type you care about.

greg k-h

#63 lore raw
In reply to Greg KH
Quoted 5 lines
Quoted 2 lines

I wasn't really looking for busses, or anything like that, mainly just going through the code and looking for copies or direct data access.

To make this clearer to me, is this a better definition of the problem:

Quoted 7 lines

- Whenever the kernel touches data that userspace will eventually see, but does not want any other userspace process to see, the CPU buffers need to be flushed before returning from the kernel to userspace.

Is that correct? If not, how would you rephrase this in a single sentence?

Here's my version:

In an asynchronous context (such as interrupts or softirqs), whenever the kernel touches data with the CPU, which originates from or will finally end up in a processes address space that may not be the current process, the CPU buffers need to be cleared before returning from kernel to user space.

This excludes some metadata, such as a network addresses, which are already visible on the network and which are difficult to protect efficiently.

[btw please avoid the term "flushing", it's a clear, not a flush]

Quoted 3 lines

If this statement is true, do you care about multiple copies of that data, or only the "last" one as you just need to flush things when returning to userspace?

In principle all touching needs to be protected.

But the flag to clear the CPU lazily only needs to be set once per asynchronous event. So if you guarantee that someone else already sets it in the same interrupt it doesn't need to be set again.

Quoted 3 lines

I ask as your patchset, for the USB data flow cases, calls lazy_clear_cpu_interrupt() twice on the same irq, each time after the buffer was copied off, which is very odd to me.

lazy_clear_cpu_interrupt() is very cheap (as in a few cycles) It's just a few instructions that set a flag. So I didn't make any attempts to minimize it. It can just be used wherever convenient.

The actual clear action is always only on the next kernel to user transition.

Quoted 3 lines

So do we care about the first copy, every copy, the last copy, or do we just need to call lazy_clear_cpu_interrupt() at least once per data flow?

At least once.

Quoted 9 lines

As an example, here's the data coming in from a USB keyboard through to userspace:
- USB irq
- USB data potentially copied from USB controller buffer -> usbmon buffer
- USB data copied from USB controller buffer -> HID driver buffer
- HID driver parsing and copying -> input data buffer
- input data buffer copied -> input event buffer(s)

This particular case is covered by the lazy_clear_cpus in the input layer.

But if there are other HID drivers that do the "USB data copied" step in interrupt context they might need lazy_clear_cpu()s too. Did I miss some here?

Quoted 5 lines

So we have USB layer copying once, maybe twice, HID layer copying, and input layer copying (at least once, maybe multiple times as you can multiplex input streams together). Where do we care about calling lazy_clear_cpu_interrupt() on this call chain? Everywhere, or just at least once?

At least once.

Quoted 4 lines

If only once, why not just care about the input layer, as that is where things get sent to userspace and that is the _type_ of data you are concerned about.o

Yes that's what I did. It's in the patchkit.

The tty layer does it too.

Generally I only patched the drivers itself when there wasn't a convenient middle layer or utility function that they called.

Quoted 9 lines

[Note, I'm not sure about the input layer, it's just an example, things could be better than it used to be, but you get the idea here.]

Same goes for USB storage data. Sometimes that uses dma bounce buffers, do we care about those? If not, do we care later if the SCSI layer

You mean swiotlb? That is covered in the patch kit.

Quoted 2 lines

strips things off and reconstructs data paths and feeds that to the block layer?

Does usb storage copy the data somewhere in the path? If yes I might have missed something. Can you point to the code?

Quoted 2 lines

If so, shouldn't we only care about the block layer and not scsi or USB?

I audited the block layer and all the users seemed to use kmap_atomic, so I put the clear hook in there.

For SCSI we only marked those that did PIO etc.

Quoted 4 lines

I'm asking you to think of the data either at the physical layer (USB, PCI, DMA, MIPI, I2C, etc.) or at the logical layer (tty, bluetooth, mouse, sound input, block, etc.) or both. Right now it's not obvious from your patchset what the correct thing is at all.

It was done case by case.

input drivers --> done in input layer
scsi drivers --> only needed to mark explicit PIO
network drivers --> most rely on skb annotation (just marked a few outliers) usb -> maybe we missed something here. The only obvious copy seemed to be usbmon.

-Andi

author
#64 lore raw

PATCH v6 40/43 MDSv6

In reply to Andi Kleen

Turn on lazy mode as default, make mds=full active as an option.

---
 arch/x86/kernel/cpu/bugs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/cpu/bugs.c +1 -3
index 146f9abc1931..1838f4d0aa72 100644
@@ -1106,9 +1106,7 @@ static void mds_select_mitigation(void)
 	setup_force_cpu_cap(X86_FEATURE_VERW);
 	if (cmdline_find_option_bool(boot_command_line, "mds=off"))
 		setup_clear_cpu_cap(X86_FEATURE_VERW);
-	/* Default to old behavior for now */
-	if (cmdline_find_option_bool(boot_command_line, "mds=full") ||
-		true)
+	if (cmdline_find_option_bool(boot_command_line, "mds=full"))
 		static_branch_enable(&force_cpu_clear);
 	/* Nop currently because this is default for now. */
 	if (cmdline_find_option_bool(boot_command_line, "mds=auto"))
Signature · 1 line
2.17.2
author
#65 lore raw

PATCH v6 41/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Mark interrupts that touch user data

Mark interrupt handlers that touch user data or might touch it with IRQF_USER_DATA to schedule cpu clears.

This has been generated with a tree wide audit and the following coccinelle script. In general it erred on the conservative. Either interrupt handlers directly touched user data (e.g. with PIO), or were too complicated to audit and for slow devices anyways.

A lot of interrupt handlers are also handled by the strategic clear cpus added to functions that touch user data directly. This patch only marks handlers that don't call any such functions.

Some auditing from Mark Gross.

// request_irq(irq, handler, flags, name, arg) ->
// request_irq(irq, handler, flags | IRQF_USER_DATA, name, arg)

@@
expression irq, handler, name, arg;
@@
- request_irq(irq, handler, 0, name, arg)
+ request_irq(irq, handler, IRQF_USER_DATA, name, arg)

@@
expression irq, handler, flags, name, arg;
@@
- request_irq(irq, handler, flags, name, arg)
+ request_irq(irq, handler, flags | IRQF_USER_DATA, name, arg)

// clean up after previous rules combined
// XXX better way to do this?
@@
expression irq, handler, name, arg;
@@
- request_irq(irq, handler, IRQF_USER_DATA | IRQF_CLEAR_CPU, name, arg)
+ request_irq(irq, handler, IRQF_USER_DATA, name, arg)

// devm_request_irq(dev, irq, handler, flags, name, arg) -> // devm_request_irq(dev, irq, handler, flags | IRQF_USER_DATA, name, arg)

@@
expression irq, handler, name, arg, dev;
@@
- devm_request_irq(dev, irq, handler, 0, name, arg)
+ devm_request_irq(dev, irq, handler, IRQF_USER_DATA, name, arg)

@@
expression irq, handler, flags, name, arg, dev;
@@
- devm_request_irq(dev, irq, handler, flags, name, arg)
+ devm_request_irq(dev, irq, handler, flags | IRQF_USER_DATA, name, arg)

// clean up after previous rules combined
// XXX better way to do this?
@@
expression irq, handler, name, arg, dev;
@@
- devm_request_irq(dev, irq, handler, IRQF_USER_DATA | IRQF_CLEAR_CPU, name, arg)
+ devm_request_irq(dev, irq, handler, IRQF_USER_DATA, name, arg)

// request_any_context_irq(irq, handler, flags, name, arg) -> // request_any_context_irq(irq, handler, flags | IRQF_USER_DATA, name, arg)

@@
expression irq, handler, name, arg;
@@
- request_any_context_irq(irq, handler, 0, name, arg)
+ request_any_context_irq(irq, handler, IRQF_USER_DATA, name, arg)

@@
expression irq, handler, flags, name, arg;
@@
- request_any_context_irq(irq, handler, flags, name, arg)
+ request_any_context_irq(irq, handler, flags | IRQF_USER_DATA, name, arg)

// clean up after previous rules combined
// XXX better way to do this?
@@
expression irq, handler, name, arg;
@@
- request_any_context_irq(irq, handler, IRQF_USER_DATA | IRQF_CLEAR_CPU, name, arg)
+ request_any_context_irq(irq, handler, IRQF_USER_DATA, name, arg)

// devm_request_any_context_irq(dev, irq, handler, flags, name, arg) -> // devm_request_any_context_irq(dev, irq, handler, flags | IRQF_USER_DATA, name, arg)

@@
expression irq, handler, name, arg, dev;
@@
- devm_request_any_context_irq(dev, irq, handler, 0, name, arg)
+ devm_request_any_context_irq(dev, irq, handler, IRQF_USER_DATA, name, arg)

@@
expression irq, handler, flags, name, arg, dev;
@@
- devm_request_any_context_irq(dev, irq, handler, flags, name, arg)
+ devm_request_any_context_irq(dev, irq, handler, flags | IRQF_USER_DATA, name, arg)

// clean up after previous rules combined
// XXX better way to do this?
@@
expression irq, handler, name, arg, dev;
@@
- devm_request_any_context_irq(dev, irq, handler, IRQF_USER_DATA | IRQF_CLEAR_CPU, name, arg)
+ devm_request_any_context_irq(dev, irq, handler, IRQF_USER_DATA, name, arg)

---
 arch/x86/include/asm/floppy.h                 |  6 ++--
 drivers/atm/lanai.c                           |  4 +--
 drivers/atm/nicstar.c                         |  4 +--
 drivers/char/ipmi/ipmi_si_intf.c              |  6 ++--
 drivers/char/sonypi.c                         |  3 +-
 drivers/firewire/nosy.c                       |  3 +-
 drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c    |  3 +-
 .../gpu/drm/nouveau/nvkm/subdev/pci/base.c    |  3 +-
 drivers/i2c/busses/i2c-emev2.c                |  5 +--
 drivers/i2c/busses/i2c-i801.c                 |  2 +-
 drivers/i2c/busses/i2c-pxa.c                  |  4 +--
 drivers/i2c/busses/i2c-rk3x.c                 |  3 +-
 drivers/ide/ide-probe.c                       |  2 +-
 drivers/infiniband/hw/mthca/mthca_eq.c        | 14 ++++----
 drivers/input/serio/i8042.c                   | 13 +++----
 drivers/ipack/carriers/tpci200.c              |  6 ++--
 drivers/isdn/hardware/avm/b1isa.c             |  4 ++-
 drivers/isdn/hardware/avm/b1pci.c             |  6 ++--
 drivers/isdn/hardware/avm/b1pcmcia.c          |  3 +-
 drivers/isdn/hardware/avm/c4.c                |  3 +-
 drivers/isdn/hardware/avm/t1isa.c             |  4 ++-
 drivers/isdn/hardware/avm/t1pci.c             |  3 +-
 drivers/isdn/hardware/mISDN/avmfritz.c        |  4 +--
 drivers/isdn/hardware/mISDN/hfcmulti.c        |  3 +-
 drivers/isdn/hardware/mISDN/hfcpci.c          |  2 +-
 drivers/isdn/hardware/mISDN/mISDNinfineon.c   |  3 +-
 drivers/isdn/hardware/mISDN/netjet.c          |  2 +-
 drivers/isdn/hardware/mISDN/speedfax.c        |  3 +-
 drivers/isdn/hardware/mISDN/w6692.c           |  2 +-
 drivers/isdn/hisax/config.c                   |  2 +-
 drivers/isdn/hisax/hfc4s8s_l1.c               |  3 +-
 drivers/isdn/hisax/hisax_fcpcipnp.c           | 13 ++++---
 drivers/media/common/saa7146/saa7146_core.c   |  4 +--
 drivers/media/pci/b2c2/flexcop-pci.c          |  3 +-
 drivers/media/pci/cobalt/cobalt-driver.c      |  3 +-
 drivers/media/pci/cx18/cx18-driver.c          |  3 +-
 drivers/media/pci/cx25821/cx25821-core.c      |  2 +-
 drivers/media/pci/cx88/cx88-alsa.c            |  3 +-
 drivers/media/pci/cx88/cx88-mpeg.c            |  2 +-
 drivers/media/pci/cx88/cx88-video.c           |  2 +-
 drivers/media/pci/dt3155/dt3155.c             |  2 +-
 drivers/media/pci/intel/ipu3/ipu3-cio2.c      |  2 +-
 drivers/media/pci/ivtv/ivtv-driver.c          |  3 +-
 drivers/media/pci/meye/meye.c                 |  3 +-
 drivers/media/pci/ngene/ngene-core.c          |  5 ++-
 drivers/media/pci/pluto2/pluto2.c             |  3 +-
 drivers/media/pci/saa7134/saa7134-alsa.c      |  4 +--
 drivers/media/pci/saa7134/saa7134-core.c      |  2 +-
 drivers/media/pci/saa7164/saa7164-core.c      |  7 ++--
 drivers/media/pci/solo6x10/solo6x10-core.c    |  4 +--
 drivers/media/pci/sta2x11/sta2x11_vip.c       |  5 ++-
 drivers/media/pci/tw68/tw68-core.c            |  2 +-
 drivers/media/pci/tw686x/tw686x-core.c        |  4 +--
 drivers/media/platform/aspeed-video.c         |  5 +--
 .../media/platform/marvell-ccic/cafe-driver.c |  3 +-
 drivers/media/rc/fintek-cir.c                 |  3 +-
 drivers/media/rc/gpio-ir-recv.c               |  2 +-
 drivers/media/rc/ir-hix5hd2.c                 |  3 +-
 drivers/media/rc/ite-cir.c                    |  3 +-
 drivers/media/rc/nuvoton-cir.c                |  3 +-
 drivers/media/rc/serial_ir.c                  |  2 +-
 drivers/media/rc/sir_ir.c                     |  3 +-
 drivers/media/rc/winbond-cir.c                |  2 +-
 drivers/memstick/host/jmb38x_ms.c             |  3 +-
 drivers/message/fusion/mptbase.c              |  3 +-
 drivers/mfd/ezx-pcap.c                        |  4 +--
 drivers/misc/ibmasm/module.c                  |  4 ++-
 drivers/misc/sgi-gru/grufile.c                |  7 ++--
 drivers/misc/sgi-xp/xpc_uv.c                  |  3 +-
 drivers/mmc/host/mtk-sd.c                     |  3 +-
 drivers/net/arcnet/arc-rimi.c                 |  2 +-
 drivers/net/arcnet/com20020.c                 |  3 +-
 drivers/net/arcnet/com90io.c                  |  3 +-
 drivers/net/arcnet/com90xx.c                  |  2 +-
 drivers/net/can/cc770/cc770.c                 |  4 +--
 drivers/net/can/peak_canfd/peak_pciefd_main.c |  8 ++---
 drivers/net/can/sja1000/ems_pcmcia.c          |  4 +--
 drivers/net/can/sja1000/peak_pcmcia.c         |  3 +-
 drivers/net/can/sja1000/sja1000.c             |  5 +--
 drivers/net/ethernet/3com/3c509.c             |  3 +-
 drivers/net/ethernet/3com/3c515.c             |  6 ++--
 drivers/net/ethernet/8390/axnet_cs.c          |  3 +-
 drivers/net/ethernet/8390/ne.c                |  3 +-
 drivers/net/ethernet/8390/ne2k-pci.c          |  3 +-
 drivers/net/ethernet/8390/pcnet_cs.c          |  3 +-
 drivers/net/ethernet/8390/smc-ultra.c         |  3 +-
 drivers/net/ethernet/8390/wd.c                |  3 +-
 drivers/net/ethernet/agere/et131x.c           |  4 +--
 drivers/net/ethernet/amd/lance.c              |  2 +-
 drivers/net/ethernet/amd/ni65.c               |  5 +--
 drivers/net/ethernet/atheros/atlx/atl1.c      |  4 +--
 drivers/net/ethernet/atheros/atlx/atl2.c      |  4 +--
 .../net/ethernet/chelsio/cxgb3/cxgb3_main.c   | 16 +++------
 drivers/net/ethernet/micrel/ks8851_mll.c      |  3 +-
 drivers/net/ethernet/microchip/lan743x_main.c |  7 ++--
 drivers/net/ethernet/realtek/atp.c            |  3 +-
 drivers/net/fddi/skfp/skfddi.c                |  4 +--
 drivers/net/hamradio/baycom_ser_fdx.c         |  3 +-
 drivers/net/hamradio/baycom_ser_hdx.c         |  3 +-
 drivers/net/hamradio/scc.c                    |  4 +--
 drivers/net/hamradio/yam.c                    |  2 +-
 drivers/net/ieee802154/at86rf230.c            |  3 +-
 drivers/net/ieee802154/ca8210.c               | 10 ++----
 drivers/net/ieee802154/mcr20a.c               |  3 +-
 drivers/net/ieee802154/mrf24j40.c             |  3 +-
 drivers/net/wan/cosa.c                        |  2 +-
 drivers/net/wan/farsync.c                     |  2 +-
 drivers/net/wan/hostess_sv11.c                |  3 +-
 drivers/net/wan/sbni.c                        |  2 +-
 drivers/net/wan/sdla.c                        |  2 +-
 drivers/net/wan/sealevel.c                    |  3 +-
 .../net/wireless/broadcom/b43legacy/main.c    |  2 +-
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  7 ++--
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c |  3 +-
 drivers/net/wireless/cisco/airo.c             |  4 +--
 drivers/net/wireless/intel/ipw2x00/ipw2100.c  |  4 +--
 drivers/net/wireless/intel/ipw2x00/ipw2200.c  |  3 +-
 .../net/wireless/intel/iwlegacy/3945-mac.c    |  3 +-
 .../net/wireless/intel/iwlegacy/4965-mac.c    |  3 +-
 .../net/wireless/intersil/hostap/hostap_pci.c |  3 +-
 .../net/wireless/intersil/hostap/hostap_plx.c |  3 +-
 .../intersil/orinoco/orinoco_nortel.c         |  4 +--
 .../wireless/intersil/orinoco/orinoco_pci.c   |  4 +--
 .../wireless/intersil/orinoco/orinoco_plx.c   |  4 +--
 .../wireless/intersil/orinoco/orinoco_tmd.c   |  4 +--
 drivers/net/wireless/intersil/p54/p54pci.c    |  2 +-
 drivers/net/wireless/intersil/p54/p54spi.c    |  4 +--
 .../intersil/prism54/islpci_hotplug.c         |  2 +-
 drivers/net/wireless/marvell/libertas/if_cs.c |  2 +-
 .../net/wireless/marvell/libertas/if_spi.c    |  3 +-
 drivers/net/wireless/marvell/mwifiex/main.c   |  5 +--
 drivers/net/wireless/marvell/mwifiex/pcie.c   |  8 +++--
 drivers/net/wireless/marvell/mwl8k.c          |  4 +--
 .../net/wireless/mediatek/mt76/mt76x0/pci.c   |  3 +-
 .../net/wireless/mediatek/mt76/mt76x2/pci.c   |  3 +-
 .../quantenna/qtnfmac/pcie/pearl_pcie.c       |  3 +-
 .../quantenna/qtnfmac/pcie/topaz_pcie.c       |  3 +-
 .../net/wireless/ralink/rt2x00/rt2x00mmio.c   |  6 ++--
 .../wireless/realtek/rtl818x/rtl8180/dev.c    |  6 ++--
 drivers/net/wireless/realtek/rtlwifi/pci.c    |  4 +--
 drivers/net/wireless/ti/wl1251/sdio.c         |  4 ++-
 drivers/net/wireless/ti/wl1251/spi.c          |  5 +--
 drivers/ntb/hw/amd/ntb_hw_amd.c               | 12 ++++---
 drivers/ntb/hw/intel/ntb_hw_gen1.c            | 12 ++++---
 drivers/ntb/hw/mscc/ntb_hw_switchtec.c        |  8 ++---
 drivers/parport/parport_ax88796.c             |  3 +-
 drivers/parport/parport_pc.c                  |  3 +-
 drivers/pci/controller/pcie-xilinx.c          |  2 +-
 drivers/pci/controller/vmd.c                  | 11 +++---
 drivers/pci/hotplug/cpci_hotplug_core.c       |  6 +---
 drivers/pci/hotplug/cpqphp_core.c             |  3 +-
 drivers/pci/hotplug/shpchp_hpc.c              |  5 +--
 drivers/pci/pcie/pme.c                        |  3 +-
 drivers/pci/switch/switchtec.c                | 10 +++---
 drivers/pcmcia/i82092.c                       |  2 +-
 drivers/pcmcia/i82365.c                       |  9 ++---
 drivers/pcmcia/pcmcia_resource.c              |  9 ++---
 drivers/pcmcia/pd6729.c                       |  8 +++--
 drivers/pcmcia/tcic.c                         |  7 ++--
 drivers/pcmcia/yenta_socket.c                 |  4 +--
 drivers/pinctrl/intel/pinctrl-intel.c         |  2 +-
 drivers/pinctrl/pinctrl-amd.c                 |  3 +-
 drivers/pinctrl/pinctrl-single.c              |  3 +-
 drivers/platform/goldfish/goldfish_pipe.c     |  6 ++--
 drivers/platform/mellanox/mlxreg-hotplug.c    |  5 +--
 drivers/platform/x86/fujitsu-tablet.c         |  3 +-
 drivers/platform/x86/intel_int0002_vgpio.c    |  2 +-
 drivers/platform/x86/intel_ips.c              |  3 +-
 drivers/platform/x86/intel_pmc_ipc.c          |  8 ++---
 drivers/platform/x86/intel_punit_ipc.c        |  4 +--
 drivers/platform/x86/intel_scu_ipc.c          |  5 +--
 drivers/platform/x86/sony-laptop.c            |  3 +-
 drivers/pnp/resource.c                        |  3 +-
 drivers/power/reset/ltc2952-poweroff.c        |  6 +---
 drivers/power/supply/act8945a_charger.c       |  6 ++--
 drivers/power/supply/goldfish_battery.c       |  5 +--
 .../power/supply/max14656_charger_detector.c  |  2 +-
 drivers/power/supply/pda_power.c              |  6 ++--
 drivers/power/supply/wm97xx_battery.c         |  5 +--
 drivers/pps/clients/pps-gpio.c                |  3 +-
 drivers/ptp/ptp_pch.c                         |  3 +-
 drivers/rapidio/devices/tsi721.c              | 25 +++++++------
 drivers/rapidio/devices/tsi721_dma.c          |  8 +++--
 drivers/regulator/qcom_spmi-regulator.c       |  5 +--
 drivers/rpmsg/qcom_glink_native.c             |  5 ++-
 drivers/rtc/rtc-cmos.c                        |  5 +--
 drivers/rtc/rtc-ds1305.c                      |  3 +-
 drivers/rtc/rtc-ds1374.c                      |  5 +--
 drivers/rtc/rtc-ds1511.c                      |  3 +-
 drivers/rtc/rtc-ds1553.c                      |  4 +--
 drivers/rtc/rtc-ds1685.c                      |  3 +-
 drivers/rtc/rtc-ftrtc010.c                    |  2 +-
 drivers/rtc/rtc-m48t59.c                      |  5 +--
 drivers/rtc/rtc-mrst.c                        |  3 +-
 drivers/rtc/rtc-pcap.c                        | 10 +++---
 drivers/rtc/rtc-r7301.c                       |  3 +-
 drivers/rtc/rtc-snvs.c                        |  3 +-
 drivers/rtc/rtc-stk17ta8.c                    |  5 +--
 drivers/rtc/rtc-zynqmp.c                      |  6 ++--
 drivers/scsi/3w-9xxx.c                        |  6 ++--
 drivers/scsi/3w-sas.c                         |  6 ++--
 drivers/scsi/3w-xxxx.c                        |  3 +-
 drivers/scsi/BusLogic.c                       |  3 +-
 drivers/scsi/a100u2w.c                        |  4 +--
 drivers/scsi/aacraid/commsup.c                |  8 ++---
 drivers/scsi/aacraid/rx.c                     |  3 +-
 drivers/scsi/aacraid/sa.c                     |  3 +-
 drivers/scsi/aacraid/src.c                    |  3 +-
 drivers/scsi/advansys.c                       |  4 +--
 drivers/scsi/aha152x.c                        |  4 +--
 drivers/scsi/aha1542.c                        |  2 +-
 drivers/scsi/aha1740.c                        |  3 +-
 drivers/scsi/aic7xxx/aic7770_osm.c            |  3 +-
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c        |  2 +-
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c        |  2 +-
 drivers/scsi/aic94xx/aic94xx_init.c           |  5 +--
 drivers/scsi/am53c974.c                       |  4 +--
 drivers/scsi/arcmsr/arcmsr_hba.c              |  3 +-
 drivers/scsi/atp870u.c                        |  3 +-
 drivers/scsi/be2iscsi/be_main.c               | 12 ++++---
 drivers/scsi/bfa/bfad.c                       |  9 +++--
 drivers/scsi/csiostor/csio_isr.c              | 16 +++++----
 drivers/scsi/dpt_i2o.c                        |  2 +-
 drivers/scsi/esas2r/esas2r_init.c             |  8 +----
 drivers/scsi/fnic/fnic_isr.c                  | 13 ++++---
 drivers/scsi/g_NCR5380.c                      |  7 ++--
 drivers/scsi/gdth.c                           |  8 +++--
 drivers/scsi/hpsa.c                           | 19 +++++-----
 drivers/scsi/hptiop.c                         |  3 +-
 drivers/scsi/initio.c                         |  3 +-
 drivers/scsi/ipr.c                            | 23 ++++++------
 drivers/scsi/ips.c                            |  4 +--
 drivers/scsi/isci/init.c                      |  8 +++--
 drivers/scsi/lpfc/lpfc_init.c                 | 35 ++++++++++++-------
 drivers/scsi/megaraid.c                       |  4 +--
 drivers/scsi/megaraid/megaraid_mbox.c         |  3 +-
 drivers/scsi/megaraid/megaraid_sas_base.c     |  8 ++---
 drivers/scsi/mpt3sas/mpt3sas_base.c           |  2 +-
 drivers/scsi/mvsas/mv_init.c                  |  4 +--
 drivers/scsi/mvumi.c                          |  8 ++---
 drivers/scsi/myrb.c                           |  2 +-
 drivers/scsi/myrs.c                           |  2 +-
 drivers/scsi/nsp32.c                          |  3 +-
 drivers/scsi/pcmcia/qlogic_stub.c             |  2 +-
 drivers/scsi/pcmcia/sym53c500_cs.c            |  2 +-
 drivers/scsi/pm8001/pm8001_init.c             | 10 +++---
 drivers/scsi/pmcraid.c                        |  5 +--
 drivers/scsi/qedf/qedf_main.c                 |  4 ++-
 drivers/scsi/qedi/qedi_main.c                 |  3 +-
 drivers/scsi/qla1280.c                        |  3 +-
 drivers/scsi/qla2xxx/qla_isr.c                | 22 +++++++-----
 drivers/scsi/qla4xxx/ql4_isr.c                |  5 +--
 drivers/scsi/qla4xxx/ql4_nx.c                 | 10 +++---
 drivers/scsi/qlogicfas.c                      |  2 +-
 drivers/scsi/sim710.c                         |  2 +-
 drivers/scsi/smartpqi/smartpqi_init.c         | 11 +++---
 drivers/scsi/snic/snic_isr.c                  |  5 ++-
 drivers/scsi/stex.c                           |  4 +--
 drivers/scsi/sym53c8xx_2/sym_glue.c           |  3 +-
 drivers/scsi/ufs/ufshcd.c                     |  7 ++--
 drivers/scsi/vmw_pvscsi.c                     |  9 +++--
 drivers/scsi/wd719x.c                         |  4 +--
 drivers/slimbus/qcom-ctrl.c                   |  3 +-
 drivers/spi/spi-altera.c                      |  3 +-
 drivers/spi/spi-axi-spi-engine.c              |  3 +-
 drivers/spi/spi-cadence.c                     |  3 +-
 drivers/spi/spi-dw.c                          |  4 +--
 drivers/spi/spi-fsl-spi.c                     |  3 +-
 drivers/spi/spi-oc-tiny.c                     |  3 +-
 drivers/spi/spi-pxa2xx.c                      |  4 +--
 drivers/spi/spi-topcliff-pch.c                |  5 +--
 drivers/spi/spi-xilinx.c                      |  5 +--
 drivers/spi/spi-zynqmp-gqspi.c                |  3 +-
 drivers/staging/android/vsoc.c                |  3 +-
 drivers/staging/axis-fifo/axis-fifo.c         |  3 +-
 .../staging/comedi/drivers/addi_apci_1032.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_1500.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_1564.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_2032.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_3120.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_3xxx.c   |  3 +-
 drivers/staging/comedi/drivers/adl_pci9111.c  |  3 +-
 drivers/staging/comedi/drivers/adl_pci9118.c  |  3 +-
 drivers/staging/comedi/drivers/adv_pci1710.c  |  3 +-
 drivers/staging/comedi/drivers/aio_iiro_16.c  |  3 +-
 .../comedi/drivers/amplc_dio200_common.c      |  3 +-
 .../comedi/drivers/amplc_pc236_common.c       |  3 +-
 drivers/staging/comedi/drivers/amplc_pci224.c |  3 +-
 drivers/staging/comedi/drivers/amplc_pci230.c |  3 +-
 drivers/staging/comedi/drivers/cb_pcidas.c    |  4 +--
 drivers/staging/comedi/drivers/cb_pcidas64.c  |  5 +--
 .../staging/comedi/drivers/comedi_parport.c   |  3 +-
 drivers/staging/comedi/drivers/das16m1.c      |  3 +-
 drivers/staging/comedi/drivers/das1800.c      |  3 +-
 drivers/staging/comedi/drivers/das6402.c      |  3 +-
 drivers/staging/comedi/drivers/das800.c       |  5 +--
 drivers/staging/comedi/drivers/dmm32at.c      |  3 +-
 drivers/staging/comedi/drivers/dt2811.c       |  3 +-
 drivers/staging/comedi/drivers/dt2814.c       |  3 +-
 drivers/staging/comedi/drivers/dt282x.c       |  2 +-
 drivers/staging/comedi/drivers/dt3000.c       |  3 +-
 drivers/staging/comedi/drivers/gsc_hpdi.c     |  3 +-
 drivers/staging/comedi/drivers/me4000.c       |  3 +-
 drivers/staging/comedi/drivers/ni_6527.c      |  4 +--
 drivers/staging/comedi/drivers/ni_65xx.c      |  3 +-
 drivers/staging/comedi/drivers/ni_660x.c      |  4 +--
 drivers/staging/comedi/drivers/ni_at_a2150.c  |  2 +-
 drivers/staging/comedi/drivers/ni_atmio.c     |  3 +-
 drivers/staging/comedi/drivers/ni_atmio16d.c  |  3 +-
 .../staging/comedi/drivers/ni_labpc_common.c  |  5 +--
 drivers/staging/comedi/drivers/ni_pcidio.c    |  3 +-
 drivers/staging/comedi/drivers/ni_pcimio.c    |  3 +-
 drivers/staging/comedi/drivers/pcl711.c       |  3 +-
 drivers/staging/comedi/drivers/pcl726.c       |  3 +-
 drivers/staging/comedi/drivers/pcl812.c       |  3 +-
 drivers/staging/comedi/drivers/pcl816.c       |  2 +-
 drivers/staging/comedi/drivers/pcl818.c       |  3 +-
 drivers/staging/comedi/drivers/pcmmio.c       |  3 +-
 drivers/staging/comedi/drivers/pcmuio.c       |  6 ++--
 drivers/staging/comedi/drivers/rtd520.c       |  3 +-
 drivers/staging/comedi/drivers/s626.c         |  3 +-
 drivers/staging/gasket/gasket_interrupt.c     |  3 +-
 drivers/staging/goldfish/goldfish_audio.c     |  5 +--
 drivers/staging/iio/adc/ad7606.c              |  3 +-
 drivers/staging/media/bcm2048/radio-bcm2048.c |  4 +--
 drivers/staging/media/zoran/zoran_card.c      |  2 +-
 drivers/staging/most/dim2/dim2.c              |  6 ++--
 drivers/staging/most/i2c/i2c.c                |  3 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c    |  2 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c  |  2 +-
 drivers/staging/pi433/pi433_if.c              |  6 ++--
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c  |  2 +-
 drivers/staging/rtlwifi/pci.c                 |  4 +--
 drivers/staging/rts5208/rtsx.c                |  4 +--
 drivers/staging/speakup/serialio.c            |  5 +--
 drivers/staging/vt6655/device_main.c          |  2 +-
 drivers/thermal/ti-soc-thermal/ti-bandgap.c   |  6 ++--
 drivers/thunderbolt/nhi.c                     |  6 ++--
 drivers/tty/cyclades.c                        |  9 ++---
 drivers/tty/goldfish.c                        |  4 +--
 drivers/tty/hvc/hvc_irq.c                     |  4 +--
 drivers/tty/isicom.c                          |  2 +-
 drivers/tty/mxser.c                           |  4 +--
 drivers/tty/serial/8250/8250_core.c           |  3 +-
 drivers/tty/serial/8250/8250_exar.c           |  2 +-
 drivers/tty/serial/altera_jtaguart.c          |  4 +--
 drivers/tty/serial/altera_uart.c              |  5 +--
 drivers/tty/serial/arc_uart.c                 |  2 +-
 drivers/tty/serial/digicolor-usart.c          |  3 +-
 drivers/tty/serial/fsl_lpuart.c               | 12 ++++---
 drivers/tty/serial/ifx6x60.c                  |  7 ++--
 drivers/tty/serial/jsm/jsm_driver.c           |  3 +-
 drivers/tty/serial/max3100.c                  |  3 +-
 drivers/tty/serial/men_z135_uart.c            |  4 +--
 drivers/tty/serial/pch_uart.c                 |  4 +--
 drivers/tty/serial/rp2.c                      |  2 +-
 drivers/tty/serial/sc16is7xx.c                |  2 +-
 drivers/tty/serial/timbuart.c                 |  4 +--
 drivers/tty/serial/uartlite.c                 |  3 +-
 drivers/tty/serial/xilinx_uartps.c            |  4 ++-
 drivers/tty/synclink.c                        |  3 +-
 drivers/tty/synclink_gt.c                     |  6 +---
 drivers/tty/synclinkmp.c                      |  7 ++--
 drivers/uio/uio.c                             |  3 +-
 drivers/usb/c67x00/c67x00-drv.c               |  3 +-
 drivers/usb/chipidea/core.c                   |  5 +--
 drivers/usb/core/hcd.c                        |  5 +--
 drivers/usb/dwc2/gadget.c                     |  3 +-
 drivers/usb/dwc2/platform.c                   |  3 +-
 drivers/usb/gadget/udc/amd5536udc_pci.c       |  2 +-
 drivers/usb/gadget/udc/bdc/bdc_udc.c          |  3 +-
 drivers/usb/gadget/udc/fotg210-udc.c          |  4 +--
 drivers/usb/gadget/udc/fusb300_udc.c          |  6 ++--
 drivers/usb/gadget/udc/goku_udc.c             |  3 +-
 drivers/usb/gadget/udc/m66592-udc.c           |  4 +--
 drivers/usb/gadget/udc/mv_u3d_core.c          |  3 +-
 drivers/usb/gadget/udc/mv_udc_core.c          |  3 +-
 drivers/usb/gadget/udc/net2272.c              |  3 +-
 drivers/usb/gadget/udc/net2280.c              |  3 +-
 drivers/usb/gadget/udc/pch_udc.c              |  8 +++--
 drivers/usb/gadget/udc/pxa27x_udc.c           |  3 +-
 drivers/usb/gadget/udc/r8a66597-udc.c         |  5 +--
 drivers/usb/gadget/udc/snps_udc_plat.c        |  4 +--
 drivers/usb/gadget/udc/udc-xilinx.c           |  3 +-
 drivers/usb/host/max3421-hcd.c                |  3 +-
 drivers/usb/host/xhci.c                       | 12 ++++---
 drivers/usb/isp1760/isp1760-udc.c             |  3 +-
 drivers/usb/musb/musb_core.c                  |  2 +-
 drivers/usb/phy/phy-gpio-vbus-usb.c           |  4 +--
 drivers/uwb/whc-rc.c                          |  5 +--
 drivers/vfio/pci/vfio_pci_intrs.c             |  5 +--
 drivers/video/fbdev/arcfb.c                   |  3 +-
 drivers/video/fbdev/aty/atyfb_base.c          |  2 +-
 drivers/video/fbdev/goldfishfb.c              |  4 +--
 drivers/video/fbdev/matrox/matroxfb_base.c    |  3 +-
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c    |  7 ++--
 drivers/video/fbdev/via/via-core.c            |  3 +-
 drivers/virt/vboxguest/vboxguest_linux.c      |  5 +--
 drivers/virtio/virtio_mmio.c                  |  4 +--
 drivers/virtio/virtio_pci_common.c            | 20 ++++++-----
 drivers/vme/bridges/vme_ca91cx42.c            |  5 +--
 drivers/vme/bridges/vme_tsi148.c              |  7 ++--
 drivers/w1/masters/ds1wm.c                    |  3 +-
 drivers/xen/events/events_base.c              | 12 ++++---
 drivers/xen/platform-pci.c                    |  4 +--
 drivers/xen/xen-pciback/pciback_ops.c         |  6 ++--
 samples/v4l/v4l2-pci-skeleton.c               |  5 +--
 sound/drivers/mpu401/mpu401_uart.c            |  3 +-
 sound/drivers/mtpav.c                         |  2 +-
 sound/drivers/serial-u16550.c                 |  3 +-
 sound/isa/ad1816a/ad1816a_lib.c               |  2 +-
 sound/isa/es1688/es1688_lib.c                 |  4 ++-
 sound/isa/es18xx.c                            |  3 +-
 sound/isa/gus/gus_main.c                      |  2 +-
 sound/isa/gus/gusmax.c                        |  2 +-
 sound/isa/gus/interwave.c                     |  3 +-
 sound/isa/msnd/msnd_pinnacle.c                |  3 +-
 sound/isa/opl3sa2.c                           |  4 +--
 sound/isa/opti9xx/opti92x-ad1848.c            |  3 +-
 sound/isa/sb/sb_common.c                      |  6 +---
 sound/isa/wavefront/wavefront.c               |  3 +-
 sound/isa/wss/wss_lib.c                       |  3 +-
 sound/pci/ad1889.c                            |  3 +-
 sound/pci/ali5451/ali5451.c                   |  3 +-
 sound/pci/als300.c                            |  3 +-
 sound/pci/asihpi/hpioctl.c                    |  3 +-
 sound/pci/atiixp.c                            |  3 +-
 sound/pci/atiixp_modem.c                      |  3 +-
 sound/pci/aw2/aw2-alsa.c                      |  3 +-
 sound/pci/azt3328.c                           |  3 +-
 sound/pci/bt87x.c                             |  4 +--
 sound/pci/ca0106/ca0106_main.c                |  3 +-
 sound/pci/cmipci.c                            |  3 +-
 sound/pci/cs4281.c                            |  3 +-
 sound/pci/cs46xx/cs46xx_lib.c                 |  3 +-
 sound/pci/cs5535audio/cs5535audio.c           |  3 +-
 sound/pci/ctxfi/cthw20k1.c                    |  3 +-
 sound/pci/ctxfi/cthw20k2.c                    |  3 +-
 sound/pci/emu10k1/emu10k1_main.c              |  3 +-
 sound/pci/emu10k1/emu10k1x.c                  |  3 +-
 sound/pci/ens1370.c                           |  3 +-
 sound/pci/es1938.c                            |  6 ++--
 sound/pci/es1968.c                            |  3 +-
 sound/pci/fm801.c                             |  3 +-
 sound/pci/hda/hda_intel.c                     |  4 +--
 sound/pci/ice1712/ice1712.c                   |  3 +-
 sound/pci/ice1712/ice1724.c                   |  3 +-
 sound/pci/intel8x0.c                          |  6 ++--
 sound/pci/intel8x0m.c                         |  6 ++--
 sound/pci/korg1212/korg1212.c                 |  4 +--
 sound/pci/lola/lola.c                         |  3 +-
 sound/pci/maestro3.c                          |  3 +-
 sound/pci/nm256/nm256.c                       |  3 +-
 sound/pci/oxygen/oxygen_lib.c                 |  4 +--
 sound/pci/riptide/riptide.c                   |  3 +-
 sound/pci/rme32.c                             |  3 +-
 sound/pci/rme96.c                             |  3 +-
 sound/pci/rme9652/hdsp.c                      |  3 +-
 sound/pci/rme9652/hdspm.c                     |  3 +-
 sound/pci/rme9652/rme9652.c                   |  3 +-
 sound/pci/sis7019.c                           |  7 ++--
 sound/pci/sonicvibes.c                        |  3 +-
 sound/pci/trident/trident_main.c              |  3 +-
 sound/pci/via82xx.c                           |  6 +---
 sound/pci/via82xx_modem.c                     |  3 +-
 sound/pci/ymfpci/ymfpci_main.c                |  3 +-
 sound/soc/amd/acp-pcm-dma.c                   |  3 +-
 sound/soc/amd/raven/acp3x-pcm-dma.c           |  3 +-
 sound/soc/codecs/rt5640.c                     |  4 +--
 sound/soc/codecs/rt5651.c                     |  4 +--
 sound/soc/codecs/rt5663.c                     |  4 +--
 sound/soc/dwc/dwc-i2s.c                       |  5 +--
 sound/soc/fsl/fsl_asrc.c                      |  3 +-
 sound/soc/fsl/fsl_esai.c                      |  3 +-
 sound/soc/fsl/fsl_sai.c                       |  3 +-
 sound/soc/fsl/fsl_spdif.c                     |  3 +-
 sound/soc/fsl/fsl_ssi.c                       |  3 +-
 sound/x86/intel_hdmi_audio.c                  |  5 +--
 478 files changed, 1084 insertions(+), 966 deletions(-)
arch/x86/include/asm/floppy.h +4 -2
index 7ec59edde154..4bcdde7e5fb8 100644
@@ -145,10 +145,12 @@ static int fd_request_irq(void)
 {
 	if (can_use_virtual_dma)
 		return request_irq(FLOPPY_IRQ, floppy_hardint,
-				   0, "floppy", NULL);
+				   IRQF_USER_DATA, "floppy",
+				   NULL);
 	else
 		return request_irq(FLOPPY_IRQ, floppy_interrupt,
-				   0, "floppy", NULL);
+				   IRQF_USER_DATA, "floppy",
+				   NULL);
 }
 
 static unsigned long dma_mem_alloc(unsigned long size)
drivers/atm/lanai.c +2 -2
index 5f8e009b2da1..880dc6af0a36 100644
@@ -2198,8 +2198,8 @@ static int lanai_dev_open(struct atm_dev *atmdev)
 	conf2_write(lanai);
 	reg_write(lanai, TX_FIFO_DEPTH, TxDepth_Reg);
 	reg_write(lanai, 0, CBR_ICG_Reg);	/* CBR defaults to no limit */
-	if ((result = request_irq(lanai->pci->irq, lanai_int, IRQF_SHARED,
-	    DEV_LABEL, lanai)) != 0) {
+	if ((result = request_irq(lanai->pci->irq, lanai_int,
+				IRQF_SHARED | IRQF_USER_DATA, DEV_LABEL, lanai)) != 0) {
 		printk(KERN_ERR DEV_LABEL ": can't allocate interrupt\n");
 		goto error_vcctable;
 	}
drivers/atm/nicstar.c +2 -2
index ae4aa02e4dc6..0d96c52cd217 100644
@@ -751,8 +751,8 @@ static int ns_init_card(int i, struct pci_dev *pcidev)
 	card->efbie = 1;
 
 	card->intcnt = 0;
-	if (request_irq
-	    (pcidev->irq, &ns_irq_handler, IRQF_SHARED, "nicstar", card) != 0) {
+	if (request_irq(pcidev->irq, &ns_irq_handler,
+				IRQF_SHARED | IRQF_USER_DATA, "nicstar", card) != 0) {
 		printk("nicstar%d: can't allocate IRQ %d.\n", i, pcidev->irq);
 		error = 9;
 		ns_init_card_error(card, error);
drivers/char/ipmi/ipmi_si_intf.c +2 -4
index dc8603d34320..0b4f02a446a7 100644
@@ -1266,10 +1266,8 @@ int ipmi_std_irq_setup(struct si_sm_io *io)
 	if (!io->irq)
 		return 0;
 
-	rv = request_irq(io->irq,
-			 ipmi_si_irq_handler,
-			 IRQF_SHARED,
-			 DEVICE_NAME,
+	rv = request_irq(io->irq, ipmi_si_irq_handler,
+			 IRQF_SHARED | IRQF_USER_DATA, DEVICE_NAME,
 			 io->irq_handler_data);
 	if (rv) {
 		dev_warn(io->dev, "%s unable to claim interrupt %d,"
drivers/char/sonypi.c +1 -2
index 186689833231..b923ce92039c 100644
@@ -1265,8 +1265,7 @@ static int sonypi_setup_irq(struct sonypi_device *dev,
 {
 	while (irq_list->irq) {
 
-		if (!request_irq(irq_list->irq, sonypi_irq,
-				 IRQF_SHARED, "sonypi", sonypi_irq)) {
+		if (!request_irq(irq_list->irq, sonypi_irq, IRQF_SHARED | IRQF_USER_DATA, "sonypi", sonypi_irq)) {
 			dev->irq = irq_list->irq;
 			dev->bits = irq_list->bits;
 			return 0;
drivers/firewire/nosy.c +1 -2
index a128dd1126ae..25c500fb01a2 100644
@@ -641,8 +641,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
 
 	run_pcl(lynx, lynx->rcv_start_pcl_bus, 0);
 
-	if (request_irq(dev->irq, irq_handler, IRQF_SHARED,
-			driver_name, lynx)) {
+	if (request_irq(dev->irq, irq_handler, IRQF_SHARED | IRQF_USER_DATA, driver_name, lynx)) {
 		dev_err(&dev->dev,
 			"Failed to allocate shared interrupt %d\n", dev->irq);
 		ret = -EIO;
drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c +2 -1
index e28107061148..e274a60a5887 100644
@@ -296,7 +296,8 @@ int oaktrail_hdmi_i2c_init(struct pci_dev *dev)
 	oaktrail_hdmi_i2c_gpio_fix();
 
 	/* request irq */
-	ret = request_irq(dev->irq, oaktrail_hdmi_i2c_handler, IRQF_SHARED,
+	ret = request_irq(dev->irq, oaktrail_hdmi_i2c_handler,
+			  IRQF_SHARED | IRQF_USER_DATA,
 			  oaktrail_hdmi_i2c_adapter.name, hdmi_dev);
 	if (ret) {
 		DRM_ERROR("Failed to request IRQ for I2C controller\n");
drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c +2 -1
index ee2431a7804e..656fcae19f2b 100644
@@ -116,7 +116,8 @@ nvkm_pci_oneinit(struct nvkm_subdev *subdev)
 			return ret;
 	}
 
-	ret = request_irq(pdev->irq, nvkm_pci_intr, IRQF_SHARED, "nvkm", pci);
+	ret = request_irq(pdev->irq, nvkm_pci_intr,
+			  IRQF_SHARED | IRQF_USER_DATA, "nvkm", pci);
 	if (ret)
 		return ret;
 
drivers/i2c/busses/i2c-emev2.c +3 -2
index 35b302d983e0..f69979d0b7b7 100644
@@ -391,8 +391,9 @@ static int em_i2c_probe(struct platform_device *pdev)
 	em_i2c_reset(&priv->adap);
 
 	irq = platform_get_irq(pdev, 0);
-	ret = devm_request_irq(&pdev->dev, irq, em_i2c_irq_handler, 0,
-				"em_i2c", priv);
+	ret = devm_request_irq(&pdev->dev, irq, em_i2c_irq_handler,
+			       IRQF_USER_DATA, "em_i2c",
+			       priv);
 	if (ret)
 		goto err_clk;
 
drivers/i2c/busses/i2c-i801.c +1 -1
index c91e145ef5a5..2aa88243db79 100644
@@ -1659,7 +1659,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		init_waitqueue_head(&priv->waitq);
 
 		err = devm_request_irq(&dev->dev, dev->irq, i801_isr,
-				       IRQF_SHARED,
+				       IRQF_SHARED | IRQF_USER_DATA,
 				       dev_driver_string(&dev->dev), priv);
 		if (err) {
 			dev_err(&dev->dev, "Failed to allocate irq %d: %d\n",
drivers/i2c/busses/i2c-pxa.c +2 -2
index fbf91d383b40..45c4415d67e4 100644
@@ -1297,8 +1297,8 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	} else {
 		i2c->adap.algo = &i2c_pxa_algorithm;
 		ret = devm_request_irq(&dev->dev, irq, i2c_pxa_handler,
-				IRQF_SHARED | IRQF_NO_SUSPEND,
-				dev_name(&dev->dev), i2c);
+				       IRQF_SHARED | IRQF_NO_SUSPEND | IRQF_USER_DATA,
+				       dev_name(&dev->dev), i2c);
 		if (ret) {
 			dev_err(&dev->dev, "failed to request irq: %d\n", ret);
 			goto ereqirq;
drivers/i2c/busses/i2c-rk3x.c +2 -1
index b8a2728dd4b6..9846859a9b57 100644
@@ -1271,7 +1271,8 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, irq, rk3x_i2c_irq,
-			       0, dev_name(&pdev->dev), i2c);
+			       IRQF_USER_DATA,
+			       dev_name(&pdev->dev), i2c);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "cannot request IRQ\n");
 		return ret;
drivers/ide/ide-probe.c +1 -1
index 17e9f447472c..958bf916d096 100644
@@ -882,7 +882,7 @@ static int init_irq (ide_hwif_t *hwif)
 
 	if (!host->get_lock)
 		if (request_irq(hwif->irq, irq_handler, sa | IRQF_USER_DATA,
-					hwif->name, hwif))
+				hwif->name, hwif))
 			goto out_up;
 
 #if !defined(__mc68000__)
drivers/infiniband/hw/mthca/mthca_eq.c +6 -8
index 30400ea4808b..e259c148411b 100644
@@ -825,10 +825,9 @@ int mthca_init_eq_table(struct mthca_dev *dev)
 				 "%s@pci:%s", eq_name[i],
 				 pci_name(dev->pdev));
 			err = request_irq(dev->eq_table.eq[i].msi_x_vector,
-					  mthca_is_memfree(dev) ?
-					  mthca_arbel_msi_x_interrupt :
-					  mthca_tavor_msi_x_interrupt,
-					  0, dev->eq_table.eq[i].irq_name,
+					  mthca_is_memfree(dev) ? mthca_arbel_msi_x_interrupt : mthca_tavor_msi_x_interrupt,
+					  IRQF_USER_DATA,
+					  dev->eq_table.eq[i].irq_name,
 					  dev->eq_table.eq + i);
 			if (err)
 				goto err_out_cmd;
@@ -838,10 +837,9 @@ int mthca_init_eq_table(struct mthca_dev *dev)
 		snprintf(dev->eq_table.eq[0].irq_name, IB_DEVICE_NAME_MAX,
 			 DRV_NAME "@pci:%s", pci_name(dev->pdev));
 		err = request_irq(dev->pdev->irq,
-				  mthca_is_memfree(dev) ?
-				  mthca_arbel_interrupt :
-				  mthca_tavor_interrupt,
-				  IRQF_SHARED, dev->eq_table.eq[0].irq_name, dev);
+				  mthca_is_memfree(dev) ? mthca_arbel_interrupt : mthca_tavor_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  dev->eq_table.eq[0].irq_name, dev);
 		if (err)
 			goto err_out_cmd;
 		dev->eq_table.have_irq = 1;
drivers/input/serio/i8042.c +7 -6
index 95a78ccbd847..6aadc878def2 100644
@@ -865,8 +865,7 @@ static int __init i8042_check_aux(void)
 		goto out;
 	}
 
-	if (request_irq(I8042_AUX_IRQ, i8042_aux_test_irq, IRQF_SHARED,
-			"i8042", i8042_platform_device))
+	if (request_irq(I8042_AUX_IRQ, i8042_aux_test_irq, IRQF_SHARED | IRQF_USER_DATA, "i8042", i8042_platform_device))
 		goto out;
 
 	irq_registered = true;
@@ -1463,8 +1462,9 @@ static int __init i8042_setup_aux(void)
 		aux_enable = i8042_enable_mux_ports;
 	}
 
-	error = request_irq(I8042_AUX_IRQ, i8042_interrupt, IRQF_SHARED,
-			    "i8042", i8042_platform_device);
+	error = request_irq(I8042_AUX_IRQ, i8042_interrupt,
+			    IRQF_SHARED | IRQF_USER_DATA, "i8042",
+			    i8042_platform_device);
 	if (error)
 		goto err_free_ports;
 
@@ -1489,8 +1489,9 @@ static int __init i8042_setup_kbd(void)
 	if (error)
 		return error;
 
-	error = request_irq(I8042_KBD_IRQ, i8042_interrupt, IRQF_SHARED,
-			    "i8042", i8042_platform_device);
+	error = request_irq(I8042_KBD_IRQ, i8042_interrupt,
+			    IRQF_SHARED | IRQF_USER_DATA, "i8042",
+			    i8042_platform_device);
 	if (error)
 		goto err_free_port;
 
drivers/ipack/carriers/tpci200.c +3 -3
index 8a9c169b6f99..fa0fd1c5a19c 100644
@@ -340,9 +340,9 @@ static int tpci200_register(struct tpci200_board *tpci200)
 	for (i = 0; i < TPCI200_NB_SLOT; i++)
 		writew(slot_ctrl, &tpci200->info->interface_regs->control[i]);
 
-	res = request_irq(tpci200->info->pdev->irq,
-			  tpci200_interrupt, IRQF_SHARED,
-			  KBUILD_MODNAME, (void *) tpci200);
+	res = request_irq(tpci200->info->pdev->irq, tpci200_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME,
+			  (void *)tpci200);
 	if (res) {
 		dev_err(&tpci200->info->pdev->dev,
 			"(bn 0x%X, sn 0x%X) unable to register IRQ !",
drivers/isdn/hardware/avm/b1isa.c +3 -1
index cdfea72e0ef6..63a724d5fc02 100644
@@ -97,7 +97,9 @@ static int b1isa_probe(struct pci_dev *pdev)
 		retval = -EBUSY;
 		goto err_free;
 	}
-	retval = request_irq(card->irq, b1_interrupt, 0, card->name, card);
+	retval = request_irq(card->irq, b1_interrupt,
+			     IRQF_USER_DATA, card->name,
+			     card);
 	if (retval) {
 		printk(KERN_ERR "b1isa: unable to get IRQ %d.\n", card->irq);
 		goto err_release_region;
drivers/isdn/hardware/avm/b1pci.c +4 -2
index b76b57a82c02..0bcc2f8fe1f1 100644
@@ -97,7 +97,8 @@ static int b1pci_probe(struct capicardparams *p, struct pci_dev *pdev)
 	b1_reset(card->port);
 	b1_getrevision(card);
 
-	retval = request_irq(card->irq, b1_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, b1_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "b1pci: unable to get IRQ %d.\n", card->irq);
 		retval = -EBUSY;
@@ -234,7 +235,8 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev)
 	b1dma_reset(card);
 	b1_getrevision(card);
 
-	retval = request_irq(card->irq, b1dma_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, b1dma_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "b1pci: unable to get IRQ %d.\n",
 		       card->irq);
drivers/isdn/hardware/avm/b1pcmcia.c +2 -1
index 3aca16e62902..4421a6a215ec 100644
@@ -82,7 +82,8 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq,
 	card->irq = irq;
 	card->cardtype = cardtype;
 
-	retval = request_irq(card->irq, b1_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, b1_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "b1pcmcia: unable to get IRQ %d.\n",
 		       card->irq);
drivers/isdn/hardware/avm/c4.c +2 -1
index ac72cd204c4d..a0ddcf7ae95b 100644
@@ -1180,7 +1180,8 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev,
 	}
 	c4_reset(card);
 
-	retval = request_irq(card->irq, c4_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, c4_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "c4: unable to get IRQ %d.\n", card->irq);
 		retval = -EBUSY;
drivers/isdn/hardware/avm/t1isa.c +3 -1
index 2153619c5b31..a00ff6646c9d 100644
@@ -405,7 +405,9 @@ static int t1isa_probe(struct pci_dev *pdev, int cardnr)
 		retval = -EBUSY;
 		goto err_free;
 	}
-	retval = request_irq(card->irq, t1isa_interrupt, 0, card->name, card);
+	retval = request_irq(card->irq, t1isa_interrupt,
+			     IRQF_USER_DATA, card->name,
+			     card);
 	if (retval) {
 		printk(KERN_INFO "t1isa: unable to get IRQ %d.\n", card->irq);
 		retval = -EBUSY;
drivers/isdn/hardware/avm/t1pci.c +2 -1
index f5ed1d5004c9..c43a57b95524 100644
@@ -103,7 +103,8 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev)
 	}
 	b1dma_reset(card);
 
-	retval = request_irq(card->irq, b1dma_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, b1dma_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "t1pci: unable to get IRQ %d.\n", card->irq);
 		retval = -EBUSY;
drivers/isdn/hardware/mISDN/avmfritz.c +2 -2
index 8eb28a83832e..12496f0038e5 100644
@@ -794,10 +794,10 @@ init_card(struct fritzcard *fc)
 	reset_avm(fc); /* disable IRQ */
 	if (fc->type == AVM_FRITZ_PCIV2)
 		ret = request_irq(fc->irq, avm_fritzv2_interrupt,
-				  IRQF_SHARED, fc->name, fc);
+				  IRQF_SHARED | IRQF_USER_DATA, fc->name, fc);
 	else
 		ret = request_irq(fc->irq, avm_fritz_interrupt,
-				  IRQF_SHARED, fc->name, fc);
+				  IRQF_SHARED | IRQF_USER_DATA, fc->name, fc);
 	if (ret) {
 		pr_info("%s: couldn't get interrupt %d\n",
 			fc->name, fc->irq);
drivers/isdn/hardware/mISDN/hfcmulti.c +1 -2
index 4d85645c87f7..c6bdad91ff4e 100644
@@ -4271,8 +4271,7 @@ init_card(struct hfc_multi *hc)
 	disable_hwirq(hc);
 	spin_unlock_irqrestore(&hc->lock, flags);
 
-	if (request_irq(hc->irq, hfcmulti_interrupt, IRQF_SHARED,
-			"HFC-multi", hc)) {
+	if (request_irq(hc->irq, hfcmulti_interrupt, IRQF_SHARED | IRQF_USER_DATA, "HFC-multi", hc)) {
 		printk(KERN_WARNING "mISDN: Could not get interrupt %d.\n",
 		       hc->irq);
 		hc->irq = 0;
drivers/isdn/hardware/mISDN/hfcpci.c +1 -1
index ebb3fa2e1d00..3da919c1c29e 100644
@@ -1738,7 +1738,7 @@ init_card(struct hfc_pci *hc)
 	spin_lock_irqsave(&hc->lock, flags);
 	disable_hwirq(hc);
 	spin_unlock_irqrestore(&hc->lock, flags);
-	if (request_irq(hc->irq, hfcpci_int, IRQF_SHARED, "HFC PCI", hc)) {
+	if (request_irq(hc->irq, hfcpci_int, IRQF_SHARED | IRQF_USER_DATA, "HFC PCI", hc)) {
 		printk(KERN_WARNING
 		       "mISDN: couldn't get interrupt %d\n", hc->irq);
 		return -EIO;
drivers/isdn/hardware/mISDN/mISDNinfineon.c +2 -1
index 3e01012be4ab..631543dfb025 100644
@@ -611,7 +611,8 @@ init_irq(struct inf_hw *hw)
 
 	if (!hw->ci->irqfunc)
 		return -EINVAL;
-	ret = request_irq(hw->irq, hw->ci->irqfunc, IRQF_SHARED, hw->name, hw);
+	ret = request_irq(hw->irq, hw->ci->irqfunc,
+			  IRQF_SHARED | IRQF_USER_DATA, hw->name, hw);
 	if (ret) {
 		pr_info("%s: couldn't get interrupt %d\n", hw->name, hw->irq);
 		return ret;
drivers/isdn/hardware/mISDN/netjet.c +1 -1
index 2b317cb63d06..3aafe328e919 100644
@@ -929,7 +929,7 @@ nj_init_card(struct tiger_hw *card)
 	spin_unlock_irqrestore(&card->lock, flags);
 
 	card->irq = card->pdev->irq;
-	if (request_irq(card->irq, nj_irq, IRQF_SHARED, card->name, card)) {
+	if (request_irq(card->irq, nj_irq, IRQF_SHARED | IRQF_USER_DATA, card->name, card)) {
 		pr_info("%s: couldn't get interrupt %d\n",
 			card->name, card->irq);
 		card->irq = -1;
drivers/isdn/hardware/mISDN/speedfax.c +2 -1
index 1f1446ed8d5f..378b9ff9711f 100644
@@ -288,7 +288,8 @@ init_card(struct sfax_hw *sf)
 	int	ret, cnt = 3;
 	u_long	flags;
 
-	ret = request_irq(sf->irq, speedfax_irq, IRQF_SHARED, sf->name, sf);
+	ret = request_irq(sf->irq, speedfax_irq, IRQF_SHARED | IRQF_USER_DATA,
+			  sf->name, sf);
 	if (ret) {
 		pr_info("%s: couldn't get interrupt %d\n", sf->name, sf->irq);
 		return ret;
drivers/isdn/hardware/mISDN/w6692.c +1 -1
index 6f60aced11c5..5628e9a764b8 100644
@@ -917,7 +917,7 @@ init_card(struct w6692_hw *card)
 	spin_lock_irqsave(&card->lock, flags);
 	disable_hwirq(card);
 	spin_unlock_irqrestore(&card->lock, flags);
-	if (request_irq(card->irq, w6692_irq, IRQF_SHARED, card->name, card)) {
+	if (request_irq(card->irq, w6692_irq, IRQF_SHARED | IRQF_USER_DATA, card->name, card)) {
 		pr_info("%s: couldn't get interrupt %d\n", card->name,
 			card->irq);
 		return -EIO;
drivers/isdn/hisax/config.c +1 -1
index b12e6cae26c2..03feb71c82f0 100644
@@ -822,7 +822,7 @@ static int init_card(struct IsdnCardState *cs)
 	irq_cnt = cs->irq_cnt = 0;
 	printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ],
 	       cs->irq, irq_cnt);
-	if (request_irq(cs->irq, card_irq, cs->irq_flags, "HiSax", cs)) {
+	if (request_irq(cs->irq, card_irq, cs->irq_flags | IRQF_USER_DATA, "HiSax", cs)) {
 		printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n",
 		       cs->irq);
 		return 1;
drivers/isdn/hisax/hfc4s8s_l1.c +1 -2
index e9bb8fb67ad0..be383944e1cb 100644
@@ -1440,8 +1440,7 @@ setup_instance(hfc4s8s_hw *hw)
 
 	INIT_WORK(&hw->tqueue, hfc4s8s_bh);
 
-	if (request_irq
-	    (hw->irq, hfc4s8s_interrupt, IRQF_SHARED, hw->card_name, hw)) {
+	if (request_irq(hw->irq, hfc4s8s_interrupt, IRQF_SHARED | IRQF_USER_DATA, hw->card_name, hw)) {
 		printk(KERN_INFO
 		       "HFC-4S/8S: unable to alloc irq %d, card ignored\n",
 		       hw->irq);
drivers/isdn/hisax/hisax_fcpcipnp.c +8 -5
index 7a7137d8664b..28f734bb18e4 100644
@@ -780,15 +780,18 @@ static int fcpcipnp_setup(struct fritz_adapter *adapter)
 
 	switch (adapter->type) {
 	case AVM_FRITZ_PCIV2:
-		retval = request_irq(adapter->irq, fcpci2_irq, IRQF_SHARED,
-				     "fcpcipnp", adapter);
+		retval = request_irq(adapter->irq, fcpci2_irq,
+				     IRQF_SHARED | IRQF_USER_DATA, "fcpcipnp",
+				     adapter);
 		break;
 	case AVM_FRITZ_PCI:
-		retval = request_irq(adapter->irq, fcpci_irq, IRQF_SHARED,
-				     "fcpcipnp", adapter);
+		retval = request_irq(adapter->irq, fcpci_irq,
+				     IRQF_SHARED | IRQF_USER_DATA, "fcpcipnp",
+				     adapter);
 		break;
 	case AVM_FRITZ_PNP:
-		retval = request_irq(adapter->irq, fcpci_irq, 0,
+		retval = request_irq(adapter->irq, fcpci_irq,
+				     IRQF_USER_DATA,
 				     "fcpcipnp", adapter);
 		break;
 	}
drivers/media/common/saa7146/saa7146_core.c +2 -2
index 9f7c5b0a6b45..67c358d839e0 100644
@@ -414,8 +414,8 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
 	saa7146_write(dev, MC2, 0xf8000000);
 
 	/* request an interrupt for the saa7146 */
-	err = request_irq(pci->irq, interrupt_hw, IRQF_SHARED,
-			  dev->name, dev);
+	err = request_irq(pci->irq, interrupt_hw,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err < 0) {
 		ERR("request_irq() failed\n");
 		goto err_unmap;
drivers/media/pci/b2c2/flexcop-pci.c +1 -2
index cc6527e35537..723e9d1266ef 100644
@@ -309,8 +309,7 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
 
 	pci_set_drvdata(fc_pci->pdev, fc_pci);
 	spin_lock_init(&fc_pci->irq_lock);
-	if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_isr,
-					IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0)
+	if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_isr, IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, fc_pci)) != 0)
 		goto err_pci_iounmap;
 
 	fc_pci->init_state |= FC_PCI_INIT;
drivers/media/pci/cobalt/cobalt-driver.c +1 -2
index 4885e833c052..77b6b1ec77b9 100644
@@ -383,8 +383,7 @@ static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev,
 	msi_config_show(cobalt, pci_dev);
 
 	/* Register IRQ */
-	if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED,
-			cobalt->v4l2_dev.name, (void *)cobalt)) {
+	if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED | IRQF_USER_DATA, cobalt->v4l2_dev.name, (void *)cobalt)) {
 		cobalt_err("Failed to register irq %d\n", pci_dev->irq);
 		ret = -EIO;
 		goto err_msi;
drivers/media/pci/cx18/cx18-driver.c +2 -1
index a6ba4ca5aa91..fce1d506c9d9 100644
@@ -1026,7 +1026,8 @@ static int cx18_probe(struct pci_dev *pci_dev,
 
 	/* Register IRQ */
 	retval = request_irq(cx->pci_dev->irq, cx18_irq_handler,
-			     IRQF_SHARED, cx->v4l2_dev.name, (void *)cx);
+			     IRQF_SHARED | IRQF_USER_DATA, cx->v4l2_dev.name,
+			     (void *)cx);
 	if (retval) {
 		CX18_ERR("Failed to register irq %d\n", retval);
 		goto free_i2c;
drivers/media/pci/cx25821/cx25821-core.c +1 -1
index 2f0171134f7e..e0f847d634a0 100644
@@ -1319,7 +1319,7 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
 	}
 
 	err = request_irq(pci_dev->irq, cx25821_irq,
-			IRQF_SHARED, dev->name, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 
 	if (err < 0) {
 		pr_err("%s: can't get IRQ %d\n", dev->name, pci_dev->irq);
drivers/media/pci/cx88/cx88-alsa.c +2 -1
index b683cbe13dee..00950fcc3468 100644
@@ -895,7 +895,8 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
 
 	/* get irq */
 	err = request_irq(chip->pci->irq, cx8801_irq,
-			  IRQF_SHARED, chip->core->name, chip);
+			  IRQF_SHARED | IRQF_USER_DATA, chip->core->name,
+			  chip);
 	if (err < 0) {
 		dprintk(0, "%s: can't get IRQ %d\n",
 			chip->core->name, chip->pci->irq);
drivers/media/pci/cx88/cx88-mpeg.c +1 -1
index 52ff00ebd4bd..34613db7cedb 100644
@@ -416,7 +416,7 @@ static int cx8802_init_common(struct cx8802_dev *dev)
 
 	/* get irq */
 	err = request_irq(dev->pci->irq, cx8802_irq,
-			  IRQF_SHARED, dev->core->name, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, dev->core->name, dev);
 	if (err < 0) {
 		pr_err("can't get IRQ %d\n", dev->pci->irq);
 		return err;
drivers/media/pci/cx88/cx88-video.c +1 -1
index e1549d352f70..bd2214ce59c5 100644
@@ -1342,7 +1342,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
 
 	/* get irq */
 	err = request_irq(pci_dev->irq, cx8800_irq,
-			  IRQF_SHARED, core->name, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, core->name, dev);
 	if (err < 0) {
 		pr_err("can't get IRQ %d\n", pci_dev->irq);
 		goto fail_core;
drivers/media/pci/dt3155/dt3155.c +1 -1
index 17d69bd5d7f1..dffc0b43fb64 100644
@@ -565,7 +565,7 @@ static int dt3155_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (err)
 		goto err_iounmap;
 	err = request_irq(pd->pdev->irq, dt3155_irq_handler_even,
-					IRQF_SHARED, DT3155_NAME, pd);
+			  IRQF_SHARED | IRQF_USER_DATA, DT3155_NAME, pd);
 	if (err)
 		goto err_iounmap;
 	err = video_register_device(&pd->vdev, VFL_TYPE_GRABBER, -1);
drivers/media/pci/intel/ipu3/ipu3-cio2.c +1 -1
index cdb79ae2d8dc..d5e80865c2d6 100644
@@ -1814,7 +1814,7 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
 		goto fail_cio2_queue_exit;
 
 	r = devm_request_irq(&pci_dev->dev, pci_dev->irq, cio2_irq,
-			     IRQF_SHARED, CIO2_NAME, cio2);
+			     IRQF_SHARED | IRQF_USER_DATA, CIO2_NAME, cio2);
 	if (r) {
 		dev_err(&pci_dev->dev, "failed to request IRQ (%d)\n", r);
 		goto fail;
drivers/media/pci/ivtv/ivtv-driver.c +2 -1
index dd727098daf4..155ac84fa563 100644
@@ -1249,7 +1249,8 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
 
 	/* Register IRQ */
 	retval = request_irq(itv->pdev->irq, ivtv_irq_handler,
-	     IRQF_SHARED, itv->v4l2_dev.name, (void *)itv);
+			     IRQF_SHARED | IRQF_USER_DATA, itv->v4l2_dev.name,
+			     (void *)itv);
 	if (retval) {
 		IVTV_ERR("Failed to register irq %d\n", retval);
 		goto free_i2c;
drivers/media/pci/meye/meye.c +1 -2
index bd870e60c32b..7c600673607b 100644
@@ -1674,8 +1674,7 @@ static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 	}
 
 	meye.mchip_irq = pcidev->irq;
-	if (request_irq(meye.mchip_irq, meye_irq,
-			IRQF_SHARED, "meye", meye_irq)) {
+	if (request_irq(meye.mchip_irq, meye_irq, IRQF_SHARED | IRQF_USER_DATA, "meye", meye_irq)) {
 		v4l2_err(v4l2_dev, "request_irq failed\n");
 		goto outreqirq;
 	}
drivers/media/pci/ngene/ngene-core.c +2 -3
index 25f16833a475..515f6fb6ab18 100644
@@ -1332,8 +1332,7 @@ static int ngene_start(struct ngene *dev)
 	ngene_init(dev);
 
 	stat = request_irq(dev->pci_dev->irq, irq_handler,
-			   IRQF_SHARED, "nGene",
-			   (void *)dev);
+			   IRQF_SHARED | IRQF_USER_DATA, "nGene", (void *)dev);
 	if (stat < 0)
 		return stat;
 
@@ -1372,7 +1371,7 @@ static int ngene_start(struct ngene *dev)
 			dev->msi_enabled = true;
 		}
 		stat = request_irq(dev->pci_dev->irq, irq_handler,
-					flags, "nGene", dev);
+				   flags | IRQF_USER_DATA, "nGene", dev);
 		if (stat < 0)
 			goto fail2;
 		ngwritel(1, NGENE_INT_ENABLE);
drivers/media/pci/pluto2/pluto2.c +2 -1
index 872c796621d2..e056ffee8ea6 100644
@@ -623,7 +623,8 @@ static int pluto2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_set_drvdata(pdev, pluto);
 
-	ret = request_irq(pdev->irq, pluto_irq, IRQF_SHARED, DRIVER_NAME, pluto);
+	ret = request_irq(pdev->irq, pluto_irq, IRQF_SHARED | IRQF_USER_DATA,
+			  DRIVER_NAME, pluto);
 	if (ret < 0)
 		goto err_pci_iounmap;
 
drivers/media/pci/saa7134/saa7134-alsa.c +2 -2
index dc9cdaaee1fb..80adb620e9b4 100644
@@ -1157,8 +1157,8 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
 
 
 	err = request_irq(dev->pci->irq, saa7134_alsa_irq,
-				IRQF_SHARED, dev->name,
-				(void*) &dev->dmasound);
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name,
+			  (void *)&dev->dmasound);
 
 	if (err < 0) {
 		pr_err("%s: can't get IRQ %d for ALSA\n",
drivers/media/pci/saa7134/saa7134-core.c +1 -1
index aa98ea49558c..b582fdd67c2c 100644
@@ -1158,7 +1158,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
 
 	/* get irq */
 	err = request_irq(pci_dev->irq, saa7134_irq,
-			  IRQF_SHARED, dev->name, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err < 0) {
 		pr_err("%s: can't get IRQ %d\n",
 		       dev->name,pci_dev->irq);
drivers/media/pci/saa7164/saa7164-core.c +4 -3
index f33349e16359..d8bcef88c3b2 100644
@@ -1188,8 +1188,8 @@ static bool saa7164_enable_msi(struct pci_dev *pci_dev, struct saa7164_dev *dev)
 	}
 
 	/* no error - so request an msi interrupt */
-	err = request_irq(pci_dev->irq, saa7164_irq, 0,
-						dev->name, dev);
+	err = request_irq(pci_dev->irq, saa7164_irq,
+			  IRQF_USER_DATA, dev->name, dev);
 
 	if (err) {
 		/* fall back to legacy interrupt */
@@ -1256,7 +1256,8 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
 			 or msi is not enabled - fallback to shared interrupt */
 
 		err = request_irq(pci_dev->irq, saa7164_irq,
-				IRQF_SHARED, dev->name, dev);
+				  IRQF_SHARED | IRQF_USER_DATA, dev->name,
+				  dev);
 
 		if (err < 0) {
 			printk(KERN_ERR "%s: can't get IRQ %d\n", dev->name,
drivers/media/pci/solo6x10/solo6x10-core.c +2 -2
index 19ffd2ed3cc7..0c46cde4644d 100644
@@ -559,8 +559,8 @@ static int solo_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	/* PLL locking time of 1ms */
 	mdelay(1);
 
-	ret = request_irq(pdev->irq, solo_isr, IRQF_SHARED, SOLO6X10_NAME,
-			  solo_dev);
+	ret = request_irq(pdev->irq, solo_isr, IRQF_SHARED | IRQF_USER_DATA,
+			  SOLO6X10_NAME, solo_dev);
 	if (ret)
 		goto fail_probe;
 
drivers/media/pci/sta2x11/sta2x11_vip.c +2 -3
index 411177ec4d72..1f869047e940 100644
@@ -1073,9 +1073,8 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev,
 
 	spin_lock_init(&vip->slock);
 
-	ret = request_irq(pdev->irq,
-			  (irq_handler_t) vip_irq,
-			  IRQF_SHARED, KBUILD_MODNAME, vip);
+	ret = request_irq(pdev->irq, (irq_handler_t)vip_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, vip);
 	if (ret) {
 		dev_err(&pdev->dev, "request_irq failed\n");
 		ret = -ENODEV;
drivers/media/pci/tw68/tw68-core.c +1 -1
index 8474528be91e..034fa832d925 100644
@@ -307,7 +307,7 @@ static int tw68_initdev(struct pci_dev *pci_dev,
 
 	/* get irq */
 	err = devm_request_irq(&pci_dev->dev, pci_dev->irq, tw68_irq,
-			  IRQF_SHARED, dev->name, dev);
+			       IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err < 0) {
 		pr_err("%s: can't get IRQ %d\n",
 		       dev->name, pci_dev->irq);
drivers/media/pci/tw686x/tw686x-core.c +2 -2
index 7fb3f07bf022..9d4fb3bfd947 100644
@@ -318,8 +318,8 @@ static int tw686x_probe(struct pci_dev *pci_dev,
 
 	spin_lock_init(&dev->lock);
 
-	err = request_irq(pci_dev->irq, tw686x_irq, IRQF_SHARED,
-			  dev->name, dev);
+	err = request_irq(pci_dev->irq, tw686x_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err < 0) {
 		dev_err(&pci_dev->dev, "unable to request interrupt\n");
 		goto iounmap;
drivers/media/platform/aspeed-video.c +3 -2
index dfec813f50a9..e1fe3bee82ab 100644
@@ -1600,8 +1600,9 @@ static int aspeed_video_init(struct aspeed_video *video)
 		return -ENODEV;
 	}
 
-	rc = devm_request_irq(dev, irq, aspeed_video_irq, IRQF_SHARED,
-			      DEVICE_NAME, video);
+	rc = devm_request_irq(dev, irq, aspeed_video_irq,
+			      IRQF_SHARED | IRQF_USER_DATA, DEVICE_NAME,
+			      video);
 	if (rc < 0) {
 		dev_err(dev, "Unable to request IRQ %d\n", irq);
 		return rc;
drivers/media/platform/marvell-ccic/cafe-driver.c +2 -1
index 8d00d9d8adff..689a0f1a95ee 100644
@@ -508,7 +508,8 @@ static int cafe_pci_probe(struct pci_dev *pdev,
 		goto out_disable;
 	}
 	mcam->regs_size = pci_resource_len(pdev, 0);
-	ret = request_irq(pdev->irq, cafe_irq, IRQF_SHARED, "cafe-ccic", cam);
+	ret = request_irq(pdev->irq, cafe_irq, IRQF_SHARED | IRQF_USER_DATA,
+			  "cafe-ccic", cam);
 	if (ret)
 		goto out_iounmap;
 
drivers/media/rc/fintek-cir.c +1 -2
index 601944666b71..07cd3c28b892 100644
@@ -552,8 +552,7 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
 			    fintek->cir_port_len, FINTEK_DRIVER_NAME))
 		goto exit_free_dev_rdev;
 
-	if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
-			FINTEK_DRIVER_NAME, (void *)fintek))
+	if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED | IRQF_USER_DATA, FINTEK_DRIVER_NAME, (void *)fintek))
 		goto exit_free_cir_addr;
 
 	ret = rc_register_device(rdev);
drivers/media/rc/gpio-ir-recv.c +1 -1
index 3d99b51384ac..487157b7a679 100644
@@ -101,7 +101,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, gpio_dev);
 
 	return devm_request_irq(dev, gpio_dev->irq, gpio_ir_recv_irq,
-				IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
+				IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | IRQF_USER_DATA,
 				"gpio-ir-recv-irq", gpio_dev);
 }
 
drivers/media/rc/ir-hix5hd2.c +1 -2
index abc4d6c1b323..5fad158e9a39 100644
@@ -275,8 +275,7 @@ static int hix5hd2_ir_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto clkerr;
 
-	if (devm_request_irq(dev, priv->irq, hix5hd2_ir_rx_interrupt,
-			     0, pdev->name, priv) < 0) {
+	if (devm_request_irq(dev, priv->irq, hix5hd2_ir_rx_interrupt, IRQF_USER_DATA, pdev->name, priv) < 0) {
 		dev_err(dev, "IRQ %d register failed\n", priv->irq);
 		ret = -EINVAL;
 		goto regerr;
drivers/media/rc/ite-cir.c +1 -2
index cd3c60ba8519..52d82983521a 100644
@@ -1593,8 +1593,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
 				dev_desc->io_region_size, ITE_DRIVER_NAME))
 		goto exit_unregister_device;
 
-	if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
-			ITE_DRIVER_NAME, (void *)itdev))
+	if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED | IRQF_USER_DATA, ITE_DRIVER_NAME, (void *)itdev))
 		goto exit_release_cir_addr;
 
 	ite_pr(KERN_NOTICE, "driver has been successfully loaded\n");
drivers/media/rc/nuvoton-cir.c +2 -1
index 5c2cd8d2d155..98d392188b2b 100644
@@ -1049,7 +1049,8 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
 		return -EBUSY;
 
 	ret = devm_request_irq(&pdev->dev, nvt->cir_irq, nvt_cir_isr,
-			       IRQF_SHARED, NVT_DRIVER_NAME, nvt);
+			       IRQF_SHARED | IRQF_USER_DATA, NVT_DRIVER_NAME,
+			       nvt);
 	if (ret)
 		return ret;
 
drivers/media/rc/serial_ir.c +1 -1
index ffe2c672d105..ffdd1f5cd194 100644
@@ -543,7 +543,7 @@ static int serial_ir_probe(struct platform_device *dev)
 	timer_setup(&serial_ir.timeout_timer, serial_ir_timeout, 0);
 
 	result = devm_request_irq(&dev->dev, irq, serial_ir_irq_handler,
-				  share_irq ? IRQF_SHARED : 0,
+				  (share_irq ? IRQF_SHARED : 0) | IRQF_USER_DATA,
 				  KBUILD_MODNAME, &hardware);
 	if (result < 0) {
 		if (result == -EBUSY)
drivers/media/rc/sir_ir.c +2 -1
index c8951650a368..952b1d93960e 100644
@@ -355,7 +355,8 @@ static int sir_ir_probe(struct platform_device *dev)
 		pr_err("i/o port 0x%.4x already in use.\n", io);
 		return -EBUSY;
 	}
-	retval = devm_request_irq(&sir_ir_dev->dev, irq, sir_interrupt, 0,
+	retval = devm_request_irq(&sir_ir_dev->dev, irq, sir_interrupt,
+				  IRQF_USER_DATA,
 				  KBUILD_MODNAME, NULL);
 	if (retval < 0) {
 		pr_err("IRQ %d already in use.\n", irq);
drivers/media/rc/winbond-cir.c +1 -1
index 0f07a2c384fa..d9876f3d5133 100644
@@ -1123,7 +1123,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
 	}
 
 	err = request_irq(data->irq, wbcir_irq_handler,
-			  0, DRVNAME, device);
+			  IRQF_USER_DATA, DRVNAME, device);
 	if (err) {
 		dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
 		err = -EBUSY;
drivers/memstick/host/jmb38x_ms.c +1 -2
index bcdca9fbef51..13b969c106ff 100644
@@ -901,8 +901,7 @@ static struct memstick_host *jmb38x_ms_alloc_host(struct jmb38x_ms *jm, int cnt)
 
 	timer_setup(&host->timer, jmb38x_ms_abort, 0);
 
-	if (!request_irq(host->irq, jmb38x_ms_isr, IRQF_SHARED, host->host_id,
-			 msh))
+	if (!request_irq(host->irq, jmb38x_ms_isr, IRQF_SHARED | IRQF_USER_DATA, host->host_id, msh))
 		return msh;
 
 	iounmap(host->addr);
drivers/message/fusion/mptbase.c +2 -1
index ba551d8dfba4..73c43c5e06b4 100644
@@ -2425,7 +2425,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
 			else
 				ioc->msi_enable = 0;
 			rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
-			    IRQF_SHARED, ioc->name, ioc);
+					 IRQF_SHARED | IRQF_USER_DATA,
+					 ioc->name, ioc);
 			if (rc < 0) {
 				printk(MYIOC_s_ERR_FMT "Unable to allocate "
 				    "interrupt %d!\n",
drivers/mfd/ezx-pcap.c +2 -2
index 542b47c6bcd2..61c36d063792 100644
@@ -479,8 +479,8 @@ static int ezx_pcap_probe(struct spi_device *spi)
 	adc_irq = pcap_to_irq(pcap, (pdata->config & PCAP_SECOND_PORT) ?
 					PCAP_IRQ_ADCDONE2 : PCAP_IRQ_ADCDONE);
 
-	ret = devm_request_irq(&spi->dev, adc_irq, pcap_adc_irq, 0, "ADC",
-				pcap);
+	ret = devm_request_irq(&spi->dev, adc_irq, pcap_adc_irq,
+			       IRQF_USER_DATA, "ADC", pcap);
 	if (ret)
 		goto free_irqchip;
 
drivers/misc/ibmasm/module.c +3 -1
index e914b8c80943..737bc3f9047b 100644
@@ -114,7 +114,9 @@ static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto error_ioremap;
 	}
 
-	result = request_irq(sp->irq, ibmasm_interrupt_handler, IRQF_SHARED, sp->devname, (void*)sp);
+	result = request_irq(sp->irq, ibmasm_interrupt_handler,
+			     IRQF_SHARED | IRQF_USER_DATA, sp->devname,
+			     (void *)sp);
 	if (result) {
 		dev_err(sp->dev, "Failed to register interrupt handler\n");
 		goto error_request_irq;
drivers/misc/sgi-gru/grufile.c +5 -2
index 104a05f6b738..e728978286dd 100644
@@ -385,7 +385,9 @@ static int gru_chiplet_setup_tlb_irq(int chiplet, char *irq_name,
 			return ret;
 		}
 
-		ret = request_irq(irq, irq_handler, 0, irq_name, NULL);
+		ret = request_irq(irq, irq_handler,
+				  IRQF_USER_DATA, irq_name,
+				  NULL);
 		if (ret) {
 			printk(KERN_ERR "%s: request_irq failed, errno=%d\n",
 			       GRU_DRIVER_ID_STR, -ret);
@@ -433,7 +435,8 @@ static int gru_chiplet_setup_tlb_irq(int chiplet, char *irq_name,
 		return irq;
 	}
 
-	ret = request_irq(irq, irq_handler, 0, irq_name, NULL);
+	ret = request_irq(irq, irq_handler, IRQF_USER_DATA,
+			  irq_name, NULL);
 	if (ret) {
 		uv_teardown_irq(irq);
 		printk(KERN_ERR "%s: request_irq failed, errno=%d\n",
drivers/misc/sgi-xp/xpc_uv.c +2 -1
index 0441abe87880..1563fbac9d5b 100644
@@ -259,7 +259,8 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name,
 	if (ret != 0)
 		goto out_4;
 
-	ret = request_irq(mq->irq, irq_handler, 0, irq_name, NULL);
+	ret = request_irq(mq->irq, irq_handler,
+			  IRQF_USER_DATA, irq_name, NULL);
 	if (ret != 0) {
 		dev_err(xpc_part, "request_irq(irq=%d) returned error=%d\n",
 			mq->irq, -ret);
drivers/mmc/host/mtk-sd.c +2 -1
index 833ef0590af8..1e95f419fb92 100644
@@ -2227,7 +2227,8 @@ static int msdc_drv_probe(struct platform_device *pdev)
 	msdc_init_hw(host);
 
 	ret = devm_request_irq(&pdev->dev, host->irq, msdc_irq,
-		IRQF_TRIGGER_LOW | IRQF_ONESHOT, pdev->name, host);
+			       IRQF_TRIGGER_LOW | IRQF_ONESHOT | IRQF_USER_DATA,
+			       pdev->name, host);
 	if (ret)
 		goto release;
 
drivers/net/arcnet/arc-rimi.c +1 -1
index 11c5bad95226..fc5b690b12af 100644
@@ -136,7 +136,7 @@ static int __init arcrimi_found(struct net_device *dev)
 	}
 
 	/* reserve the irq */
-	if (request_irq(dev->irq, arcnet_interrupt, 0, "arcnet (RIM I)", dev)) {
+	if (request_irq(dev->irq, arcnet_interrupt, IRQF_USER_DATA, "arcnet (RIM I)", dev)) {
 		iounmap(p);
 		release_mem_region(dev->mem_start, MIRROR_SIZE);
 		arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
drivers/net/arcnet/com20020.c +1 -2
index 78043a9c5981..c9fa16d5d079 100644
@@ -240,8 +240,7 @@ int com20020_found(struct net_device *dev, int shared)
 	arcnet_outb(dev->dev_addr[0], ioaddr, COM20020_REG_W_XREG);
 
 	/* reserve the irq */
-	if (request_irq(dev->irq, arcnet_interrupt, shared,
-			"arcnet (COM20020)", dev)) {
+	if (request_irq(dev->irq, arcnet_interrupt, shared | IRQF_USER_DATA, "arcnet (COM20020)", dev)) {
 		arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
 		return -ENODEV;
 	}
drivers/net/arcnet/com90io.c +1 -2
index 2c546013a980..d7ed122e9e47 100644
@@ -225,8 +225,7 @@ static int __init com90io_found(struct net_device *dev)
 	int err;
 
 	/* Reserve the irq */
-	if (request_irq(dev->irq, arcnet_interrupt, 0,
-			"arcnet (COM90xx-IO)", dev)) {
+	if (request_irq(dev->irq, arcnet_interrupt, IRQF_USER_DATA, "arcnet (COM90xx-IO)", dev)) {
 		arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
 		return -ENODEV;
 	}
drivers/net/arcnet/com90xx.c +1 -1
index ca4a57c30bf8..7d564078022b 100644
@@ -508,7 +508,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem,
 		goto err_free_dev;
 
 	/* reserve the irq */
-	if (request_irq(airq, arcnet_interrupt, 0, "arcnet (90xx)", dev)) {
+	if (request_irq(airq, arcnet_interrupt, IRQF_USER_DATA, "arcnet (90xx)", dev)) {
 		arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", airq);
 		goto err_release_mem;
 	}
drivers/net/can/cc770/cc770.c +2 -2
index da636a22c542..ffdfc65d0bf0 100644
@@ -782,8 +782,8 @@ static int cc770_open(struct net_device *dev)
 	if (err)
 		return err;
 
-	err = request_irq(dev->irq, &cc770_interrupt, priv->irq_flags,
-			  dev->name, dev);
+	err = request_irq(dev->irq, &cc770_interrupt,
+			  priv->irq_flags | IRQF_USER_DATA, dev->name, dev);
 	if (err) {
 		close_candev(dev);
 		return -EAGAIN;
drivers/net/can/peak_canfd/peak_pciefd_main.c +3 -5
index c458d5fdc8d3..844b9c17b40a 100644
@@ -415,11 +415,9 @@ static int pciefd_pre_cmd(struct peak_canfd_priv *ucan)
 			break;
 
 		/* going into operational mode: setup IRQ handler */
-		err = request_irq(priv->ucan.ndev->irq,
-				  pciefd_irq_handler,
-				  IRQF_SHARED,
-				  PCIEFD_DRV_NAME,
-				  priv);
+		err = request_irq(priv->ucan.ndev->irq, pciefd_irq_handler,
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  PCIEFD_DRV_NAME, priv);
 		if (err)
 			return err;
 
drivers/net/can/sja1000/ems_pcmcia.c +2 -2
index 381de998d2f1..831b4e962296 100644
@@ -243,8 +243,8 @@ static int ems_pcmcia_add_card(struct pcmcia_device *pdev, unsigned long base)
 			free_sja1000dev(dev);
 	}
 
-	err = request_irq(dev->irq, &ems_pcmcia_interrupt, IRQF_SHARED,
-			  DRV_NAME, card);
+	err = request_irq(dev->irq, &ems_pcmcia_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, card);
 	if (!err)
 		return 0;
 
drivers/net/can/sja1000/peak_pcmcia.c +2 -1
index b8c39ede7cd5..ace929c99393 100644
@@ -695,7 +695,8 @@ static int pcan_probe(struct pcmcia_device *pdev)
 	timer_setup(&card->led_timer, pcan_led_timer, 0);
 
 	/* request the given irq */
-	err = request_irq(pdev->irq, &pcan_isr, IRQF_SHARED, PCC_NAME, card);
+	err = request_irq(pdev->irq, &pcan_isr, IRQF_SHARED | IRQF_USER_DATA,
+			  PCC_NAME, card);
 	if (err) {
 		dev_err(&pdev->dev, "couldn't request irq%d\n", pdev->irq);
 		goto probe_err_5;
drivers/net/can/sja1000/sja1000.c +3 -2
index 9f107798f904..82fc8b74c5b9 100644
@@ -581,8 +581,9 @@ static int sja1000_open(struct net_device *dev)
 
 	/* register interrupt handler, if not done by the device driver */
 	if (!(priv->flags & SJA1000_CUSTOM_IRQ_HANDLER)) {
-		err = request_irq(dev->irq, sja1000_interrupt, priv->irq_flags,
-				  dev->name, (void *)dev);
+		err = request_irq(dev->irq, sja1000_interrupt,
+				  priv->irq_flags | IRQF_USER_DATA, dev->name,
+				  (void *)dev);
 		if (err) {
 			close_candev(dev);
 			return -EAGAIN;
drivers/net/ethernet/3com/3c509.c +2 -1
index b223769d6a5e..0230d2605b0f 100644
@@ -670,7 +670,8 @@ el3_open(struct net_device *dev)
 	outw(RxReset, ioaddr + EL3_CMD);
 	outw(SetStatusEnb | 0x00, ioaddr + EL3_CMD);
 
-	i = request_irq(dev->irq, el3_interrupt, 0, dev->name, dev);
+	i = request_irq(dev->irq, el3_interrupt,
+			IRQF_USER_DATA, dev->name, dev);
 	if (i)
 		return i;
 
drivers/net/ethernet/3com/3c515.c +2 -4
index b648e3f95c01..1ff6190b9ae4 100644
@@ -764,13 +764,11 @@ static int corkscrew_open(struct net_device *dev)
 		/* Corkscrew: Cannot share ISA resources. */
 		if (dev->irq == 0 ||
 		    dev->dma == 0 ||
-		    request_irq(dev->irq, corkscrew_interrupt, 0,
-				vp->product_name, dev))
+		    request_irq(dev->irq, corkscrew_interrupt, IRQF_USER_DATA, vp->product_name, dev))
 			return -EAGAIN;
 		enable_dma(dev->dma);
 		set_dma_mode(dev->dma, DMA_MODE_CASCADE);
-	} else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED,
-			       vp->product_name, dev)) {
+	} else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED | IRQF_USER_DATA, vp->product_name, dev)) {
 		return -EAGAIN;
 	}
 
drivers/net/ethernet/8390/axnet_cs.c +2 -1
index 0b6bbf63f7ca..01e1756458ea 100644
@@ -474,7 +474,8 @@ static int axnet_open(struct net_device *dev)
 	return -ENODEV;
 
     outb_p(0xFF, nic_base + EN0_ISR); /* Clear bogus intr. */
-    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev);
+    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED | IRQF_USER_DATA,
+                      "axnet_cs", dev);
     if (ret)
 	    return ret;
 
drivers/net/ethernet/8390/ne.c +2 -1
index 1c97e39b478e..a1b236fec72e 100644
@@ -492,7 +492,8 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
 
 	/* Snarf the interrupt now.  There's no point in waiting since we cannot
 	   share and the board will usually be enabled. */
-	ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+	ret = request_irq(dev->irq, eip_interrupt,
+			  IRQF_USER_DATA, name, dev);
 	if (ret) {
 		pr_cont(" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
 		goto err_out;
drivers/net/ethernet/8390/ne2k-pci.c +2 -1
index 42985a82321a..67607c6cea12 100644
@@ -431,7 +431,8 @@ static int ne2k_pci_set_fdx(struct net_device *dev)
 
 static int ne2k_pci_open(struct net_device *dev)
 {
-	int ret = request_irq(dev->irq, ei_interrupt, IRQF_SHARED, dev->name, dev);
+	int ret = request_irq(dev->irq, ei_interrupt,
+			      IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (ret)
 		return ret;
 
drivers/net/ethernet/8390/pcnet_cs.c +2 -1
index 61e43802b9a5..cb7ccae4e84d 100644
@@ -905,7 +905,8 @@ static int pcnet_open(struct net_device *dev)
     set_misc_reg(dev);
 
     outb_p(0xFF, nic_base + EN0_ISR); /* Clear bogus intr. */
-    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev->name, dev);
+    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED | IRQF_USER_DATA,
+                      dev->name, dev);
     if (ret)
 	    return ret;
 
drivers/net/ethernet/8390/smc-ultra.c +2 -1
index 3fe3b4dfa7c5..0ab0505a10d9 100644
@@ -390,7 +390,8 @@ ultra_open(struct net_device *dev)
 	unsigned char irq2reg[] = {0, 0, 0x04, 0x08, 0, 0x0C, 0, 0x40,
 				   0, 0x04, 0x44, 0x48, 0, 0, 0, 0x4C, };
 
-	retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+	retval = request_irq(dev->irq, ei_interrupt,
+			     IRQF_USER_DATA, dev->name, dev);
 	if (retval)
 		return retval;
 
drivers/net/ethernet/8390/wd.c +2 -1
index c834123560f1..bcfa77e1ed5c 100644
@@ -310,7 +310,8 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
 
 	/* Snarf the interrupt now.  There's no point in waiting since we cannot
 	   share and the board will usually be enabled. */
-	i = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
+	i = request_irq(dev->irq, ei_interrupt,
+			IRQF_USER_DATA, DRV_NAME, dev);
 	if (i) {
 		pr_cont(" unable to get IRQ %d.\n", dev->irq);
 		return i;
drivers/net/ethernet/agere/et131x.c +2 -2
index ea34bcb868b5..b143f7b734f8 100644
@@ -3621,8 +3621,8 @@ static int et131x_open(struct net_device *netdev)
 		msecs_to_jiffies(TX_ERROR_PERIOD);
 	add_timer(&adapter->error_timer);
 
-	result = request_irq(irq, et131x_isr,
-			     IRQF_SHARED, netdev->name, netdev);
+	result = request_irq(irq, et131x_isr, IRQF_SHARED | IRQF_USER_DATA,
+			     netdev->name, netdev);
 	if (result) {
 		dev_err(&pdev->dev, "could not register IRQ %d\n", irq);
 		return result;
drivers/net/ethernet/amd/lance.c +1 -1
index b56d84c7df46..2761fb2fc6ff 100644
@@ -753,7 +753,7 @@ lance_open(struct net_device *dev)
 	int i;
 
 	if (dev->irq == 0 ||
-		request_irq(dev->irq, lance_interrupt, 0, dev->name, dev)) {
+		request_irq(dev->irq, lance_interrupt, IRQF_USER_DATA, dev->name, dev)) {
 		return -EAGAIN;
 	}
 
drivers/net/ethernet/amd/ni65.c +3 -2
index 8931ce6bab7b..6285977cce73 100644
@@ -294,8 +294,9 @@ static void ni65_set_performance(struct priv *p)
 static int ni65_open(struct net_device *dev)
 {
 	struct priv *p = dev->ml_priv;
-	int irqval = request_irq(dev->irq, ni65_interrupt,0,
-                        cards[p->cardno].cardname,dev);
+	int irqval = request_irq(dev->irq, ni65_interrupt,
+				 IRQF_USER_DATA,
+				 cards[p->cardno].cardname, dev);
 	if (irqval) {
 		printk(KERN_ERR "%s: unable to get IRQ %d (irqval=%d).\n",
 		          dev->name,dev->irq, irqval);
drivers/net/ethernet/atheros/atlx/atl1.c +2 -2
index 63edc5706c09..d7fe078569df 100644
@@ -2637,8 +2637,8 @@ static s32 atl1_up(struct atl1_adapter *adapter)
 		irq_flags |= IRQF_SHARED;
 	}
 
-	err = request_irq(adapter->pdev->irq, atl1_intr, irq_flags,
-			netdev->name, netdev);
+	err = request_irq(adapter->pdev->irq, atl1_intr,
+			  irq_flags | IRQF_USER_DATA, netdev->name, netdev);
 	if (unlikely(err))
 		goto err_up;
 
drivers/net/ethernet/atheros/atlx/atl2.c +2 -2
index bb41becb6609..65b29d484bf1 100644
@@ -670,8 +670,8 @@ static int atl2_request_irq(struct atl2_adapter *adapter)
 	if (adapter->have_msi)
 		flags &= ~IRQF_SHARED;
 
-	return request_irq(adapter->pdev->irq, atl2_intr, flags, netdev->name,
-		netdev);
+	return request_irq(adapter->pdev->irq, atl2_intr,
+			   flags | IRQF_USER_DATA, netdev->name, netdev);
 }
 
 /**
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +5 -11
index 1e82b9efe447..b54e170ca81c 100644
@@ -407,9 +407,8 @@ static int request_msix_data_irqs(struct adapter *adap)
 
 		for (j = 0; j < nqsets; ++j) {
 			err = request_irq(adap->msix_info[qidx + 1].vec,
-					  t3_intr_handler(adap,
-							  adap->sge.qs[qidx].
-							  rspq.polling), 0,
+					  t3_intr_handler(adap, adap->sge.qs[qidx].rspq.polling),
+					  IRQF_USER_DATA,
 					  adap->msix_info[qidx + 1].desc,
 					  &adap->sge.qs[qidx]);
 			if (err) {
@@ -1264,7 +1263,8 @@ static int cxgb_up(struct adapter *adap)
 	if (adap->flags & USING_MSIX) {
 		name_msix_vecs(adap);
 		err = request_irq(adap->msix_info[0].vec,
-				  t3_async_intr_handler, 0,
+				  t3_async_intr_handler,
+				  IRQF_USER_DATA,
 				  adap->msix_info[0].desc, adap);
 		if (err)
 			goto irq_err;
@@ -1274,13 +1274,7 @@ static int cxgb_up(struct adapter *adap)
 			free_irq(adap->msix_info[0].vec, adap);
 			goto irq_err;
 		}
-	} else if ((err = request_irq(adap->pdev->irq,
-				      t3_intr_handler(adap,
-						      adap->sge.qs[0].rspq.
-						      polling),
-				      (adap->flags & USING_MSI) ?
-				       0 : IRQF_SHARED,
-				      adap->name, adap)))
+	} else if ((err = request_irq(adap->pdev->irq, t3_intr_handler(adap, adap->sge.qs[0].rspq.polling), ((adap->flags & USING_MSI) ? 0 : IRQF_SHARED) | IRQF_USER_DATA, adap->name, adap)))
 		goto irq_err;
 
 	enable_all_napi(adap);
drivers/net/ethernet/micrel/ks8851_mll.c +2 -1
index 35f8c9ef204d..2343c911276f 100644
@@ -924,7 +924,8 @@ static int ks_net_open(struct net_device *netdev)
 	netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__);
 
 	/* reset the HW */
-	err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);
+	err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS | IRQF_USER_DATA,
+			  DRV_NAME, netdev);
 
 	if (err) {
 		pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err);
drivers/net/ethernet/microchip/lan743x_main.c +3 -4
index 310807ef328b..4fd1123173e8 100644
@@ -385,10 +385,9 @@ static int lan743x_intr_register_isr(struct lan743x_adapter *adapter,
 	vector->handler = handler;
 	vector->context = context;
 
-	ret = request_irq(vector->irq,
-			  lan743x_intr_entry_isr,
-			  (flags & LAN743X_VECTOR_FLAG_IRQ_SHARED) ?
-			  IRQF_SHARED : 0, DRIVER_NAME, vector);
+	ret = request_irq(vector->irq, lan743x_intr_entry_isr,
+			  ((flags & LAN743X_VECTOR_FLAG_IRQ_SHARED) ? IRQF_SHARED : 0) | IRQF_USER_DATA,
+			  DRIVER_NAME, vector);
 	if (ret) {
 		vector->handler = NULL;
 		vector->context = NULL;
drivers/net/ethernet/realtek/atp.c +2 -1
index 7e011c1c1e6e..03ab879536b7 100644
@@ -433,7 +433,8 @@ static int net_open(struct net_device *dev)
 	/* The interrupt line is turned off (tri-stated) when the device isn't in
 	   use.  That's especially important for "attached" interfaces where the
 	   port or interrupt may be shared. */
-	ret = request_irq(dev->irq, atp_interrupt, 0, dev->name, dev);
+	ret = request_irq(dev->irq, atp_interrupt,
+			  IRQF_USER_DATA, dev->name, dev);
 	if (ret)
 		return ret;
 
drivers/net/fddi/skfp/skfddi.c +2 -2
index 5d661f60b101..077c3113418c 100644
@@ -486,8 +486,8 @@ static int skfp_open(struct net_device *dev)
 
 	pr_debug("entering skfp_open\n");
 	/* Register IRQ - support shared interrupts by passing device ptr */
-	err = request_irq(dev->irq, skfp_interrupt, IRQF_SHARED,
-			  dev->name, dev);
+	err = request_irq(dev->irq, skfp_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err)
 		return err;
 
drivers/net/hamradio/baycom_ser_fdx.c +1 -2
index 190f66c88479..31a59326c141 100644
@@ -447,8 +447,7 @@ static int ser12_open(struct net_device *dev)
 	outb(0, FCR(dev->base_addr));  /* disable FIFOs */
 	outb(0x0d, MCR(dev->base_addr));
 	outb(0, IER(dev->base_addr));
-	if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED,
-			"baycom_ser_fdx", dev)) {
+	if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED | IRQF_USER_DATA, "baycom_ser_fdx", dev)) {
 		release_region(dev->base_addr, SER12_EXTENT);
 		return -EBUSY;
 	}
drivers/net/hamradio/baycom_ser_hdx.c +1 -2
index 3c823c648cf5..2b98365f27da 100644
@@ -490,8 +490,7 @@ static int ser12_open(struct net_device *dev)
 	outb(0, FCR(dev->base_addr));  /* disable FIFOs */
 	outb(0x0d, MCR(dev->base_addr));
 	outb(0, IER(dev->base_addr));
-	if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED,
-			"baycom_ser12", dev)) {
+	if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED | IRQF_USER_DATA, "baycom_ser12", dev)) {
 		release_region(dev->base_addr, SER12_EXTENT);       
 		return -EBUSY;
 	}
drivers/net/hamradio/scc.c +1 -3
index 6c03932d8a6b..1e7ee07887e1 100644
@@ -1737,9 +1737,7 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 				
 			if (!Ivec[hwcfg.irq].used && hwcfg.irq)
 			{
-				if (request_irq(hwcfg.irq, scc_isr,
-						0, "AX.25 SCC",
-						(void *)(long) hwcfg.irq))
+				if (request_irq(hwcfg.irq, scc_isr, IRQF_USER_DATA, "AX.25 SCC", (void *)(long)hwcfg.irq))
 					printk(KERN_WARNING "z8530drv: warning, cannot get IRQ %d\n", hwcfg.irq);
 				else
 					Ivec[hwcfg.irq].used = 1;
drivers/net/hamradio/yam.c +1 -1
index ba9df430fca6..433695ae5e5c 100644
@@ -877,7 +877,7 @@ static int yam_open(struct net_device *dev)
 		goto out_release_base;
 	}
 	outb(0, IER(dev->base_addr));
-	if (request_irq(dev->irq, yam_interrupt, IRQF_SHARED, dev->name, dev)) {
+	if (request_irq(dev->irq, yam_interrupt, IRQF_SHARED | IRQF_USER_DATA, dev->name, dev)) {
 		printk(KERN_ERR "%s: irq %d busy\n", dev->name, dev->irq);
 		ret = -EBUSY;
 		goto out_release_base;
drivers/net/ieee802154/at86rf230.c +2 -1
index 0253eb502153..50af3e288503 100644
@@ -1749,7 +1749,8 @@ static int at86rf230_probe(struct spi_device *spi)
 		irq_type = IRQF_TRIGGER_HIGH;
 
 	rc = devm_request_irq(&spi->dev, spi->irq, at86rf230_isr,
-			      IRQF_SHARED | irq_type, dev_name(&spi->dev), lp);
+			      IRQF_SHARED | irq_type | IRQF_USER_DATA,
+			      dev_name(&spi->dev), lp);
 	if (rc)
 		goto free_dev;
 
drivers/net/ieee802154/ca8210.c +3 -7
index b2ff903a9cb6..e4915a6810a3 100644
@@ -2884,13 +2884,9 @@ static int ca8210_interrupt_init(struct spi_device *spi)
 		return pdata->irq_id;
 	}
 
-	ret = request_irq(
-		pdata->irq_id,
-		ca8210_interrupt_handler,
-		IRQF_TRIGGER_FALLING,
-		"ca8210-irq",
-		spi_get_drvdata(spi)
-	);
+	ret = request_irq(pdata->irq_id, ca8210_interrupt_handler,
+			  IRQF_TRIGGER_FALLING | IRQF_USER_DATA, "ca8210-irq",
+			  spi_get_drvdata(spi));
 	if (ret) {
 		dev_crit(&spi->dev, "request_irq %d failed\n", pdata->irq_id);
 		gpio_unexport(pdata->gpio_irq);
drivers/net/ieee802154/mcr20a.c +2 -1
index c589f5ae75bb..2a7e90769ed2 100644
@@ -1314,7 +1314,8 @@ mcr20a_probe(struct spi_device *spi)
 		irq_type = IRQF_TRIGGER_FALLING;
 
 	ret = devm_request_irq(&spi->dev, spi->irq, mcr20a_irq_isr,
-			       irq_type, dev_name(&spi->dev), lp);
+			       irq_type | IRQF_USER_DATA, dev_name(&spi->dev),
+			       lp);
 	if (ret) {
 		dev_err(&spi->dev, "could not request_irq for mcr20a\n");
 		ret = -ENODEV;
drivers/net/ieee802154/mrf24j40.c +2 -1
index cf4788d840bf..31b7d8d544bb 100644
@@ -1346,7 +1346,8 @@ static int mrf24j40_probe(struct spi_device *spi)
 		irq_type = IRQF_TRIGGER_LOW;
 
 	ret = devm_request_irq(&spi->dev, spi->irq, mrf24j40_isr,
-			       irq_type, dev_name(&spi->dev), devrec);
+			       irq_type | IRQF_USER_DATA, dev_name(&spi->dev),
+			       devrec);
 	if (ret) {
 		dev_err(printdev(devrec), "Unable to get IRQ");
 		goto err_register_device;
drivers/net/wan/cosa.c +1 -1
index f6b000ddcd15..d466bb81f2ab 100644
@@ -541,7 +541,7 @@ static int cosa_probe(int base, int irq, int dma)
 	cosa->usage = 0;
 	cosa->nchannels = 2;	/* FIXME: how to determine this? */
 
-	if (request_irq(cosa->irq, cosa_interrupt, 0, cosa->type, cosa)) {
+	if (request_irq(cosa->irq, cosa_interrupt, IRQF_USER_DATA, cosa->type, cosa)) {
 		err = -1;
 		goto err_out;
 	}
drivers/net/wan/farsync.c +1 -1
index 2a3f0f1a2b0a..070dee4a1ac6 100644
@@ -2466,7 +2466,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dbg(DBG_PCI, "kernel mem %p, ctlmem %p\n", card->mem, card->ctlmem);
 
 	/* Register the interrupt handler */
-	if (request_irq(pdev->irq, fst_intr, IRQF_SHARED, FST_DEV_NAME, card)) {
+	if (request_irq(pdev->irq, fst_intr, IRQF_SHARED | IRQF_USER_DATA, FST_DEV_NAME, card)) {
 		pr_err("Unable to register interrupt %d\n", card->irq);
 		err = -ENODEV;
 		goto irq_fail;
drivers/net/wan/hostess_sv11.c +1 -2
index 4de0737fbf8a..e4f5e247072f 100644
@@ -219,8 +219,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
 	/* We want a fast IRQ for this device. Actually we'd like an even faster
 	   IRQ ;) - This is one driver RtLinux is made for */
 
-	if (request_irq(irq, z8530_interrupt, 0,
-			"Hostess SV11", sv) < 0) {
+	if (request_irq(irq, z8530_interrupt, IRQF_USER_DATA, "Hostess SV11", sv) < 0) {
 		pr_warn("IRQ %d already in use\n", irq);
 		goto err_irq;
 	}
drivers/net/wan/sbni.c +1 -1
index 8e8c4c0e1b64..4f541c8c3615 100644
@@ -1175,7 +1175,7 @@ sbni_open( struct net_device  *dev )
 			}
 	}
 
-	if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) {
+	if(request_irq(dev->irq, sbni_interrupt, IRQF_SHARED | IRQF_USER_DATA, dev->name, dev)) {
 		netdev_err(dev, "unable to get IRQ %d\n", dev->irq);
 		return  -EAGAIN;
 	}
drivers/net/wan/sdla.c +1 -1
index 57ed259c8208..0a0cff9228e8 100644
@@ -1452,7 +1452,7 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map)
 	}
 
 	err = -EAGAIN;
-	if (request_irq(dev->irq, sdla_isr, 0, dev->name, dev)) 
+	if (request_irq(dev->irq, sdla_isr, IRQF_USER_DATA, dev->name, dev)) 
 		goto fail;
 
 	if (flp->type == SDLA_S507) {
drivers/net/wan/sealevel.c +1 -2
index c56f2c252113..53687a3b703f 100644
@@ -265,8 +265,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,
 	/* We want a fast IRQ for this device. Actually we'd like an even faster
 	   IRQ ;) - This is one driver RtLinux is made for */
 
-	if (request_irq(irq, z8530_interrupt, 0,
-			"SeaLevel", dev) < 0) {
+	if (request_irq(irq, z8530_interrupt, IRQF_USER_DATA, "SeaLevel", dev) < 0) {
 		pr_warn("IRQ %d already in use\n", irq);
 		goto err_request_irq;
 	}
drivers/net/wireless/broadcom/b43legacy/main.c +1 -1
index 55f411925960..e61752e584dd 100644
@@ -2989,7 +2989,7 @@ static int b43legacy_wireless_core_start(struct b43legacy_wldev *dev)
 
 	drain_txstatus_queue(dev);
 	err = request_irq(dev->dev->irq, b43legacy_interrupt_handler,
-			  IRQF_SHARED, KBUILD_MODNAME, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, dev);
 	if (err) {
 		b43legacyerr(dev->wl, "Cannot request IRQ-%d\n",
 		       dev->dev->irq);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +4 -3
index d64bf233b12c..a38d39a52133 100644
@@ -116,9 +116,10 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)
 		spin_lock_init(&sdiodev->irq_en_lock);
 		sdiodev->irq_en = true;
 
-		ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler,
-				  pdata->oob_irq_flags, "brcmf_oob_intr",
-				  &sdiodev->func1->dev);
+		ret = request_irq(pdata->oob_irq_nr,
+				  brcmf_sdiod_oob_irqhandler,
+				  pdata->oob_irq_flags | IRQF_USER_DATA,
+				  "brcmf_oob_intr", &sdiodev->func1->dev);
 		if (ret != 0) {
 			brcmf_err("request_irq failed %d\n", ret);
 			return ret;
drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +1 -2
index 6188275b17e5..f81ec32145c3 100644
@@ -1167,8 +1167,7 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev)
 	wl->pub->ieee_hw = hw;
 
 	/* register our interrupt handler */
-	if (request_irq(pdev->irq, brcms_isr,
-			IRQF_SHARED, KBUILD_MODNAME, wl)) {
+	if (request_irq(pdev->irq, brcms_isr, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, wl)) {
 		wiphy_err(wl->wiphy, "wl%d: request_irq() failed\n", unit);
 		goto fail;
 	}
drivers/net/wireless/cisco/airo.c +2 -2
index 3f5a14112c6b..5e85377e1565 100644
@@ -1894,8 +1894,8 @@ static int airo_open(struct net_device *dev) {
 		if (IS_ERR(ai->airo_thread_task))
 			return (int)PTR_ERR(ai->airo_thread_task);
 
-		rc = request_irq(dev->irq, airo_interrupt, IRQF_SHARED,
-			dev->name, dev);
+		rc = request_irq(dev->irq, airo_interrupt,
+				 IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 		if (rc) {
 			airo_print_err(dev->name,
 				"register interrupt %d failed, rc %d",
drivers/net/wireless/intel/ipw2x00/ipw2100.c +2 -2
index 52e5ed2d3bc2..0b8c2275ec55 100644
@@ -6253,8 +6253,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 	}
 	ipw2100_queues_initialize(priv);
 
-	err = request_irq(pci_dev->irq,
-			  ipw2100_interrupt, IRQF_SHARED, dev->name, priv);
+	err = request_irq(pci_dev->irq, ipw2100_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, priv);
 	if (err) {
 		printk(KERN_WARNING DRV_NAME
 		       "Error calling request_irq: %d.\n", pci_dev->irq);
drivers/net/wireless/intel/ipw2x00/ipw2200.c +2 -1
index fa400f92d7e2..33931a4435e3 100644
@@ -11686,7 +11686,8 @@ static int ipw_pci_probe(struct pci_dev *pdev,
 
 	ipw_sw_reset(priv, 1);
 
-	err = request_irq(pdev->irq, ipw_isr, IRQF_SHARED, DRV_NAME, priv);
+	err = request_irq(pdev->irq, ipw_isr, IRQF_SHARED | IRQF_USER_DATA,
+			  DRV_NAME, priv);
 	if (err) {
 		IPW_ERROR("Error allocating IRQ %d\n", pdev->irq);
 		goto out_iounmap;
drivers/net/wireless/intel/iwlegacy/3945-mac.c +2 -1
index 57e3b6cca234..48cdce4a6ca0 100644
@@ -3729,7 +3729,8 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_enable_msi(il->pci_dev);
 
-	err = request_irq(il->pci_dev->irq, il_isr, IRQF_SHARED, DRV_NAME, il);
+	err = request_irq(il->pci_dev->irq, il_isr,
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, il);
 	if (err) {
 		IL_ERR("Error allocating IRQ %d\n", il->pci_dev->irq);
 		goto out_disable_msi;
drivers/net/wireless/intel/iwlegacy/4965-mac.c +2 -1
index 6b4488a178a7..8132d6964923 100644
@@ -6642,7 +6642,8 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_enable_msi(il->pci_dev);
 
-	err = request_irq(il->pci_dev->irq, il_isr, IRQF_SHARED, DRV_NAME, il);
+	err = request_irq(il->pci_dev->irq, il_isr,
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, il);
 	if (err) {
 		IL_ERR("Error allocating IRQ %d\n", il->pci_dev->irq);
 		goto out_disable_msi;
drivers/net/wireless/intersil/hostap/hostap_pci.c +1 -2
index c864ef4b0015..9886b9007da3 100644
@@ -335,8 +335,7 @@ static int prism2_pci_probe(struct pci_dev *pdev,
 
 	pci_set_drvdata(pdev, dev);
 
-	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name,
-			dev)) {
+	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED | IRQF_USER_DATA, dev->name, dev)) {
 		printk(KERN_WARNING "%s: request_irq failed\n", dev->name);
 		goto fail;
 	} else
drivers/net/wireless/intersil/hostap/hostap_plx.c +1 -2
index 4901a99c6c59..f6ba83e95bf3 100644
@@ -549,8 +549,7 @@ static int prism2_plx_probe(struct pci_dev *pdev,
 
 	pci_set_drvdata(pdev, dev);
 
-	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name,
-			dev)) {
+	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED | IRQF_USER_DATA, dev->name, dev)) {
 		printk(KERN_WARNING "%s: request_irq failed\n", dev->name);
 		goto fail;
 	} else
drivers/net/wireless/intersil/orinoco/orinoco_nortel.c +2 -2
index 048693b6c6c2..d5a5fbd013e7 100644
@@ -194,8 +194,8 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
 
 	hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
 
-	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
-			  DRIVER_NAME, priv);
+	err = request_irq(pdev->irq, orinoco_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, priv);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
drivers/net/wireless/intersil/orinoco/orinoco_pci.c +2 -2
index 4938a2208a37..30a5865822eb 100644
@@ -150,8 +150,8 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
 
 	hermes_struct_init(&priv->hw, hermes_io, HERMES_32BIT_REGSPACING);
 
-	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
-			  DRIVER_NAME, priv);
+	err = request_irq(pdev->irq, orinoco_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, priv);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
drivers/net/wireless/intersil/orinoco/orinoco_plx.c +2 -2
index 221352027779..72379f60f7db 100644
@@ -233,8 +233,8 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
 
 	hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
 
-	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
-			  DRIVER_NAME, priv);
+	err = request_irq(pdev->irq, orinoco_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, priv);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
drivers/net/wireless/intersil/orinoco/orinoco_tmd.c +2 -2
index 20ce569b8a43..0ab170de926a 100644
@@ -136,8 +136,8 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
 
 	hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
 
-	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
-			  DRIVER_NAME, priv);
+	err = request_irq(pdev->irq, orinoco_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, priv);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
drivers/net/wireless/intersil/p54/p54pci.c +1 -1
index 27a49068d32d..5b4af691fb2a 100644
@@ -435,7 +435,7 @@ static int p54p_open(struct ieee80211_hw *dev)
 
 	init_completion(&priv->boot_comp);
 	err = request_irq(priv->pdev->irq, p54p_interrupt,
-			  IRQF_SHARED, "p54pci", dev);
+			  IRQF_SHARED | IRQF_USER_DATA, "p54pci", dev);
 	if (err) {
 		dev_err(&priv->pdev->dev, "failed to register IRQ handler\n");
 		return err;
drivers/net/wireless/intersil/p54/p54spi.c +2 -2
index e41bf042352e..83202723109d 100644
@@ -635,8 +635,8 @@ static int p54spi_probe(struct spi_device *spi)
 	gpio_direction_output(p54spi_gpio_power, 0);
 	gpio_direction_input(p54spi_gpio_irq);
 
-	ret = request_irq(gpio_to_irq(p54spi_gpio_irq),
-			  p54spi_interrupt, 0, "p54spi",
+	ret = request_irq(gpio_to_irq(p54spi_gpio_irq), p54spi_interrupt,
+			  IRQF_USER_DATA, "p54spi",
 			  priv->spi);
 	if (ret < 0) {
 		dev_err(&priv->spi->dev, "request_irq() failed");
drivers/net/wireless/intersil/prism54/islpci_hotplug.c +1 -1
index 300c846ea087..50ac965c0092 100644
@@ -182,7 +182,7 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	/* request for the interrupt before uploading the firmware */
 	rvalue = request_irq(pdev->irq, islpci_interrupt,
-			     IRQF_SHARED, ndev->name, priv);
+			     IRQF_SHARED | IRQF_USER_DATA, ndev->name, priv);
 
 	if (rvalue) {
 		/* error, could not hook the handler to the irq */
drivers/net/wireless/marvell/libertas/if_cs.c +1 -1
index cebf03c6a622..aed7ad507a2b 100644
@@ -736,7 +736,7 @@ static void if_cs_prog_firmware(struct lbs_private *priv, int ret,
 
 	/* Now actually get the IRQ */
 	ret = request_irq(card->p_dev->irq, if_cs_interrupt,
-		IRQF_SHARED, DRV_NAME, card);
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, card);
 	if (ret) {
 		pr_err("error in request_irq\n");
 		return;
drivers/net/wireless/marvell/libertas/if_spi.c +2 -1
index 7c3224b83ef7..3b8c174448c8 100644
@@ -1167,7 +1167,8 @@ static int if_spi_probe(struct spi_device *spi)
 	INIT_WORK(&card->resume_work, if_spi_resume_worker);
 
 	err = request_irq(spi->irq, if_spi_host_interrupt,
-			IRQF_TRIGGER_FALLING, "libertas_spi", card);
+			  IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
+			  "libertas_spi", card);
 	if (err) {
 		pr_err("can't get host irq line-- request_irq failed\n");
 		goto terminate_workqueue;
drivers/net/wireless/marvell/mwifiex/main.c +3 -2
index 20cee5c397fb..730acbe06c99 100644
@@ -1602,8 +1602,9 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
 	}
 
 	ret = devm_request_irq(dev, adapter->irq_wakeup,
-			       mwifiex_irq_wakeup_handler, IRQF_TRIGGER_LOW,
-			       "wifi_wake", adapter);
+			       mwifiex_irq_wakeup_handler,
+			       IRQF_TRIGGER_LOW | IRQF_USER_DATA, "wifi_wake",
+			       adapter);
 	if (ret) {
 		dev_err(dev, "Failed to request irq_wakeup %d (%d)\n",
 			adapter->irq_wakeup, ret);
drivers/net/wireless/marvell/mwifiex/pcie.c +5 -3
index 3fe81b2a929a..f8ee89d5fa81 100644
@@ -3033,7 +3033,8 @@ static int mwifiex_pcie_request_irq(struct mwifiex_adapter *adapter)
 				card->msix_ctx[i].msg_id = i;
 
 				ret = request_irq(card->msix_entries[i].vector,
-						  mwifiex_pcie_interrupt, 0,
+						  mwifiex_pcie_interrupt,
+						  IRQF_USER_DATA,
 						  "MWIFIEX_PCIE_MSIX",
 						  &card->msix_ctx[i]);
 				if (ret)
@@ -3064,8 +3065,9 @@ static int mwifiex_pcie_request_irq(struct mwifiex_adapter *adapter)
 
 	card->share_irq_ctx.dev = pdev;
 	card->share_irq_ctx.msg_id = -1;
-	ret = request_irq(pdev->irq, mwifiex_pcie_interrupt, IRQF_SHARED,
-			  "MRVL_PCIE", &card->share_irq_ctx);
+	ret = request_irq(pdev->irq, mwifiex_pcie_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, "MRVL_PCIE",
+			  &card->share_irq_ctx);
 	if (ret) {
 		pr_err("request_irq failed: ret=%d\n", ret);
 		return -1;
drivers/net/wireless/marvell/mwl8k.c +2 -2
index 8e4e9b6919e0..9a55fe1a2f0d 100644
@@ -4696,7 +4696,7 @@ static int mwl8k_start(struct ieee80211_hw *hw)
 	int rc;
 
 	rc = request_irq(priv->pdev->irq, mwl8k_interrupt,
-			 IRQF_SHARED, MWL8K_NAME, hw);
+			 IRQF_SHARED | IRQF_USER_DATA, MWL8K_NAME, hw);
 	if (rc) {
 		priv->irq = -1;
 		wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
@@ -5902,7 +5902,7 @@ static int mwl8k_probe_hw(struct ieee80211_hw *hw)
 		  priv->regs + MWL8K_HIU_A2H_INTERRUPT_STATUS_MASK);
 
 	rc = request_irq(priv->pdev->irq, mwl8k_interrupt,
-			 IRQF_SHARED, MWL8K_NAME, hw);
+			 IRQF_SHARED | IRQF_USER_DATA, MWL8K_NAME, hw);
 	if (rc) {
 		wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
 		goto err_free_queues;
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c +2 -1
index d895b6f3dc44..e6f717724f81 100644
@@ -191,7 +191,8 @@ mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	dev_info(dev->mt76.dev, "ASIC revision: %08x\n", dev->mt76.rev);
 
 	ret = devm_request_irq(dev->mt76.dev, pdev->irq, mt76x02_irq_handler,
-			       IRQF_SHARED, KBUILD_MODNAME, dev);
+			       IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME,
+			       dev);
 	if (ret)
 		goto error;
 
drivers/net/wireless/mediatek/mt76/mt76x2/pci.c +2 -1
index 92432fe97312..3c21e173786a 100644
@@ -58,7 +58,8 @@ mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	dev_info(dev->mt76.dev, "ASIC revision: %08x\n", dev->mt76.rev);
 
 	ret = devm_request_irq(dev->mt76.dev, pdev->irq, mt76x02_irq_handler,
-			       IRQF_SHARED, KBUILD_MODNAME, dev);
+			       IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME,
+			       dev);
 	if (ret)
 		goto error;
 
drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c +2 -1
index 1f5facbb8905..7fd8ee3c14b7 100644
@@ -1095,7 +1095,8 @@ static int qtnf_pcie_pearl_probe(struct qtnf_bus *bus, unsigned int tx_bd_size)
 	qtnf_disable_hdp_irqs(ps);
 
 	ret = devm_request_irq(&pdev->dev, pdev->irq,
-			       &qtnf_pcie_pearl_interrupt, 0,
+			       &qtnf_pcie_pearl_interrupt,
+			       IRQF_USER_DATA,
 			       "qtnf_pearl_irq", (void *)bus);
 	if (ret) {
 		pr_err("failed to request pcie irq %d\n", pdev->irq);
drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c +2 -1
index 598edb814421..2905fa3d7261 100644
@@ -1120,7 +1120,8 @@ static int qtnf_pcie_topaz_probe(struct qtnf_bus *bus, unsigned int tx_bd_num)
 
 	ret = devm_request_irq(&pdev->dev, pdev->irq,
 			       &qtnf_pcie_topaz_interrupt,
-			       irqflags, "qtnf_topaz_irq", (void *)bus);
+			       irqflags | IRQF_USER_DATA, "qtnf_topaz_irq",
+			       (void *)bus);
 	if (ret) {
 		pr_err("failed to request pcie irq %d\n", pdev->irq);
 		return ret;
drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c +3 -3
index 4956a54151cb..bd31eb811f19 100644
@@ -167,9 +167,9 @@ int rt2x00mmio_initialize(struct rt2x00_dev *rt2x00dev)
 	/*
 	 * Register interrupt handler.
 	 */
-	status = request_irq(rt2x00dev->irq,
-			     rt2x00dev->ops->lib->irq_handler,
-			     IRQF_SHARED, rt2x00dev->name, rt2x00dev);
+	status = request_irq(rt2x00dev->irq, rt2x00dev->ops->lib->irq_handler,
+			     IRQF_SHARED | IRQF_USER_DATA, rt2x00dev->name,
+			     rt2x00dev);
 	if (status) {
 		rt2x00_err(rt2x00dev, "IRQ %d allocation failed (error %d)\n",
 			   rt2x00dev->irq, status);
drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c +4 -2
index 225c1c8851cc..4ae6d1d7bdec 100644
@@ -1134,10 +1134,12 @@ static int rtl8180_start(struct ieee80211_hw *dev)
 
 	if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) {
 		ret = request_irq(priv->pdev->irq, rtl8187se_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, dev);
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  KBUILD_MODNAME, dev);
 	} else {
 		ret = request_irq(priv->pdev->irq, rtl8180_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, dev);
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  KBUILD_MODNAME, dev);
 	}
 
 	if (ret) {
drivers/net/wireless/realtek/rtlwifi/pci.c +2 -2
index 5d1fda16fc8c..58b64849172a 100644
@@ -2108,7 +2108,7 @@ static int rtl_pci_intr_mode_msi(struct ieee80211_hw *hw)
 		return ret;
 
 	ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, hw);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, hw);
 	if (ret < 0) {
 		pci_disable_msi(rtlpci->pdev);
 		return ret;
@@ -2129,7 +2129,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw)
 	int ret;
 
 	ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, hw);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, hw);
 	if (ret < 0)
 		return ret;
 
drivers/net/wireless/ti/wl1251/sdio.c +3 -1
index b661f896e9fe..f5c3450cf15f 100644
@@ -274,7 +274,9 @@ static int wl1251_sdio_probe(struct sdio_func *func,
 
 	if (wl->irq) {
 		irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
-		ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl);
+		ret = request_irq(wl->irq, wl1251_line_irq,
+				  IRQF_USER_DATA, "wl1251",
+				  wl);
 		if (ret < 0) {
 			wl1251_error("request_irq() failed: %d", ret);
 			goto disable;
drivers/net/wireless/ti/wl1251/spi.c +3 -2
index 8de9d4444a6a..1fc0a75d4281 100644
@@ -307,8 +307,9 @@ static int wl1251_spi_probe(struct spi_device *spi)
 	}
 
 	irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
-	ret = devm_request_irq(&spi->dev, wl->irq, wl1251_irq, 0,
-							DRIVER_NAME, wl);
+	ret = devm_request_irq(&spi->dev, wl->irq, wl1251_irq,
+			       IRQF_USER_DATA, DRIVER_NAME,
+			       wl);
 	if (ret < 0) {
 		wl1251_error("request_irq() failed: %d", ret);
 		goto out_free;
drivers/ntb/hw/amd/ntb_hw_amd.c +7 -5
index efb214fc545a..8de5bd055b66 100644
@@ -621,7 +621,8 @@ static int ndev_init_isr(struct amd_ntb_dev *ndev,
 	for (i = 0; i < msix_count; ++i) {
 		ndev->vec[i].ndev = ndev;
 		ndev->vec[i].num = i;
-		rc = request_irq(ndev->msix[i].vector, ndev_vec_isr, 0,
+		rc = request_irq(ndev->msix[i].vector, ndev_vec_isr,
+				 IRQF_USER_DATA,
 				 "ndev_vec_isr", &ndev->vec[i]);
 		if (rc)
 			goto err_msix_request;
@@ -649,8 +650,9 @@ static int ndev_init_isr(struct amd_ntb_dev *ndev,
 	if (rc)
 		goto err_msi_enable;
 
-	rc = request_irq(pdev->irq, ndev_irq_isr, 0,
-			 "ndev_irq_isr", ndev);
+	rc = request_irq(pdev->irq, ndev_irq_isr,
+			 IRQF_USER_DATA, "ndev_irq_isr",
+			 ndev);
 	if (rc)
 		goto err_msi_request;
 
@@ -666,8 +668,8 @@ static int ndev_init_isr(struct amd_ntb_dev *ndev,
 	/* Try to set up intx irq */
 	pci_intx(pdev, 1);
 
-	rc = request_irq(pdev->irq, ndev_irq_isr, IRQF_SHARED,
-			 "ndev_irq_isr", ndev);
+	rc = request_irq(pdev->irq, ndev_irq_isr,
+			 IRQF_SHARED | IRQF_USER_DATA, "ndev_irq_isr", ndev);
 	if (rc)
 		goto err_intx_request;
 
drivers/ntb/hw/intel/ntb_hw_gen1.c +7 -5
index 2ad263f708da..106f1800c35b 100644
@@ -401,7 +401,8 @@ int ndev_init_isr(struct intel_ntb_dev *ndev,
 	for (i = 0; i < msix_count; ++i) {
 		ndev->vec[i].ndev = ndev;
 		ndev->vec[i].num = i;
-		rc = request_irq(ndev->msix[i].vector, ndev_vec_isr, 0,
+		rc = request_irq(ndev->msix[i].vector, ndev_vec_isr,
+				 IRQF_USER_DATA,
 				 "ndev_vec_isr", &ndev->vec[i]);
 		if (rc)
 			goto err_msix_request;
@@ -430,8 +431,9 @@ int ndev_init_isr(struct intel_ntb_dev *ndev,
 	if (rc)
 		goto err_msi_enable;
 
-	rc = request_irq(pdev->irq, ndev_irq_isr, 0,
-			 "ndev_irq_isr", ndev);
+	rc = request_irq(pdev->irq, ndev_irq_isr,
+			 IRQF_USER_DATA, "ndev_irq_isr",
+			 ndev);
 	if (rc)
 		goto err_msi_request;
 
@@ -448,8 +450,8 @@ int ndev_init_isr(struct intel_ntb_dev *ndev,
 
 	pci_intx(pdev, 1);
 
-	rc = request_irq(pdev->irq, ndev_irq_isr, IRQF_SHARED,
-			 "ndev_irq_isr", ndev);
+	rc = request_irq(pdev->irq, ndev_irq_isr,
+			 IRQF_SHARED | IRQF_USER_DATA, "ndev_irq_isr", ndev);
 	if (rc)
 		goto err_intx_request;
 
drivers/ntb/hw/mscc/ntb_hw_switchtec.c +4 -4
index f1eaa3c4d46a..e038a6847ae4 100644
@@ -1448,14 +1448,14 @@ static int switchtec_ntb_init_db_msg_irq(struct switchtec_ntb *sndev)
 	sndev->doorbell_irq = pci_irq_vector(sndev->stdev->pdev, doorbell_irq);
 	sndev->message_irq = pci_irq_vector(sndev->stdev->pdev, message_irq);
 
-	rc = request_irq(sndev->doorbell_irq,
-			 switchtec_ntb_doorbell_isr, 0,
+	rc = request_irq(sndev->doorbell_irq, switchtec_ntb_doorbell_isr,
+			 IRQF_USER_DATA,
 			 "switchtec_ntb_doorbell", sndev);
 	if (rc)
 		return rc;
 
-	rc = request_irq(sndev->message_irq,
-			 switchtec_ntb_message_isr, 0,
+	rc = request_irq(sndev->message_irq, switchtec_ntb_message_isr,
+			 IRQF_USER_DATA,
 			 "switchtec_ntb_message", sndev);
 	if (rc) {
 		free_irq(sndev->doorbell_irq, sndev);
drivers/parport/parport_ax88796.c +2 -1
index bfe97c2a8d4c..5a4a87e73d57 100644
@@ -336,7 +336,8 @@ static int parport_ax88796_probe(struct platform_device *pdev)
 	if (irq >= 0) {
 		/* request irq */
 		ret = request_irq(irq, parport_irq_handler,
-				  IRQF_TRIGGER_FALLING, pdev->name, pp);
+				  IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
+				  pdev->name, pp);
 
 		if (ret < 0)
 			goto exit_port;
drivers/parport/parport_pc.c +1 -2
index 9c8249f74479..512f98234bdd 100644
@@ -2190,8 +2190,7 @@ struct parport *parport_pc_probe_port(unsigned long int base,
 		EPP_res = NULL;
 	}
 	if (p->irq != PARPORT_IRQ_NONE) {
-		if (request_irq(p->irq, parport_irq_handler,
-				 irqflags, p->name, p)) {
+		if (request_irq(p->irq, parport_irq_handler, irqflags | IRQF_USER_DATA, p->name, p)) {
 			printk(KERN_WARNING "%s: irq %d in use, "
 				"resorting to polled operation\n",
 				p->name, p->irq);
drivers/pci/controller/pcie-xilinx.c +1 -1
index 9bd1a35cd5d8..57294e32ab68 100644
@@ -588,7 +588,7 @@ static int xilinx_pcie_parse_dt(struct xilinx_pcie_port *port)
 
 	port->irq = irq_of_parse_and_map(node, 0);
 	err = devm_request_irq(dev, port->irq, xilinx_pcie_intr_handler,
-			       IRQF_SHARED | IRQF_NO_THREAD,
+			       IRQF_SHARED | IRQF_NO_THREAD | IRQF_USER_DATA,
 			       "xilinx-pcie", port);
 	if (err) {
 		dev_err(dev, "unable to request irq %d\n", port->irq);
drivers/pci/controller/vmd.c +6 -5
index 3890812cdf87..acf4d9942120 100644
@@ -766,8 +766,9 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 		INIT_LIST_HEAD(&vmd->irqs[i].irq_list);
 		err = devm_request_irq(&dev->dev, pci_irq_vector(dev, i),
-				       vmd_irq, IRQF_NO_THREAD,
-				       "vmd", &vmd->irqs[i]);
+				       vmd_irq,
+				       IRQF_NO_THREAD | IRQF_USER_DATA, "vmd",
+				       &vmd->irqs[i]);
 		if (err)
 			return err;
 	}
@@ -825,9 +826,9 @@ static int vmd_resume(struct device *dev)
 	int err, i;
 
 	for (i = 0; i < vmd->msix_count; i++) {
-		err = devm_request_irq(dev, pci_irq_vector(pdev, i),
-				       vmd_irq, IRQF_NO_THREAD,
-				       "vmd", &vmd->irqs[i]);
+		err = devm_request_irq(dev, pci_irq_vector(pdev, i), vmd_irq,
+				       IRQF_NO_THREAD | IRQF_USER_DATA, "vmd",
+				       &vmd->irqs[i]);
 		if (err)
 			return err;
 	}
drivers/pci/hotplug/cpci_hotplug_core.c +1 -5
index 603eadf3d965..4d45dcc7de58 100644
@@ -525,11 +525,7 @@ cpci_hp_register_controller(struct cpci_hp_controller *new_controller)
 		if (!(new_controller->ops->enable_irq &&
 		     new_controller->ops->disable_irq))
 			status = -EINVAL;
-		if (request_irq(new_controller->irq,
-			       cpci_hp_intr,
-			       new_controller->irq_flags,
-			       MY_NAME,
-			       new_controller->dev_id)) {
+		if (request_irq(new_controller->irq, cpci_hp_intr, new_controller->irq_flags | IRQF_USER_DATA, MY_NAME, new_controller->dev_id)) {
 			err("Can't get irq %d for the hotplug cPCI controller",
 			    new_controller->irq);
 			status = -ENODEV;
drivers/pci/hotplug/cpqphp_core.c +1 -2
index 16bbb183695a..4fa05ac1a086 100644
@@ -1139,8 +1139,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	/* set up the interrupt */
 	dbg("HPC interrupt = %d\n", ctrl->interrupt);
-	if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr,
-			IRQF_SHARED, MY_NAME, ctrl)) {
+	if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr, IRQF_SHARED | IRQF_USER_DATA, MY_NAME, ctrl)) {
 		err("Can't get irq %d for the hotplug pci controller\n",
 			ctrl->interrupt);
 		rc = -ENODEV;
drivers/pci/hotplug/shpchp_hpc.c +3 -2
index db047284c291..7f183f687201 100644
@@ -1049,8 +1049,9 @@ int shpc_init(struct controller *ctrl, struct pci_dev *pdev)
 			pci_set_master(pdev);
 		}
 
-		rc = request_irq(ctrl->pci_dev->irq, shpc_isr, IRQF_SHARED,
-				 MY_NAME, (void *)ctrl);
+		rc = request_irq(ctrl->pci_dev->irq, shpc_isr,
+				 IRQF_SHARED | IRQF_USER_DATA, MY_NAME,
+				 (void *)ctrl);
 		ctrl_dbg(ctrl, "request_irq %d (returns %d)\n",
 			 ctrl->pci_dev->irq, rc);
 		if (rc) {
drivers/pci/pcie/pme.c +2 -1
index 0dbcf429089f..af231bd42113 100644
@@ -335,7 +335,8 @@ static int pcie_pme_probe(struct pcie_device *srv)
 	pcie_pme_interrupt_enable(port, false);
 	pcie_clear_root_pme_status(port);
 
-	ret = request_irq(srv->irq, pcie_pme_irq, IRQF_SHARED, "PCIe PME", srv);
+	ret = request_irq(srv->irq, pcie_pme_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, "PCIe PME", srv);
 	if (ret) {
 		kfree(data);
 		return ret;
drivers/pci/switch/switchtec.c +6 -4
index e22766c79fe9..55fbaa281a5d 100644
@@ -1261,8 +1261,9 @@ static int switchtec_init_isr(struct switchtec_dev *stdev)
 		return event_irq;
 
 	rc = devm_request_irq(&stdev->pdev->dev, event_irq,
-				switchtec_event_isr, 0,
-				KBUILD_MODNAME, stdev);
+			      switchtec_event_isr,
+			      IRQF_USER_DATA, KBUILD_MODNAME,
+			      stdev);
 
 	if (rc)
 		return rc;
@@ -1279,8 +1280,9 @@ static int switchtec_init_isr(struct switchtec_dev *stdev)
 		return dma_mrpc_irq;
 
 	rc = devm_request_irq(&stdev->pdev->dev, dma_mrpc_irq,
-				switchtec_dma_mrpc_isr, 0,
-				KBUILD_MODNAME, stdev);
+			      switchtec_dma_mrpc_isr,
+			      IRQF_USER_DATA, KBUILD_MODNAME,
+			      stdev);
 
 	return rc;
 }
drivers/pcmcia/i82092.c +1 -1
index aae7e6df99cd..80f763adc42d 100644
@@ -128,7 +128,7 @@ static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *i
 
 	/* Register the interrupt handler */
 	dprintk(KERN_DEBUG "Requesting interrupt %i \n",dev->irq);
-	if ((ret = request_irq(dev->irq, i82092aa_interrupt, IRQF_SHARED, "i82092aa", i82092aa_interrupt))) {
+	if ((ret = request_irq(dev->irq, i82092aa_interrupt, IRQF_SHARED | IRQF_USER_DATA, "i82092aa", i82092aa_interrupt))) {
 		printk(KERN_ERR "i82092aa: Failed to register IRQ %d, aborting\n", dev->irq);
 		goto err_out_free_res;
 	}
drivers/pcmcia/i82365.c +5 -4
index 891ccea2cccb..9002327b582a 100644
@@ -63,7 +63,7 @@
 static irqreturn_t i365_count_irq(int, void *);
 static inline int _check_irq(int irq, int flags)
 {
-    if (request_irq(irq, i365_count_irq, flags, "x", i365_count_irq) != 0)
+    if (request_irq(irq, i365_count_irq, flags | IRQF_USER_DATA, "x", i365_count_irq) != 0)
 	return -1;
     free_irq(irq, i365_count_irq);
     return 0;
@@ -489,8 +489,7 @@ static irqreturn_t i365_count_irq(int irq, void *dev)
 static u_int __init test_irq(u_short sock, int irq)
 {
     pr_debug("i82365:  testing ISA irq %d\n", irq);
-    if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan",
-			i365_count_irq) != 0)
+    if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED | IRQF_USER_DATA, "scan", i365_count_irq) != 0)
 	return 1;
     irq_hits = 0; irq_sock = sock;
     msleep(10);
@@ -1270,7 +1269,9 @@ static int __init init_i82365(void)
 
     /* Set up interrupt handler(s) */
     if (grab_irq != 0)
-	ret = request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
+	ret = request_irq(cs_irq, pcic_interrupt,
+                          IRQF_USER_DATA, "i82365",
+                          pcic_interrupt);
 
     if (ret)
 	goto err_socket_release;
drivers/pcmcia/pcmcia_resource.c +5 -4
index 99a778b022e5..96c292b616fa 100644
@@ -702,8 +702,9 @@ int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
 	if (!p_dev->irq)
 		return -EINVAL;
 
-	ret = request_irq(p_dev->irq, handler, IRQF_SHARED | IRQF_USER_DATA,
-			p_dev->devname, p_dev->priv);
+	ret = request_irq(p_dev->irq, handler,
+			  IRQF_SHARED | IRQF_USER_DATA,
+			  p_dev->devname, p_dev->priv);
 	if (!ret)
 		p_dev->_irq = 1;
 
@@ -752,8 +753,8 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
 		/* register the correct driver, if possible, to check whether
 		 * registering a dummy handle works, i.e. if the IRQ isn't
 		 * marked as used by the kernel resource management core */
-		ret = request_irq(irq, test_action, type, p_dev->devname,
-				  p_dev);
+		ret = request_irq(irq, test_action, type | IRQF_USER_DATA,
+				  p_dev->devname, p_dev);
 		if (!ret) {
 			free_irq(irq, p_dev);
 			p_dev->irq = s->pcmcia_irq = irq;
drivers/pcmcia/pd6729.c +5 -3
index f0af9985ca09..5af3986c642f 100644
@@ -580,7 +580,8 @@ static int pd6729_check_irq(int irq)
 {
 	int ret;
 
-	ret = request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x",
+	ret = request_irq(irq, pd6729_test,
+			  IRQF_PROBE_SHARED | IRQF_USER_DATA, "x",
 			  pd6729_test);
 	if (ret)
 		return -1;
@@ -698,8 +699,9 @@ static int pd6729_pci_probe(struct pci_dev *dev,
 	pci_set_drvdata(dev, socket);
 	if (irq_mode == 1) {
 		/* Register the interrupt handler */
-		ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED,
-				  "pd6729", socket);
+		ret = request_irq(dev->irq, pd6729_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA, "pd6729",
+				  socket);
 		if (ret) {
 			dev_err(&dev->dev, "Failed to register irq %d\n",
 				dev->irq);
drivers/pcmcia/tcic.c +3 -4
index 1a0e3f098759..666fae3cdedc 100644
@@ -210,7 +210,7 @@ static u_int __init try_irq(int irq)
     u_short cfg;
 
     irq_hits = 0;
-    if (request_irq(irq, tcic_irq_count, 0, "irq scan", tcic_irq_count) != 0)
+    if (request_irq(irq, tcic_irq_count, IRQF_USER_DATA, "irq scan", tcic_irq_count) != 0)
 	return -1;
     mdelay(10);
     if (irq_hits) {
@@ -266,7 +266,7 @@ static u_int __init irq_scan(u_int mask0)
 	/* Fallback: just find interrupts that aren't in use */
 	for (i = 0; i < 16; i++)
 	    if ((mask0 & (1 << i)) &&
-		(request_irq(i, tcic_irq_count, 0, "x", tcic_irq_count) == 0)) {
+		(request_irq(i, tcic_irq_count, IRQF_USER_DATA, "x", tcic_irq_count) == 0)) {
 		mask1 |= (1 << i);
 		free_irq(i, tcic_irq_count);
 	    }
@@ -463,8 +463,7 @@ static int __init init_tcic(void)
 	u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12));
 	for (i = 15; i > 0; i--)
 	    if ((cs_mask & (1 << i)) &&
-		(request_irq(i, tcic_interrupt, 0, "tcic",
-			     tcic_interrupt) == 0))
+		(request_irq(i, tcic_interrupt, IRQF_USER_DATA, "tcic", tcic_interrupt) == 0))
 		break;
 	cs_irq = i;
 	if (cs_irq == 0) poll_interval = HZ;
drivers/pcmcia/yenta_socket.c +2 -2
index ac6a3f46b1e6..c978a6961578 100644
@@ -978,7 +978,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
 
 	socket->probe_status = 0;
 
-	if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED, "yenta", socket)) {
+	if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED | IRQF_USER_DATA, "yenta", socket)) {
 		dev_warn(&socket->dev->dev,
 			 "request_irq() in yenta_probe_cb_irq() failed!\n");
 		return -1;
@@ -1231,7 +1231,7 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 	/* We must finish initialization here */
 
-	if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED, "yenta", socket)) {
+	if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED | IRQF_USER_DATA, "yenta", socket)) {
 		/* No IRQ or request_irq failed. Poll */
 		socket->cb_irq = 0; /* But zero is a valid IRQ number. */
 		timer_setup(&socket->poll_timer, yenta_interrupt_wrapper, 0);
drivers/pinctrl/intel/pinctrl-intel.c +1 -1
index 3b1818184207..6e39197be8d8 100644
@@ -1192,7 +1192,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
 	 * controllers share the same interrupt line.
 	 */
 	ret = devm_request_irq(pctrl->dev, irq, intel_gpio_irq,
-			       IRQF_SHARED | IRQF_NO_THREAD,
+			       IRQF_SHARED | IRQF_NO_THREAD | IRQF_USER_DATA,
 			       dev_name(pctrl->dev), pctrl);
 	if (ret) {
 		dev_err(pctrl->dev, "failed to request interrupt\n");
drivers/pinctrl/pinctrl-amd.c +2 -1
index 2a7d638978d8..fbedf886439d 100644
@@ -930,7 +930,8 @@ static int amd_gpio_probe(struct platform_device *pdev)
 		goto out2;
 	}
 
-	ret = devm_request_irq(&pdev->dev, irq_base, amd_gpio_irq_handler, 0,
+	ret = devm_request_irq(&pdev->dev, irq_base, amd_gpio_irq_handler,
+			       IRQF_USER_DATA,
 			       KBUILD_MODNAME, gpio_dev);
 	if (ret)
 		goto out2;
drivers/pinctrl/pinctrl-single.c +1 -2
index 1e0614daee9b..0d46b75b16b5 100644
@@ -1567,8 +1567,7 @@ static int pcs_irq_init_chained_handler(struct pcs_device *pcs,
 		int res;
 
 		res = request_irq(pcs_soc->irq, pcs_irq_handler,
-				  IRQF_SHARED | IRQF_NO_SUSPEND |
-				  IRQF_NO_THREAD,
+				  IRQF_SHARED | IRQF_NO_SUSPEND | IRQF_NO_THREAD | IRQF_USER_DATA,
 				  name, pcs_soc);
 		if (res) {
 			pcs_soc->irq = -1;
drivers/platform/goldfish/goldfish_pipe.c +3 -3
index 321bc673c417..35c79464ca98 100644
@@ -824,9 +824,9 @@ static int goldfish_pipe_device_init(struct platform_device *pdev,
 	tasklet_init(&dev->irq_tasklet, &goldfish_interrupt_task,
 		     (unsigned long)dev);
 
-	err = devm_request_irq(&pdev->dev, dev->irq,
-			       goldfish_pipe_interrupt,
-			       IRQF_SHARED, "goldfish_pipe", dev);
+	err = devm_request_irq(&pdev->dev, dev->irq, goldfish_pipe_interrupt,
+			       IRQF_SHARED | IRQF_USER_DATA, "goldfish_pipe",
+			       dev);
 	if (err) {
 		dev_err(&pdev->dev, "unable to allocate IRQ for v2\n");
 		return err;
drivers/platform/mellanox/mlxreg-hotplug.c +3 -2
index b6d44550d98c..e31a659c6117 100644
@@ -632,8 +632,9 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
 	priv->pdev = pdev;
 
 	err = devm_request_irq(&pdev->dev, priv->irq,
-			       mlxreg_hotplug_irq_handler, IRQF_TRIGGER_FALLING
-			       | IRQF_SHARED, "mlxreg-hotplug", priv);
+			       mlxreg_hotplug_irq_handler,
+			       IRQF_TRIGGER_FALLING | IRQF_SHARED | IRQF_USER_DATA,
+			       "mlxreg-hotplug", priv);
 	if (err) {
 		dev_err(&pdev->dev, "Failed to request irq: %d\n", err);
 		return err;
drivers/platform/x86/fujitsu-tablet.c +2 -1
index baea077a02cc..9795095421a4 100644
@@ -486,7 +486,8 @@ static int acpi_fujitsu_add(struct acpi_device *adev)
 	fujitsu_reset();
 
 	error = request_irq(fujitsu.irq, fujitsu_interrupt,
-			IRQF_SHARED, MODULENAME, fujitsu_interrupt);
+			    IRQF_SHARED | IRQF_USER_DATA, MODULENAME,
+			    fujitsu_interrupt);
 	if (error) {
 		release_region(fujitsu.io_base, fujitsu.io_length);
 		input_fujitsu_remove();
drivers/platform/x86/intel_int0002_vgpio.c +1 -1
index 4b8f7305fc8a..903ccf5f8d59 100644
@@ -189,7 +189,7 @@ static int int0002_probe(struct platform_device *pdev)
 	 * to gpiochip_set_chained_irqchip, because the irq is shared.
 	 */
 	ret = devm_request_irq(dev, irq, int0002_irq,
-			       IRQF_SHARED, "INT0002", chip);
+			       IRQF_SHARED | IRQF_USER_DATA, "INT0002", chip);
 	if (ret) {
 		dev_err(dev, "Error requesting IRQ %d: %d\n", irq, ret);
 		return ret;
drivers/platform/x86/intel_ips.c +2 -1
index bffe548187ee..3b3847484fa4 100644
@@ -1528,7 +1528,8 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 	ips->irq = pci_irq_vector(dev, 0);
 
-	ret = request_irq(ips->irq, ips_irq_handler, IRQF_SHARED, "ips", ips);
+	ret = request_irq(ips->irq, ips_irq_handler,
+			  IRQF_SHARED | IRQF_USER_DATA, "ips", ips);
 	if (ret) {
 		dev_err(&dev->dev, "request irq failed, aborting\n");
 		return ret;
drivers/platform/x86/intel_pmc_ipc.c +4 -4
index 7964ba22ef8d..fc375bf0e49c 100644
@@ -529,8 +529,9 @@ static int ipc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	pmc->ipc_base = pcim_iomap_table(pdev)[0];
 
-	ret = devm_request_irq(&pdev->dev, pdev->irq, ioc, 0, "intel_pmc_ipc",
-				pmc);
+	ret = devm_request_irq(&pdev->dev, pdev->irq, ioc,
+			       IRQF_USER_DATA,
+			       "intel_pmc_ipc", pmc);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to request irq\n");
 		return ret;
@@ -951,8 +952,7 @@ static int ipc_plat_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	if (devm_request_irq(&pdev->dev, ipcdev.irq, ioc, IRQF_NO_SUSPEND,
-			     "intel_pmc_ipc", &ipcdev)) {
+	if (devm_request_irq(&pdev->dev, ipcdev.irq, ioc, IRQF_NO_SUSPEND | IRQF_USER_DATA, "intel_pmc_ipc", &ipcdev)) {
 		dev_err(&pdev->dev, "Failed to request irq\n");
 		ret = -EBUSY;
 		goto err_irq;
drivers/platform/x86/intel_punit_ipc.c +2 -2
index 79671927f4ef..756eae04c544 100644
@@ -299,8 +299,8 @@ static int intel_punit_ipc_probe(struct platform_device *pdev)
 		dev_warn(&pdev->dev, "Invalid IRQ, using polling mode\n");
 	} else {
 		ret = devm_request_irq(&pdev->dev, irq, intel_punit_ioc,
-				       IRQF_NO_SUSPEND, "intel_punit_ipc",
-				       &punit_ipcdev);
+				       IRQF_NO_SUSPEND | IRQF_USER_DATA,
+				       "intel_punit_ipc", &punit_ipcdev);
 		if (ret) {
 			dev_err(&pdev->dev, "Failed to request irq: %d\n", irq);
 			return ret;
drivers/platform/x86/intel_scu_ipc.c +3 -2
index cdab916fbf92..a7dd4d9c89cb 100644
@@ -656,8 +656,9 @@ static int ipc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (!scu->i2c_base)
 		return -ENOMEM;
 
-	err = devm_request_irq(&pdev->dev, pdev->irq, ioc, 0, "intel_scu_ipc",
-			       scu);
+	err = devm_request_irq(&pdev->dev, pdev->irq, ioc,
+			       IRQF_USER_DATA,
+			       "intel_scu_ipc", scu);
 	if (err)
 		return err;
 
drivers/platform/x86/sony-laptop.c +1 -2
index b205b037fd61..c83a8da216ce 100644
@@ -4772,8 +4772,7 @@ static int sony_pic_add(struct acpi_device *device)
 
 	/* request IRQ */
 	list_for_each_entry_reverse(irq, &spic_dev.interrupts, list) {
-		if (!request_irq(irq->irq.interrupts[0], sony_pic_irq,
-					0, "sony-laptop", &spic_dev)) {
+		if (!request_irq(irq->irq.interrupts[0], sony_pic_irq, IRQF_USER_DATA, "sony-laptop", &spic_dev)) {
 			dprintk("IRQ: %d - triggering: %d - "
 					"polarity: %d - shr: %d\n",
 					irq->irq.interrupts[0],
drivers/pnp/resource.c +1 -2
index 70d4ba95735a..6fec093aa4ca 100644
@@ -387,8 +387,7 @@ int pnp_check_irq(struct pnp_dev *dev, struct resource *res)
 	/* check if the resource is already in use, skip if the
 	 * device is active because it itself may be in use */
 	if (!dev->active) {
-		if (request_irq(*irq, pnp_test_handler,
-				IRQF_PROBE_SHARED, "pnp", NULL))
+		if (request_irq(*irq, pnp_test_handler, IRQF_PROBE_SHARED | IRQF_USER_DATA, "pnp", NULL))
 			return 0;
 		free_irq(*irq, NULL);
 	}
drivers/power/reset/ltc2952-poweroff.c +1 -5
index c484584745bc..ec581ff897f5 100644
@@ -214,11 +214,7 @@ static int ltc2952_poweroff_init(struct platform_device *pdev)
 		data->gpio_trigger = NULL;
 	}
 
-	if (devm_request_irq(&pdev->dev, gpiod_to_irq(data->gpio_trigger),
-			     ltc2952_poweroff_handler,
-			     (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING),
-			     "ltc2952-poweroff",
-			     data)) {
+	if (devm_request_irq(&pdev->dev, gpiod_to_irq(data->gpio_trigger), ltc2952_poweroff_handler, (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING) | IRQF_USER_DATA, "ltc2952-poweroff", data)) {
 		/*
 		 * Some things may have happened:
 		 * - No trigger input was defined
drivers/power/supply/act8945a_charger.c +3 -3
index 8e117b31ba79..b68b9d759667 100644
@@ -496,7 +496,7 @@ static int act8945a_charger_config(struct device *dev,
 
 	ret = devm_request_irq(dev, gpiod_to_irq(charger->lbo_gpio),
 			       act8945a_status_changed,
-			       (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING),
+			       (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING) | IRQF_USER_DATA,
 			       "act8945a_lbo_detect", charger);
 	if (ret)
 		dev_info(dev, "failed to request gpio \"lbo\" IRQ\n");
@@ -602,8 +602,8 @@ static int act8945a_charger_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, irq, act8945a_status_changed,
-			       IRQF_TRIGGER_FALLING, "act8945a_interrupt",
-			       charger);
+			       IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
+			       "act8945a_interrupt", charger);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to request nIRQ pin IRQ\n");
 		return ret;
drivers/power/supply/goldfish_battery.c +3 -2
index f5c525e4482a..643bf6abcd30 100644
@@ -193,8 +193,9 @@ static int goldfish_battery_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	ret = devm_request_irq(&pdev->dev, data->irq, goldfish_battery_interrupt,
-						IRQF_SHARED, pdev->name, data);
+	ret = devm_request_irq(&pdev->dev, data->irq,
+			       goldfish_battery_interrupt,
+			       IRQF_SHARED | IRQF_USER_DATA, pdev->name, data);
 	if (ret)
 		return ret;
 
drivers/power/supply/max14656_charger_detector.c +1 -1
index b91b1d2999dc..e73ba28edb50 100644
@@ -281,7 +281,7 @@ static int max14656_probe(struct i2c_client *client,
 	INIT_DELAYED_WORK(&chip->irq_work, max14656_irq_worker);
 
 	ret = devm_request_irq(dev, chip->irq, max14656_irq,
-			       IRQF_TRIGGER_FALLING,
+			       IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
 			       MAX14656_NAME, chip);
 	if (ret) {
 		dev_err(dev, "request_irq %d failed\n", chip->irq);
drivers/power/supply/pda_power.c +3 -3
index 922a86787c5c..b7e8d8f5863f 100644
@@ -340,8 +340,8 @@ static int pda_power_probe(struct platform_device *pdev)
 
 		if (ac_irq) {
 			ret = request_irq(ac_irq->start, power_changed_isr,
-					  get_irq_flags(ac_irq), ac_irq->name,
-					  pda_psy_ac);
+					  get_irq_flags(ac_irq) | IRQF_USER_DATA,
+					  ac_irq->name, pda_psy_ac);
 			if (ret) {
 				dev_err(dev, "request ac irq failed\n");
 				goto ac_irq_failed;
@@ -364,7 +364,7 @@ static int pda_power_probe(struct platform_device *pdev)
 
 		if (usb_irq) {
 			ret = request_irq(usb_irq->start, power_changed_isr,
-					  get_irq_flags(usb_irq),
+					  get_irq_flags(usb_irq) | IRQF_USER_DATA,
 					  usb_irq->name, pda_psy_usb);
 			if (ret) {
 				dev_err(dev, "request usb irq failed\n");
drivers/power/supply/wm97xx_battery.c +3 -2
index 6754e761778a..246830c06e3b 100644
@@ -183,8 +183,9 @@ static int wm97xx_bat_probe(struct platform_device *dev)
 		if (ret)
 			goto err2;
 		ret = request_irq(gpio_to_irq(pdata->charge_gpio),
-				wm97xx_chrg_irq, 0,
-				"AC Detect", dev);
+				  wm97xx_chrg_irq,
+				  IRQF_USER_DATA,
+				  "AC Detect", dev);
 		if (ret)
 			goto err2;
 		props++;	/* POWER_SUPPLY_PROP_STATUS */
drivers/pps/clients/pps-gpio.c +2 -1
index dd5d1103e02b..a59a6e2545c3 100644
@@ -166,7 +166,8 @@ static int pps_gpio_probe(struct platform_device *pdev)
 
 	/* register IRQ interrupt handler */
 	ret = devm_request_irq(&pdev->dev, data->irq, pps_gpio_irq_handler,
-			get_irqf_trigger_flags(data), data->info.name, data);
+			       get_irqf_trigger_flags(data) | IRQF_USER_DATA,
+			       data->info.name, data);
 	if (ret) {
 		pps_unregister_source(data->pps);
 		dev_err(&pdev->dev, "failed to acquire IRQ %d\n", data->irq);
drivers/ptp/ptp_pch.c +2 -1
index 78ccf936d356..cf4832a54862 100644
@@ -633,7 +633,8 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	spin_lock_init(&chip->register_lock);
 
-	ret = request_irq(pdev->irq, &isr, IRQF_SHARED, KBUILD_MODNAME, chip);
+	ret = request_irq(pdev->irq, &isr, IRQF_SHARED | IRQF_USER_DATA,
+			  KBUILD_MODNAME, chip);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "failed to get irq %d\n", pdev->irq);
 		goto err_req_irq;
drivers/rapidio/devices/tsi721.c +15 -10
index b64c56c33c3b..d22a80107b24 100644
@@ -708,14 +708,15 @@ static int tsi721_request_msix(struct tsi721_device *priv)
 	int err = 0;
 
 	err = request_irq(priv->msix[TSI721_VECT_IDB].vector,
-			tsi721_sr2pc_ch_msix, 0,
-			priv->msix[TSI721_VECT_IDB].irq_name, (void *)priv);
+			  tsi721_sr2pc_ch_msix,
+			  IRQF_USER_DATA,
+			  priv->msix[TSI721_VECT_IDB].irq_name, (void *)priv);
 	if (err)
 		return err;
 
 	err = request_irq(priv->msix[TSI721_VECT_PWRX].vector,
-			tsi721_srio_msix, 0,
-			priv->msix[TSI721_VECT_PWRX].irq_name, (void *)priv);
+			  tsi721_srio_msix, IRQF_USER_DATA,
+			  priv->msix[TSI721_VECT_PWRX].irq_name, (void *)priv);
 	if (err) {
 		free_irq(priv->msix[TSI721_VECT_IDB].vector, (void *)priv);
 		return err;
@@ -844,8 +845,8 @@ static int tsi721_request_irq(struct tsi721_device *priv)
 	else
 #endif
 		err = request_irq(priv->pdev->irq, tsi721_irqhandler,
-			  (priv->flags & TSI721_USING_MSI) ? 0 : IRQF_SHARED,
-			  DRV_NAME, (void *)priv);
+				  ((priv->flags & TSI721_USING_MSI) ? 0 : IRQF_SHARED) | IRQF_USER_DATA,
+				  DRV_NAME, (void *)priv);
 
 	if (err)
 		tsi_err(&priv->pdev->dev,
@@ -1977,7 +1978,8 @@ static int tsi721_open_outb_mbox(struct rio_mport *mport, void *dev_id,
 		int idx = TSI721_VECT_OMB0_DONE + mbox;
 
 		/* Request interrupt service if we are in MSI-X mode */
-		rc = request_irq(priv->msix[idx].vector, tsi721_omsg_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_omsg_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)priv);
 
 		if (rc) {
@@ -1988,7 +1990,8 @@ static int tsi721_open_outb_mbox(struct rio_mport *mport, void *dev_id,
 		}
 
 		idx = TSI721_VECT_OMB0_INT + mbox;
-		rc = request_irq(priv->msix[idx].vector, tsi721_omsg_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_omsg_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)priv);
 
 		if (rc)	{
@@ -2292,7 +2295,8 @@ static int tsi721_open_inb_mbox(struct rio_mport *mport, void *dev_id,
 		int idx = TSI721_VECT_IMB0_RCV + mbox;
 
 		/* Request interrupt service if we are in MSI-X mode */
-		rc = request_irq(priv->msix[idx].vector, tsi721_imsg_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_imsg_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)priv);
 
 		if (rc) {
@@ -2303,7 +2307,8 @@ static int tsi721_open_inb_mbox(struct rio_mport *mport, void *dev_id,
 		}
 
 		idx = TSI721_VECT_IMB0_INT + mbox;
-		rc = request_irq(priv->msix[idx].vector, tsi721_imsg_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_imsg_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)priv);
 
 		if (rc)	{
drivers/rapidio/devices/tsi721_dma.c +5 -3
index 7f5d4436f594..f932701225df 100644
@@ -161,7 +161,8 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
 
 		idx = TSI721_VECT_DMA0_DONE + bdma_chan->id;
 
-		rc = request_irq(priv->msix[idx].vector, tsi721_bdma_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_bdma_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)bdma_chan);
 
 		if (rc) {
@@ -173,8 +174,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
 
 		idx = TSI721_VECT_DMA0_INT + bdma_chan->id;
 
-		rc = request_irq(priv->msix[idx].vector, tsi721_bdma_msix, 0,
-				priv->msix[idx].irq_name, (void *)bdma_chan);
+		rc = request_irq(priv->msix[idx].vector, tsi721_bdma_msix,
+				 IRQF_USER_DATA,
+				 priv->msix[idx].irq_name, (void *)bdma_chan);
 
 		if (rc)	{
 			tsi_debug(DMA, &bdma_chan->dchan.dev->device,
drivers/regulator/qcom_spmi-regulator.c +3 -2
index 53a61fb65642..28c1b169330e 100644
@@ -1584,8 +1584,9 @@ static int spmi_regulator_of_parse(struct device_node *node,
 
 	if (vreg->ocp_irq) {
 		ret = devm_request_irq(dev, vreg->ocp_irq,
-			spmi_regulator_vs_ocp_isr, IRQF_TRIGGER_RISING, "ocp",
-			vreg);
+				       spmi_regulator_vs_ocp_isr,
+				       IRQF_TRIGGER_RISING | IRQF_USER_DATA,
+				       "ocp", vreg);
 		if (ret < 0) {
 			dev_err(dev, "failed to request irq %d, ret=%d\n",
 				vreg->ocp_irq, ret);
drivers/rpmsg/qcom_glink_native.c +2 -3
index f46c787733e8..c72229a2fc80 100644
@@ -1588,9 +1588,8 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev,
 	}
 
 	irq = of_irq_get(dev->of_node, 0);
-	ret = devm_request_irq(dev, irq,
-			       qcom_glink_native_intr,
-			       IRQF_NO_SUSPEND | IRQF_SHARED,
+	ret = devm_request_irq(dev, irq, qcom_glink_native_intr,
+			       IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_USER_DATA,
 			       "glink-native", glink);
 	if (ret) {
 		dev_err(dev, "failed to request IRQ\n");
drivers/rtc/rtc-cmos.c +3 -2
index a5a19ff10535..81380c3b3fa7 100644
@@ -854,8 +854,9 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 			rtc_cmos_int_handler = cmos_interrupt;
 
 		retval = request_irq(rtc_irq, rtc_cmos_int_handler,
-				IRQF_SHARED, dev_name(&cmos_rtc.rtc->dev),
-				cmos_rtc.rtc);
+				     IRQF_SHARED | IRQF_USER_DATA,
+				     dev_name(&cmos_rtc.rtc->dev),
+				     cmos_rtc.rtc);
 		if (retval < 0) {
 			dev_dbg(dev, "IRQ %d is already in use\n", rtc_irq);
 			goto cleanup1;
drivers/rtc/rtc-ds1305.c +2 -1
index 2d502fc85698..5ab3759914e8 100644
@@ -719,7 +719,8 @@ static int ds1305_probe(struct spi_device *spi)
 	if (spi->irq) {
 		INIT_WORK(&ds1305->work, ds1305_work);
 		status = devm_request_irq(&spi->dev, spi->irq, ds1305_irq,
-				0, dev_name(&ds1305->rtc->dev), ds1305);
+					  IRQF_USER_DATA,
+					  dev_name(&ds1305->rtc->dev), ds1305);
 		if (status < 0) {
 			dev_err(&spi->dev, "request_irq %d --> %d\n",
 					spi->irq, status);
drivers/rtc/rtc-ds1374.c +3 -2
index 38a2e9e684df..9c5bd44571c2 100644
@@ -631,8 +631,9 @@ static int ds1374_probe(struct i2c_client *client,
 		return ret;
 
 	if (client->irq > 0) {
-		ret = devm_request_irq(&client->dev, client->irq, ds1374_irq, 0,
-					"ds1374", client);
+		ret = devm_request_irq(&client->dev, client->irq, ds1374_irq,
+				       IRQF_USER_DATA,
+				       "ds1374", client);
 		if (ret) {
 			dev_err(&client->dev, "unable to request IRQ\n");
 			return ret;
drivers/rtc/rtc-ds1511.c +1 -2
index b8b6e51c0461..c90343e4cc65 100644
@@ -485,8 +485,7 @@ static int ds1511_rtc_probe(struct platform_device *pdev)
 	 */
 	if (pdata->irq > 0) {
 		rtc_read(RTC_CMD1);
-		if (devm_request_irq(&pdev->dev, pdata->irq, ds1511_interrupt,
-			IRQF_SHARED, pdev->name, pdev) < 0) {
+		if (devm_request_irq(&pdev->dev, pdata->irq, ds1511_interrupt, IRQF_SHARED | IRQF_USER_DATA, pdev->name, pdev) < 0) {
 
 			dev_warn(&pdev->dev, "interrupt not available.\n");
 			pdata->irq = 0;
drivers/rtc/rtc-ds1553.c +1 -3
index 34af7a802f43..c69b0b48991e 100644
@@ -307,9 +307,7 @@ static int ds1553_rtc_probe(struct platform_device *pdev)
 
 	if (pdata->irq > 0) {
 		writeb(0, ioaddr + RTC_INTERRUPTS);
-		if (devm_request_irq(&pdev->dev, pdata->irq,
-				ds1553_rtc_interrupt,
-				0, pdev->name, pdev) < 0) {
+		if (devm_request_irq(&pdev->dev, pdata->irq, ds1553_rtc_interrupt, IRQF_USER_DATA, pdev->name, pdev) < 0) {
 			dev_warn(&pdev->dev, "interrupt not available.\n");
 			pdata->irq = 0;
 		}
drivers/rtc/rtc-ds1685.c +2 -1
index 2710f2594c42..dc856f4fb7cb 100644
@@ -1341,7 +1341,8 @@ ds1685_rtc_probe(struct platform_device *pdev)
 			/* Request an IRQ. */
 			ret = devm_request_irq(&pdev->dev, rtc->irq_num,
 					       ds1685_rtc_irq_handler,
-					       IRQF_SHARED, pdev->name, pdev);
+					       IRQF_SHARED | IRQF_USER_DATA,
+					       pdev->name, pdev);
 
 			/* Check to see if something came back. */
 			if (unlikely(ret)) {
drivers/rtc/rtc-ftrtc010.c +1 -1
index 8f1dd88fa827..a7536520d481 100644
@@ -181,7 +181,7 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
 	rtc->rtc_dev->range_max = U32_MAX + rtc->rtc_dev->range_min;
 
 	ret = devm_request_irq(dev, rtc->rtc_irq, ftrtc010_rtc_interrupt,
-			       IRQF_SHARED, pdev->name, dev);
+			       IRQF_SHARED | IRQF_USER_DATA, pdev->name, dev);
 	if (unlikely(ret))
 		return ret;
 
drivers/rtc/rtc-m48t59.c +3 -2
index 3c8ad1cdfd7c..5566f0a56d54 100644
@@ -436,8 +436,9 @@ static int m48t59_rtc_probe(struct platform_device *pdev)
 
 	if (m48t59->irq != NO_IRQ) {
 		ret = devm_request_irq(&pdev->dev, m48t59->irq,
-				m48t59_rtc_interrupt, IRQF_SHARED,
-				"rtc-m48t59", &pdev->dev);
+				       m48t59_rtc_interrupt,
+				       IRQF_SHARED | IRQF_USER_DATA,
+				       "rtc-m48t59", &pdev->dev);
 		if (ret)
 			return ret;
 	}
drivers/rtc/rtc-mrst.c +2 -1
index daf354a6a853..01264ed17b08 100644
@@ -356,7 +356,8 @@ static int vrtc_mrst_do_probe(struct device *dev, struct resource *iomem,
 
 	if (rtc_irq) {
 		retval = devm_request_irq(dev, rtc_irq, mrst_rtc_irq,
-					  0, dev_name(&mrst_rtc.rtc->dev),
+					  IRQF_USER_DATA,
+					  dev_name(&mrst_rtc.rtc->dev),
 					  mrst_rtc.rtc);
 		if (retval < 0) {
 			dev_dbg(dev, "IRQ %d is already in use, err %d\n",
drivers/rtc/rtc-pcap.c +6 -4
index f176cb9d0dbc..2dd631d5f5b1 100644
@@ -157,13 +157,15 @@ static int __init pcap_rtc_probe(struct platform_device *pdev)
 	timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ);
 	alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA);
 
-	err = devm_request_irq(&pdev->dev, timer_irq, pcap_rtc_irq, 0,
-				"RTC Timer", pcap_rtc);
+	err = devm_request_irq(&pdev->dev, timer_irq, pcap_rtc_irq,
+			       IRQF_USER_DATA, "RTC Timer",
+			       pcap_rtc);
 	if (err)
 		return err;
 
-	err = devm_request_irq(&pdev->dev, alarm_irq, pcap_rtc_irq, 0,
-				"RTC Alarm", pcap_rtc);
+	err = devm_request_irq(&pdev->dev, alarm_irq, pcap_rtc_irq,
+			       IRQF_USER_DATA, "RTC Alarm",
+			       pcap_rtc);
 	if (err)
 		return err;
 
drivers/rtc/rtc-r7301.c +2 -1
index 1943c8151152..f4f87345ecc7 100644
@@ -392,7 +392,8 @@ static int __init rtc7301_rtc_probe(struct platform_device *dev)
 
 	if (priv->irq > 0) {
 		ret = devm_request_irq(&dev->dev, priv->irq,
-				       rtc7301_irq_handler, IRQF_SHARED,
+				       rtc7301_irq_handler,
+				       IRQF_SHARED | IRQF_USER_DATA,
 				       dev_name(&dev->dev), rtc);
 		if (ret) {
 			priv->irq = 0;
drivers/rtc/rtc-snvs.c +2 -1
index b2483a749ac4..4bc1edff3c85 100644
@@ -328,7 +328,8 @@ static int snvs_rtc_probe(struct platform_device *pdev)
 	device_init_wakeup(&pdev->dev, true);
 
 	ret = devm_request_irq(&pdev->dev, data->irq, snvs_rtc_irq_handler,
-			       IRQF_SHARED, "rtc alarm", &pdev->dev);
+			       IRQF_SHARED | IRQF_USER_DATA, "rtc alarm",
+			       &pdev->dev);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to request irq %d: %d\n",
 			data->irq, ret);
drivers/rtc/rtc-stk17ta8.c +1 -4
index fccbecbb2c98..62deb2c871fa 100644
@@ -302,10 +302,7 @@ static int stk17ta8_rtc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, pdata);
 	if (pdata->irq > 0) {
 		writeb(0, ioaddr + RTC_INTERRUPTS);
-		if (devm_request_irq(&pdev->dev, pdata->irq,
-				stk17ta8_rtc_interrupt,
-				IRQF_SHARED,
-				pdev->name, pdev) < 0) {
+		if (devm_request_irq(&pdev->dev, pdata->irq, stk17ta8_rtc_interrupt, IRQF_SHARED | IRQF_USER_DATA, pdev->name, pdev) < 0) {
 			dev_warn(&pdev->dev, "interrupt not available.\n");
 			pdata->irq = 0;
 		}
drivers/rtc/rtc-zynqmp.c +4 -2
index c532bd13fbe5..e7687aa8ed3a 100644
@@ -234,7 +234,8 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
 		return xrtcdev->alarm_irq;
 	}
 	ret = devm_request_irq(&pdev->dev, xrtcdev->alarm_irq,
-			       xlnx_rtc_interrupt, 0,
+			       xlnx_rtc_interrupt,
+			       IRQF_USER_DATA,
 			       dev_name(&pdev->dev), xrtcdev);
 	if (ret) {
 		dev_err(&pdev->dev, "request irq failed\n");
@@ -247,7 +248,8 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
 		return xrtcdev->sec_irq;
 	}
 	ret = devm_request_irq(&pdev->dev, xrtcdev->sec_irq,
-			       xlnx_rtc_interrupt, 0,
+			       xlnx_rtc_interrupt,
+			       IRQF_USER_DATA,
 			       dev_name(&pdev->dev), xrtcdev);
 	if (ret) {
 		dev_err(&pdev->dev, "request irq failed\n");
drivers/scsi/3w-9xxx.c +4 -2
index a3c20e3a8b7c..73d42056212c 100644
@@ -2116,7 +2116,8 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
 		set_bit(TW_USING_MSI, &tw_dev->flags);
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, twa_interrupt, IRQF_SHARED, "3w-9xxx", tw_dev);
+	retval = request_irq(pdev->irq, twa_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-9xxx", tw_dev);
 	if (retval) {
 		TW_PRINTK(tw_dev->host, TW_DRIVER, 0x30, "Error requesting IRQ");
 		goto out_remove_host;
@@ -2254,7 +2255,8 @@ static int twa_resume(struct pci_dev *pdev)
 	}
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, twa_interrupt, IRQF_SHARED, "3w-9xxx", tw_dev);
+	retval = request_irq(pdev->irq, twa_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-9xxx", tw_dev);
 	if (retval) {
 		TW_PRINTK(tw_dev->host, TW_DRIVER, 0x42, "Error requesting IRQ during resume");
 		retval = -ENODEV;
drivers/scsi/3w-sas.c +4 -2
index cd096104bcec..11306ca378b5 100644
@@ -1662,7 +1662,8 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
 		set_bit(TW_USING_MSI, &tw_dev->flags);
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, twl_interrupt, IRQF_SHARED, "3w-sas", tw_dev);
+	retval = request_irq(pdev->irq, twl_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-sas", tw_dev);
 	if (retval) {
 		TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1f, "Error requesting IRQ");
 		goto out_remove_host;
@@ -1819,7 +1820,8 @@ static int twl_resume(struct pci_dev *pdev)
 	}
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, twl_interrupt, IRQF_SHARED, "3w-sas", tw_dev);
+	retval = request_irq(pdev->irq, twl_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-sas", tw_dev);
 	if (retval) {
 		TW_PRINTK(tw_dev->host, TW_DRIVER, 0x26, "Error requesting IRQ during resume");
 		retval = -ENODEV;
drivers/scsi/3w-xxxx.c +2 -1
index 2b1e0d503020..86eca9664b53 100644
@@ -2333,7 +2333,8 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
 	printk(KERN_WARNING "3w-xxxx: scsi%d: Found a 3ware Storage Controller at 0x%x, IRQ: %d.\n", host->host_no, tw_dev->base_addr, pdev->irq);
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, tw_interrupt, IRQF_SHARED, "3w-xxxx", tw_dev);
+	retval = request_irq(pdev->irq, tw_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-xxxx", tw_dev);
 	if (retval) {
 		printk(KERN_WARNING "3w-xxxx: Error requesting IRQ.");
 		goto out_remove_host;
drivers/scsi/BusLogic.c +1 -2
index e41e51f1da71..66e8231fb283 100644
@@ -1994,8 +1994,7 @@ static bool __init blogic_getres(struct blogic_adapter *adapter)
 	/*
 	   Acquire shared access to the IRQ Channel.
 	 */
-	if (request_irq(adapter->irq_ch, blogic_inthandler, IRQF_SHARED,
-				adapter->full_model, adapter) < 0) {
+	if (request_irq(adapter->irq_ch, blogic_inthandler, IRQF_SHARED | IRQF_USER_DATA, adapter->full_model, adapter) < 0) {
 		blogic_err("UNABLE TO ACQUIRE IRQ CHANNEL %d - DETACHING\n",
 				adapter, adapter->irq_ch);
 		return false;
drivers/scsi/a100u2w.c +2 -2
index 66c514310f3c..263408266f10 100644
@@ -1158,8 +1158,8 @@ static int inia100_probe_one(struct pci_dev *pdev,
 	shost->sg_tablesize = TOTAL_SG_ENTRY;
 
 	/* Initial orc chip           */
-	error = request_irq(pdev->irq, inia100_intr, IRQF_SHARED,
-			"inia100", shost);
+	error = request_irq(pdev->irq, inia100_intr,
+			    IRQF_SHARED | IRQF_USER_DATA, "inia100", shost);
 	if (error < 0) {
 		printk(KERN_WARNING "inia100: unable to get irq %d\n",
 				pdev->irq);
drivers/scsi/aacraid/commsup.c +2 -6
index d5a6aa9676c8..eadd3bf6119a 100644
@@ -2553,9 +2553,7 @@ int aac_acquire_irq(struct aac_dev *dev)
 		for (i = 0; i < dev->max_msix; i++) {
 			dev->aac_msix[i].vector_no = i;
 			dev->aac_msix[i].dev = dev;
-			if (request_irq(pci_irq_vector(dev->pdev, i),
-					dev->a_ops.adapter_intr,
-					0, "aacraid", &(dev->aac_msix[i]))) {
+			if (request_irq(pci_irq_vector(dev->pdev, i), dev->a_ops.adapter_intr, IRQF_USER_DATA, "aacraid", &(dev->aac_msix[i]))) {
 				printk(KERN_ERR "%s%d: Failed to register IRQ for vector %d.\n",
 						dev->name, dev->id, i);
 				for (j = 0 ; j < i ; j++)
@@ -2569,9 +2567,7 @@ int aac_acquire_irq(struct aac_dev *dev)
 		dev->aac_msix[0].vector_no = 0;
 		dev->aac_msix[0].dev = dev;
 
-		if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-			IRQF_SHARED, "aacraid",
-			&(dev->aac_msix[0])) < 0) {
+		if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr, IRQF_SHARED | IRQF_USER_DATA, "aacraid", &(dev->aac_msix[0])) < 0) {
 			if (dev->msi)
 				pci_disable_msi(dev->pdev);
 			printk(KERN_ERR "%s%d: Interrupt unavailable.\n",
drivers/scsi/aacraid/rx.c +1 -2
index 576cdf9cc120..6bb11613c7e4 100644
@@ -649,8 +649,7 @@ int _aac_rx_init(struct aac_dev *dev)
 	aac_adapter_comm(dev, dev->comm_interface);
 	dev->sync_mode = 0;	/* sync. mode not supported */
 	dev->msi = aac_msi && !pci_enable_msi(dev->pdev);
-	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-			IRQF_SHARED, "aacraid", dev) < 0) {
+	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr, IRQF_SHARED | IRQF_USER_DATA, "aacraid", dev) < 0) {
 		if (dev->msi)
 			pci_disable_msi(dev->pdev);
 		printk(KERN_ERR "%s%d: Interrupt unavailable.\n",
drivers/scsi/aacraid/sa.c +1 -2
index efa96c1c6aa3..1bc3c4c93852 100644
@@ -388,8 +388,7 @@ int aac_sa_init(struct aac_dev *dev)
 	if(aac_init_adapter(dev) == NULL)
 		goto error_irq;
 	dev->sync_mode = 0;	/* sync. mode not supported */
-	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-			IRQF_SHARED, "aacraid", (void *)dev) < 0) {
+	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr, IRQF_SHARED | IRQF_USER_DATA, "aacraid", (void *)dev) < 0) {
 		printk(KERN_WARNING "%s%d: Interrupt unavailable.\n",
 			name, instance);
 		goto error_iounmap;
drivers/scsi/aacraid/src.c +1 -2
index 8377aec0649d..113e5e95c507 100644
@@ -986,8 +986,7 @@ int aac_src_init(struct aac_dev *dev)
 	dev->aac_msix[0].vector_no = 0;
 	dev->aac_msix[0].dev = dev;
 
-	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-			IRQF_SHARED, "aacraid", &(dev->aac_msix[0]))  < 0) {
+	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr, IRQF_SHARED | IRQF_USER_DATA, "aacraid", &(dev->aac_msix[0]))  < 0) {
 
 		if (dev->msi)
 			pci_disable_msi(dev->pdev);
drivers/scsi/advansys.c +2 -2
index d37584403c33..1dc63c240c0d 100644
@@ -11298,8 +11298,8 @@ static int advansys_board_found(struct Scsi_Host *shost, unsigned int iop,
 	/* Register IRQ Number. */
 	ASC_DBG(2, "request_irq(%d, %p)\n", boardp->irq, shost);
 
-	ret = request_irq(boardp->irq, advansys_interrupt, share_irq,
-			  DRV_NAME, shost);
+	ret = request_irq(boardp->irq, advansys_interrupt,
+			  share_irq | IRQF_USER_DATA, DRV_NAME, shost);
 
 	if (ret) {
 		if (ret == -EBUSY) {
drivers/scsi/aha152x.c +2 -2
index 97872838b983..820af5a16dac 100644
@@ -798,7 +798,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)
 	SETPORT(SIMODE0, 0);
 	SETPORT(SIMODE1, 0);
 
-	if (request_irq(shpnt->irq, swintr, IRQF_SHARED, "aha152x", shpnt)) {
+	if (request_irq(shpnt->irq, swintr, IRQF_SHARED | IRQF_USER_DATA, "aha152x", shpnt)) {
 		printk(KERN_ERR "aha152x%d: irq %d busy.\n", shpnt->host_no, shpnt->irq);
 		goto out_host_put;
 	}
@@ -832,7 +832,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)
 	SETPORT(SSTAT0, 0x7f);
 	SETPORT(SSTAT1, 0xef);
 
-	if (request_irq(shpnt->irq, intr, IRQF_SHARED, "aha152x", shpnt)) {
+	if (request_irq(shpnt->irq, intr, IRQF_SHARED | IRQF_USER_DATA, "aha152x", shpnt)) {
 		printk(KERN_ERR "aha152x%d: failed to reassign irq %d.\n", shpnt->host_no, shpnt->irq);
 		goto out_host_put;
 	}
drivers/scsi/aha1542.c +1 -1
index ba7a5725be04..4e2a66982248 100644
@@ -782,7 +782,7 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct
 
 	setup_mailboxes(sh);
 
-	if (request_irq(sh->irq, aha1542_interrupt, 0, "aha1542", sh)) {
+	if (request_irq(sh->irq, aha1542_interrupt, IRQF_USER_DATA, "aha1542", sh)) {
 		shost_printk(KERN_ERR, sh, "Unable to allocate IRQ.\n");
 		goto free_ccb;
 	}
drivers/scsi/aha1740.c +1 -2
index da4150c17781..06da04ed2b28 100644
@@ -597,8 +597,7 @@ static int aha1740_probe (struct device *dev)
 	}
 	
 	DEB(printk("aha1740_probe: enable interrupt channel %d\n",irq_level));
-	if (request_irq(irq_level,aha1740_intr_handle,irq_type ? 0 : IRQF_SHARED,
-			"aha1740",shpnt)) {
+	if (request_irq(irq_level, aha1740_intr_handle, (irq_type ? 0 : IRQF_SHARED) | IRQF_USER_DATA, "aha1740", shpnt)) {
 		printk(KERN_ERR "aha1740_probe: Unable to allocate IRQ %d.\n",
 		       irq_level);
 		goto err_unmap;
drivers/scsi/aic7xxx/aic7770_osm.c +2 -1
index 3d401d02c019..5a1190313f68 100644
@@ -67,7 +67,8 @@ aic7770_map_int(struct ahc_softc *ahc, u_int irq)
 	if ((ahc->flags & AHC_EDGE_INTERRUPT) == 0)
 		shared = IRQF_SHARED;
 
-	error = request_irq(irq, ahc_linux_isr, shared, "aic7xxx", ahc);
+	error = request_irq(irq, ahc_linux_isr, shared | IRQF_USER_DATA,
+			    "aic7xxx", ahc);
 	if (error == 0)
 		ahc->platform_data->irq = irq;
 	
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +1 -1
index 8466aa784ec1..be821365298d 100644
@@ -383,7 +383,7 @@ ahd_pci_map_int(struct ahd_softc *ahd)
 	int error;
 
 	error = request_irq(ahd->dev_softc->irq, ahd_linux_isr,
-			    IRQF_SHARED, "aic79xx", ahd);
+			    IRQF_SHARED | IRQF_USER_DATA, "aic79xx", ahd);
 	if (!error)
 		ahd->platform_data->irq = ahd->dev_softc->irq;
 	
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +1 -1
index 0fc14dac7070..867ada06c334 100644
@@ -461,7 +461,7 @@ ahc_pci_map_int(struct ahc_softc *ahc)
 	int error;
 
 	error = request_irq(ahc->dev_softc->irq, ahc_linux_isr,
-			    IRQF_SHARED, "aic7xxx", ahc);
+			    IRQF_SHARED | IRQF_USER_DATA, "aic7xxx", ahc);
 	if (error == 0)
 		ahc->platform_data->irq = ahc->dev_softc->irq;
 	
drivers/scsi/aic94xx/aic94xx_init.c +3 -2
index 07efcb9b5b94..f1d5d9b14d2f 100644
@@ -804,8 +804,9 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (use_msi)
 		pci_enable_msi(asd_ha->pcidev);
 
-	err = request_irq(asd_ha->pcidev->irq, asd_hw_isr, IRQF_SHARED,
-			  ASD_DRIVER_NAME, asd_ha);
+	err = request_irq(asd_ha->pcidev->irq, asd_hw_isr,
+			  IRQF_SHARED | IRQF_USER_DATA, ASD_DRIVER_NAME,
+			  asd_ha);
 	if (err) {
 		asd_printk("couldn't get irq %d for %s\n",
 			   asd_ha->pcidev->irq, pci_name(asd_ha->pcidev));
drivers/scsi/am53c974.c +2 -2
index 27c0a4a937d9..b6778db02433 100644
@@ -448,8 +448,8 @@ static int pci_esp_probe_one(struct pci_dev *pdev,
 
 	pci_set_drvdata(pdev, pep);
 
-	err = request_irq(pdev->irq, scsi_esp_intr, IRQF_SHARED,
-			  DRV_MODULE_NAME, esp);
+	err = request_irq(pdev->irq, scsi_esp_intr,
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_MODULE_NAME, esp);
 	if (err < 0) {
 		dev_printk(KERN_ERR, &pdev->dev, "failed to register IRQ\n");
 		goto fail_unmap_command_block;
drivers/scsi/arcmsr/arcmsr_hba.c +1 -2
index 57c6fa388bf6..eaf5b63c8023 100644
@@ -860,8 +860,7 @@ arcmsr_request_irq(struct pci_dev *pdev, struct AdapterControlBlock *acb)
 
 	acb->vector_count = nvec;
 	for (i = 0; i < nvec; i++) {
-		if (request_irq(pci_irq_vector(pdev, i), arcmsr_do_interrupt,
-				flags, "arcmsr", acb)) {
+		if (request_irq(pci_irq_vector(pdev, i), arcmsr_do_interrupt, flags | IRQF_USER_DATA, "arcmsr", acb)) {
 			pr_warn("arcmsr%d: request_irq =%d failed!\n",
 				acb->host->host_no, pci_irq_vector(pdev, i));
 			goto out_free_irq;
drivers/scsi/atp870u.c +2 -1
index 1267200380f8..9a31e1ad82b7 100644
@@ -1551,7 +1551,8 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	else
 		atp870_init(shpnt);
 
-	err = request_irq(shpnt->irq, atp870u_intr_handle, IRQF_SHARED, "atp870u", shpnt);
+	err = request_irq(shpnt->irq, atp870u_intr_handle,
+			  IRQF_SHARED | IRQF_USER_DATA, "atp870u", shpnt);
 	if (err) {
 		dev_err(&pdev->dev, "Unable to allocate IRQ %d.\n", shpnt->irq);
 		goto free_tables;
drivers/scsi/be2iscsi/be_main.c +8 -4
index 74e260027c7d..b2a797b4aac1 100644
@@ -821,7 +821,9 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
 			}
 
 			ret = request_irq(pci_irq_vector(pcidev, i),
-					  be_isr_msix, 0, phba->msi_name[i],
+					  be_isr_msix,
+					  IRQF_USER_DATA,
+					  phba->msi_name[i],
 					  &phwi_context->be_eq[i]);
 			if (ret) {
 				beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
@@ -838,7 +840,8 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
 			ret = -ENOMEM;
 			goto free_msix_irqs;
 		}
-		ret = request_irq(pci_irq_vector(pcidev, i), be_isr_mcc, 0,
+		ret = request_irq(pci_irq_vector(pcidev, i), be_isr_mcc,
+				  IRQF_USER_DATA,
 				  phba->msi_name[i], &phwi_context->be_eq[i]);
 		if (ret) {
 			beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT ,
@@ -849,8 +852,9 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
 		}
 
 	} else {
-		ret = request_irq(pcidev->irq, be_isr, IRQF_SHARED,
-				  "beiscsi", phba);
+		ret = request_irq(pcidev->irq, be_isr,
+				  IRQF_SHARED | IRQF_USER_DATA, "beiscsi",
+				  phba);
 		if (ret) {
 			beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
 				    "BM_%d : beiscsi_init_irqs-"
drivers/scsi/bfa/bfad.c +6 -3
index 42a0caf6740d..26c1ac916d6c 100644
@@ -1177,8 +1177,10 @@ bfad_install_msix_handler(struct bfad_s *bfad)
 				msix_name_cb[i] : msix_name_ct[i]));
 
 		error = request_irq(bfad->msix_tab[i].msix.vector,
-				    (irq_handler_t) bfad_msix, 0,
-				    bfad->msix_tab[i].name, &bfad->msix_tab[i]);
+				    (irq_handler_t)bfad_msix,
+				    IRQF_USER_DATA,
+				    bfad->msix_tab[i].name,
+				    &bfad->msix_tab[i]);
 		bfa_trc(bfad, i);
 		bfa_trc(bfad, bfad->msix_tab[i].msix.vector);
 		if (error) {
@@ -1261,7 +1263,8 @@ bfad_setup_intr(struct bfad_s *bfad)
 
 line_based:
 	error = request_irq(bfad->pcidev->irq, (irq_handler_t)bfad_intx,
-			    BFAD_IRQ_FLAGS, BFAD_DRIVER_NAME, bfad);
+			    BFAD_IRQ_FLAGS | IRQF_USER_DATA, BFAD_DRIVER_NAME,
+			    bfad);
 	if (error)
 		return error;
 
drivers/scsi/csiostor/csio_isr.c +9 -7
index 7c8814715711..2897050f8ee1 100644
@@ -387,8 +387,8 @@ csio_request_irqs(struct csio_hw *hw)
 
 	if (hw->intr_mode != CSIO_IM_MSIX) {
 		rv = request_irq(pci_irq_vector(pdev, 0), csio_fcoe_isr,
-				hw->intr_mode == CSIO_IM_MSI ? 0 : IRQF_SHARED,
-				KBUILD_MODNAME, hw);
+				 (hw->intr_mode == CSIO_IM_MSI ? 0 : IRQF_SHARED) | IRQF_USER_DATA,
+				 KBUILD_MODNAME, hw);
 		if (rv) {
 			csio_err(hw, "Failed to allocate interrupt line.\n");
 			goto out_free_irqs;
@@ -400,8 +400,8 @@ csio_request_irqs(struct csio_hw *hw)
 	/* Add the MSIX vector descriptions */
 	csio_add_msix_desc(hw);
 
-	rv = request_irq(pci_irq_vector(pdev, k), csio_nondata_isr, 0,
-			 entryp[k].desc, hw);
+	rv = request_irq(pci_irq_vector(pdev, k), csio_nondata_isr,
+			 IRQF_USER_DATA, entryp[k].desc, hw);
 	if (rv) {
 		csio_err(hw, "IRQ request failed for vec %d err:%d\n",
 			 pci_irq_vector(pdev, k), rv);
@@ -410,8 +410,8 @@ csio_request_irqs(struct csio_hw *hw)
 
 	entryp[k++].dev_id = hw;
 
-	rv = request_irq(pci_irq_vector(pdev, k), csio_fwevt_isr, 0,
-			 entryp[k].desc, hw);
+	rv = request_irq(pci_irq_vector(pdev, k), csio_fwevt_isr,
+			 IRQF_USER_DATA, entryp[k].desc, hw);
 	if (rv) {
 		csio_err(hw, "IRQ request failed for vec %d err:%d\n",
 			 pci_irq_vector(pdev, k), rv);
@@ -427,7 +427,9 @@ csio_request_irqs(struct csio_hw *hw)
 			struct csio_scsi_qset *sqset = &hw->sqset[i][j];
 			struct csio_q *q = hw->wrm.q_arr[sqset->iq_idx];
 
-			rv = request_irq(pci_irq_vector(pdev, k), csio_scsi_isr, 0,
+			rv = request_irq(pci_irq_vector(pdev, k),
+					 csio_scsi_isr,
+					 IRQF_USER_DATA,
 					 entryp[k].desc, q);
 			if (rv) {
 				csio_err(hw,
drivers/scsi/dpt_i2o.c +1 -1
index 70d1a18278af..31acc27f2b29 100644
@@ -1065,7 +1065,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
 		printk(KERN_INFO"     BAR1 %p - size= %x\n",msg_addr_virt,hba_map1_area_size);
 	}
 
-	if (request_irq (pDev->irq, adpt_isr, IRQF_SHARED, pHba->name, pHba)) {
+	if (request_irq(pDev->irq, adpt_isr, IRQF_SHARED | IRQF_USER_DATA, pHba->name, pHba)) {
 		printk(KERN_ERR"%s: Couldn't register IRQ %d\n", pHba->name, pDev->irq);
 		adpt_i2o_delete_hba(pHba);
 		return -EINVAL;
drivers/scsi/esas2r/esas2r_init.c +1 -7
index 46b2c83ba21f..43e61aaefe9d 100644
@@ -240,13 +240,7 @@ static void esas2r_claim_interrupts(struct esas2r_adapter *a)
 		   "esas2r_claim_interrupts irq=%d (%p, %s, %lx)",
 		   a->pcid->irq, a, a->name, flags);
 
-	if (request_irq(a->pcid->irq,
-			(a->intr_mode ==
-			 INTR_MODE_LEGACY) ? esas2r_interrupt :
-			esas2r_msi_interrupt,
-			flags,
-			a->name,
-			a)) {
+	if (request_irq(a->pcid->irq, (a->intr_mode == INTR_MODE_LEGACY) ? esas2r_interrupt : esas2r_msi_interrupt, flags | IRQF_USER_DATA, a->name, a)) {
 		esas2r_log(ESAS2R_LOG_CRIT, "unable to request IRQ %02X",
 			   a->pcid->irq);
 		return;
drivers/scsi/fnic/fnic_isr.c +9 -4
index 4e3a50202e8c..2f71590be836 100644
@@ -178,12 +178,16 @@ int fnic_request_intr(struct fnic *fnic)
 
 	case VNIC_DEV_INTR_MODE_INTX:
 		err = request_irq(pci_irq_vector(fnic->pdev, 0),
-				&fnic_isr_legacy, IRQF_SHARED, DRV_NAME, fnic);
+				  &fnic_isr_legacy,
+				  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME,
+				  fnic);
 		break;
 
 	case VNIC_DEV_INTR_MODE_MSI:
-		err = request_irq(pci_irq_vector(fnic->pdev, 0), &fnic_isr_msi,
-				  0, fnic->name, fnic);
+		err = request_irq(pci_irq_vector(fnic->pdev, 0),
+				  &fnic_isr_msi,
+				  IRQF_USER_DATA, fnic->name,
+				  fnic);
 		break;
 
 	case VNIC_DEV_INTR_MODE_MSIX:
@@ -211,7 +215,8 @@ int fnic_request_intr(struct fnic *fnic)
 
 		for (i = 0; i < ARRAY_SIZE(fnic->msix); i++) {
 			err = request_irq(pci_irq_vector(fnic->pdev, i),
-					  fnic->msix[i].isr, 0,
+					  fnic->msix[i].isr,
+					  IRQF_USER_DATA,
 					  fnic->msix[i].devname,
 					  fnic->msix[i].devid);
 			if (err) {
drivers/scsi/g_NCR5380.c +2 -5
index 9cdca0625498..c95a9af1fd4f 100644
@@ -191,9 +191,7 @@ static irqreturn_t legacy_empty_irq_handler(int irq, void *dev_id)
 static int legacy_find_free_irq(int *irq_table)
 {
 	while (*irq_table != -1) {
-		if (!request_irq(*irq_table, legacy_empty_irq_handler,
-		                 IRQF_PROBE_SHARED, "Test IRQ",
-		                 (void *)irq_table)) {
+		if (!request_irq(*irq_table, legacy_empty_irq_handler, IRQF_PROBE_SHARED | IRQF_USER_DATA, "Test IRQ", (void *)irq_table)) {
 			free_irq(*irq_table, (void *) irq_table);
 			return *irq_table;
 		}
@@ -428,8 +426,7 @@ static int generic_NCR5380_init_one(struct scsi_host_template *tpnt,
 	}
 
 	if (instance->irq != NO_IRQ) {
-		if (request_irq(instance->irq, generic_NCR5380_intr,
-				0, "NCR5380", instance)) {
+		if (request_irq(instance->irq, generic_NCR5380_intr, IRQF_USER_DATA, "NCR5380", instance)) {
 			instance->irq = NO_IRQ;
 			shost_printk(KERN_INFO, instance,
 			             "irq %d denied\n", instance->irq);
drivers/scsi/gdth.c +5 -3
index 194c294f9b6c..361f8bd6b863 100644
@@ -4707,7 +4707,8 @@ static int __init gdth_isa_probe_one(u32 isa_bios)
 	printk("Configuring GDT-ISA HA at BIOS 0x%05X IRQ %u DRQ %u\n",
 		isa_bios, ha->irq, ha->drq);
 
-	error = request_irq(ha->irq, gdth_interrupt, 0, "gdth", ha);
+	error = request_irq(ha->irq, gdth_interrupt,
+			    IRQF_USER_DATA, "gdth", ha);
 	if (error) {
 		printk("GDT-ISA: Unable to allocate IRQ\n");
 		goto out_host_put;
@@ -4839,7 +4840,8 @@ static int __init gdth_eisa_probe_one(u16 eisa_slot)
 	printk("Configuring GDT-EISA HA at Slot %d IRQ %u\n",
 		eisa_slot >> 12, ha->irq);
 
-	error = request_irq(ha->irq, gdth_interrupt, 0, "gdth", ha);
+	error = request_irq(ha->irq, gdth_interrupt,
+			    IRQF_USER_DATA, "gdth", ha);
 	if (error) {
 		printk("GDT-EISA: Unable to allocate IRQ\n");
 		goto out_host_put;
@@ -4975,7 +4977,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, gdth_ha_str **ha_out)
 		ha->irq);
 
 	error = request_irq(ha->irq, gdth_interrupt,
-				IRQF_SHARED, "gdth", ha);
+			    IRQF_SHARED | IRQF_USER_DATA, "gdth", ha);
 	if (error) {
 		printk("GDT-PCI: Unable to allocate IRQ\n");
 		goto out_host_put;
drivers/scsi/hpsa.c +10 -9
index ff67ef5d5347..38f68b4b4160 100644
@@ -7994,9 +7994,10 @@ static int hpsa_request_irqs(struct ctlr_info *h,
 		/* If performant mode and MSI-X, use multiple reply queues */
 		for (i = 0; i < h->msix_vectors; i++) {
 			sprintf(h->intrname[i], "%s-msix%d", h->devname, i);
-			rc = request_irq(pci_irq_vector(h->pdev, i), msixhandler,
-					0, h->intrname[i],
-					&h->q[i]);
+			rc = request_irq(pci_irq_vector(h->pdev, i),
+					 msixhandler,
+					 IRQF_USER_DATA,
+					 h->intrname[i], &h->q[i]);
 			if (rc) {
 				int j;
 
@@ -8018,16 +8019,16 @@ static int hpsa_request_irqs(struct ctlr_info *h,
 			sprintf(h->intrname[0], "%s-msi%s", h->devname,
 				h->msix_vectors ? "x" : "");
 			rc = request_irq(pci_irq_vector(h->pdev, 0),
-				msixhandler, 0,
-				h->intrname[0],
-				&h->q[h->intr_mode]);
+					 msixhandler,
+					 IRQF_USER_DATA,
+					 h->intrname[0], &h->q[h->intr_mode]);
 		} else {
 			sprintf(h->intrname[h->intr_mode],
 				"%s-intx", h->devname);
 			rc = request_irq(pci_irq_vector(h->pdev, 0),
-				intxhandler, IRQF_SHARED,
-				h->intrname[0],
-				&h->q[h->intr_mode]);
+					 intxhandler,
+					 IRQF_SHARED | IRQF_USER_DATA,
+					 h->intrname[0], &h->q[h->intr_mode]);
 		}
 	}
 	if (rc) {
drivers/scsi/hptiop.c +1 -2
index 3eedfd4f8f57..b6cf8ed9f111 100644
@@ -1421,8 +1421,7 @@ static int hptiop_probe(struct pci_dev *pcidev, const struct pci_device_id *id)
 
 	pci_set_drvdata(pcidev, host);
 
-	if (request_irq(pcidev->irq, hptiop_intr, IRQF_SHARED,
-					driver_name, hba)) {
+	if (request_irq(pcidev->irq, hptiop_intr, IRQF_SHARED | IRQF_USER_DATA, driver_name, hba)) {
 		printk(KERN_ERR "scsi%d: request irq %d failed\n",
 					hba->host->host_no, pcidev->irq);
 		goto unmap_pci_bar;
drivers/scsi/initio.c +2 -1
index eb2778b5c81b..33293ed73424 100644
@@ -2913,7 +2913,8 @@ static int initio_probe_one(struct pci_dev *pdev,
 	shost->base = host->addr;
 	shost->sg_tablesize = TOTAL_SG_ENTRY;
 
-	error = request_irq(pdev->irq, i91u_intr, IRQF_SHARED, "i91u", shost);
+	error = request_irq(pdev->irq, i91u_intr,
+			    IRQF_SHARED | IRQF_USER_DATA, "i91u", shost);
 	if (error < 0) {
 		printk(KERN_WARNING "initio: Unable to request IRQ %d\n", pdev->irq);
 		goto out_free_scbs;
drivers/scsi/ipr.c +12 -11
index d1b4025a4503..0a55dd02bc6c 100644
@@ -10048,11 +10048,10 @@ static int ipr_request_other_msi_irqs(struct ipr_ioa_cfg *ioa_cfg,
 	int i, rc;
 
 	for (i = 1; i < ioa_cfg->nvectors; i++) {
-		rc = request_irq(pci_irq_vector(pdev, i),
-			ipr_isr_mhrrq,
-			0,
-			ioa_cfg->vectors_info[i].desc,
-			&ioa_cfg->hrrq[i]);
+		rc = request_irq(pci_irq_vector(pdev, i), ipr_isr_mhrrq,
+				 IRQF_USER_DATA,
+				 ioa_cfg->vectors_info[i].desc,
+				 &ioa_cfg->hrrq[i]);
 		if (rc) {
 			while (--i >= 0)
 				free_irq(pci_irq_vector(pdev, i),
@@ -10117,7 +10116,8 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev)
 	int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg);
 	spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
 
-	rc = request_irq(irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg);
+	rc = request_irq(irq, ipr_test_intr, IRQF_USER_DATA,
+			 IPR_NAME, ioa_cfg);
 	if (rc) {
 		dev_err(&pdev->dev, "Can not assign irq %d\n", irq);
 		return rc;
@@ -10369,15 +10369,16 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
 
 	if (pdev->msi_enabled || pdev->msix_enabled) {
 		name_msi_vectors(ioa_cfg);
-		rc = request_irq(pci_irq_vector(pdev, 0), ipr_isr, 0,
-			ioa_cfg->vectors_info[0].desc,
-			&ioa_cfg->hrrq[0]);
+		rc = request_irq(pci_irq_vector(pdev, 0), ipr_isr,
+				 IRQF_USER_DATA,
+				 ioa_cfg->vectors_info[0].desc,
+				 &ioa_cfg->hrrq[0]);
 		if (!rc)
 			rc = ipr_request_other_msi_irqs(ioa_cfg, pdev);
 	} else {
 		rc = request_irq(pdev->irq, ipr_isr,
-			 IRQF_SHARED,
-			 IPR_NAME, &ioa_cfg->hrrq[0]);
+				 IRQF_SHARED | IRQF_USER_DATA, IPR_NAME,
+				 &ioa_cfg->hrrq[0]);
 	}
 	if (rc) {
 		dev_err(&pdev->dev, "Couldn't register IRQ %d! rc=%d\n",
drivers/scsi/ips.c +2 -2
index e8bc8d328bab..5d878d646708 100644
@@ -6664,7 +6664,7 @@ ips_register_scsi(int index)
 	memcpy(ha, oldha, sizeof (ips_ha_t));
 	free_irq(oldha->pcidev->irq, oldha);
 	/* Install the interrupt handler with the new ha */
-	if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
+	if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED | IRQF_USER_DATA, ips_name, ha)) {
 		IPS_PRINTK(KERN_WARNING, ha->pcidev,
 			   "Unable to install interrupt handler\n");
 		goto err_out_sh;
@@ -7062,7 +7062,7 @@ ips_init_phase2(int index)
 	}
 
 	/* Install the interrupt handler */
-	if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
+	if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED | IRQF_USER_DATA, ips_name, ha)) {
 		IPS_PRINTK(KERN_WARNING, ha->pcidev,
 			   "Unable to install interrupt handler\n");
 		return ips_abort_init(ha, index);
drivers/scsi/isci/init.c +5 -3
index 1727d0c71b12..a8245e9c367d 100644
@@ -353,7 +353,8 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
 			isr = isci_msix_isr;
 
 		err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, i),
-				isr, 0, DRV_NAME"-msix", ihost);
+				       isr, IRQF_USER_DATA,
+				       DRV_NAME "-msix", ihost);
 		if (!err)
 			continue;
 
@@ -372,8 +373,9 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
  intx:
 	for_each_isci_host(i, ihost, pdev) {
 		err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, 0),
-				isci_intx_isr, IRQF_SHARED, DRV_NAME"-intx",
-				ihost);
+				       isci_intx_isr,
+				       IRQF_SHARED | IRQF_USER_DATA,
+				       DRV_NAME "-intx", ihost);
 		if (err)
 			break;
 	}
drivers/scsi/lpfc/lpfc_init.c +22 -13
index bede11e16349..f1ded4ebd05c 100644
@@ -10004,7 +10004,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
 
 	/* vector-0 is associated to slow-path handler */
 	rc = request_irq(pci_irq_vector(phba->pcidev, 0),
-			 &lpfc_sli_sp_intr_handler, 0,
+			 &lpfc_sli_sp_intr_handler,
+			 IRQF_USER_DATA,
 			 LPFC_SP_DRIVER_HANDLER_NAME, phba);
 	if (rc) {
 		lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
@@ -10015,7 +10016,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
 
 	/* vector-1 is associated to fast-path handler */
 	rc = request_irq(pci_irq_vector(phba->pcidev, 1),
-			 &lpfc_sli_fp_intr_handler, 0,
+			 &lpfc_sli_fp_intr_handler,
+			 IRQF_USER_DATA,
 			 LPFC_FP_DRIVER_HANDLER_NAME, phba);
 
 	if (rc) {
@@ -10103,7 +10105,8 @@ lpfc_sli_enable_msi(struct lpfc_hba *phba)
 	}
 
 	rc = request_irq(phba->pcidev->irq, lpfc_sli_intr_handler,
-			 0, LPFC_DRIVER_NAME, phba);
+			 IRQF_USER_DATA, LPFC_DRIVER_NAME,
+			 phba);
 	if (rc) {
 		pci_disable_msi(phba->pcidev);
 		lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
@@ -10161,7 +10164,8 @@ lpfc_sli_enable_intr(struct lpfc_hba *phba, uint32_t cfg_mode)
 	/* Fallback to INTx if both MSI-X/MSI initalization failed */
 	if (phba->intr_type == NONE) {
 		retval = request_irq(phba->pcidev->irq, lpfc_sli_intr_handler,
-				     IRQF_SHARED, LPFC_DRIVER_NAME, phba);
+				     IRQF_SHARED | IRQF_USER_DATA,
+				     LPFC_DRIVER_NAME, phba);
 		if (!retval) {
 			/* Indicate initialization to INTx mode */
 			phba->intr_type = INTx;
@@ -10297,14 +10301,16 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
 		atomic_set(&phba->sli4_hba.hba_eq_hdl[index].hba_eq_in_use, 1);
 		if (phba->cfg_fof && (index == (vectors - 1)))
 			rc = request_irq(pci_irq_vector(phba->pcidev, index),
-				 &lpfc_sli4_fof_intr_handler, 0,
-				 name,
-				 &phba->sli4_hba.hba_eq_hdl[index]);
+					 &lpfc_sli4_fof_intr_handler,
+					 IRQF_USER_DATA,
+					 name,
+					 &phba->sli4_hba.hba_eq_hdl[index]);
 		else
 			rc = request_irq(pci_irq_vector(phba->pcidev, index),
-				 &lpfc_sli4_hba_intr_handler, 0,
-				 name,
-				 &phba->sli4_hba.hba_eq_hdl[index]);
+					 &lpfc_sli4_hba_intr_handler,
+					 IRQF_USER_DATA,
+					 name,
+					 &phba->sli4_hba.hba_eq_hdl[index]);
 		if (rc) {
 			lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
 					"0486 MSI-X fast-path (%d) "
@@ -10377,7 +10383,8 @@ lpfc_sli4_enable_msi(struct lpfc_hba *phba)
 	}
 
 	rc = request_irq(phba->pcidev->irq, lpfc_sli4_intr_handler,
-			 0, LPFC_DRIVER_NAME, phba);
+			 IRQF_USER_DATA, LPFC_DRIVER_NAME,
+			 phba);
 	if (rc) {
 		pci_disable_msi(phba->pcidev);
 		lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
@@ -10445,8 +10452,10 @@ lpfc_sli4_enable_intr(struct lpfc_hba *phba, uint32_t cfg_mode)
 
 	/* Fallback to INTx if both MSI-X/MSI initalization failed */
 	if (phba->intr_type == NONE) {
-		retval = request_irq(phba->pcidev->irq, lpfc_sli4_intr_handler,
-				     IRQF_SHARED, LPFC_DRIVER_NAME, phba);
+		retval = request_irq(phba->pcidev->irq,
+				     lpfc_sli4_intr_handler,
+				     IRQF_SHARED | IRQF_USER_DATA,
+				     LPFC_DRIVER_NAME, phba);
 		if (!retval) {
 			struct lpfc_hba_eq_hdl *eqhdl;
 
drivers/scsi/megaraid.c +1 -3
index 4862f65ec3e8..12fb3c35cc08 100644
@@ -4299,9 +4299,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto out_free_cmd_buffer;
 	}
 
-	if (request_irq(irq, (adapter->flag & BOARD_MEMMAP) ?
-				megaraid_isr_memmapped : megaraid_isr_iomapped,
-					IRQF_SHARED, "megaraid", adapter)) {
+	if (request_irq(irq, (adapter->flag & BOARD_MEMMAP) ? megaraid_isr_memmapped : megaraid_isr_iomapped, IRQF_SHARED | IRQF_USER_DATA, "megaraid", adapter)) {
 		dev_warn(&pdev->dev, "Couldn't register IRQ %d!\n", irq);
 		goto out_free_scb_list;
 	}
drivers/scsi/megaraid/megaraid_mbox.c +1 -2
index f112458023ff..b94dcce82042 100644
@@ -767,8 +767,7 @@ megaraid_init_mbox(adapter_t *adapter)
 	 */
 
 	/* request IRQ and register the interrupt service routine */
-	if (request_irq(adapter->irq, megaraid_isr, IRQF_SHARED, "megaraid",
-		adapter)) {
+	if (request_irq(adapter->irq, megaraid_isr, IRQF_SHARED | IRQF_USER_DATA, "megaraid", adapter)) {
 
 		con_log(CL_ANN, (KERN_WARNING
 			"megaraid: Couldn't register IRQ %d!\n", adapter->irq));
drivers/scsi/megaraid/megaraid_sas_base.c +2 -6
index fcbff83c0097..b1dccee2bdc1 100644
@@ -5170,9 +5170,7 @@ megasas_setup_irqs_ioapic(struct megasas_instance *instance)
 	pdev = instance->pdev;
 	instance->irq_context[0].instance = instance;
 	instance->irq_context[0].MSIxIndex = 0;
-	if (request_irq(pci_irq_vector(pdev, 0),
-			instance->instancet->service_isr, IRQF_SHARED,
-			"megasas", &instance->irq_context[0])) {
+	if (request_irq(pci_irq_vector(pdev, 0), instance->instancet->service_isr, IRQF_SHARED | IRQF_USER_DATA, "megasas", &instance->irq_context[0])) {
 		dev_err(&instance->pdev->dev,
 				"Failed to register IRQ from %s %d\n",
 				__func__, __LINE__);
@@ -5202,9 +5200,7 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe)
 	for (i = 0; i < instance->msix_vectors; i++) {
 		instance->irq_context[i].instance = instance;
 		instance->irq_context[i].MSIxIndex = i;
-		if (request_irq(pci_irq_vector(pdev, i),
-			instance->instancet->service_isr, 0, "megasas",
-			&instance->irq_context[i])) {
+		if (request_irq(pci_irq_vector(pdev, i), instance->instancet->service_isr, IRQF_USER_DATA, "megasas", &instance->irq_context[i])) {
 			dev_err(&instance->pdev->dev,
 				"Failed to register IRQ for vector %d.\n", i);
 			for (j = 0; j < i; j++)
drivers/scsi/mpt3sas/mpt3sas_base.c +1 -1
index 0a6cb8f0680c..7f9a4d44c605 100644
@@ -2727,7 +2727,7 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index)
 		snprintf(reply_q->name, MPT_NAME_LENGTH, "%s%d",
 		    ioc->driver_name, ioc->id);
 	r = request_irq(pci_irq_vector(pdev, index), _base_interrupt,
-			IRQF_SHARED, reply_q->name, reply_q);
+			IRQF_SHARED | IRQF_USER_DATA, reply_q->name, reply_q);
 	if (r) {
 		pr_err("%s: unable to allocate interrupt %d!\n",
 		       reply_q->name, pci_irq_vector(pdev, index));
drivers/scsi/mvsas/mv_init.c +2 -2
index 030d911ee374..4fd2179f3d55 100644
@@ -589,8 +589,8 @@ static int mvs_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent)
 	rc = sas_register_ha(SHOST_TO_SAS_HA(shost));
 	if (rc)
 		goto err_out_shost;
-	rc = request_irq(pdev->irq, irq_handler, IRQF_SHARED,
-		DRV_NAME, SHOST_TO_SAS_HA(shost));
+	rc = request_irq(pdev->irq, irq_handler, IRQF_SHARED | IRQF_USER_DATA,
+			 DRV_NAME, SHOST_TO_SAS_HA(shost));
 	if (rc)
 		goto err_not_sas;
 
drivers/scsi/mvumi.c +4 -4
index 36f64205ecfa..7520c7740044 100644
@@ -2516,8 +2516,8 @@ static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (ret)
 		goto fail_init_fw;
 
-	ret = request_irq(mhba->pdev->irq, mvumi_isr_handler, IRQF_SHARED,
-				"mvumi", mhba);
+	ret = request_irq(mhba->pdev->irq, mvumi_isr_handler,
+			  IRQF_SHARED | IRQF_USER_DATA, "mvumi", mhba);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register IRQ\n");
 		goto fail_init_irq;
@@ -2645,8 +2645,8 @@ static int __maybe_unused mvumi_resume(struct pci_dev *pdev)
 		goto unmap_pci_addr;
 	}
 
-	ret = request_irq(mhba->pdev->irq, mvumi_isr_handler, IRQF_SHARED,
-				"mvumi", mhba);
+	ret = request_irq(mhba->pdev->irq, mvumi_isr_handler,
+			  IRQF_SHARED | IRQF_USER_DATA, "mvumi", mhba);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register IRQ\n");
 		goto unmap_pci_addr;
drivers/scsi/myrb.c +1 -1
index 539ac8ce4fcd..8a47670a7700 100644
@@ -3542,7 +3542,7 @@ static struct myrb_hba *myrb_detect(struct pci_dev *pdev,
 	if (privdata->hw_init(pdev, cb, cb->io_base))
 		goto failure;
 
-	if (request_irq(pdev->irq, irq_handler, IRQF_SHARED, "myrb", cb) < 0) {
+	if (request_irq(pdev->irq, irq_handler, IRQF_SHARED | IRQF_USER_DATA, "myrb", cb) < 0) {
 		dev_err(&pdev->dev,
 			"Unable to acquire IRQ Channel %d\n", pdev->irq);
 		goto failure;
drivers/scsi/myrs.c +1 -1
index b8d54ef8cf6d..4e8fd9480469 100644
@@ -2323,7 +2323,7 @@ static struct myrs_hba *myrs_detect(struct pci_dev *pdev,
 		goto Failure;
 
 	/* Acquire shared access to the IRQ Channel. */
-	if (request_irq(pdev->irq, irq_handler, IRQF_SHARED, "myrs", cs) < 0) {
+	if (request_irq(pdev->irq, irq_handler, IRQF_SHARED | IRQF_USER_DATA, "myrs", cs) < 0) {
 		dev_err(&pdev->dev,
 			"Unable to acquire IRQ Channel %d\n", pdev->irq);
 		goto Failure;
drivers/scsi/nsp32.c +2 -1
index 00e3cbee55b8..3477288bad79 100644
@@ -2729,7 +2729,8 @@ static int nsp32_detect(struct pci_dev *pdev)
 	 */
 	nsp32_do_bus_reset(data);
 
-	ret = request_irq(host->irq, do_nsp32_isr, IRQF_SHARED, "nsp32", data);
+	ret = request_irq(host->irq, do_nsp32_isr,
+			  IRQF_SHARED | IRQF_USER_DATA, "nsp32", data);
 	if (ret < 0) {
 		nsp32_msg(KERN_ERR, "Unable to allocate IRQ for NinjaSCSI32 "
 			  "SCSI PCI controller. Interrupt: %d", host->irq);
drivers/scsi/pcmcia/qlogic_stub.c +1 -1
index 828d53faf09a..e321a9c57c5d 100644
@@ -119,7 +119,7 @@ static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
 	priv->shost = shost;
 	priv->int_type = INT_TYPE;					
 
-	if (request_irq(qlirq, qlogicfas408_ihandl, 0, qlogic_name, shost))
+	if (request_irq(qlirq, qlogicfas408_ihandl, IRQF_USER_DATA, qlogic_name, shost))
 		goto free_scsi_host;
[… more lines in the raw message]

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

drivers/scsi/pcmcia/sym53c500_cs.c +1 -1
index d1e98a6ea28f..66c96648ecaf 100644

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

drivers/scsi/pm8001/pm8001_init.c +6 -4
index a36060c23b37..bc9ce9eceaa2 100644

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

drivers/scsi/pmcraid.c +3 -2
index e338d7a4f571..9f94b2b713dd 100644

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

drivers/scsi/qedf/qedf_main.c +3 -1
index 9bbc19fc190b..452e8e7db1d1 100644

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

drivers/scsi/qedi/qedi_main.c +2 -1
index e74a62448ba4..792ead7e468a 100644

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

drivers/scsi/qla1280.c +1 -2
index 6856dfdfa473..fb0cebb1665f 100644

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

drivers/scsi/qla2xxx/qla_isr.c +13 -9
index 8507c43b918c..43463db8a0d7 100644

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

drivers/scsi/qla4xxx/ql4_isr.c +3 -2
index d2cd33d8d67f..236166da1ac8 100644

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

drivers/scsi/qla4xxx/ql4_nx.c +6 -4
index 5a31877c9d04..4a3e1ce069f8 100644

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

drivers/scsi/qlogicfas.c +1 -1
index 8f709002f746..c9bd84f4df25 100644

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

drivers/scsi/sim710.c +1 -1
index 82ed99848378..1838cc163fea 100644

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

drivers/scsi/smartpqi/smartpqi_init.c +7 -4
index f564af8949e8..10cb10c47b87 100644

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

drivers/scsi/snic/snic_isr.c +2 -3
index c4da3673f2ae..015ae0bc061b 100644

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

drivers/scsi/stex.c +2 -2
index f6bef7ad65e7..416a71d13169 100644

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

drivers/scsi/sym53c8xx_2/sym_glue.c +1 -2
index 57f6d63e4c40..9c38ffd7675f 100644

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

drivers/scsi/ufs/ufshcd.c +4 -3
index 2ddf24466a62..807fbd94c31f 100644

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

drivers/scsi/vmw_pvscsi.c +6 -3
index ecee4b3ff073..14885a807d2d 100644

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

drivers/scsi/wd719x.c +2 -2
index e3310e9488d2..a27d1269736d 100644

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

drivers/slimbus/qcom-ctrl.c +2 -1
index ad3e2e23f56e..8e7e50676162 100644

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

drivers/spi/spi-altera.c +2 -1
index a5adf0d868fc..5ad3eb51e7bd 100644

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

drivers/spi/spi-axi-spi-engine.c +2 -1
index 68cfc351b47f..189aa3723ef8 100644

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

drivers/spi/spi-cadence.c +2 -1
index 7c88f74f7f47..792af77b42c9 100644

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

drivers/spi/spi-dw.c +2 -2
index 2e822a56576a..2acec28544e3 100644

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

drivers/spi/spi-fsl-spi.c +2 -1
index 8f2e97857e8b..ae6a34fdc38f 100644

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

drivers/spi/spi-oc-tiny.c +2 -1
index 085f580be7ec..ee8dace61752 100644

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

drivers/spi/spi-pxa2xx.c +2 -2
index d84b893a64d7..072f49852e3e 100644

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

drivers/spi/spi-topcliff-pch.c +3 -2
index 97d137591b18..0b4840f1049b 100644

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

drivers/spi/spi-xilinx.c +3 -2
index 63fedc49ae9c..0043addb8d4a 100644

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

drivers/spi/spi-zynqmp-gqspi.c +2 -1
index 9f83e1b17aa1..8ff24edd3720 100644

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

drivers/staging/android/vsoc.c +2 -1
index 22571abcaa4e..43e40f31f9e5 100644

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

drivers/staging/axis-fifo/axis-fifo.c +2 -1
index 805437fa249a..af010e5dbfc6 100644

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

drivers/staging/comedi/drivers/addi_apci_1032.c +2 -1
index 560649be9d13..6503721d68c8 100644

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

drivers/staging/comedi/drivers/addi_apci_1500.c +2 -1
index 45ad4ba92f94..d9e909f3b9bf 100644

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

drivers/staging/comedi/drivers/addi_apci_1564.c +2 -1
index 10501fe6bb25..3ae718d28c74 100644

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

drivers/staging/comedi/drivers/addi_apci_2032.c +2 -1
index a122f3f3f5ec..f0f56908a809 100644

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

drivers/staging/comedi/drivers/addi_apci_3120.c +2 -1
index d2810fdd5e63..362863489892 100644

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

drivers/staging/comedi/drivers/addi_apci_3xxx.c +2 -1
index 55784f24e2a7..d64987dfdafa 100644

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

drivers/staging/comedi/drivers/adl_pci9111.c +2 -1
index f4dba6271d0d..a6adf1caeb63 100644

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

drivers/staging/comedi/drivers/adl_pci9118.c +2 -1
index 2528ca0ede6d..ca7ed001d7cb 100644

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

drivers/staging/comedi/drivers/adv_pci1710.c +2 -1
index 6a93b04f1fdf..50b74ae9404e 100644

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

drivers/staging/comedi/drivers/aio_iiro_16.c +2 -1
index 41c9c56816ef..9ef45db38500 100644

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

drivers/staging/comedi/drivers/amplc_dio200_common.c +1 -2
index 8697dc02ffb4..d8a15e405087 100644

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

drivers/staging/comedi/drivers/amplc_pc236_common.c +1 -2
index 01b90e4eca8a..b29133e1803d 100644

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

drivers/staging/comedi/drivers/amplc_pci224.c +2 -1
index 657b736ef46d..d463432103c0 100644

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

drivers/staging/comedi/drivers/amplc_pci230.c +2 -1
index 08ffe26c5d43..3def00d21e70 100644

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

drivers/staging/comedi/drivers/cb_pcidas.c +2 -2
index 02ae00c95313..71860c4cd7e0 100644

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

drivers/staging/comedi/drivers/cb_pcidas64.c +3 -2
index e1774e09a320..669d5540f0a9 100644

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

drivers/staging/comedi/drivers/comedi_parport.c +2 -1
index efaa57372aeb..41ef8b705546 100644

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

drivers/staging/comedi/drivers/das16m1.c +2 -1
index 4e36377b592a..b9cf4eb1dfab 100644

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

drivers/staging/comedi/drivers/das1800.c +2 -1
index f16aa7e9f4f3..18684d080e1e 100644

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

drivers/staging/comedi/drivers/das6402.c +2 -1
index f99211ec46de..a008aa26c9da 100644

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

drivers/staging/comedi/drivers/das800.c +3 -2
index 8cf09ef3012f..b304b1beaa01 100644

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

drivers/staging/comedi/drivers/dmm32at.c +2 -1
index 75693cdde313..021323879051 100644

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

drivers/staging/comedi/drivers/dt2811.c +2 -1
index 05207a519755..fd85efad6201 100644

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

drivers/staging/comedi/drivers/dt2814.c +2 -1
index d2c715737361..b52d2003f2fc 100644

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

drivers/staging/comedi/drivers/dt282x.c +1 -1
index 3be927f1d3a9..9e7a8f774f3c 100644

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

drivers/staging/comedi/drivers/dt3000.c +2 -1
index 2edf3ee91300..0d7d59217343 100644

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

drivers/staging/comedi/drivers/gsc_hpdi.c +1 -2
index 4bdf44d82879..73295b0dd890 100644

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

drivers/staging/comedi/drivers/me4000.c +2 -1
index ee53571a8969..cb183b99cbad 100644

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

drivers/staging/comedi/drivers/ni_6527.c +2 -2
index 4d1eccb5041d..5611b3d34564 100644

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

drivers/staging/comedi/drivers/ni_65xx.c +2 -1
index 996074e471d3..06aba4d9fb29 100644

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

drivers/staging/comedi/drivers/ni_660x.c +2 -2
index e70a461e723f..c68a98309ea6 100644

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

drivers/staging/comedi/drivers/ni_at_a2150.c +1 -1
index 76e8d047f71e..98018c27ea26 100644

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

drivers/staging/comedi/drivers/ni_atmio.c +2 -1
index 2b7bfe0dd7f3..1b333b8b85a0 100644

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

drivers/staging/comedi/drivers/ni_atmio16d.c +2 -1
index 68ad9676f962..482516f2a7a3 100644

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

drivers/staging/comedi/drivers/ni_labpc_common.c +3 -2
index 406952f5521d..c7043ef7a767 100644

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

drivers/staging/comedi/drivers/ni_pcidio.c +2 -1
index b9a0dc6eac44..ac7aff073f44 100644

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

drivers/staging/comedi/drivers/ni_pcimio.c +2 -1
index 14b26fffe049..cdbac51a690c 100644

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

drivers/staging/comedi/drivers/pcl711.c +2 -1
index a5937206bf1c..de61ca3abf33 100644

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

drivers/staging/comedi/drivers/pcl726.c +2 -1
index 0963d85873a9..669a13124343 100644

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

drivers/staging/comedi/drivers/pcl812.c +2 -1
index aefc1b849cf7..fe1af6ad4893 100644

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

drivers/staging/comedi/drivers/pcl816.c +1 -1
index d87cf6d4a161..3976db1227af 100644

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

drivers/staging/comedi/drivers/pcl818.c +2 -1
index 0af5315d4357..d207a9048a82 100644

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

drivers/staging/comedi/drivers/pcmmio.c +2 -1
index 72af1776f785..4e08b0c12cf3 100644

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

drivers/staging/comedi/drivers/pcmuio.c +4 -2
index 743fb226e2e4..cdcc5fca7402 100644

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

drivers/staging/comedi/drivers/rtd520.c +2 -1
index bb400e08f0bc..17460b0fb2e2 100644

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

drivers/staging/comedi/drivers/s626.c +2 -1
index f5af6f4069dc..2c6e135b8838 100644

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

drivers/staging/gasket/gasket_interrupt.c +2 -1
index ad5657d213f0..c0c73b1bad90 100644

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

drivers/staging/goldfish/goldfish_audio.c +3 -2
index d4520490cf6d..8796e7af3541 100644

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

drivers/staging/iio/adc/ad7606.c +2 -1
index 7308fa8fbb4c..64140840b4c1 100644

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

drivers/staging/media/bcm2048/radio-bcm2048.c +2 -2
index d9b02ff66259..063801da275b 100644

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

drivers/staging/media/zoran/zoran_card.c +1 -1
index 94dadbba7cd5..e3c7b11958dd 100644

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

drivers/staging/most/dim2/dim2.c +4 -2
index 31fbc1a75b06..d2dbd23c4841 100644

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

drivers/staging/most/i2c/i2c.c +2 -1
index 4a4fc1005932..60a33ea89b1e 100644

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

drivers/staging/olpc_dcon/olpc_dcon_xo_1.c +1 -1
index 80b8d4153414..d089114098ef 100644

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

drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c +1 -1
index 838daa2be3ef..e5efb7421f92 100644

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

drivers/staging/pi433/pi433_if.c +2 -4
index b2314636dc89..e7240abab54e 100644

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

drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -1
index 96f265eee007..6070e3da1be6 100644

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

drivers/staging/rtlwifi/pci.c +2 -2
index 4bb5703bd715..473d9cac1060 100644

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

drivers/staging/rts5208/rtsx.c +1 -3
index fa597953e9a0..bf11d96531e6 100644

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

drivers/staging/speakup/serialio.c +3 -2
index 177a2988641c..49dbedd2be0d 100644

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

drivers/staging/vt6655/device_main.c +1 -1
index c9097e7367d8..32544b8b75d3 100644

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

drivers/thermal/ti-soc-thermal/ti-bandgap.c +4 -2
index 097328d8e943..fd1326340b2a 100644

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

drivers/thunderbolt/nhi.c +4 -2
index 9aa44f9762a3..262bff1e829b 100644

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

drivers/tty/cyclades.c +5 -4
index 4562c8060d09..b564886c39ac 100644

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

drivers/tty/goldfish.c +2 -2
index c8c5cdfc5e19..608922f7c22d 100644

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

drivers/tty/hvc/hvc_irq.c +2 -2
index 4b255dfef2cc..e12dff7e9658 100644

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

drivers/tty/isicom.c +1 -1
index e04a43e89f6b..803226775c8e 100644

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

drivers/tty/mxser.c +2 -2
index 9d00ff5ef961..772497d057de 100644

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

drivers/tty/serial/8250/8250_core.c +2 -1
index e441221e04b9..2b161a64a0c8 100644

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

drivers/tty/serial/8250/8250_exar.c +1 -1
index 0089aa305ef9..4d600c39b518 100644

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

drivers/tty/serial/altera_jtaguart.c +2 -2
index c90e503d6b57..4f54bf976dca 100644

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

drivers/tty/serial/altera_uart.c +3 -2
index 0e487ce091ac..150c193dfb9c 100644

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

drivers/tty/serial/arc_uart.c +1 -1
index d904a3a345e7..63f9d11a93da 100644

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

drivers/tty/serial/digicolor-usart.c +2 -1
index f460cca139e2..a19ea82d617e 100644

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

drivers/tty/serial/fsl_lpuart.c +8 -4
index debdd1b9e01a..39950a1c45a8 100644

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

drivers/tty/serial/ifx6x60.c +4 -3
index ffefd218761e..4d796a82f311 100644

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

drivers/tty/serial/jsm/jsm_driver.c +2 -1
index 592e51d8944e..2cf37114dbdd 100644

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

drivers/tty/serial/max3100.c +1 -2
index 371569a0fd00..437c22dbc7e9 100644

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

drivers/tty/serial/men_z135_uart.c +2 -2
index ef89534dd760..ca87d7c99f76 100644

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

drivers/tty/serial/pch_uart.c +2 -2
index 9ed121f08a54..019d58228f55 100644

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

drivers/tty/serial/rp2.c +1 -1
index 5690c09cc041..2697acd6bff8 100644

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

drivers/tty/serial/sc16is7xx.c +1 -1
index 268098681856..c99e7ce41db4 100644

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

drivers/tty/serial/timbuart.c +2 -2
index 19d38b504e27..7febe4bfb676 100644

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

drivers/tty/serial/uartlite.c +2 -1
index b8b912b5a8b9..5d5a89b2fa60 100644

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

drivers/tty/serial/xilinx_uartps.c +3 -1
index 094f2958cb2b..76ebb8db3d4c 100644

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

drivers/tty/synclink.c +1 -2
index d55c858d6058..3a885131f45e 100644

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

drivers/tty/synclink_gt.c +1 -5
index e8a9047de451..4b9d1b347673 100644

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

drivers/tty/synclinkmp.c +3 -4
index fcb91bf7a15b..50b1e41501cf 100644

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

drivers/uio/uio.c +2 -1
index 131342280b46..b9f21495141b 100644

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

drivers/usb/c67x00/c67x00-drv.c +2 -1
index 53838e7d4eef..db2532530953 100644

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

drivers/usb/chipidea/core.c +3 -2
index 7bfcbb23c2a4..7c8d5edb9819 100644

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

drivers/usb/core/hcd.c +3 -2
index be47f96e810d..29790c4110fe 100644

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

drivers/usb/dwc2/gadget.c +2 -1
index 55ef3cc2701b..55bf64169647 100644

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

drivers/usb/dwc2/platform.c +2 -1
index c0b64d483552..153e2dff52ec 100644

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

drivers/usb/gadget/udc/amd5536udc_pci.c +1 -1
index 57b6f66331cf..8a629e2031ee 100644

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

drivers/usb/gadget/udc/bdc/bdc_udc.c +2 -1
index 7bfd58c846f7..6ddd31aa7f95 100644

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

drivers/usb/gadget/udc/fotg210-udc.c +2 -2
index bc6abaea907d..19a0a5449b60 100644

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

drivers/usb/gadget/udc/fusb300_udc.c +3 -3
index 263804d154a7..94daba652c50 100644

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

drivers/usb/gadget/udc/goku_udc.c +1 -2
index c3721225b61e..cdad54ba2cd7 100644

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

drivers/usb/gadget/udc/m66592-udc.c +2 -2
index a8288df6aadf..7f8f97ec63f3 100644

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

drivers/usb/gadget/udc/mv_u3d_core.c +1 -2
index 35e02a8d0091..4b5b71e916fe 100644

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

drivers/usb/gadget/udc/mv_udc_core.c +1 -2
index cafde053788b..99f8ab17f39d 100644

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

drivers/usb/gadget/udc/net2272.c +2 -1
index b77f3126580e..1fc269c98ffd 100644

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

drivers/usb/gadget/udc/net2280.c +1 -2
index e7dae5379e04..1b2b012fcac8 100644

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

drivers/usb/gadget/udc/pch_udc.c +5 -3
index 55c8c8abeacd..84e44f14ef5d 100644

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

drivers/usb/gadget/udc/pxa27x_udc.c +2 -1
index 014233252299..e72c51764c7a 100644

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

drivers/usb/gadget/udc/r8a66597-udc.c +3 -2
index 11e25a3f4f1f..1370c43c1f79 100644

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

drivers/usb/gadget/udc/snps_udc_plat.c +2 -2
index 32f1d3e90c26..31d3fbba1932 100644

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

drivers/usb/gadget/udc/udc-xilinx.c +2 -1
index b1f4104d1283..0b48ddec81c0 100644

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

drivers/usb/host/max3421-hcd.c +2 -1
index afa321ab55fc..b64eaea62e23 100644

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

drivers/usb/host/xhci.c +7 -5
index 005e65922608..3f191e431edf 100644

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

drivers/usb/isp1760/isp1760-udc.c +2 -1
index 1714b2258b54..fe83ffbc8cdc 100644

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

drivers/usb/musb/musb_core.c +1 -1
index b7d56272f9d1..445a8520b4e5 100644

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

drivers/usb/phy/phy-gpio-vbus-usb.c +2 -2
index 553e2573c74f..71d4e46fdac3 100644

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

drivers/uwb/whc-rc.c +3 -2
index 3ae3c702500d..6591dbaac5eb 100644

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

drivers/vfio/pci/vfio_pci_intrs.c +3 -2
index 1c46045b0e7f..d928f12708b9 100644

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

drivers/video/fbdev/arcfb.c +1 -2
index a48741aab240..c873ebc1a551 100644

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

drivers/video/fbdev/aty/atyfb_base.c +1 -1
index b6fe103df145..0764bb519b83 100644

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

drivers/video/fbdev/goldfishfb.c +2 -2
index 4377e3442638..4ad3e0cf34ee 100644

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

drivers/video/fbdev/matrox/matroxfb_base.c +1 -2
index 838869c6490c..f8707365ee67 100644

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

drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +3 -4
index cd372527c9e4..d74a8a5b4ff9 100644

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

drivers/video/fbdev/via/via-core.c +2 -1
index b041eb27a9bf..d242edf537a0 100644

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

drivers/virt/vboxguest/vboxguest_linux.c +3 -2
index 6e2a9619192d..768aa4677c64 100644

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

drivers/virtio/virtio_mmio.c +2 -2
index d9dd0f789279..c45cfc7a0ddf 100644

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

drivers/virtio/virtio_pci_common.c +11 -9
index d0584c040c60..04a25f2c208b 100644

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

drivers/vme/bridges/vme_ca91cx42.c +3 -2
index 53bdc256805f..0afef4408ded 100644

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

drivers/vme/bridges/vme_tsi148.c +3 -4
index 647d231d4422..73160ddfe675 100644

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

drivers/w1/masters/ds1wm.c +2 -1
index f661695fb589..c5b0e509f4a8 100644

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

drivers/xen/events/events_base.c +8 -4
index 117e76b2f939..c849861f3c33 100644

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

drivers/xen/platform-pci.c +2 -2
index 5d7dcad0b0a0..8416bfa8b0bf 100644

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

drivers/xen/xen-pciback/pciback_ops.c +3 -3
index ea4a08b83fa0..0ce77cab9cc3 100644

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

samples/v4l/v4l2-pci-skeleton.c +3 -2
index 27ec30952cfa..b6115d9c0459 100644

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

sound/drivers/mpu401/mpu401_uart.c +1 -2
index 85610cdcde9f..528bcc670149 100644

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

sound/drivers/mtpav.c +1 -1
index 547662e02fcc..32b04d8b10e3 100644

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

sound/drivers/serial-u16550.c +1 -2
index 0a67b8b9f176..6f7315903ce9 100644

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

sound/isa/ad1816a/ad1816a_lib.c +1 -1
index fba6d22f7f4b..c1740bb3874a 100644

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

sound/isa/es1688/es1688_lib.c +3 -1
index 50cdce0e8946..d243f6763330 100644

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

sound/isa/es18xx.c +1 -2
index 0d103d6f805e..85ecf0c7173f 100644

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

sound/isa/gus/gus_main.c +1 -1
index 3b8a0c880db5..d6e6cf996b8e 100644

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

sound/isa/gus/gusmax.c +1 -1
index 63309a453140..9e4f8d55522c 100644

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

sound/isa/gus/interwave.c +1 -2
index a6fc26bf0af2..f09d8198f61f 100644

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

sound/isa/msnd/msnd_pinnacle.c +2 -1
index 11af9c40bc05..f448872f943e 100644

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

sound/isa/opl3sa2.c +2 -2
index 7cce4cd4a23b..75ac5916c1e2 100644

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

sound/isa/opti9xx/opti92x-ad1848.c +2 -1
index 47e0b2820ace..ade2f53fc8c2 100644

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

sound/isa/sb/sb_common.c +1 -5
index 90b254aaef74..9f7e44c4973c 100644

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

sound/isa/wavefront/wavefront.c +1 -2
index b1989facd732..abc0e4136030 100644

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

sound/isa/wss/wss_lib.c +1 -2
index 3a5008837576..a2ec51887db5 100644

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

sound/pci/ad1889.c +1 -2
index d9c54c08e2db..4234cfe099f6 100644

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

sound/pci/ali5451/ali5451.c +1 -2
index 9f569379b77e..a1001fe87a6c 100644

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

sound/pci/als300.c +1 -2
index eaa2d853d922..3a1a1cf54d33 100644

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

sound/pci/asihpi/hpioctl.c +1 -2
index 7d049569012c..a3b5dbfec973 100644

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

sound/pci/atiixp.c +1 -2
index 1a41f8c80243..dc7002089fe2 100644

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

sound/pci/atiixp_modem.c +1 -2
index dc1de860cedf..5fbed10f86ca 100644

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

sound/pci/aw2/aw2-alsa.c +1 -2
index 9a49e4243a9c..15118f5be53d 100644

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

sound/pci/azt3328.c +1 -2
index fc18c29a8173..6ff40c762da1 100644

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

sound/pci/bt87x.c +2 -2
index ba971042f871..230c58b24383 100644

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

sound/pci/ca0106/ca0106_main.c +1 -2
index cd27b5536654..553f8e50393b 100644

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

sound/pci/cmipci.c +1 -2
index 452cc79b44af..f058c8d01d01 100644

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

sound/pci/cs4281.c +1 -2
index ec4247638fa1..9855ce43d187 100644

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

sound/pci/cs46xx/cs46xx_lib.c +1 -2
index 750eec437a79..88f7a7c5e918 100644

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

sound/pci/cs5535audio/cs5535audio.c +1 -2
index 4590086d9cd8..db73543eb7c8 100644

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

sound/pci/ctxfi/cthw20k1.c +2 -1
index 6a051a1c3724..4ef23084d48b 100644

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

sound/pci/ctxfi/cthw20k2.c +2 -1
index 3c966fafc754..7b470af8f10a 100644

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

sound/pci/emu10k1/emu10k1_main.c +1 -2
index 61f85ff91cd9..05cad2c2ac92 100644

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

sound/pci/emu10k1/emu10k1x.c +1 -2
index 611589cbdad6..1513af662fe6 100644

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

sound/pci/ens1370.c +1 -2
index 727eb3da1fda..afb73016d36f 100644

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

sound/pci/es1938.c +2 -4
index 9d248eb2e26c..a775bcb1c15b 100644

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

sound/pci/es1968.c +1 -2
index 0b1845ca6005..b1fea07bdd87 100644

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

sound/pci/fm801.c +1 -2
index e3fb9c61017c..bbd5c056a412 100644

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

sound/pci/hda/hda_intel.c +1 -3
index e5c49003e75f..5e03b7cde151 100644

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

sound/pci/ice1712/ice1712.c +1 -2
index f1fe497c2f9d..d1aaf856fd0a 100644

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

sound/pci/ice1712/ice1724.c +1 -2
index 057c2f394ea7..ec53f2f7b6cc 100644

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

sound/pci/intel8x0.c +2 -4
index ffddcdfe0c66..ba2d7a64c051 100644

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

sound/pci/intel8x0m.c +2 -4
index c84629190cba..0ffb23fa00b9 100644

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

sound/pci/korg1212/korg1212.c +2 -2
index 4e189a93f475..f7608ffce070 100644

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

sound/pci/lola/lola.c +1 -2
index 254f24366892..b7f8fc1b422e 100644

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

sound/pci/maestro3.c +1 -2
index 62962178a9d7..2de65a6027b5 100644

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

sound/pci/nm256/nm256.c +1 -2
index b97f4ea6b56c..2901b32e509f 100644

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

sound/pci/oxygen/oxygen_lib.c +2 -2
index b4ef5804212d..544457309d33 100644

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

sound/pci/riptide/riptide.c +1 -2
index 23017e3bc76c..7b94fb792a8c 100644

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

sound/pci/rme32.c +1 -2
index 3ac8c71d567c..6e69d95a5834 100644

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

sound/pci/rme96.c +1 -2
index dcfa4d7a73e2..04b9dfe9349b 100644

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

sound/pci/rme9652/hdsp.c +1 -2
index ba99ff0e93e0..479db0dcb86f 100644

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

sound/pci/rme9652/hdspm.c +1 -2
index 679ad0415e3b..5cb6248677f7 100644

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

sound/pci/rme9652/rme9652.c +1 -2
index edd765e22377..cab697211d25 100644

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

sound/pci/sis7019.c +3 -4
index 964acf302479..33b0ab75060f 100644

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

sound/pci/sonicvibes.c +1 -2
index 7218f38b59db..5ae258d3b8b4 100644

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

sound/pci/trident/trident_main.c +1 -2
index 5523e193d556..4e5b48c8745f 100644

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

sound/pci/via82xx.c +1 -5
index c488c5afa195..0051a94c5030 100644

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

sound/pci/via82xx_modem.c +1 -2
index b13c8688cc8d..277b44566d47 100644

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

sound/pci/ymfpci/ymfpci_main.c +1 -2
index a4926fb03991..0e0bdefbee4d 100644

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

sound/soc/amd/acp-pcm-dma.c +2 -1
index f4011bebc7ec..3689383fd5c3 100644

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

sound/soc/amd/raven/acp3x-pcm-dma.c +2 -1
index 3d58338fa3cf..8c15933a3145 100644

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

sound/soc/codecs/rt5640.c +2 -2
index fc530481a6e4..6433d713ae8b 100644

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

sound/soc/codecs/rt5651.c +2 -2
index b7ba64350a07..6965f970a32a 100644

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

sound/soc/codecs/rt5663.c +2 -2
index da6647015708..aa24893a98b6 100644

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

sound/soc/dwc/dwc-i2s.c +3 -2
index 65112b9d8588..4ab23c0474c8 100644

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

sound/soc/fsl/fsl_asrc.c +2 -1
index 528e8b108422..119c1f908115 100644

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

sound/soc/fsl/fsl_esai.c +2 -1
index 57b484768a58..e72b88a34cd5 100644

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

sound/soc/fsl/fsl_sai.c +2 -1
index 4163f2cfc06f..859c7b8b5074 100644

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

sound/soc/fsl/fsl_spdif.c +2 -1
index 740b90df44bb..9987849d5258 100644

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

sound/soc/fsl/fsl_ssi.c +2 -1
index 0a648229e643..6481ea718aa3 100644

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

sound/x86/intel_hdmi_audio.c +3 -2
index 00c92eb854ce..d497def8ecdf 100644

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

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

Signature · 1 line
2.17.2

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

author
#66 lore raw

PATCH v6 42/43 MDSv6

In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Subject: mds sweep: Mark timer handlers that touch user data

This is the result of a large scale tree audit, looking for timer handlers that may touch user data. The audit was on the conservative side, it was either handlers that clearly user data, or were too complicated to audit and not performance critical.

There are more timer handlers that touch user data, but these are covered by centralized hooks.

The change was done with the following cocci script, except for DEFINE_TIMER, which was done by sed.

// SPDX-License-Identifier: GPL-2.0

@@
expression timer, func, flags;
@@
- timer_setup(timer, func, flags)
+ timer_setup(timer, func, flags | TIMER_USER_DATA)

@@
expression timer, func, flags;
@@
- timer_setup_on_stack(timer, func, flags)
+ timer_setup_on_stack(timer, func, flags | TIMER_USER_DATA)

@@
expression timer, flags1, flags2;
@@
- hrtimer_init(timer, flags1, flags2)
+ hrtimer_init(timer, flags1, flags2 | HRTIMER_MODE_USER_DATA)

---
 arch/x86/events/intel/uncore.c                |  3 ++-
 drivers/auxdisplay/img-ascii-lcd.c            |  2 +-
 drivers/block/xsysace.c                       |  2 +-
 drivers/firewire/core-transaction.c           |  5 +++--
 drivers/gpu/drm/i915/i915_pmu.c               |  3 ++-
 drivers/ide/ide-probe.c                       |  2 +-
 drivers/iio/trigger/iio-trig-hrtimer.c        |  3 ++-
 drivers/input/ff-memless.c                    |  2 +-
 drivers/input/input.c                         |  2 +-
 drivers/isdn/capi/capidrv.c                   |  2 +-
 drivers/isdn/i4l/isdn_common.c                |  2 +-
 drivers/media/cec/cec-pin.c                   |  3 ++-
 drivers/media/pci/bt8xx/bttv-driver.c         |  2 +-
 drivers/media/pci/bt8xx/bttv-input.c          |  5 +++--
 .../pci/netup_unidvb/netup_unidvb_core.c      |  3 ++-
 drivers/media/pci/saa7134/saa7134-input.c     |  3 ++-
 drivers/media/pci/saa7134/saa7134-ts.c        |  3 ++-
 drivers/media/pci/saa7134/saa7134-vbi.c       |  3 ++-
 drivers/media/pci/saa7134/saa7134-video.c     |  3 ++-
 drivers/media/pci/ttpci/av7110_ir.c           |  3 ++-
 drivers/media/radio/radio-cadet.c             |  2 +-
 drivers/media/radio/wl128x/fmdrv_common.c     |  3 ++-
 drivers/media/rc/img-ir/img-ir-raw.c          |  2 +-
 drivers/media/rc/ir-rx51.c                    |  3 ++-
 drivers/media/usb/au0828/au0828-video.c       |  6 +++--
 drivers/net/appletalk/cops.c                  |  2 +-
 drivers/net/caif/caif_hsi.c                   |  9 +++++---
 drivers/net/hamradio/6pack.c                  |  4 ++--
 drivers/net/hamradio/scc.c                    |  4 ++--
 drivers/net/hamradio/yam.c                    |  4 ++--
 drivers/net/hippi/rrunner.c                   |  2 +-
 drivers/net/ieee802154/at86rf230.c            |  3 ++-
 drivers/net/slip/slip.c                       |  4 ++--
 drivers/net/wan/sdla.c                        |  2 +-
 drivers/net/wireless/ath/ath9k/init.c         |  5 +++--
 .../net/wireless/intersil/hostap/hostap_ap.c  |  2 +-
 .../wireless/marvell/mwifiex/11n_rxreorder.c  |  3 ++-
 drivers/net/wireless/marvell/mwifiex/usb.c    |  2 +-
 drivers/pcmcia/yenta_socket.c                 |  3 ++-
 drivers/platform/x86/sony-laptop.c            |  2 +-
 drivers/staging/comedi/drivers/comedi_test.c  |  6 +++--
 drivers/staging/comedi/drivers/jr3_pci.c      |  2 +-
 drivers/staging/rtl8188eu/core/rtw_recv.c     |  2 +-
 drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 17 +++++++++-----
 drivers/staging/rtl8188eu/os_dep/recv_linux.c |  2 +-
 .../rtl8192u/ieee80211/ieee80211_module.c     |  2 +-
 .../rtl8192u/ieee80211/ieee80211_softmac.c    |  6 +++--
 drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 22 ++++++++++++-------
 drivers/staging/rtl8723bs/os_dep/recv_linux.c |  2 +-
 drivers/staging/speakup/main.c                |  2 +-
 drivers/tty/isicom.c                          |  2 +-
 drivers/tty/moxa.c                            |  2 +-
 drivers/tty/n_gsm.c                           |  5 +++--
 drivers/tty/n_r3964.c                         |  2 +-
 drivers/tty/rocket.c                          |  2 +-
 drivers/tty/serial/8250/8250_core.c           |  3 ++-
 drivers/tty/serial/8250/8250_port.c           |  4 ++--
 drivers/tty/serial/max3100.c                  |  2 +-
 drivers/tty/serial/mux.c                      |  2 +-
 drivers/tty/serial/pnx8xxx_uart.c             |  3 ++-
 drivers/tty/serial/sccnxp.c                   |  2 +-
 drivers/tty/serial/sh-sci.c                   |  9 +++++---
 drivers/tty/vcc.c                             |  4 ++--
 drivers/tty/vt/keyboard.c                     |  2 +-
 drivers/usb/chipidea/otg_fsm.c                |  3 ++-
 drivers/usb/dwc2/hcd_queue.c                  |  6 +++--
 drivers/usb/gadget/function/f_ncm.c           |  3 ++-
 drivers/usb/gadget/udc/dummy_hcd.c            |  4 ++--
 drivers/usb/gadget/udc/m66592-udc.c           |  2 +-
 drivers/usb/gadget/udc/r8a66597-udc.c         |  2 +-
 drivers/usb/usbip/vudc_transfer.c             |  2 +-
 drivers/uwb/neh.c                             |  2 +-
 drivers/uwb/rsv.c                             |  5 +++--
 drivers/visorbus/visorbus_main.c              |  2 +-
 kernel/time/alarmtimer.c                      |  2 +-
 lib/random32.c                                |  2 +-
 net/wireless/lib80211.c                       |  2 +-
 security/keys/gc.c                            |  2 +-
 sound/core/hrtimer.c                          |  3 ++-
 sound/drivers/mpu401/mpu401_uart.c            |  3 ++-
 sound/drivers/mtpav.c                         |  3 ++-
 sound/drivers/pcsp/pcsp.c                     |  3 ++-
 sound/drivers/serial-u16550.c                 |  3 ++-
 sound/isa/sb/emu8000_pcm.c                    |  2 +-
 sound/isa/sb/sb8_midi.c                       |  3 ++-
 sound/isa/wavefront/wavefront_midi.c          |  4 ++--
 sound/pci/echoaudio/midi.c                    |  2 +-
 sound/pci/rme9652/hdsp.c                      |  2 +-
 sound/pci/rme9652/hdspm.c                     |  3 ++-
 sound/usb/midi.c                              |  3 ++-
 90 files changed, 180 insertions(+), 123 deletions(-)
arch/x86/events/intel/uncore.c +2 -1
index 27a461414b30..2fe6f453b440 100644
@@ -289,7 +289,8 @@ void uncore_pmu_cancel_hrtimer(struct intel_uncore_box *box)
 
 static void uncore_pmu_init_hrtimer(struct intel_uncore_box *box)
 {
-	hrtimer_init(&box->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&box->hrtimer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	box->hrtimer.function = uncore_pmu_hrtimer;
 }
 
drivers/auxdisplay/img-ascii-lcd.c +1 -1
index 834509506ef6..cfa0d8dcfbda 100644
@@ -395,7 +395,7 @@ static int img_ascii_lcd_probe(struct platform_device *pdev)
 	ctx->scroll_rate = HZ / 2;
 
 	/* initialise a timer for scrolling the message */
-	timer_setup(&ctx->timer, img_ascii_lcd_scroll, 0);
+	timer_setup(&ctx->timer, img_ascii_lcd_scroll, TIMER_USER_DATA);
 
 	platform_set_drvdata(pdev, ctx);
 
drivers/block/xsysace.c +1 -1
index 87ccef4bd69e..a6b3aa5bbb82 100644
@@ -1005,7 +1005,7 @@ static int ace_setup(struct ace_device *ace)
 	 * Initialize the state machine tasklet and stall timer
 	 */
 	tasklet_init(&ace->fsm_tasklet, ace_fsm_tasklet, (unsigned long)ace);
-	timer_setup(&ace->stall_timer, ace_stall_timer, 0);
+	timer_setup(&ace->stall_timer, ace_stall_timer, TIMER_USER_DATA);
 
 	/*
 	 * Initialize the request queue
drivers/firewire/core-transaction.c +3 -2
index 50bf1fe1775f..44b19256a6aa 100644
@@ -374,7 +374,7 @@ void fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode,
 	t->card = card;
 	t->is_split_transaction = false;
 	timer_setup(&t->split_timeout_timer,
-		    split_transaction_timeout_callback, 0);
+		    split_transaction_timeout_callback, TIMER_USER_DATA);
 	t->callback = callback;
 	t->callback_data = callback_data;
 
@@ -431,7 +431,8 @@ int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
 	struct transaction_callback_data d;
 	struct fw_transaction t;
 
-	timer_setup_on_stack(&t.split_timeout_timer, NULL, 0);
+	timer_setup_on_stack(&t.split_timeout_timer, NULL,
+			     TIMER_USER_DATA);
 	init_completion(&d.done);
 	d.payload = payload;
 	fw_send_request(card, &t, tcode, destination_id, generation, speed,
drivers/gpu/drm/i915/i915_pmu.c +2 -1
index 017fc602a10e..be1aae302add 100644
@@ -1066,7 +1066,8 @@ void i915_pmu_register(struct drm_i915_private *i915)
 	i915->pmu.base.event_idx	= i915_pmu_event_event_idx;
 
 	spin_lock_init(&i915->pmu.lock);
-	hrtimer_init(&i915->pmu.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&i915->pmu.timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	i915->pmu.timer.function = i915_sample;
 
 	ret = perf_pmu_register(&i915->pmu.base, "i915", -1);
drivers/ide/ide-probe.c +1 -1
index 958bf916d096..a137dfb1220c 100644
@@ -1233,7 +1233,7 @@ static void ide_init_port_data(ide_hwif_t *hwif, unsigned int index)
 
 	spin_lock_init(&hwif->lock);
 
-	timer_setup(&hwif->timer, ide_timer_expiry, 0);
+	timer_setup(&hwif->timer, ide_timer_expiry, TIMER_USER_DATA);
 
 	init_completion(&hwif->gendev_rel_comp);
 
drivers/iio/trigger/iio-trig-hrtimer.c +2 -1
index 7accd0187ba1..d254026f82c4 100644
@@ -136,7 +136,8 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name)
 	trig_info->swt.trigger->ops = &iio_hrtimer_trigger_ops;
 	trig_info->swt.trigger->dev.groups = iio_hrtimer_attr_groups;
 
-	hrtimer_init(&trig_info->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&trig_info->timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	trig_info->timer.function = iio_hrtimer_trig_handler;
 
 	trig_info->sampling_frequency = HRTIMER_DEFAULT_SAMPLING_FREQUENCY;
drivers/input/ff-memless.c +1 -1
index 2743ed4656e4..0fa743d51d46 100644
@@ -526,7 +526,7 @@ int input_ff_create_memless(struct input_dev *dev, void *data,
 	ml->private = data;
 	ml->play_effect = play_effect;
 	ml->gain = 0xffff;
-	timer_setup(&ml->timer, ml_effect_timer, 0);
+	timer_setup(&ml->timer, ml_effect_timer, TIMER_USER_DATA);
 
 	set_bit(FF_GAIN, dev->ffbit);
 
drivers/input/input.c +1 -1
index c22e8e167025..ce77a24512fe 100644
@@ -1795,7 +1795,7 @@ struct input_dev *input_allocate_device(void)
 		device_initialize(&dev->dev);
 		mutex_init(&dev->mutex);
 		spin_lock_init(&dev->event_lock);
-		timer_setup(&dev->timer, NULL, 0);
+		timer_setup(&dev->timer, NULL, TIMER_USER_DATA);
 		INIT_LIST_HEAD(&dev->h_list);
 		INIT_LIST_HEAD(&dev->node);
 
drivers/isdn/capi/capidrv.c +1 -1
index e8949f3dcae1..44c6722b596f 100644
@@ -2265,7 +2265,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
 		return -1;
 	}
 	card->owner = THIS_MODULE;
-	timer_setup(&card->listentimer, listentimerfunc, 0);
+	timer_setup(&card->listentimer, listentimerfunc, TIMER_USER_DATA);
 	strcpy(card->name, id);
 	card->contrnr = contr;
 	card->nbchan = profp->nbchannel;
drivers/isdn/i4l/isdn_common.c +1 -1
index 6a5b3f00f9ad..0ec6f1115447 100644
@@ -2290,7 +2290,7 @@ static int __init isdn_init(void)
 		printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
 		return -EIO;
 	}
-	timer_setup(&dev->timer, isdn_timer_funct, 0);
+	timer_setup(&dev->timer, isdn_timer_funct, TIMER_USER_DATA);
 	spin_lock_init(&dev->lock);
 	spin_lock_init(&dev->timerlock);
 #ifdef MODULE
drivers/media/cec/cec-pin.c +2 -1
index 8f987bc0dd88..62efd672b249 100644
@@ -1312,7 +1312,8 @@ struct cec_adapter *cec_pin_allocate_adapter(const struct cec_pin_ops *pin_ops,
 	if (pin == NULL)
 		return ERR_PTR(-ENOMEM);
 	pin->ops = pin_ops;
-	hrtimer_init(&pin->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&pin->timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	pin->timer.function = cec_pin_timer;
 	init_waitqueue_head(&pin->kthread_waitq);
 	pin->tx_custom_low_usecs = CEC_TIM_CUSTOM_DEFAULT;
drivers/media/pci/bt8xx/bttv-driver.c +1 -1
index d09785fd37a8..703d0bdd9607 100644
@@ -4040,7 +4040,7 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
 	INIT_LIST_HEAD(&btv->capture);
 	INIT_LIST_HEAD(&btv->vcapture);
 
-	timer_setup(&btv->timeout, bttv_irq_timeout, 0);
+	timer_setup(&btv->timeout, bttv_irq_timeout, TIMER_USER_DATA);
 
 	btv->i2c_rc = -1;
 	btv->tuner_type  = UNSET;
drivers/media/pci/bt8xx/bttv-input.c +3 -2
index d34fbaa027c2..6acb2e1fa418 100644
@@ -299,12 +299,13 @@ static int bttv_rc5_irq(struct bttv *btv)
 static void bttv_ir_start(struct bttv_ir *ir)
 {
 	if (ir->polling) {
-		timer_setup(&ir->timer, bttv_input_timer, 0);
+		timer_setup(&ir->timer, bttv_input_timer, TIMER_USER_DATA);
 		ir->timer.expires  = jiffies + msecs_to_jiffies(1000);
 		add_timer(&ir->timer);
 	} else if (ir->rc5_gpio) {
 		/* set timer_end for code completion */
-		timer_setup(&ir->timer, bttv_rc5_timer_end, 0);
+		timer_setup(&ir->timer, bttv_rc5_timer_end,
+			    TIMER_USER_DATA);
 		ir->shift_by = 1;
 		ir->rc5_remote_gap = ir_rc5_remote_gap;
 	}
drivers/media/pci/netup_unidvb/netup_unidvb_core.c +2 -1
index ead59fabd15f..8b945aa3d1c1 100644
@@ -664,7 +664,8 @@ static int netup_unidvb_dma_init(struct netup_unidvb_dev *ndev, int num)
 	spin_lock_init(&dma->lock);
 	INIT_WORK(&dma->work, netup_unidvb_dma_worker);
 	INIT_LIST_HEAD(&dma->free_buffers);
-	timer_setup(&dma->timeout, netup_unidvb_dma_timeout, 0);
+	timer_setup(&dma->timeout, netup_unidvb_dma_timeout,
+		    TIMER_USER_DATA);
 	dma->ring_buffer_size = ndev->dma_size / 2;
 	dma->addr_virt = ndev->dma_virt + dma->ring_buffer_size * num;
 	dma->addr_phys = (dma_addr_t)((u64)ndev->dma_phys +
drivers/media/pci/saa7134/saa7134-input.c +2 -1
index 35884d5b8337..43422aa92a1a 100644
@@ -492,7 +492,8 @@ int saa7134_ir_open(struct rc_dev *rc)
 	ir->running = true;
 
 	if (ir->polling) {
-		timer_setup(&ir->timer, saa7134_input_timer, 0);
+		timer_setup(&ir->timer, saa7134_input_timer,
+			    TIMER_USER_DATA);
 		ir->timer.expires = jiffies + HZ;
 		add_timer(&ir->timer);
 	}
drivers/media/pci/saa7134/saa7134-ts.c +2 -1
index 2be703617e29..bb94e1a92669 100644
@@ -223,7 +223,8 @@ int saa7134_ts_init1(struct saa7134_dev *dev)
 	dev->ts.nr_packets = ts_nr_packets;
 
 	INIT_LIST_HEAD(&dev->ts_q.queue);
-	timer_setup(&dev->ts_q.timeout, saa7134_buffer_timeout, 0);
+	timer_setup(&dev->ts_q.timeout, saa7134_buffer_timeout,
+		    TIMER_USER_DATA);
 	dev->ts_q.dev              = dev;
 	dev->ts_q.need_two         = 1;
 	dev->ts_started            = 0;
drivers/media/pci/saa7134/saa7134-vbi.c +2 -1
index 57bea543c39b..f860bcc1797e 100644
@@ -181,7 +181,8 @@ const struct vb2_ops saa7134_vbi_qops = {
 int saa7134_vbi_init1(struct saa7134_dev *dev)
 {
 	INIT_LIST_HEAD(&dev->vbi_q.queue);
-	timer_setup(&dev->vbi_q.timeout, saa7134_buffer_timeout, 0);
+	timer_setup(&dev->vbi_q.timeout, saa7134_buffer_timeout,
+		    TIMER_USER_DATA);
 	dev->vbi_q.dev              = dev;
 
 	if (vbibufs < 2)
drivers/media/pci/saa7134/saa7134-video.c +2 -1
index 5bc4b8fc8ebf..26076173343b 100644
@@ -2147,7 +2147,8 @@ int saa7134_video_init1(struct saa7134_dev *dev)
 	dev->automute       = 0;
 
 	INIT_LIST_HEAD(&dev->video_q.queue);
-	timer_setup(&dev->video_q.timeout, saa7134_buffer_timeout, 0);
+	timer_setup(&dev->video_q.timeout, saa7134_buffer_timeout,
+		    TIMER_USER_DATA);
 	dev->video_q.dev              = dev;
 	dev->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24);
 	dev->width    = 720;
drivers/media/pci/ttpci/av7110_ir.c +2 -1
index ee414803e6b5..11fb9c8f9892 100644
@@ -313,7 +313,8 @@ int av7110_ir_init(struct av7110 *av7110)
 	av_list[av_cnt++] = av7110;
 	av7110_check_ir_config(av7110, true);
 
-	timer_setup(&av7110->ir.keyup_timer, av7110_emit_keyup, 0);
+	timer_setup(&av7110->ir.keyup_timer, av7110_emit_keyup,
+		    TIMER_USER_DATA);
 
 	input_dev = input_allocate_device();
 	if (!input_dev)
drivers/media/radio/radio-cadet.c +1 -1
index d12e07e32546..3ad09e86971c 100644
@@ -317,7 +317,7 @@ static void cadet_start_rds(struct cadet *dev)
 {
 	dev->rdsstat = 1;
 	outb(0x80, dev->io);        /* Select RDS fifo */
-	timer_setup(&dev->readtimer, cadet_handler, 0);
+	timer_setup(&dev->readtimer, cadet_handler, TIMER_USER_DATA);
 	dev->readtimer.expires = jiffies + msecs_to_jiffies(50);
 	add_timer(&dev->readtimer);
 }
drivers/media/radio/wl128x/fmdrv_common.c +2 -1
index 800d69c3f80b..f2b0598d62e5 100644
@@ -1550,7 +1550,8 @@ int fmc_prepare(struct fmdev *fmdev)
 	atomic_set(&fmdev->tx_cnt, 1);
 	fmdev->resp_comp = NULL;
 
-	timer_setup(&fmdev->irq_info.timer, int_timeout_handler, 0);
+	timer_setup(&fmdev->irq_info.timer, int_timeout_handler,
+		    TIMER_USER_DATA);
 	/*TODO: add FM_STIC_EVENT later */
 	fmdev->irq_info.mask = FM_MAL_EVENT;
 
drivers/media/rc/img-ir/img-ir-raw.c +1 -1
index 6e545680d3b6..26c72c418942 100644
@@ -107,7 +107,7 @@ int img_ir_probe_raw(struct img_ir_priv *priv)
 	int error;
 
 	/* Set up the echo timer */
-	timer_setup(&raw->timer, img_ir_echo_timer, 0);
+	timer_setup(&raw->timer, img_ir_echo_timer, TIMER_USER_DATA);
 
 	/* Allocate raw decoder */
 	raw->rdev = rdev = rc_allocate_device(RC_DRIVER_IR_RAW);
drivers/media/rc/ir-rx51.c +2 -1
index 8a93f7468622..b32ba38951bd 100644
@@ -253,7 +253,8 @@ static int ir_rx51_probe(struct platform_device *dev)
 	ir_rx51.freq = DIV_ROUND_CLOSEST(pwm_get_period(pwm), NSEC_PER_SEC);
 	pwm_put(pwm);
 
-	hrtimer_init(&ir_rx51.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&ir_rx51.timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	ir_rx51.timer.function = ir_rx51_timer_cb;
 
 	ir_rx51.dev = &dev->dev;
drivers/media/usb/au0828/au0828-video.c +4 -2
index 7876c897cc1d..6b802ab82488 100644
@@ -1969,8 +1969,10 @@ int au0828_analog_register(struct au0828_dev *dev,
 	INIT_LIST_HEAD(&dev->vidq.active);
 	INIT_LIST_HEAD(&dev->vbiq.active);
 
-	timer_setup(&dev->vid_timeout, au0828_vid_buffer_timeout, 0);
-	timer_setup(&dev->vbi_timeout, au0828_vbi_buffer_timeout, 0);
+	timer_setup(&dev->vid_timeout, au0828_vid_buffer_timeout,
+		    TIMER_USER_DATA);
+	timer_setup(&dev->vbi_timeout, au0828_vbi_buffer_timeout,
+		    TIMER_USER_DATA);
 
 	dev->width = NTSC_STD_W;
 	dev->height = NTSC_STD_H;
drivers/net/appletalk/cops.c +1 -1
index f90bb723985f..31c4c2e504b3 100644
@@ -426,7 +426,7 @@ static int cops_open(struct net_device *dev)
 		if(lp->board==TANGENT)	/* Poll 20 times per second */
 		{
 		    cops_timer_dev = dev;
-		    timer_setup(&cops_timer, cops_poll, 0);
+		    timer_setup(&cops_timer, cops_poll, TIMER_USER_DATA);
 		    cops_timer.expires 	= jiffies + HZ/20;
 		    add_timer(&cops_timer);
 		} 
drivers/net/caif/caif_hsi.c +6 -3
index 433a14b9f731..8d3422e2444e 100644
@@ -1210,11 +1210,14 @@ static int cfhsi_open(struct net_device *ndev)
 	init_waitqueue_head(&cfhsi->flush_fifo_wait);
 
 	/* Setup the inactivity timer. */
-	timer_setup(&cfhsi->inactivity_timer, cfhsi_inactivity_tout, 0);
+	timer_setup(&cfhsi->inactivity_timer, cfhsi_inactivity_tout,
+		    TIMER_USER_DATA);
 	/* Setup the slowpath RX timer. */
-	timer_setup(&cfhsi->rx_slowpath_timer, cfhsi_rx_slowpath, 0);
+	timer_setup(&cfhsi->rx_slowpath_timer, cfhsi_rx_slowpath,
+		    TIMER_USER_DATA);
 	/* Setup the aggregation timer. */
-	timer_setup(&cfhsi->aggregation_timer, cfhsi_aggregation_tout, 0);
+	timer_setup(&cfhsi->aggregation_timer, cfhsi_aggregation_tout,
+		    TIMER_USER_DATA);
 
 	/* Activate HSI interface. */
 	res = cfhsi->ops->cfhsi_up(cfhsi->ops);
drivers/net/hamradio/6pack.c +2 -2
index a19868cba48c..13d1566bf9bc 100644
@@ -613,9 +613,9 @@ static int sixpack_open(struct tty_struct *tty)
 
 	netif_start_queue(dev);
 
-	timer_setup(&sp->tx_t, sp_xmit_on_air, 0);
+	timer_setup(&sp->tx_t, sp_xmit_on_air, TIMER_USER_DATA);
 
-	timer_setup(&sp->resync_t, resync_tnc, 0);
+	timer_setup(&sp->resync_t, resync_tnc, TIMER_USER_DATA);
 
 	spin_unlock_bh(&sp->lock);
 
drivers/net/hamradio/scc.c +2 -2
index 1e7ee07887e1..16f851941e51 100644
@@ -1523,8 +1523,8 @@ static int scc_net_alloc(const char *name, struct scc_channel *scc)
 	dev->ml_priv = scc;
 	scc->dev = dev;
 	spin_lock_init(&scc->lock);
-	timer_setup(&scc->tx_t, NULL, 0);
-	timer_setup(&scc->tx_wdog, NULL, 0);
+	timer_setup(&scc->tx_t, NULL, TIMER_USER_DATA);
+	timer_setup(&scc->tx_wdog, NULL, TIMER_USER_DATA);
 
 	err = register_netdevice(dev);
 	if (err) {
drivers/net/hamradio/yam.c +2 -2
index 433695ae5e5c..ee316c06eb3c 100644
@@ -157,7 +157,7 @@ static struct net_device *yam_devs[NR_PORTS];
 
 static struct yam_mcs *yam_data;
 
-static DEFINE_TIMER(yam_timer, NULL);
+static DEFINE_TIMER_USERDATA(yam_timer, NULL);
 
 /* --------------------------------------------------------------------- */
 
@@ -1154,7 +1154,7 @@ static int __init yam_init_driver(void)
 
 	}
 
-	timer_setup(&yam_timer, yam_dotimer, 0);
+	timer_setup(&yam_timer, yam_dotimer, TIMER_USER_DATA);
 	yam_timer.expires = jiffies + HZ / 100;
 	add_timer(&yam_timer);
 
drivers/net/hippi/rrunner.c +1 -1
index 029206e4da3b..d38830828bad 100644
@@ -1229,7 +1229,7 @@ static int rr_open(struct net_device *dev)
 
 	/* Set the timer to switch to check for link beat and perhaps switch
 	   to an alternate media type. */
-	timer_setup(&rrpriv->timer, rr_timer, 0);
+	timer_setup(&rrpriv->timer, rr_timer, TIMER_USER_DATA);
 	rrpriv->timer.expires = RUN_AT(5*HZ);           /* 5 sec. watchdog */
 	add_timer(&rrpriv->timer);
 
drivers/net/ieee802154/at86rf230.c +2 -1
index 50af3e288503..bb82970486b3 100644
@@ -812,7 +812,8 @@ at86rf230_setup_spi_messages(struct at86rf230_local *lp,
 	state->trx.tx_buf = state->buf;
 	state->trx.rx_buf = state->buf;
 	spi_message_add_tail(&state->trx, &state->msg);
-	hrtimer_init(&state->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&state->timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	state->timer.function = at86rf230_async_state_timer;
 }
 
drivers/net/slip/slip.c +2 -2
index 9757f1fc104f..9a7bb0f5ffff 100644
@@ -762,8 +762,8 @@ static struct slip *sl_alloc(void)
 	sl->mode        = SL_MODE_DEFAULT;
 #ifdef CONFIG_SLIP_SMART
 	/* initialize timer_list struct */
-	timer_setup(&sl->keepalive_timer, sl_keepalive, 0);
-	timer_setup(&sl->outfill_timer, sl_outfill, 0);
+	timer_setup(&sl->keepalive_timer, sl_keepalive, TIMER_USER_DATA);
+	timer_setup(&sl->outfill_timer, sl_outfill, TIMER_USER_DATA);
 #endif
 	slip_devs[i] = dev;
 	return sl;
drivers/net/wan/sdla.c +1 -1
index 0a0cff9228e8..6bb1c9b5b87d 100644
@@ -1615,7 +1615,7 @@ static void setup_sdla(struct net_device *dev)
 	flp->dlci_conf		= sdla_dlci_conf;
 	flp->dev		= dev;
 
-	timer_setup(&flp->timer, sdla_poll, 0);
+	timer_setup(&flp->timer, sdla_poll, TIMER_USER_DATA);
 	flp->timer.expires	= 1;
 }
 
drivers/net/wireless/ath/ath9k/init.c +3 -2
index c070a9e51ebf..ef93894a1cf1 100644
@@ -425,7 +425,8 @@ static void ath9k_init_misc(struct ath_softc *sc)
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	int i = 0;
 
-	timer_setup(&common->ani.timer, ath_ani_calibrate, 0);
+	timer_setup(&common->ani.timer, ath_ani_calibrate,
+		    TIMER_USER_DATA);
 
 	common->last_rssi = ATH_RSSI_DUMMY_MARKER;
 	eth_broadcast_addr(common->bssidmask);
@@ -734,7 +735,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
 	tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
 		     (unsigned long)sc);
 
-	timer_setup(&sc->sleep_timer, ath_ps_full_sleep, 0);
+	timer_setup(&sc->sleep_timer, ath_ps_full_sleep, TIMER_USER_DATA);
 	INIT_WORK(&sc->hw_reset_work, ath_reset_work);
 	INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
 	INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
drivers/net/wireless/intersil/hostap/hostap_ap.c +1 -1
index 0094b1d2b577..8494fb259e8d 100644
@@ -1131,7 +1131,7 @@ static struct sta_info * ap_add_sta(struct ap_data *ap, u8 *addr)
 	}
 
 #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT
-	timer_setup(&sta->timer, ap_handle_timer, 0);
+	timer_setup(&sta->timer, ap_handle_timer, TIMER_USER_DATA);
 	sta->timer.expires = jiffies + ap->max_inactivity;
 	if (!ap->local->hostapd)
 		add_timer(&sta->timer);
drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c +2 -1
index 5380fba652cc..dcb5e62e0102 100644
@@ -413,7 +413,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
 	new_node->timer_context.priv = priv;
 	new_node->timer_context.timer_is_set = false;
 
-	timer_setup(&new_node->timer_context.timer, mwifiex_flush_data, 0);
+	timer_setup(&new_node->timer_context.timer, mwifiex_flush_data,
+		    TIMER_USER_DATA);
 
 	for (i = 0; i < win_size; ++i)
 		new_node->rx_reorder_ptr[i] = NULL;
drivers/net/wireless/marvell/mwifiex/usb.c +1 -1
index d445acc4786b..ce963105142b 100644
@@ -1261,7 +1261,7 @@ static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter)
 		port->tx_aggr.timer_cnxt.is_hold_timer_set = false;
 		port->tx_aggr.timer_cnxt.hold_tmo_msecs = 0;
 		timer_setup(&port->tx_aggr.timer_cnxt.hold_timer,
-			    mwifiex_usb_tx_aggr_tmo, 0);
+			    mwifiex_usb_tx_aggr_tmo, TIMER_USER_DATA);
 	}
 
 	return 0;
drivers/pcmcia/yenta_socket.c +2 -1
index c978a6961578..4f8d72d7a691 100644
@@ -1234,7 +1234,8 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED | IRQF_USER_DATA, "yenta", socket)) {
 		/* No IRQ or request_irq failed. Poll */
 		socket->cb_irq = 0; /* But zero is a valid IRQ number. */
-		timer_setup(&socket->poll_timer, yenta_interrupt_wrapper, 0);
+		timer_setup(&socket->poll_timer, yenta_interrupt_wrapper,
+			    TIMER_USER_DATA);
 		mod_timer(&socket->poll_timer, jiffies + HZ);
 		dev_info(&dev->dev,
 			 "no PCI IRQ, CardBus support disabled for this socket.\n");
drivers/platform/x86/sony-laptop.c +1 -1
index c83a8da216ce..52770388c84f 100644
@@ -471,7 +471,7 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device)
 	}
 
 	timer_setup(&sony_laptop_input.release_key_timer,
-		    do_sony_laptop_release_key, 0);
+		    do_sony_laptop_release_key, TIMER_USER_DATA);
 
 	/* input keys */
 	key_dev = input_allocate_device();
drivers/staging/comedi/drivers/comedi_test.c +4 -2
index ef4c7c8a2b71..02b9ea93c1e7 100644
@@ -723,8 +723,10 @@ static int waveform_common_attach(struct comedi_device *dev,
 		devpriv->ao_loopbacks[i] = s->maxdata / 2;
 
 	devpriv->dev = dev;
-	timer_setup(&devpriv->ai_timer, waveform_ai_timer, 0);
-	timer_setup(&devpriv->ao_timer, waveform_ao_timer, 0);
+	timer_setup(&devpriv->ai_timer, waveform_ai_timer,
+		    TIMER_USER_DATA);
+	timer_setup(&devpriv->ao_timer, waveform_ao_timer,
+		    TIMER_USER_DATA);
 
 	dev_info(dev->class_dev,
 		 "%s: %u microvolt, %u microsecond waveform attached\n",
drivers/staging/comedi/drivers/jr3_pci.c +1 -1
index c3c88e6d298f..87e8b685b586 100644
@@ -762,7 +762,7 @@ static int jr3_pci_auto_attach(struct comedi_device *dev,
 	}
 
 	devpriv->dev = dev;
-	timer_setup(&devpriv->timer, jr3_pci_poll_dev, 0);
+	timer_setup(&devpriv->timer, jr3_pci_poll_dev, TIMER_USER_DATA);
 	devpriv->timer.expires = jiffies + msecs_to_jiffies(1000);
 	add_timer(&devpriv->timer);
 
drivers/staging/rtl8188eu/core/rtw_recv.c +1 -1
index 1d83affc08ce..d0bda444397a 100644
@@ -77,7 +77,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
 	res = rtw_hal_init_recv_priv(padapter);
 
 	timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl,
-		    0);
+		    TIMER_USER_DATA);
 
 	precvpriv->signal_stat_sampling_interval = 1000; /* ms */
 
drivers/staging/rtl8188eu/os_dep/mlme_linux.c +11 -6
index d5ceb3beabbc..bed626e73545 100644
@@ -15,10 +15,12 @@ void rtw_init_mlme_timer(struct adapter *padapter)
 {
 	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	timer_setup(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler, 0);
-	timer_setup(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler, 0);
+	timer_setup(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler,
+		    TIMER_USER_DATA);
+	timer_setup(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler,
+		    TIMER_USER_DATA);
 	timer_setup(&pmlmepriv->dynamic_chk_timer,
-		    rtw_dynamic_check_timer_handlder, 0);
+		    rtw_dynamic_check_timer_handlder, TIMER_USER_DATA);
 }
 
 void rtw_os_indicate_connect(struct adapter *adapter)
@@ -114,15 +116,18 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
 
 void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)
 {
-	timer_setup(&psta->addba_retry_timer, addba_timer_hdl, 0);
+	timer_setup(&psta->addba_retry_timer, addba_timer_hdl,
+		    TIMER_USER_DATA);
 }
 
 void init_mlme_ext_timer(struct adapter *padapter)
 {
 	struct	mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 
-	timer_setup(&pmlmeext->survey_timer, survey_timer_hdl, 0);
-	timer_setup(&pmlmeext->link_timer, link_timer_hdl, 0);
+	timer_setup(&pmlmeext->survey_timer, survey_timer_hdl,
+		    TIMER_USER_DATA);
+	timer_setup(&pmlmeext->link_timer, link_timer_hdl,
+		    TIMER_USER_DATA);
 }
 
 #ifdef CONFIG_88EU_AP_MODE
drivers/staging/rtl8188eu/os_dep/recv_linux.c +1 -1
index 9c9339863a4a..e24c94c24441 100644
@@ -141,5 +141,5 @@ int rtw_recv_indicatepkt(struct adapter *padapter,
 void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
 {
 	timer_setup(&preorder_ctrl->reordering_ctrl_timer,
-		    rtw_reordering_ctrl_timeout_handler, 0);
+		    rtw_reordering_ctrl_timeout_handler, TIMER_USER_DATA);
 }
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -1
index d7975aa335b2..da4143c26ab4 100644
@@ -132,7 +132,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
 
 	INIT_LIST_HEAD(&ieee->crypt_deinit_list);
 	timer_setup(&ieee->crypt_deinit_timer, ieee80211_crypt_deinit_handler,
-		    0);
+		    TIMER_USER_DATA);
 
 	spin_lock_init(&ieee->lock);
 	spin_lock_init(&ieee->wpax_suitlist_lock);
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +4 -2
index 8635faf84316..59c8aee82736 100644
@@ -2578,9 +2578,11 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
 	ieee->enable_rx_imm_BA = true;
 	ieee->tx_pending.txb = NULL;
 
-	timer_setup(&ieee->associate_timer, ieee80211_associate_abort_cb, 0);
+	timer_setup(&ieee->associate_timer, ieee80211_associate_abort_cb,
+		    TIMER_USER_DATA);
 
-	timer_setup(&ieee->beacon_timer, ieee80211_send_beacon_cb, 0);
+	timer_setup(&ieee->beacon_timer, ieee80211_send_beacon_cb,
+		    TIMER_USER_DATA);
 
 	INIT_DELAYED_WORK(&ieee->start_ibss_wq, ieee80211_start_ibss_wq);
 	INIT_WORK(&ieee->associate_complete_wq, ieee80211_associate_complete_wq);
drivers/staging/rtl8723bs/os_dep/mlme_linux.c +14 -8
index da4bd5292b0a..05899bf7916b 100644
@@ -33,12 +33,14 @@ void rtw_init_mlme_timer(struct adapter *padapter)
 {
 	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	timer_setup(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler, 0);
-	timer_setup(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler, 0);
+	timer_setup(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler,
+		    TIMER_USER_DATA);
+	timer_setup(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler,
+		    TIMER_USER_DATA);
 	timer_setup(&pmlmepriv->dynamic_chk_timer,
-		    _dynamic_check_timer_handler, 0);
+		    _dynamic_check_timer_handler, TIMER_USER_DATA);
 	timer_setup(&pmlmepriv->set_scan_deny_timer,
-		    _rtw_set_scan_deny_timer_hdl, 0);
+		    _rtw_set_scan_deny_timer_hdl, TIMER_USER_DATA);
 }
 
 void rtw_os_indicate_connect(struct adapter *adapter)
@@ -185,14 +187,18 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
 
 void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)
 {
-	timer_setup(&psta->addba_retry_timer, addba_timer_hdl, 0);
+	timer_setup(&psta->addba_retry_timer, addba_timer_hdl,
+		    TIMER_USER_DATA);
 }
 
 void init_mlme_ext_timer(struct adapter *padapter)
 {
 	struct	mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 
-	timer_setup(&pmlmeext->survey_timer, survey_timer_hdl, 0);
-	timer_setup(&pmlmeext->link_timer, link_timer_hdl, 0);
-	timer_setup(&pmlmeext->sa_query_timer, sa_query_timer_hdl, 0);
+	timer_setup(&pmlmeext->survey_timer, survey_timer_hdl,
+		    TIMER_USER_DATA);
+	timer_setup(&pmlmeext->link_timer, link_timer_hdl,
+		    TIMER_USER_DATA);
+	timer_setup(&pmlmeext->sa_query_timer, sa_query_timer_hdl,
+		    TIMER_USER_DATA);
 }
drivers/staging/rtl8723bs/os_dep/recv_linux.c +1 -1
index 67ec336264e5..49aaf90622b0 100644
@@ -350,6 +350,6 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
 void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
 {
 	timer_setup(&preorder_ctrl->reordering_ctrl_timer,
-		    rtw_reordering_ctrl_timeout_handler, 0);
+		    rtw_reordering_ctrl_timeout_handler, TIMER_USER_DATA);
 
 }
drivers/staging/speakup/main.c +1 -1
index 869f40ebf1a7..954bc394d17c 100644
@@ -1160,7 +1160,7 @@ static const int NUM_CTL_LABELS = (MSG_CTL_END - MSG_CTL_START + 1);
 
 static void read_all_doc(struct vc_data *vc);
 static void cursor_done(struct timer_list *unused);
-static DEFINE_TIMER(cursor_timer, cursor_done);
+static DEFINE_TIMER_USERDATA(cursor_timer, cursor_done);
 
 static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag)
 {
drivers/tty/isicom.c +1 -1
index 803226775c8e..7cd335c00faa 100644
@@ -173,7 +173,7 @@ static struct tty_driver *isicom_normal;
 static void isicom_tx(struct timer_list *unused);
 static void isicom_start(struct tty_struct *tty);
 
-static DEFINE_TIMER(tx, isicom_tx);
+static DEFINE_TIMER_USERDATA(tx, isicom_tx);
 
 /*   baud index mappings from linux defns to isi */
 
drivers/tty/moxa.c +1 -1
index 3a1a5e0ee93f..27263e0e5e1e 100644
@@ -416,7 +416,7 @@ static const struct tty_port_operations moxa_port_ops = {
 };
 
 static struct tty_driver *moxaDriver;
-static DEFINE_TIMER(moxaTimer, moxa_poll);
+static DEFINE_TIMER_USERDATA(moxaTimer, moxa_poll);
 
 /*
  * HW init
drivers/tty/n_gsm.c +3 -2
index 6f7da9a9d76f..96c369226698 100644
@@ -1655,7 +1655,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
 	}
 
 	skb_queue_head_init(&dlci->skb_list);
-	timer_setup(&dlci->t1, gsm_dlci_t1, 0);
+	timer_setup(&dlci->t1, gsm_dlci_t1, TIMER_USER_DATA);
 	tty_port_init(&dlci->port);
 	dlci->port.ops = &gsm_port_ops;
 	dlci->gsm = gsm;
@@ -2109,7 +2109,8 @@ static int gsm_activate_mux(struct gsm_mux *gsm)
 	struct gsm_dlci *dlci;
 	int i = 0;
 
-	timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0);
+	timer_setup(&gsm->t2_timer, gsm_control_retransmit,
+		    TIMER_USER_DATA);
 	init_waitqueue_head(&gsm->event);
 	spin_lock_init(&gsm->control_lock);
 	spin_lock_init(&gsm->tx_lock);
drivers/tty/n_r3964.c +1 -1
index f75696f0ee2d..b4245410649b 100644
@@ -1000,7 +1000,7 @@ static int r3964_open(struct tty_struct *tty)
 	tty->disc_data = pInfo;
 	tty->receive_room = 65536;
 
-	timer_setup(&pInfo->tmr, on_timeout, 0);
+	timer_setup(&pInfo->tmr, on_timeout, TIMER_USER_DATA);
 
 	return 0;
 }
drivers/tty/rocket.c +1 -1
index b121d8f8f3d7..b016580693bb 100644
@@ -98,7 +98,7 @@ static struct r_port *rp_table[MAX_RP_PORTS];	       /*  The main repository of
 static unsigned int xmit_flags[NUM_BOARDS];	       /*  Bit significant, indicates port had data to transmit. */
 						       /*  eg.  Bit 0 indicates port 0 has xmit data, ...        */
 static atomic_t rp_num_ports_open;	               /*  Number of serial ports open                           */
-static DEFINE_TIMER(rocket_timer, rp_do_poll);
+static DEFINE_TIMER_USERDATA(rocket_timer, rp_do_poll);
 
 static unsigned long board1;	                       /* ISA addresses, retrieved from rocketport.conf          */
 static unsigned long board2;
drivers/tty/serial/8250/8250_core.c +2 -1
index 2b161a64a0c8..6e7f07bde100 100644
@@ -516,7 +516,8 @@ static void __init serial8250_isa_init_ports(void)
 			base_ops = port->ops;
 		port->ops = &univ8250_port_ops;
 
-		timer_setup(&up->timer, serial8250_timeout, 0);
+		timer_setup(&up->timer, serial8250_timeout,
+			    TIMER_USER_DATA);
 
 		up->ops = &univ8250_driver_ops;
 
drivers/tty/serial/8250/8250_port.c +2 -2
index d2f3310abe54..b3cab67ec021 100644
@@ -628,9 +628,9 @@ int serial8250_em485_init(struct uart_8250_port *p)
 		return -ENOMEM;
 
 	hrtimer_init(&p->em485->stop_tx_timer, CLOCK_MONOTONIC,
-		     HRTIMER_MODE_REL);
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	hrtimer_init(&p->em485->start_tx_timer, CLOCK_MONOTONIC,
-		     HRTIMER_MODE_REL);
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	p->em485->stop_tx_timer.function = &serial8250_em485_handle_stop_tx;
 	p->em485->start_tx_timer.function = &serial8250_em485_handle_start_tx;
 	p->em485->port = p;
drivers/tty/serial/max3100.c +1 -1
index 437c22dbc7e9..cf4d70234f87 100644
@@ -779,7 +779,7 @@ static int max3100_probe(struct spi_device *spi)
 		max3100s[i]->poll_time = 1;
 	max3100s[i]->max3100_hw_suspend = pdata->max3100_hw_suspend;
 	max3100s[i]->minor = i;
-	timer_setup(&max3100s[i]->timer, max3100_timeout, 0);
+	timer_setup(&max3100s[i]->timer, max3100_timeout, TIMER_USER_DATA);
 
 	dev_dbg(&spi->dev, "%s: adding port %d\n", __func__, i);
 	max3100s[i]->port.irq = max3100s[i]->irq;
drivers/tty/serial/mux.c +1 -1
index 00ce31e8d19a..433b98fbe911 100644
@@ -572,7 +572,7 @@ static int __init mux_init(void)
 
 	if(port_cnt > 0) {
 		/* Start the Mux timer */
-		timer_setup(&mux_timer, mux_poll, 0);
+		timer_setup(&mux_timer, mux_poll, TIMER_USER_DATA);
 		mod_timer(&mux_timer, jiffies + MUX_POLL_DELAY);
 
 #ifdef CONFIG_SERIAL_MUX_CONSOLE
drivers/tty/serial/pnx8xxx_uart.c +2 -1
index 223a9499104e..e1d971e763ee 100644
@@ -662,7 +662,8 @@ static void __init pnx8xxx_init_ports(void)
 	first = 0;
 
 	for (i = 0; i < NR_PORTS; i++) {
-		timer_setup(&pnx8xxx_ports[i].timer, pnx8xxx_timeout, 0);
+		timer_setup(&pnx8xxx_ports[i].timer, pnx8xxx_timeout,
+			    TIMER_USER_DATA);
 		pnx8xxx_ports[i].port.ops = &pnx8xxx_pops;
 	}
 }
drivers/tty/serial/sccnxp.c +1 -1
index 68a24a14f6b7..eeb8f0dc8da7 100644
@@ -1022,7 +1022,7 @@ static int sccnxp_probe(struct platform_device *pdev)
 
 		dev_err(&pdev->dev, "Unable to reguest IRQ %i\n", s->irq);
 	} else {
-		timer_setup(&s->timer, sccnxp_timer, 0);
+		timer_setup(&s->timer, sccnxp_timer, TIMER_USER_DATA);
 		mod_timer(&s->timer, jiffies +
 			  usecs_to_jiffies(s->pdata.poll_time_us));
 		return 0;
drivers/tty/serial/sh-sci.c +6 -3
index 64bbeb7d7e0c..23eedfebff08 100644
@@ -1173,7 +1173,8 @@ static ssize_t rx_fifo_timeout_store(struct device *dev,
 		sci->rx_fifo_timeout = r;
 		scif_set_rtrg(port, 1);
 		if (r > 0)
-			timer_setup(&sci->rx_fifo_timer, rx_fifo_timer_fn, 0);
+			timer_setup(&sci->rx_fifo_timer, rx_fifo_timer_fn,
+				    TIMER_USER_DATA);
 	}
 
 	return count;
@@ -1614,7 +1615,8 @@ static void sci_request_dma(struct uart_port *port)
 			dma += s->buf_len_rx;
 		}
 
-		hrtimer_init(&s->rx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+		hrtimer_init(&s->rx_timer, CLOCK_MONOTONIC,
+			     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA);
 		s->rx_timer.function = rx_timer_fn;
 
 		s->chan_rx_saved = s->chan_rx = chan;
@@ -2326,7 +2328,8 @@ static void sci_reset(struct uart_port *port)
 	if (s->rx_trigger > 1) {
 		if (s->rx_fifo_timeout) {
 			scif_set_rtrg(port, 1);
-			timer_setup(&s->rx_fifo_timer, rx_fifo_timer_fn, 0);
+			timer_setup(&s->rx_fifo_timer, rx_fifo_timer_fn,
+				    TIMER_USER_DATA);
 		} else {
 			if (port->type == PORT_SCIFA ||
 			    port->type == PORT_SCIFB)
drivers/tty/vcc.c +2 -2
index 58b454c34560..c325d92aa95c 100644
@@ -637,8 +637,8 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 	if (rv)
 		goto free_domain;
 
-	timer_setup(&port->rx_timer, vcc_rx_timer, 0);
-	timer_setup(&port->tx_timer, vcc_tx_timer, 0);
+	timer_setup(&port->rx_timer, vcc_rx_timer, TIMER_USER_DATA);
+	timer_setup(&port->tx_timer, vcc_tx_timer, TIMER_USER_DATA);
 
 	dev_set_drvdata(&vdev->dev, port);
 
drivers/tty/vt/keyboard.c +1 -1
index 88312c6c92cc..551fcf59be9f 100644
@@ -251,7 +251,7 @@ static void kd_nosound(struct timer_list *unused)
 	input_handler_for_each_handle(&kbd_handler, &zero, kd_sound_helper);
 }
 
-static DEFINE_TIMER(kd_mksound_timer, kd_nosound);
+static DEFINE_TIMER_USERDATA(kd_mksound_timer, kd_nosound);
 
 void kd_mksound(unsigned int hz, unsigned int ticks)
 {
drivers/usb/chipidea/otg_fsm.c +2 -1
index 6ed4b00dba96..974141fc8d74 100644
@@ -422,7 +422,8 @@ static enum hrtimer_restart ci_otg_hrtimer_func(struct hrtimer *t)
 /* Initialize timers */
 static int ci_otg_init_timers(struct ci_hdrc *ci)
 {
-	hrtimer_init(&ci->otg_fsm_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
+	hrtimer_init(&ci->otg_fsm_hrtimer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_ABS | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	ci->otg_fsm_hrtimer.function = ci_otg_hrtimer_func;
 
 	return 0;
drivers/usb/dwc2/hcd_queue.c +4 -2
index ea3aa640c15c..6d1e635efff0 100644
@@ -1523,8 +1523,10 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
 
 	/* Initialize QH */
 	qh->hsotg = hsotg;
-	timer_setup(&qh->unreserve_timer, dwc2_unreserve_timer_fn, 0);
-	hrtimer_init(&qh->wait_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	timer_setup(&qh->unreserve_timer, dwc2_unreserve_timer_fn,
+		    TIMER_USER_DATA | TIMER_USER_DATA);
+	hrtimer_init(&qh->wait_timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	qh->wait_timer.function = &dwc2_wait_timer_fn;
 	qh->ep_type = ep_type;
 	qh->ep_is_in = ep_is_in;
drivers/usb/gadget/function/f_ncm.c +2 -1
index 5780fba620ab..3ad2463e15b4 100644
@@ -1499,7 +1499,8 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
 	ncm->port.open = ncm_open;
 	ncm->port.close = ncm_close;
 
-	hrtimer_init(&ncm->task_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
+	hrtimer_init(&ncm->task_timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL_SOFT | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	ncm->task_timer.function = ncm_tx_timeout;
 
 	DBG(cdev, "CDC Network: %s speed IN/%s OUT/%s NOTIFY/%s\n",
drivers/usb/gadget/udc/dummy_hcd.c +2 -2
index baf72f95f0f1..ebc4495a826a 100644
@@ -2431,7 +2431,7 @@ static DEVICE_ATTR_RO(urbs);
 
 static int dummy_start_ss(struct dummy_hcd *dum_hcd)
 {
-	timer_setup(&dum_hcd->timer, dummy_timer, 0);
+	timer_setup(&dum_hcd->timer, dummy_timer, TIMER_USER_DATA);
 	dum_hcd->rh_state = DUMMY_RH_RUNNING;
 	dum_hcd->stream_en_ep = 0;
 	INIT_LIST_HEAD(&dum_hcd->urbp_list);
@@ -2460,7 +2460,7 @@ static int dummy_start(struct usb_hcd *hcd)
 		return dummy_start_ss(dum_hcd);
 
 	spin_lock_init(&dum_hcd->dum->lock);
-	timer_setup(&dum_hcd->timer, dummy_timer, 0);
+	timer_setup(&dum_hcd->timer, dummy_timer, TIMER_USER_DATA);
 	dum_hcd->rh_state = DUMMY_RH_RUNNING;
 
 	INIT_LIST_HEAD(&dum_hcd->urbp_list);
drivers/usb/gadget/udc/m66592-udc.c +1 -1
index 7f8f97ec63f3..d191995e4001 100644
@@ -1589,7 +1589,7 @@ static int m66592_probe(struct platform_device *pdev)
 	m66592->gadget.max_speed = USB_SPEED_HIGH;
 	m66592->gadget.name = udc_name;
 
-	timer_setup(&m66592->timer, m66592_timer, 0);
+	timer_setup(&m66592->timer, m66592_timer, TIMER_USER_DATA);
 	m66592->reg = reg;
 
 	ret = request_irq(ires->start, m66592_irq,
drivers/usb/gadget/udc/r8a66597-udc.c +1 -1
index 1370c43c1f79..8d6d4f27c9f5 100644
@@ -1874,7 +1874,7 @@ static int r8a66597_probe(struct platform_device *pdev)
 	r8a66597->gadget.max_speed = USB_SPEED_HIGH;
 	r8a66597->gadget.name = udc_name;
 
-	timer_setup(&r8a66597->timer, r8a66597_timer, 0);
+	timer_setup(&r8a66597->timer, r8a66597_timer, TIMER_USER_DATA);
 	r8a66597->reg = reg;
 
 	if (r8a66597->pdata->on_chip) {
drivers/usb/usbip/vudc_transfer.c +1 -1
index c9db846ee4f6..617fb13abae1 100644
@@ -447,7 +447,7 @@ void v_init_timer(struct vudc *udc)
 {
 	struct transfer_timer *t = &udc->tr_timer;
 
-	timer_setup(&t->timer, v_timer, 0);
+	timer_setup(&t->timer, v_timer, TIMER_USER_DATA);
 	t->state = VUDC_TR_STOPPED;
 }
 
drivers/uwb/neh.c +1 -1
index fbdca728bd9f..3ba6255795c7 100644
@@ -223,7 +223,7 @@ struct uwb_rc_neh *uwb_rc_neh_add(struct uwb_rc *rc, struct uwb_rccb *cmd,
 
 	kref_init(&neh->kref);
 	INIT_LIST_HEAD(&neh->list_node);
-	timer_setup(&neh->timer, uwb_rc_neh_timer, 0);
+	timer_setup(&neh->timer, uwb_rc_neh_timer, TIMER_USER_DATA);
 
 	neh->rc = rc;
 	neh->evt_type = expected_type;
drivers/uwb/rsv.c +3 -2
index fe25a8cc6fa1..1a6648a4dfc8 100644
@@ -470,7 +470,7 @@ static struct uwb_rsv *uwb_rsv_alloc(struct uwb_rc *rc)
 	INIT_LIST_HEAD(&rsv->rc_node);
 	INIT_LIST_HEAD(&rsv->pal_node);
 	kref_init(&rsv->kref);
-	timer_setup(&rsv->timer, uwb_rsv_timer, 0);
+	timer_setup(&rsv->timer, uwb_rsv_timer, TIMER_USER_DATA);
 
 	rsv->rc = rc;
 	INIT_WORK(&rsv->handle_timeout_work, uwb_rsv_handle_timeout_work);
@@ -987,7 +987,8 @@ void uwb_rsv_init(struct uwb_rc *rc)
 	rc->bow.can_reserve_extra_mases = true;
 	rc->bow.total_expired = 0;
 	rc->bow.window = UWB_DRP_BACKOFF_WIN_MIN >> 1;
-	timer_setup(&rc->bow.timer, uwb_rsv_backoff_win_timer, 0);
+	timer_setup(&rc->bow.timer, uwb_rsv_backoff_win_timer,
+		    TIMER_USER_DATA);
 
 	bitmap_complement(rc->uwb_dev.streams, rc->uwb_dev.streams, UWB_NUM_STREAMS);
 }
drivers/visorbus/visorbus_main.c +1 -1
index 0b2434cc4ecd..eb7ed196b429 100644
@@ -658,7 +658,7 @@ int create_visor_device(struct visor_device *dev)
 	dev->device.release = visorbus_release_device;
 	/* keep a reference just for us (now 2) */
 	get_device(&dev->device);
-	timer_setup(&dev->timer, dev_periodic_work, 0);
+	timer_setup(&dev->timer, dev_periodic_work, TIMER_USER_DATA);
 	/*
 	 * bus_id must be a unique name with respect to this bus TYPE (NOT bus
 	 * instance).  That's why we need to include the bus number within the
kernel/time/alarmtimer.c +1 -1
index 2c97e8c2d29f..c7576710ee85 100644
@@ -344,7 +344,7 @@ void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
 		enum alarmtimer_restart (*function)(struct alarm *, ktime_t))
 {
 	hrtimer_init(&alarm->timer, alarm_bases[type].base_clockid,
-		     HRTIMER_MODE_ABS);
+		     HRTIMER_MODE_ABS | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	__alarm_init(alarm, type, function);
 }
 EXPORT_SYMBOL_GPL(alarm_init);
lib/random32.c +1 -1
index 4aaa76404d56..9cea9e8df380 100644
@@ -215,7 +215,7 @@ core_initcall(prandom_init);
 
 static void __prandom_timer(struct timer_list *unused);
 
-static DEFINE_TIMER(seed_timer, __prandom_timer);
+static DEFINE_TIMER_USERDATA(seed_timer, __prandom_timer);
 
 static void __prandom_timer(struct timer_list *unused)
 {
net/wireless/lib80211.c +1 -1
index 801d4781a73b..0e9867cb473e 100644
@@ -56,7 +56,7 @@ int lib80211_crypt_info_init(struct lib80211_crypt_info *info, char *name,
 
 	INIT_LIST_HEAD(&info->crypt_deinit_list);
 	timer_setup(&info->crypt_deinit_timer, lib80211_crypt_deinit_handler,
-		    0);
+		    TIMER_USER_DATA);
 
 	return 0;
 }
security/keys/gc.c +1 -1
index 634e96b380e8..66f35942b031 100644
@@ -29,7 +29,7 @@ DECLARE_WORK(key_gc_work, key_garbage_collector);
  * Reaper for links from keyrings to dead keys.
  */
 static void key_gc_timer_func(struct timer_list *);
-static DEFINE_TIMER(key_gc_timer, key_gc_timer_func);
+static DEFINE_TIMER_USERDATA(key_gc_timer, key_gc_timer_func);
 
 static time64_t key_gc_next_run = TIME64_MAX;
 static struct key_type *key_gc_dead_keytype;
sound/core/hrtimer.c +2 -1
index 18cb6f476bf4..a973931bf0f2 100644
@@ -82,7 +82,8 @@ static int snd_hrtimer_open(struct snd_timer *t)
 	stime = kzalloc(sizeof(*stime), GFP_KERNEL);
 	if (!stime)
 		return -ENOMEM;
-	hrtimer_init(&stime->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&stime->hrt, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	stime->timer = t;
 	stime->hrt.function = snd_hrtimer_callback;
 	t->private_data = stime;
sound/drivers/mpu401/mpu401_uart.c +2 -1
index 528bcc670149..5c024fa2c650 100644
@@ -193,7 +193,8 @@ static void snd_mpu401_uart_add_timer (struct snd_mpu401 *mpu, int input)
 
 	spin_lock_irqsave (&mpu->timer_lock, flags);
 	if (mpu->timer_invoked == 0) {
-		timer_setup(&mpu->timer, snd_mpu401_uart_timer, 0);
+		timer_setup(&mpu->timer, snd_mpu401_uart_timer,
+			    TIMER_USER_DATA);
 		mod_timer(&mpu->timer, 1 + jiffies);
 	} 
 	mpu->timer_invoked |= input ? MPU401_MODE_INPUT_TIMER :
sound/drivers/mtpav.c +2 -1
index 32b04d8b10e3..8e8d9d203d7b 100644
@@ -707,7 +707,8 @@ static int snd_mtpav_probe(struct platform_device *dev)
 	mtp_card->share_irq = 0;
 	mtp_card->inmidistate = 0;
 	mtp_card->outmidihwport = 0xffffffff;
-	timer_setup(&mtp_card->timer, snd_mtpav_output_timer, 0);
+	timer_setup(&mtp_card->timer, snd_mtpav_output_timer,
+		    TIMER_USER_DATA);
 
 	card->private_free = snd_mtpav_free;
 
sound/drivers/pcsp/pcsp.c +2 -1
index 0dd3f46eb03e..80d971cbc4d7 100644
@@ -100,7 +100,8 @@ static int snd_card_pcsp_probe(int devnum, struct device *dev)
 	if (devnum != 0)
 		return -EINVAL;
 
-	hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	pcsp_chip.timer.function = pcsp_do_timer;
 
 	err = snd_card_new(dev, index, id, THIS_MODULE, 0, &card);
sound/drivers/serial-u16550.c +2 -1
index 6f7315903ce9..283c937c44f7 100644
@@ -827,7 +827,8 @@ static int snd_uart16550_create(struct snd_card *card,
 	uart->prev_in = 0;
 	uart->rstatus = 0;
 	memset(uart->prev_status, 0x80, sizeof(unsigned char) * SNDRV_SERIAL_MAX_OUTS);
-	timer_setup(&uart->buffer_timer, snd_uart16550_buffer_timer, 0);
+	timer_setup(&uart->buffer_timer, snd_uart16550_buffer_timer,
+		    TIMER_USER_DATA);
 	uart->timer_running = 0;
 
 	/* Register device */
sound/isa/sb/emu8000_pcm.c +1 -1
index f46f6ec3ea0c..9882e7b38156 100644
@@ -241,7 +241,7 @@ static int emu8k_pcm_open(struct snd_pcm_substream *subs)
 	runtime->private_data = rec;
 
 	spin_lock_init(&rec->timer_lock);
-	timer_setup(&rec->timer, emu8k_pcm_timer_func, 0);
+	timer_setup(&rec->timer, emu8k_pcm_timer_func, TIMER_USER_DATA);
 
 	runtime->hw = emu8k_pcm_hw;
 	runtime->hw.buffer_bytes_max = emu->mem_size - LOOP_BLANK_SIZE * 3;
sound/isa/sb/sb8_midi.c +2 -1
index 4affdcb78f72..b1aaecdde82d 100644
@@ -273,7 +273,8 @@ int snd_sb8dsp_midi(struct snd_sb *chip, int device)
 	if (chip->hardware >= SB_HW_20)
 		rmidi->info_flags |= SNDRV_RAWMIDI_INFO_DUPLEX;
 	rmidi->private_data = chip;
-	timer_setup(&chip->midi_timer, snd_sb8dsp_midi_output_timer, 0);
+	timer_setup(&chip->midi_timer, snd_sb8dsp_midi_output_timer,
+		    TIMER_USER_DATA);
 	chip->rmidi = rmidi;
 	return 0;
 }
sound/isa/wavefront/wavefront_midi.c +2 -2
index 556b14738970..6c6a53bce685 100644
@@ -384,8 +384,8 @@ static void snd_wavefront_midi_output_trigger(struct snd_rawmidi_substream *subs
 		if ((midi->mode[mpu] & MPU401_MODE_OUTPUT_TRIGGER) == 0) {
 			if (!midi->istimer) {
 				timer_setup(&midi->timer,
-					    snd_wavefront_midi_output_timer,
-					    0);
+				            snd_wavefront_midi_output_timer,
+				            TIMER_USER_DATA);
 				mod_timer(&midi->timer, 1 + jiffies);
 			}
 			midi->istimer++;
sound/pci/echoaudio/midi.c +1 -1
index 6045a115cffe..a4d0b1ee6f15 100644
@@ -258,7 +258,7 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream
 	if (up) {
 		if (!chip->tinuse) {
 			timer_setup(&chip->timer, snd_echo_midi_output_write,
-				    0);
+				    TIMER_USER_DATA);
 			chip->tinuse = 1;
 		}
 	} else {
sound/pci/rme9652/hdsp.c +1 -1
index 479db0dcb86f..9917f8a3c582 100644
@@ -1441,7 +1441,7 @@ static void snd_hdsp_midi_output_trigger(struct snd_rawmidi_substream *substream
 	if (up) {
 		if (!hmidi->istimer) {
 			timer_setup(&hmidi->timer, snd_hdsp_midi_output_timer,
-				    0);
+				    TIMER_USER_DATA);
 			mod_timer(&hmidi->timer, 1 + jiffies);
 			hmidi->istimer++;
 		}
sound/pci/rme9652/hdspm.c +2 -1
index 5cb6248677f7..ab86733e2d12 100644
@@ -1978,7 +1978,8 @@ snd_hdspm_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
 	if (up) {
 		if (!hmidi->istimer) {
 			timer_setup(&hmidi->timer,
-				    snd_hdspm_midi_output_timer, 0);
+				    snd_hdspm_midi_output_timer,
+				    TIMER_USER_DATA);
 			mod_timer(&hmidi->timer, 1 + jiffies);
 			hmidi->istimer++;
 		}
sound/usb/midi.c +2 -1
index b737f0ec77d0..a929f1cf1265 100644
@@ -2369,7 +2369,8 @@ int __snd_usbmidi_create(struct snd_card *card,
 		usb_id = USB_ID(le16_to_cpu(umidi->dev->descriptor.idVendor),
 			       le16_to_cpu(umidi->dev->descriptor.idProduct));
 	umidi->usb_id = usb_id;
-	timer_setup(&umidi->error_timer, snd_usbmidi_error_timer, 0);
+	timer_setup(&umidi->error_timer, snd_usbmidi_error_timer,
+		    TIMER_USER_DATA);
 
 	/* detect the endpoint(s) to use */
 	memset(endpoints, 0, sizeof(endpoints));
Signature · 1 line
2.17.2