Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 Oct 2016 17:11:24 +0000 (10:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 Oct 2016 17:11:24 +0000 (10:11 -0700)
Pull networking updates from David Miller:

 1) BBR TCP congestion control, from Neal Cardwell, Yuchung Cheng and
    co. at Google. https://lwn.net/Articles/701165/

 2) Do TCP Small Queues for retransmits, from Eric Dumazet.

 3) Support collect_md mode for all IPV4 and IPV6 tunnels, from Alexei
    Starovoitov.

 4) Allow cls_flower to classify packets in ip tunnels, from Amir Vadai.

 5) Support DSA tagging in older mv88e6xxx switches, from Andrew Lunn.

 6) Support GMAC protocol in iwlwifi mwm, from Ayala Beker.

 7) Support ndo_poll_controller in mlx5, from Calvin Owens.

 8) Move VRF processing to an output hook and allow l3mdev to be
    loopback, from David Ahern.

 9) Support SOCK_DESTROY for UDP sockets. Also from David Ahern.

10) Congestion control in RXRPC, from David Howells.

11) Support geneve RX offload in ixgbe, from Emil Tantilov.

12) When hitting pressure for new incoming TCP data SKBs, perform a
    partial rathern than a full purge of the OFO queue (which could be
    huge). From Eric Dumazet.

13) Convert XFRM state and policy lookups to RCU, from Florian Westphal.

14) Support RX network flow classification to igb, from Gangfeng Huang.

15) Hardware offloading of eBPF in nfp driver, from Jakub Kicinski.

16) New skbmod packet action, from Jamal Hadi Salim.

17) Remove some inefficiencies in snmp proc output, from Jia He.

18) Add FIB notifications to properly propagate route changes to
    hardware which is doing forwarding offloading. From Jiri Pirko.

19) New dsa driver for qca8xxx chips, from John Crispin.

20) Implement RFC7559 ipv6 router solicitation backoff, from Maciej
    Żenczykowski.

21) Add L3 mode to ipvlan, from Mahesh Bandewar.

22) Support 802.1ad in mlx4, from Moshe Shemesh.

23) Support hardware LRO in mediatek driver, from Nelson Chang.

24) Add TC offloading to mlx5, from Or Gerlitz.

25) Convert various drivers to ethtool ksettings interfaces, from
    Philippe Reynes.

26) TX max rate limiting for cxgb4, from Rahul Lakkireddy.

27) NAPI support for ath10k, from Rajkumar Manoharan.

28) Support XDP in mlx5, from Rana Shahout and Saeed Mahameed.

29) UDP replicast support in TIPC, from Richard Alpe.

30) Per-queue statistics for qed driver, from Sudarsana Reddy Kalluru.

31) Support BQL in thunderx driver, from Sunil Goutham.

32) TSO support in alx driver, from Tobias Regnery.

33) Add stream parser engine and use it in kcm.

34) Support async DHCP replies in ipconfig module, from Uwe
    Kleine-König.

35) DSA port fast aging for mv88e6xxx driver, from Vivien Didelot.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1715 commits)
  mlxsw: switchx2: Fix misuse of hard_header_len
  mlxsw: spectrum: Fix misuse of hard_header_len
  net/faraday: Stop NCSI device on shutdown
  net/ncsi: Introduce ncsi_stop_dev()
  net/ncsi: Rework the channel monitoring
  net/ncsi: Allow to extend NCSI request properties
  net/ncsi: Rework request index allocation
  net/ncsi: Don't probe on the reserved channel ID (0x1f)
  net/ncsi: Introduce NCSI_RESERVED_CHANNEL
  net/ncsi: Avoid unused-value build warning from ia64-linux-gcc
  net: Add netdev all_adj_list refcnt propagation to fix panic
  net: phy: Add Edge-rate driver for Microsemi PHYs.
  vmxnet3: Wake queue from reset work
  i40e: avoid NULL pointer dereference and recursive errors on early PCI error
  qed: Add RoCE ll2 & GSI support
  qed: Add support for memory registeration verbs
  qed: Add support for QP verbs
  qed: PD,PKEY and CQ verb support
  qed: Add support for RoCE hw init
  qede: Add qedr framework
  ...

1  2 
MAINTAINERS
drivers/net/ethernet/marvell/mvneta.c
include/linux/bcma/bcma_regs.h
include/linux/hyperv.h
include/linux/ktime.h
include/linux/perf_event.h
kernel/events/core.c

diff --combined MAINTAINERS
@@@ -636,6 -636,15 +636,15 @@@ F:       drivers/tty/serial/altera_jtaguart.
  F:    include/linux/altera_uart.h
  F:    include/linux/altera_jtaguart.h
  
+ AMAZON ETHERNET DRIVERS
+ M:    Netanel Belgazal <netanel@annapurnalabs.com>
+ R:    Saeed Bishara <saeed@annapurnalabs.com>
+ R:    Zorik Machulsky <zorik@annapurnalabs.com>
+ L:    netdev@vger.kernel.org
+ S:    Supported
+ F:    Documentation/networking/ena.txt
+ F:    drivers/net/ethernet/amazon/
  AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER
  M:    Tom Lendacky <thomas.lendacky@amd.com>
  M:    Gary Hook <gary.hook@amd.com>
@@@ -913,17 -922,15 +922,17 @@@ F:      arch/arm/include/asm/floppy.
  
  ARM PMU PROFILING AND DEBUGGING
  M:    Will Deacon <will.deacon@arm.com>
 -R:    Mark Rutland <mark.rutland@arm.com>
 +M:    Mark Rutland <mark.rutland@arm.com>
  S:    Maintained
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  F:    arch/arm*/kernel/perf_*
  F:    arch/arm/oprofile/common.c
  F:    arch/arm*/kernel/hw_breakpoint.c
  F:    arch/arm*/include/asm/hw_breakpoint.h
  F:    arch/arm*/include/asm/perf_event.h
 -F:    drivers/perf/arm_pmu.c
 +F:    drivers/perf/*
  F:    include/linux/perf/arm_pmu.h
 +F:    Documentation/devicetree/bindings/arm/pmu.txt
  
  ARM PORT
  M:    Russell King <linux@armlinux.org.uk>
@@@ -1125,11 -1132,6 +1134,11 @@@ F:    drivers/hwtracing/coresight/
  F:    Documentation/trace/coresight.txt
  F:    Documentation/devicetree/bindings/arm/coresight.txt
  F:    Documentation/ABI/testing/sysfs-bus-coresight-devices-*
 +F:    tools/perf/arch/arm/util/pmu.c
 +F:    tools/perf/arch/arm/util/auxtrace.c
 +F:    tools/perf/arch/arm/util/cs-etm.c
 +F:    tools/perf/arch/arm/util/cs-etm.h
 +F:    tools/perf/util/cs-etm.h
  
  ARM/CORGI MACHINE SUPPORT
  M:    Richard Purdie <rpurdie@rpsys.net>
@@@ -1847,7 -1849,6 +1856,7 @@@ F:      arch/arm/mach-uniphier
  F:    arch/arm/mm/cache-uniphier.c
  F:    arch/arm64/boot/dts/socionext/
  F:    drivers/bus/uniphier-system-bus.c
 +F:    drivers/clk/uniphier/
  F:    drivers/i2c/busses/i2c-uniphier*
  F:    drivers/pinctrl/uniphier/
  F:    drivers/tty/serial/8250/8250_uniphier.c
@@@ -2122,6 -2123,11 +2131,6 @@@ M:     Ludovic Desroches <ludovic.desroches
  S:    Maintained
  F:    drivers/mmc/host/atmel-mci.c
  
 -ATMEL AT91 / AT32 SERIAL DRIVER
 -M:    Nicolas Ferre <nicolas.ferre@atmel.com>
 -S:    Supported
 -F:    drivers/tty/serial/atmel_serial.c
 -
  ATMEL AT91 SAMA5D2-Compatible Shutdown Controller
  M:    Nicolas Ferre <nicolas.ferre@atmel.com>
  S:    Supported
@@@ -3139,7 -3145,7 +3148,7 @@@ L:      cocci@systeme.lip6.fr (moderated fo
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild.git misc
  W:    http://coccinelle.lip6.fr/
  S:    Supported
 -F:    Documentation/coccinelle.txt
 +F:    Documentation/dev-tools/coccinelle.rst
  F:    scripts/coccinelle/
  F:    scripts/coccicheck
  
@@@ -3165,7 -3171,6 +3174,7 @@@ COMMON CLK FRAMEWOR
  M:    Michael Turquette <mturquette@baylibre.com>
  M:    Stephen Boyd <sboyd@codeaurora.org>
  L:    linux-clk@vger.kernel.org
 +Q:    http://patchwork.kernel.org/project/linux-clk/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git
  S:    Maintained
  F:    Documentation/devicetree/bindings/clock/
@@@ -3286,7 -3291,6 +3295,7 @@@ L:      linux-pm@vger.kernel.or
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
  T:    git git://git.linaro.org/people/vireshk/linux.git (For ARM Updates)
 +F:    Documentation/cpu-freq/
  F:    drivers/cpufreq/
  F:    include/linux/cpufreq.h
  
@@@ -4410,6 -4414,7 +4419,6 @@@ F:      Documentation/filesystems/ecryptfs.t
  F:    fs/ecryptfs/
  
  EDAC-CORE
 -M:    Doug Thompson <dougthompson@xmission.com>
  M:    Borislav Petkov <bp@alien8.de>
  M:    Mauro Carvalho Chehab <mchehab@s-opensource.com>
  M:    Mauro Carvalho Chehab <mchehab@kernel.org>
@@@ -4422,12 -4427,14 +4431,12 @@@ F:   drivers/edac
  F:    include/linux/edac.h
  
  EDAC-AMD64
 -M:    Doug Thompson <dougthompson@xmission.com>
  M:    Borislav Petkov <bp@alien8.de>
  L:    linux-edac@vger.kernel.org
  S:    Maintained
  F:    drivers/edac/amd64_edac*
  
  EDAC-CALXEDA
 -M:    Doug Thompson <dougthompson@xmission.com>
  M:    Robert Richter <rric@kernel.org>
  L:    linux-edac@vger.kernel.org
  S:    Maintained
@@@ -4443,21 -4450,17 +4452,21 @@@ F:   drivers/edac/octeon_edac
  
  EDAC-E752X
  M:    Mark Gross <mark.gross@intel.com>
 -M:    Doug Thompson <dougthompson@xmission.com>
  L:    linux-edac@vger.kernel.org
  S:    Maintained
  F:    drivers/edac/e752x_edac.c
  
  EDAC-E7XXX
 -M:    Doug Thompson <dougthompson@xmission.com>
  L:    linux-edac@vger.kernel.org
  S:    Maintained
  F:    drivers/edac/e7xxx_edac.c
  
 +EDAC-FSL_DDR
 +M:    York Sun <york.sun@nxp.com>
 +L:    linux-edac@vger.kernel.org
 +S:    Maintained
 +F:    drivers/edac/fsl_ddr_edac.*
 +
  EDAC-GHES
  M:    Mauro Carvalho Chehab <mchehab@s-opensource.com>
  M:    Mauro Carvalho Chehab <mchehab@kernel.org>
@@@ -4472,11 -4475,13 +4481,11 @@@ S:   Maintaine
  F:    drivers/edac/i82443bxgx_edac.c
  
  EDAC-I3000
 -M:    Jason Uhlenkott <juhlenko@akamai.com>
  L:    linux-edac@vger.kernel.org
 -S:    Maintained
 +S:    Orphan
  F:    drivers/edac/i3000_edac.c
  
  EDAC-I5000
 -M:    Doug Thompson <dougthompson@xmission.com>
  L:    linux-edac@vger.kernel.org
  S:    Maintained
  F:    drivers/edac/i5000_edac.c
@@@ -4588,13 -4593,6 +4597,13 @@@ M:    Peter Jones <pjones@redhat.com
  S:    Maintained
  F:    drivers/video/fbdev/efifb.c
  
 +EFI TEST DRIVER
 +L:    linux-efi@vger.kernel.org
 +M:    Ivan Hu <ivan.hu@canonical.com>
 +M:    Matt Fleming <matt@codeblueprint.co.uk>
 +S:    Maintained
 +F:    drivers/firmware/efi/test/
 +
  EFS FILESYSTEM
  W:    http://aeschi.ch.eu.org/efs/
  S:    Orphan
@@@ -4862,7 -4860,6 +4871,7 @@@ F:      tools/firewire
  
  FIRMWARE LOADER (request_firmware)
  M:    Ming Lei <ming.lei@canonical.com>
 +M:    Luis R. Rodriguez <mcgrof@kernel.org>
  L:    linux-kernel@vger.kernel.org
  S:    Maintained
  F:    Documentation/firmware_class/
@@@ -5148,7 -5145,7 +5157,7 @@@ GCOV BASED KERNEL PROFILIN
  M:    Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
  S:    Maintained
  F:    kernel/gcov/
 -F:    Documentation/gcov.txt
 +F:    Documentation/dev-tools/gcov.rst
  
  GDT SCSI DISK ARRAY CONTROLLER DRIVER
  M:    Achim Leubner <achim_leubner@adaptec.com>
@@@ -5596,10 -5593,9 +5605,9 @@@ F:     Documentation/devicetree/bindings/sc
  
  HOST AP DRIVER
  M:    Jouni Malinen <j@w1.fi>
- L:    hostap@shmoo.com (subscribers-only)
  L:    linux-wireless@vger.kernel.org
- W:    http://hostap.epitest.fi/
- S:    Maintained
+ W:    http://w1.fi/hostap-driver.html
+ S:    Obsolete
  F:    drivers/net/wireless/intersil/hostap/
  
  HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER
@@@ -5636,7 -5632,7 +5644,7 @@@ M:      Sebastian Reichel <sre@kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi.git
  S:    Maintained
  F:    Documentation/ABI/testing/sysfs-bus-hsi
 -F:    Documentation/hsi.txt
 +F:    Documentation/device-drivers/serial-interfaces.rst
  F:    drivers/hsi/
  F:    include/linux/hsi/
  F:    include/uapi/linux/hsi/
@@@ -6617,7 -6613,7 +6625,7 @@@ L:      kasan-dev@googlegroups.co
  S:    Maintained
  F:    arch/*/include/asm/kasan.h
  F:    arch/*/mm/kasan_init*
 -F:    Documentation/kasan.txt
 +F:    Documentation/dev-tools/kasan.rst
  F:    include/linux/kasan*.h
  F:    lib/test_kasan.c
  F:    mm/kasan/
@@@ -6833,7 -6829,7 +6841,7 @@@ KMEMCHEC
  M:    Vegard Nossum <vegardno@ifi.uio.no>
  M:    Pekka Enberg <penberg@kernel.org>
  S:    Maintained
 -F:    Documentation/kmemcheck.txt
 +F:    Documentation/dev-tools/kmemcheck.rst
  F:    arch/x86/include/asm/kmemcheck.h
  F:    arch/x86/mm/kmemcheck/
  F:    include/linux/kmemcheck.h
@@@ -6842,7 -6838,7 +6850,7 @@@ F:      mm/kmemcheck.
  KMEMLEAK
  M:    Catalin Marinas <catalin.marinas@arm.com>
  S:    Maintained
 -F:    Documentation/kmemleak.txt
 +F:    Documentation/dev-tools/kmemleak.rst
  F:    include/linux/kmemleak.h
  F:    mm/kmemleak.c
  F:    mm/kmemleak-test.c
@@@ -7455,8 -7451,9 +7463,8 @@@ F:      Documentation/hwmon/max2075
  F:    drivers/hwmon/max20751.c
  
  MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
 -M:    "Hans J. Koch" <hjk@hansjkoch.de>
  L:    linux-hwmon@vger.kernel.org
 -S:    Maintained
 +S:    Orphan
  F:    Documentation/hwmon/max6650
  F:    drivers/hwmon/max6650.c
  
@@@ -7679,19 -7676,6 +7687,19 @@@ W:    http://www.mellanox.co
  Q:    http://patchwork.ozlabs.org/project/netdev/list/
  F:    drivers/net/ethernet/mellanox/mlxsw/
  
 +MELLANOX MLXCPLD LED DRIVER
 +M:    Vadim Pasternak <vadimp@mellanox.com>
 +L:    linux-leds@vger.kernel.org
 +S:    Supported
 +F:    drivers/leds/leds-mlxcpld.c
 +F:    Documentation/leds/leds-mlxcpld.txt
 +
 +MELLANOX PLATFORM DRIVER
 +M:      Vadim Pasternak <vadimp@mellanox.com>
 +L:      platform-driver-x86@vger.kernel.org
 +S:      Supported
 +F:      arch/x86/platform/mellanox/mlx-platform.c
 +
  SOFT-ROCE DRIVER (rxe)
  M:    Moni Shoua <monis@mellanox.com>
  L:    linux-rdma@vger.kernel.org
@@@ -7777,12 -7761,6 +7785,12 @@@ T:    git git://git.monstr.eu/linux-2.6-mi
  S:    Supported
  F:    arch/microblaze/
  
 +MICROCHIP / ATMEL AT91 / AT32 SERIAL DRIVER
 +M:    Richard Genoud <richard.genoud@gmail.com>
 +S:    Maintained
 +F:    drivers/tty/serial/atmel_serial.c
 +F:    include/linux/atmel_serial.h
 +
  MICROSOFT SURFACE PRO 3 BUTTON DRIVER
  M:    Chen Yu <yu.c.chen@intel.com>
  L:    platform-driver-x86@vger.kernel.org
@@@ -8887,7 -8865,6 +8895,7 @@@ S:      Supporte
  F:    Documentation/virtual/paravirt_ops.txt
  F:    arch/*/kernel/paravirt*
  F:    arch/*/include/asm/paravirt.h
 +F:    include/linux/hypervisor.h
  
  PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES
  M:    Tim Waugh <tim@cyberelk.net>
@@@ -9731,6 -9708,12 +9739,12 @@@ T:    git git://git.kernel.org/pub/scm/lin
  S:    Supported
  F:    drivers/net/wireless/ath/ath10k/
  
+ QUALCOMM EMAC GIGABIT ETHERNET DRIVER
+ M:    Timur Tabi <timur@codeaurora.org>
+ L:    netdev@vger.kernel.org
+ S:    Supported
+ F:    drivers/net/ethernet/qualcomm/emac/
  QUALCOMM HEXAGON ARCHITECTURE
  M:    Richard Kuo <rkuo@codeaurora.org>
  L:    linux-hexagon@vger.kernel.org
@@@ -9951,12 -9934,6 +9965,12 @@@ F:    drivers/rpmsg
  F:    Documentation/rpmsg.txt
  F:    include/linux/rpmsg.h
  
 +RENESAS CLOCK DRIVERS
 +M:    Geert Uytterhoeven <geert+renesas@glider.be>
 +L:    linux-renesas-soc@vger.kernel.org
 +S:    Supported
 +F:    drivers/clk/renesas/
 +
  RENESAS ETHERNET DRIVERS
  R:    Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
  L:    netdev@vger.kernel.org
@@@ -9992,6 -9969,7 +10006,7 @@@ F:     net/rfkill
  
  RHASHTABLE
  M:    Thomas Graf <tgraf@suug.ch>
+ M:    Herbert Xu <herbert@gondor.apana.org.au>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    lib/rhashtable.c
@@@ -10135,8 -10113,8 +10150,8 @@@ S:   Supporte
  F:    drivers/s390/cio/
  
  S390 DASD DRIVER
 -M:    Stefan Weinhuber <wein@de.ibm.com>
 -M:    Stefan Haberland <stefan.haberland@de.ibm.com>
 +M:    Stefan Haberland <sth@linux.vnet.ibm.com>
 +M:    Jan Hoeppner <hoeppner@linux.vnet.ibm.com>
  L:    linux-s390@vger.kernel.org
  W:    http://www.ibm.com/developerworks/linux/linux390/
  S:    Supported
@@@ -10300,12 -10278,9 +10315,12 @@@ F: drivers/nfc/s3fwrn
  SAMSUNG SOC CLOCK DRIVERS
  M:    Sylwester Nawrocki <s.nawrocki@samsung.com>
  M:    Tomasz Figa <tomasz.figa@gmail.com>
 +M:    Chanwoo Choi <cw00.choi@samsung.com>
  S:    Supported
  L:    linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
  F:    drivers/clk/samsung/
 +F:    include/dt-bindings/clock/exynos*.h
 +F:    Documentation/devicetree/bindings/clock/exynos*.txt
  
  SAMSUNG SPI DRIVERS
  M:    Kukjin Kim <kgene@kernel.org>
@@@ -11164,7 -11139,6 +11179,7 @@@ F:   Documentation/spi
  F:    drivers/spi/
  F:    include/linux/spi/
  F:    include/uapi/linux/spi/
 +F:    tools/spi/
  
  SPIDERNET NETWORK DRIVER for CELL
  M:    Ishizaki Kou <kou.ishizaki@toshiba.co.jp>
@@@ -12234,7 -12208,7 +12249,7 @@@ S:   Maintaine
  F:    drivers/net/usb/lan78xx.*
  
  USB MASS STORAGE DRIVER
 -M:    Matthew Dharm <mdharm-usb@one-eyed-alien.net>
 +M:    Alan Stern <stern@rowland.harvard.edu>
  L:    linux-usb@vger.kernel.org
  L:    usb-storage@lists.one-eyed-alien.net
  S:    Maintained
@@@ -12318,7 -12292,6 +12333,7 @@@ F:   drivers/net/usb/rtl8150.
  USB SERIAL SUBSYSTEM
  M:    Johan Hovold <johan@kernel.org>
  L:    linux-usb@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git
  S:    Maintained
  F:    Documentation/usb/usb-serial.txt
  F:    drivers/usb/serial/
@@@ -12332,6 -12305,7 +12347,7 @@@ F:   drivers/net/usb/smsc75xx.
  
  USB SMSC95XX ETHERNET DRIVER
  M:    Steve Glendinning <steve.glendinning@shawell.net>
+ M:    Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/usb/smsc95xx.*
@@@ -12438,6 -12412,7 +12454,6 @@@ F:   fs/hostfs
  F:    fs/hppfs/
  
  USERSPACE I/O (UIO)
 -M:    "Hans J. Koch" <hjk@hansjkoch.de>
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
@@@ -382,8 -382,7 +382,8 @@@ struct mvneta_port 
        struct mvneta_rx_queue *rxqs;
        struct mvneta_tx_queue *txqs;
        struct net_device *dev;
 -      struct notifier_block cpu_notifier;
 +      struct hlist_node node_online;
 +      struct hlist_node node_dead;
        int rxq_def;
        /* Protect the access to the percpu interrupt registers,
         * ensuring that the configuration remains coherent.
        u16 rx_ring_size;
  
        struct mii_bus *mii_bus;
-       struct phy_device *phy_dev;
        phy_interface_t phy_interface;
        struct device_node *phy_node;
        unsigned int link;
@@@ -575,7 -573,6 +574,7 @@@ struct mvneta_rx_queue 
        int next_desc_to_proc;
  };
  
 +static enum cpuhp_state online_hpstate;
  /* The hardware supports eight (8) rx queues, but we are only allowing
   * the first one to be used. Therefore, let's just allocate one queue.
   */
@@@ -637,8 -634,9 +636,9 @@@ static void mvneta_mib_counters_clear(s
  }
  
  /* Get System Network Statistics */
- struct rtnl_link_stats64 *mvneta_get_stats64(struct net_device *dev,
-                                            struct rtnl_link_stats64 *stats)
+ static struct rtnl_link_stats64 *
+ mvneta_get_stats64(struct net_device *dev,
+                  struct rtnl_link_stats64 *stats)
  {
        struct mvneta_port *pp = netdev_priv(dev);
        unsigned int start;
@@@ -2653,6 -2651,7 +2653,7 @@@ static int mvneta_poll(struct napi_stru
        u32 cause_rx_tx;
        int rx_queue;
        struct mvneta_port *pp = netdev_priv(napi->dev);
+       struct net_device *ndev = pp->dev;
        struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
  
        if (!netif_running(pp->dev)) {
                                (MVNETA_CAUSE_PHY_STATUS_CHANGE |
                                 MVNETA_CAUSE_LINK_CHANGE |
                                 MVNETA_CAUSE_PSC_SYNC_CHANGE))) {
-                       mvneta_fixed_link_update(pp, pp->phy_dev);
+                       mvneta_fixed_link_update(pp, ndev->phydev);
                }
        }
  
@@@ -2965,6 -2964,7 +2966,7 @@@ static int mvneta_setup_txqs(struct mvn
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
        int cpu;
+       struct net_device *ndev = pp->dev;
  
        mvneta_max_rx_size_set(pp, pp->pkt_size);
        mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
                    MVNETA_CAUSE_LINK_CHANGE |
                    MVNETA_CAUSE_PSC_SYNC_CHANGE);
  
-       phy_start(pp->phy_dev);
+       phy_start(ndev->phydev);
        netif_tx_start_all_queues(pp->dev);
  }
  
  static void mvneta_stop_dev(struct mvneta_port *pp)
  {
        unsigned int cpu;
+       struct net_device *ndev = pp->dev;
  
-       phy_stop(pp->phy_dev);
+       phy_stop(ndev->phydev);
  
        for_each_online_cpu(cpu) {
                struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
@@@ -3168,7 -3169,7 +3171,7 @@@ static int mvneta_set_mac_addr(struct n
  static void mvneta_adjust_link(struct net_device *ndev)
  {
        struct mvneta_port *pp = netdev_priv(ndev);
-       struct phy_device *phydev = pp->phy_dev;
+       struct phy_device *phydev = ndev->phydev;
        int status_change = 0;
  
        if (phydev->link) {
@@@ -3246,7 -3247,6 +3249,6 @@@ static int mvneta_mdio_probe(struct mvn
        phy_dev->supported &= PHY_GBIT_FEATURES;
        phy_dev->advertising = phy_dev->supported;
  
-       pp->phy_dev = phy_dev;
        pp->link    = 0;
        pp->duplex  = 0;
        pp->speed   = 0;
  
  static void mvneta_mdio_remove(struct mvneta_port *pp)
  {
-       phy_disconnect(pp->phy_dev);
-       pp->phy_dev = NULL;
+       struct net_device *ndev = pp->dev;
+       phy_disconnect(ndev->phydev);
  }
  
  /* Electing a CPU must be done in an atomic way: it should be done
@@@ -3313,104 -3314,101 +3316,104 @@@ static void mvneta_percpu_elect(struct 
        }
  };
  
 -static int mvneta_percpu_notifier(struct notifier_block *nfb,
 -                                unsigned long action, void *hcpu)
 +static int mvneta_cpu_online(unsigned int cpu, struct hlist_node *node)
  {
 -      struct mvneta_port *pp = container_of(nfb, struct mvneta_port,
 -                                            cpu_notifier);
 -      int cpu = (unsigned long)hcpu, other_cpu;
 +      int other_cpu;
 +      struct mvneta_port *pp = hlist_entry_safe(node, struct mvneta_port,
 +                                                node_online);
        struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
  
 -      switch (action) {
 -      case CPU_ONLINE:
 -      case CPU_ONLINE_FROZEN:
 -      case CPU_DOWN_FAILED:
 -      case CPU_DOWN_FAILED_FROZEN:
 -              spin_lock(&pp->lock);
 -              /* Configuring the driver for a new CPU while the
 -               * driver is stopping is racy, so just avoid it.
 -               */
 -              if (pp->is_stopped) {
 -                      spin_unlock(&pp->lock);
 -                      break;
 -              }
 -              netif_tx_stop_all_queues(pp->dev);
  
 -              /* We have to synchronise on tha napi of each CPU
 -               * except the one just being waked up
 -               */
 -              for_each_online_cpu(other_cpu) {
 -                      if (other_cpu != cpu) {
 -                              struct mvneta_pcpu_port *other_port =
 -                                      per_cpu_ptr(pp->ports, other_cpu);
 +      spin_lock(&pp->lock);
 +      /*
 +       * Configuring the driver for a new CPU while the driver is
 +       * stopping is racy, so just avoid it.
 +       */
 +      if (pp->is_stopped) {
 +              spin_unlock(&pp->lock);
 +              return 0;
 +      }
 +      netif_tx_stop_all_queues(pp->dev);
  
 -                              napi_synchronize(&other_port->napi);
 -                      }
 +      /*
 +       * We have to synchronise on tha napi of each CPU except the one
 +       * just being woken up
 +       */
 +      for_each_online_cpu(other_cpu) {
 +              if (other_cpu != cpu) {
 +                      struct mvneta_pcpu_port *other_port =
 +                              per_cpu_ptr(pp->ports, other_cpu);
 +
 +                      napi_synchronize(&other_port->napi);
                }
 +      }
  
 -              /* Mask all ethernet port interrupts */
 -              on_each_cpu(mvneta_percpu_mask_interrupt, pp, true);
 -              napi_enable(&port->napi);
 +      /* Mask all ethernet port interrupts */
 +      on_each_cpu(mvneta_percpu_mask_interrupt, pp, true);
 +      napi_enable(&port->napi);
  
 +      /*
 +       * Enable per-CPU interrupts on the CPU that is
 +       * brought up.
 +       */
 +      mvneta_percpu_enable(pp);
  
 -              /* Enable per-CPU interrupts on the CPU that is
 -               * brought up.
 -               */
 -              mvneta_percpu_enable(pp);
 +      /*
 +       * Enable per-CPU interrupt on the one CPU we care
 +       * about.
 +       */
 +      mvneta_percpu_elect(pp);
  
 -              /* Enable per-CPU interrupt on the one CPU we care
 -               * about.
 -               */
 -              mvneta_percpu_elect(pp);
 -
 -              /* Unmask all ethernet port interrupts */
 -              on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
 -              mvreg_write(pp, MVNETA_INTR_MISC_MASK,
 -                      MVNETA_CAUSE_PHY_STATUS_CHANGE |
 -                      MVNETA_CAUSE_LINK_CHANGE |
 -                      MVNETA_CAUSE_PSC_SYNC_CHANGE);
 -              netif_tx_start_all_queues(pp->dev);
 -              spin_unlock(&pp->lock);
 -              break;
 -      case CPU_DOWN_PREPARE:
 -      case CPU_DOWN_PREPARE_FROZEN:
 -              netif_tx_stop_all_queues(pp->dev);
 -              /* Thanks to this lock we are sure that any pending
 -               * cpu election is done
 -               */
 -              spin_lock(&pp->lock);
 -              /* Mask all ethernet port interrupts */
 -              on_each_cpu(mvneta_percpu_mask_interrupt, pp, true);
 -              spin_unlock(&pp->lock);
 +      /* Unmask all ethernet port interrupts */
 +      on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
 +      mvreg_write(pp, MVNETA_INTR_MISC_MASK,
 +                  MVNETA_CAUSE_PHY_STATUS_CHANGE |
 +                  MVNETA_CAUSE_LINK_CHANGE |
 +                  MVNETA_CAUSE_PSC_SYNC_CHANGE);
 +      netif_tx_start_all_queues(pp->dev);
 +      spin_unlock(&pp->lock);
 +      return 0;
 +}
  
 -              napi_synchronize(&port->napi);
 -              napi_disable(&port->napi);
 -              /* Disable per-CPU interrupts on the CPU that is
 -               * brought down.
 -               */
 -              mvneta_percpu_disable(pp);
 +static int mvneta_cpu_down_prepare(unsigned int cpu, struct hlist_node *node)
 +{
 +      struct mvneta_port *pp = hlist_entry_safe(node, struct mvneta_port,
 +                                                node_online);
 +      struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
  
 -              break;
 -      case CPU_DEAD:
 -      case CPU_DEAD_FROZEN:
 -              /* Check if a new CPU must be elected now this on is down */
 -              spin_lock(&pp->lock);
 -              mvneta_percpu_elect(pp);
 -              spin_unlock(&pp->lock);
 -              /* Unmask all ethernet port interrupts */
 -              on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
 -              mvreg_write(pp, MVNETA_INTR_MISC_MASK,
 -                      MVNETA_CAUSE_PHY_STATUS_CHANGE |
 -                      MVNETA_CAUSE_LINK_CHANGE |
 -                      MVNETA_CAUSE_PSC_SYNC_CHANGE);
 -              netif_tx_start_all_queues(pp->dev);
 -              break;
 -      }
 +      /*
 +       * Thanks to this lock we are sure that any pending cpu election is
 +       * done.
 +       */
 +      spin_lock(&pp->lock);
 +      /* Mask all ethernet port interrupts */
 +      on_each_cpu(mvneta_percpu_mask_interrupt, pp, true);
 +      spin_unlock(&pp->lock);
  
 -      return NOTIFY_OK;
 +      napi_synchronize(&port->napi);
 +      napi_disable(&port->napi);
 +      /* Disable per-CPU interrupts on the CPU that is brought down. */
 +      mvneta_percpu_disable(pp);
 +      return 0;
 +}
 +
 +static int mvneta_cpu_dead(unsigned int cpu, struct hlist_node *node)
 +{
 +      struct mvneta_port *pp = hlist_entry_safe(node, struct mvneta_port,
 +                                                node_dead);
 +
 +      /* Check if a new CPU must be elected now this on is down */
 +      spin_lock(&pp->lock);
 +      mvneta_percpu_elect(pp);
 +      spin_unlock(&pp->lock);
 +      /* Unmask all ethernet port interrupts */
 +      on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
 +      mvreg_write(pp, MVNETA_INTR_MISC_MASK,
 +                  MVNETA_CAUSE_PHY_STATUS_CHANGE |
 +                  MVNETA_CAUSE_LINK_CHANGE |
 +                  MVNETA_CAUSE_PSC_SYNC_CHANGE);
 +      netif_tx_start_all_queues(pp->dev);
 +      return 0;
  }
  
  static int mvneta_open(struct net_device *dev)
        /* Register a CPU notifier to handle the case where our CPU
         * might be taken offline.
         */
 -      register_cpu_notifier(&pp->cpu_notifier);
 +      ret = cpuhp_state_add_instance_nocalls(online_hpstate,
 +                                             &pp->node_online);
 +      if (ret)
 +              goto err_free_irq;
 +
 +      ret = cpuhp_state_add_instance_nocalls(CPUHP_NET_MVNETA_DEAD,
 +                                             &pp->node_dead);
 +      if (ret)
 +              goto err_free_online_hp;
  
        /* In default link is down */
        netif_carrier_off(pp->dev);
        ret = mvneta_mdio_probe(pp);
        if (ret < 0) {
                netdev_err(dev, "cannot probe MDIO bus\n");
 -              goto err_free_irq;
 +              goto err_free_dead_hp;
        }
  
        mvneta_start_dev(pp);
  
        return 0;
  
 +err_free_dead_hp:
 +      cpuhp_state_remove_instance_nocalls(CPUHP_NET_MVNETA_DEAD,
 +                                          &pp->node_dead);
 +err_free_online_hp:
 +      cpuhp_state_remove_instance_nocalls(online_hpstate, &pp->node_online);
  err_free_irq:
 -      unregister_cpu_notifier(&pp->cpu_notifier);
        on_each_cpu(mvneta_percpu_disable, pp, true);
        free_percpu_irq(pp->dev->irq, pp->ports);
  err_cleanup_txqs:
@@@ -3501,10 -3487,7 +3504,10 @@@ static int mvneta_stop(struct net_devic
  
        mvneta_stop_dev(pp);
        mvneta_mdio_remove(pp);
 -      unregister_cpu_notifier(&pp->cpu_notifier);
 +
 +      cpuhp_state_remove_instance_nocalls(online_hpstate, &pp->node_online);
 +      cpuhp_state_remove_instance_nocalls(CPUHP_NET_MVNETA_DEAD,
 +                                          &pp->node_dead);
        on_each_cpu(mvneta_percpu_disable, pp, true);
        free_percpu_irq(dev->irq, pp->ports);
        mvneta_cleanup_rxqs(pp);
  
  static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
  {
-       struct mvneta_port *pp = netdev_priv(dev);
-       if (!pp->phy_dev)
+       if (!dev->phydev)
                return -ENOTSUPP;
  
-       return phy_mii_ioctl(pp->phy_dev, ifr, cmd);
+       return phy_mii_ioctl(dev->phydev, ifr, cmd);
  }
  
  /* Ethtool methods */
  
- /* Get settings (phy address, speed) for ethtools */
- int mvneta_ethtool_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ /* Set link ksettings (phy address, speed) for ethtools */
+ static int
+ mvneta_ethtool_set_link_ksettings(struct net_device *ndev,
+                                 const struct ethtool_link_ksettings *cmd)
  {
-       struct mvneta_port *pp = netdev_priv(dev);
-       if (!pp->phy_dev)
-               return -ENODEV;
-       return phy_ethtool_gset(pp->phy_dev, cmd);
- }
- /* Set settings (phy address, speed) for ethtools */
- int mvneta_ethtool_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
- {
-       struct mvneta_port *pp = netdev_priv(dev);
-       struct phy_device *phydev = pp->phy_dev;
+       struct mvneta_port *pp = netdev_priv(ndev);
+       struct phy_device *phydev = ndev->phydev;
  
        if (!phydev)
                return -ENODEV;
  
-       if ((cmd->autoneg == AUTONEG_ENABLE) != pp->use_inband_status) {
+       if ((cmd->base.autoneg == AUTONEG_ENABLE) != pp->use_inband_status) {
                u32 val;
  
-               mvneta_set_autoneg(pp, cmd->autoneg == AUTONEG_ENABLE);
+               mvneta_set_autoneg(pp, cmd->base.autoneg == AUTONEG_ENABLE);
  
-               if (cmd->autoneg == AUTONEG_DISABLE) {
+               if (cmd->base.autoneg == AUTONEG_DISABLE) {
                        val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
                        val &= ~(MVNETA_GMAC_CONFIG_MII_SPEED |
                                 MVNETA_GMAC_CONFIG_GMII_SPEED |
                        mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
                }
  
-               pp->use_inband_status = (cmd->autoneg == AUTONEG_ENABLE);
+               pp->use_inband_status = (cmd->base.autoneg == AUTONEG_ENABLE);
                netdev_info(pp->dev, "autoneg status set to %i\n",
                            pp->use_inband_status);
  
-               if (netif_running(dev)) {
+               if (netif_running(ndev)) {
                        mvneta_port_down(pp);
                        mvneta_port_up(pp);
                }
        }
  
-       return phy_ethtool_sset(pp->phy_dev, cmd);
+       return phy_ethtool_ksettings_set(ndev->phydev, cmd);
  }
  
  /* Set interrupt coalescing for ethtools */
@@@ -3841,8 -3813,6 +3833,6 @@@ static const struct net_device_ops mvne
  
  const struct ethtool_ops mvneta_eth_tool_ops = {
        .get_link       = ethtool_op_get_link,
-       .get_settings   = mvneta_ethtool_get_settings,
-       .set_settings   = mvneta_ethtool_set_settings,
        .set_coalesce   = mvneta_ethtool_set_coalesce,
        .get_coalesce   = mvneta_ethtool_get_coalesce,
        .get_drvinfo    = mvneta_ethtool_get_drvinfo,
        .get_rxnfc      = mvneta_ethtool_get_rxnfc,
        .get_rxfh       = mvneta_ethtool_get_rxfh,
        .set_rxfh       = mvneta_ethtool_set_rxfh,
+       .get_link_ksettings = phy_ethtool_get_link_ksettings,
+       .set_link_ksettings = mvneta_ethtool_set_link_ksettings,
  };
  
  /* Initialize hw */
@@@ -4044,6 -4016,7 +4036,6 @@@ static int mvneta_probe(struct platform
        err = of_property_read_string(dn, "managed", &managed);
        pp->use_inband_status = (err == 0 &&
                                 strcmp(managed, "in-band-status") == 0);
 -      pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
  
        pp->rxq_def = rxq_def;
  
@@@ -4246,42 -4219,7 +4238,42 @@@ static struct platform_driver mvneta_dr
        },
  };
  
 -module_platform_driver(mvneta_driver);
 +static int __init mvneta_driver_init(void)
 +{
 +      int ret;
 +
 +      ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "net/mvmeta:online",
 +                                    mvneta_cpu_online,
 +                                    mvneta_cpu_down_prepare);
 +      if (ret < 0)
 +              goto out;
 +      online_hpstate = ret;
 +      ret = cpuhp_setup_state_multi(CPUHP_NET_MVNETA_DEAD, "net/mvneta:dead",
 +                                    NULL, mvneta_cpu_dead);
 +      if (ret)
 +              goto err_dead;
 +
 +      ret = platform_driver_register(&mvneta_driver);
 +      if (ret)
 +              goto err;
 +      return 0;
 +
 +err:
 +      cpuhp_remove_multi_state(CPUHP_NET_MVNETA_DEAD);
 +err_dead:
 +      cpuhp_remove_multi_state(online_hpstate);
 +out:
 +      return ret;
 +}
 +module_init(mvneta_driver_init);
 +
 +static void __exit mvneta_driver_exit(void)
 +{
 +      platform_driver_unregister(&mvneta_driver);
 +      cpuhp_remove_multi_state(CPUHP_NET_MVNETA_DEAD);
 +      cpuhp_remove_multi_state(online_hpstate);
 +}
 +module_exit(mvneta_driver_exit);
  
  MODULE_DESCRIPTION("Marvell NETA Ethernet Driver - www.marvell.com");
  MODULE_AUTHOR("Rami Rosen <rosenr@marvell.com>, Thomas Petazzoni <thomas.petazzoni@free-electrons.com>");
@@@ -10,7 -10,6 +10,7 @@@
  #define  BCMA_CLKCTLST_HAVEALPREQ     0x00000008 /* ALP available request */
  #define  BCMA_CLKCTLST_HAVEHTREQ      0x00000010 /* HT available request */
  #define  BCMA_CLKCTLST_HWCROFF                0x00000020 /* Force HW clock request off */
 +#define  BCMA_CLKCTLST_HQCLKREQ               0x00000040 /* HQ Clock */
  #define  BCMA_CLKCTLST_EXTRESREQ      0x00000700 /* Mask of external resource requests */
  #define  BCMA_CLKCTLST_EXTRESREQ_SHIFT        8
  #define  BCMA_CLKCTLST_HAVEALP                0x00010000 /* ALP available */
@@@ -24,6 -23,7 +24,7 @@@
  #define  BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */
  
  /* Agent registers (common for every core) */
+ #define BCMA_OOB_SEL_OUT_A30          0x0100
  #define BCMA_IOCTL                    0x0408 /* IO control */
  #define  BCMA_IOCTL_CLK                       0x0001
  #define  BCMA_IOCTL_FGC                       0x0002
diff --combined include/linux/hyperv.h
@@@ -674,11 -674,6 +674,11 @@@ enum hv_signal_policy 
        HV_SIGNAL_POLICY_EXPLICIT,
  };
  
 +enum hv_numa_policy {
 +      HV_BALANCED = 0,
 +      HV_LOCALIZED,
 +};
 +
  enum vmbus_device_type {
        HV_IDE = 0,
        HV_SCSI,
@@@ -706,6 -701,9 +706,6 @@@ struct vmbus_device 
  };
  
  struct vmbus_channel {
 -      /* Unique channel id */
 -      int id;
 -
        struct list_head listentry;
  
        struct hv_device *device_obj;
         * ring lock to preserve the current behavior.
         */
        bool acquire_ring_lock;
 +      /*
 +       * For performance critical channels (storage, networking
 +       * etc,), Hyper-V has a mechanism to enhance the throughput
 +       * at the expense of latency:
 +       * When the host is to be signaled, we just set a bit in a shared page
 +       * and this bit will be inspected by the hypervisor within a certain
 +       * window and if the bit is set, the host will be signaled. The window
 +       * of time is the monitor latency - currently around 100 usecs. This
 +       * mechanism improves throughput by:
 +       *
 +       * A) Making the host more efficient - each time it wakes up,
 +       *    potentially it will process morev number of packets. The
 +       *    monitor latency allows a batch to build up.
 +       * B) By deferring the hypercall to signal, we will also minimize
 +       *    the interrupts.
 +       *
 +       * Clearly, these optimizations improve throughput at the expense of
 +       * latency. Furthermore, since the channel is shared for both
 +       * control and data messages, control messages currently suffer
 +       * unnecessary latency adversley impacting performance and boot
 +       * time. To fix this issue, permit tagging the channel as being
 +       * in "low latency" mode. In this mode, we will bypass the monitor
 +       * mechanism.
 +       */
 +      bool low_latency;
 +
 +      /*
 +       * NUMA distribution policy:
 +       * We support teo policies:
 +       * 1) Balanced: Here all performance critical channels are
 +       *    distributed evenly amongst all the NUMA nodes.
 +       *    This policy will be the default policy.
 +       * 2) Localized: All channels of a given instance of a
 +       *    performance critical service will be assigned CPUs
 +       *    within a selected NUMA node.
 +       */
 +      enum hv_numa_policy affinity_policy;
  
  };
  
@@@ -909,12 -870,6 +909,12 @@@ static inline void set_channel_signal_s
        c->signal_policy = policy;
  }
  
 +static inline void set_channel_affinity_state(struct vmbus_channel *c,
 +                                            enum hv_numa_policy policy)
 +{
 +      c->affinity_policy = policy;
 +}
 +
  static inline void set_channel_read_state(struct vmbus_channel *c, bool state)
  {
        c->batched_reading = state;
@@@ -936,16 -891,6 +936,16 @@@ static inline void set_channel_pending_
        c->outbound.ring_buffer->pending_send_sz = size;
  }
  
 +static inline void set_low_latency_mode(struct vmbus_channel *c)
 +{
 +      c->low_latency = true;
 +}
 +
 +static inline void clear_low_latency_mode(struct vmbus_channel *c)
 +{
 +      c->low_latency = false;
 +}
 +
  void vmbus_onmessage(void *context);
  
  int vmbus_request_offers(void);
@@@ -1169,6 -1114,13 +1169,13 @@@ int __must_check __vmbus_driver_registe
                                         const char *mod_name);
  void vmbus_driver_unregister(struct hv_driver *hv_driver);
  
+ static inline const char *vmbus_dev_name(const struct hv_device *device_obj)
+ {
+       const struct kobject *kobj = &device_obj->device.kobj;
+       return kobj->name;
+ }
  void vmbus_hvsock_device_unregister(struct vmbus_channel *channel);
  
  int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj,
@@@ -1311,27 -1263,6 +1318,27 @@@ u64 hv_do_hypercall(u64 control, void *
        .guid = UUID_LE(0x44c4f61d, 0x4444, 0x4400, 0x9d, 0x52, \
                        0x80, 0x2e, 0x27, 0xed, 0xe1, 0x9f)
  
 +/*
 + * Linux doesn't support the 3 devices: the first two are for
 + * Automatic Virtual Machine Activation, and the third is for
 + * Remote Desktop Virtualization.
 + * {f8e65716-3cb3-4a06-9a60-1889c5cccab5}
 + * {3375baf4-9e15-4b30-b765-67acb10d607b}
 + * {276aacf4-ac15-426c-98dd-7521ad3f01fe}
 + */
 +
 +#define HV_AVMA1_GUID \
 +      .guid = UUID_LE(0xf8e65716, 0x3cb3, 0x4a06, 0x9a, 0x60, \
 +                      0x18, 0x89, 0xc5, 0xcc, 0xca, 0xb5)
 +
 +#define HV_AVMA2_GUID \
 +      .guid = UUID_LE(0x3375baf4, 0x9e15, 0x4b30, 0xb7, 0x65, \
 +                      0x67, 0xac, 0xb1, 0x0d, 0x60, 0x7b)
 +
 +#define HV_RDV_GUID \
 +      .guid = UUID_LE(0x276aacf4, 0xac15, 0x426c, 0x98, 0xdd, \
 +                      0x75, 0x21, 0xad, 0x3f, 0x01, 0xfe)
 +
  /*
   * Common header for Hyper-V ICs
   */
@@@ -1420,15 -1351,6 +1427,15 @@@ struct ictimesync_data 
        u8 flags;
  } __packed;
  
 +struct ictimesync_ref_data {
 +      u64 parenttime;
 +      u64 vmreferencetime;
 +      u8 flags;
 +      char leapflags;
 +      char stratum;
 +      u8 reserved[3];
 +} __packed;
 +
  struct hyperv_service_callback {
        u8 msg_type;
        char *log_msg;
@@@ -1442,9 -1364,6 +1449,9 @@@ extern bool vmbus_prep_negotiate_resp(s
                                        struct icmsg_negotiate *, u8 *, int,
                                        int);
  
 +void hv_event_tasklet_disable(struct vmbus_channel *channel);
 +void hv_event_tasklet_enable(struct vmbus_channel *channel);
 +
  void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid);
  
  /*
diff --combined include/linux/ktime.h
@@@ -63,13 -63,6 +63,13 @@@ static inline ktime_t ktime_set(const s
  #define ktime_add(lhs, rhs) \
                ({ (ktime_t){ .tv64 = (lhs).tv64 + (rhs).tv64 }; })
  
 +/*
 + * Same as ktime_add(), but avoids undefined behaviour on overflow; however,
 + * this means that you must check the result for overflow yourself.
 + */
 +#define ktime_add_unsafe(lhs, rhs) \
 +              ({ (ktime_t){ .tv64 = (u64) (lhs).tv64 + (rhs).tv64 }; })
 +
  /*
   * Add a ktime_t variable and a scalar nanosecond value.
   * res = kt + nsval:
@@@ -238,6 -231,11 +238,11 @@@ static inline ktime_t ktime_sub_us(cons
        return ktime_sub_ns(kt, usec * NSEC_PER_USEC);
  }
  
+ static inline ktime_t ktime_sub_ms(const ktime_t kt, const u64 msec)
+ {
+       return ktime_sub_ns(kt, msec * NSEC_PER_MSEC);
+ }
  extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
  
  /**
@@@ -510,15 -510,9 +510,15 @@@ typedef void (*perf_overflow_handler_t)
                                        struct perf_sample_data *,
                                        struct pt_regs *regs);
  
 -enum perf_group_flag {
 -      PERF_GROUP_SOFTWARE             = 0x1,
 -};
 +/*
 + * Event capabilities. For event_caps and groups caps.
 + *
 + * PERF_EV_CAP_SOFTWARE: Is a software event.
 + * PERF_EV_CAP_READ_ACTIVE_PKG: A CPU event (or cgroup event) that can be read
 + * from any CPU in the package where it is active.
 + */
 +#define PERF_EV_CAP_SOFTWARE          BIT(0)
 +#define PERF_EV_CAP_READ_ACTIVE_PKG   BIT(1)
  
  #define SWEVENT_HLIST_BITS            8
  #define SWEVENT_HLIST_SIZE            (1 << SWEVENT_HLIST_BITS)
@@@ -574,12 -568,7 +574,12 @@@ struct perf_event 
        struct hlist_node               hlist_entry;
        struct list_head                active_entry;
        int                             nr_siblings;
 -      int                             group_flags;
 +
 +      /* Not serialized. Only written during event initialization. */
 +      int                             event_caps;
 +      /* The cumulative AND of all event_caps for events in this group. */
 +      int                             group_caps;
 +
        struct perf_event               *group_leader;
        struct pmu                      *pmu;
        void                            *pmu_private;
        u64                             (*clock)(void);
        perf_overflow_handler_t         overflow_handler;
        void                            *overflow_handler_context;
+ #ifdef CONFIG_BPF_SYSCALL
+       perf_overflow_handler_t         orig_overflow_handler;
+       struct bpf_prog                 *prog;
+ #endif
  
  #ifdef CONFIG_EVENT_TRACING
        struct trace_event_call         *tp_event;
@@@ -785,9 -778,6 +789,9 @@@ struct perf_cpu_context 
  #ifdef CONFIG_CGROUP_PERF
        struct perf_cgroup              *cgrp;
  #endif
 +
 +      struct list_head                sched_cb_entry;
 +      int                             sched_cb_usage;
  };
  
  struct perf_output_handle {
        int                             page;
  };
  
+ struct bpf_perf_event_data_kern {
+       struct pt_regs *regs;
+       struct perf_sample_data *data;
+ };
  #ifdef CONFIG_CGROUP_PERF
  
  /*
@@@ -999,7 -994,7 +1008,7 @@@ static inline bool is_sampling_event(st
   */
  static inline int is_software_event(struct perf_event *event)
  {
 -      return event->pmu->task_ctx_nr == perf_sw_context;
 +      return event->event_caps & PERF_EV_CAP_SOFTWARE;
  }
  
  extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX];
diff --combined kernel/events/core.c
@@@ -1475,7 -1475,8 +1475,7 @@@ list_add_event(struct perf_event *event
        if (event->group_leader == event) {
                struct list_head *list;
  
 -              if (is_software_event(event))
 -                      event->group_flags |= PERF_GROUP_SOFTWARE;
 +              event->group_caps = event->event_caps;
  
                list = ctx_group_list(event, ctx);
                list_add_tail(&event->group_entry, list);
@@@ -1629,7 -1630,9 +1629,7 @@@ static void perf_group_attach(struct pe
  
        WARN_ON_ONCE(group_leader->ctx != event->ctx);
  
 -      if (group_leader->group_flags & PERF_GROUP_SOFTWARE &&
 -                      !is_software_event(event))
 -              group_leader->group_flags &= ~PERF_GROUP_SOFTWARE;
 +      group_leader->group_caps &= event->event_caps;
  
        list_add_tail(&event->group_entry, &group_leader->sibling_list);
        group_leader->nr_siblings++;
@@@ -1720,7 -1723,7 +1720,7 @@@ static void perf_group_detach(struct pe
                sibling->group_leader = sibling;
  
                /* Inherit group flags from the previous leader */
 -              sibling->group_flags = event->group_flags;
 +              sibling->group_caps = event->group_caps;
  
                WARN_ON_ONCE(sibling->ctx != event->ctx);
        }
@@@ -1829,8 -1832,6 +1829,8 @@@ group_sched_out(struct perf_event *grou
        struct perf_event *event;
        int state = group_event->state;
  
 +      perf_pmu_disable(ctx->pmu);
 +
        event_sched_out(group_event, cpuctx, ctx);
  
        /*
        list_for_each_entry(event, &group_event->sibling_list, group_entry)
                event_sched_out(event, cpuctx, ctx);
  
 +      perf_pmu_enable(ctx->pmu);
 +
        if (state == PERF_EVENT_STATE_ACTIVE && group_event->attr.exclusive)
                cpuctx->exclusive = 0;
  }
@@@ -2146,7 -2145,7 +2146,7 @@@ static int group_can_go_on(struct perf_
        /*
         * Groups consisting entirely of software events can always go on.
         */
 -      if (event->group_flags & PERF_GROUP_SOFTWARE)
 +      if (event->group_caps & PERF_EV_CAP_SOFTWARE)
                return 1;
        /*
         * If an exclusive group is already on, no other hardware
@@@ -2492,7 -2491,7 +2492,7 @@@ static int __perf_event_stop(void *info
         * while restarting.
         */
        if (sd->restart)
 -              event->pmu->start(event, PERF_EF_START);
 +              event->pmu->start(event, 0);
  
        return 0;
  }
@@@ -2838,36 -2837,19 +2838,36 @@@ unlock
        }
  }
  
 +static DEFINE_PER_CPU(struct list_head, sched_cb_list);
 +
  void perf_sched_cb_dec(struct pmu *pmu)
  {
 +      struct perf_cpu_context *cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
 +
        this_cpu_dec(perf_sched_cb_usages);
 +
 +      if (!--cpuctx->sched_cb_usage)
 +              list_del(&cpuctx->sched_cb_entry);
  }
  
 +
  void perf_sched_cb_inc(struct pmu *pmu)
  {
 +      struct perf_cpu_context *cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
 +
 +      if (!cpuctx->sched_cb_usage++)
 +              list_add(&cpuctx->sched_cb_entry, this_cpu_ptr(&sched_cb_list));
 +
        this_cpu_inc(perf_sched_cb_usages);
  }
  
  /*
   * This function provides the context switch callback to the lower code
   * layer. It is invoked ONLY when the context switch callback is enabled.
 + *
 + * This callback is relevant even to per-cpu events; for example multi event
 + * PEBS requires this to provide PID/TID information. This requires we flush
 + * all queued PEBS records before we context switch to a new task.
   */
  static void perf_pmu_sched_task(struct task_struct *prev,
                                struct task_struct *next,
  {
        struct perf_cpu_context *cpuctx;
        struct pmu *pmu;
 -      unsigned long flags;
  
        if (prev == next)
                return;
  
 -      local_irq_save(flags);
 -
 -      rcu_read_lock();
 -
 -      list_for_each_entry_rcu(pmu, &pmus, entry) {
 -              if (pmu->sched_task) {
 -                      cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
 -
 -                      perf_ctx_lock(cpuctx, cpuctx->task_ctx);
 +      list_for_each_entry(cpuctx, this_cpu_ptr(&sched_cb_list), sched_cb_entry) {
 +              pmu = cpuctx->unique_pmu; /* software PMUs will not have sched_task */
  
 -                      perf_pmu_disable(pmu);
 +              if (WARN_ON_ONCE(!pmu->sched_task))
 +                      continue;
  
 -                      pmu->sched_task(cpuctx->task_ctx, sched_in);
 +              perf_ctx_lock(cpuctx, cpuctx->task_ctx);
 +              perf_pmu_disable(pmu);
  
 -                      perf_pmu_enable(pmu);
 +              pmu->sched_task(cpuctx->task_ctx, sched_in);
  
 -                      perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
 -              }
 +              perf_pmu_enable(pmu);
 +              perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
        }
 -
 -      rcu_read_unlock();
 -
 -      local_irq_restore(flags);
  }
  
  static void perf_event_switch(struct task_struct *task,
@@@ -3424,22 -3416,6 +3424,22 @@@ struct perf_read_data 
        int ret;
  };
  
 +static int find_cpu_to_read(struct perf_event *event, int local_cpu)
 +{
 +      int event_cpu = event->oncpu;
 +      u16 local_pkg, event_pkg;
 +
 +      if (event->group_caps & PERF_EV_CAP_READ_ACTIVE_PKG) {
 +              event_pkg =  topology_physical_package_id(event_cpu);
 +              local_pkg =  topology_physical_package_id(local_cpu);
 +
 +              if (event_pkg == local_pkg)
 +                      return local_cpu;
 +      }
 +
 +      return event_cpu;
 +}
 +
  /*
   * Cross CPU call to read the hardware event
   */
@@@ -3561,7 -3537,7 +3561,7 @@@ u64 perf_event_read_local(struct perf_e
  
  static int perf_event_read(struct perf_event *event, bool group)
  {
 -      int ret = 0;
 +      int ret = 0, cpu_to_read, local_cpu;
  
        /*
         * If event is enabled and currently active on a CPU, update the
                        .group = group,
                        .ret = 0,
                };
 +
 +              local_cpu = get_cpu();
 +              cpu_to_read = find_cpu_to_read(event, local_cpu);
 +              put_cpu();
 +
                /*
                 * Purposely ignore the smp_call_function_single() return
                 * value.
                 * Therefore, either way, we'll have an up-to-date event count
                 * after this.
                 */
 -              (void)smp_call_function_single(event->oncpu, __perf_event_read, &data, 1);
 +              (void)smp_call_function_single(cpu_to_read, __perf_event_read, &data, 1);
                ret = data.ret;
        } else if (event->state == PERF_EVENT_STATE_INACTIVE) {
                struct perf_event_context *ctx = event->ctx;
@@@ -5379,10 -5350,9 +5379,10 @@@ perf_output_sample_regs(struct perf_out
                        struct pt_regs *regs, u64 mask)
  {
        int bit;
 +      DECLARE_BITMAP(_mask, 64);
  
 -      for_each_set_bit(bit, (const unsigned long *) &mask,
 -                       sizeof(mask) * BITS_PER_BYTE) {
 +      bitmap_from_u64(_mask, mask);
 +      for_each_set_bit(bit, _mask, sizeof(mask) * BITS_PER_BYTE) {
                u64 val;
  
                val = perf_reg_value(regs, bit);
@@@ -7079,7 -7049,7 +7079,7 @@@ static int __perf_event_overflow(struc
                irq_work_queue(&event->pending);
        }
  
-       event->overflow_handler(event, data, regs);
+       READ_ONCE(event->overflow_handler)(event, data, regs);
  
        if (*perf_event_fasync(event) && event->pending_kill) {
                event->pending_wakeup = 1;
@@@ -7694,11 -7664,83 +7694,83 @@@ static void perf_event_free_filter(stru
        ftrace_profile_free_filter(event);
  }
  
+ #ifdef CONFIG_BPF_SYSCALL
+ static void bpf_overflow_handler(struct perf_event *event,
+                                struct perf_sample_data *data,
+                                struct pt_regs *regs)
+ {
+       struct bpf_perf_event_data_kern ctx = {
+               .data = data,
+               .regs = regs,
+       };
+       int ret = 0;
+       preempt_disable();
+       if (unlikely(__this_cpu_inc_return(bpf_prog_active) != 1))
+               goto out;
+       rcu_read_lock();
+       ret = BPF_PROG_RUN(event->prog, (void *)&ctx);
+       rcu_read_unlock();
+ out:
+       __this_cpu_dec(bpf_prog_active);
+       preempt_enable();
+       if (!ret)
+               return;
+       event->orig_overflow_handler(event, data, regs);
+ }
+ static int perf_event_set_bpf_handler(struct perf_event *event, u32 prog_fd)
+ {
+       struct bpf_prog *prog;
+       if (event->overflow_handler_context)
+               /* hw breakpoint or kernel counter */
+               return -EINVAL;
+       if (event->prog)
+               return -EEXIST;
+       prog = bpf_prog_get_type(prog_fd, BPF_PROG_TYPE_PERF_EVENT);
+       if (IS_ERR(prog))
+               return PTR_ERR(prog);
+       event->prog = prog;
+       event->orig_overflow_handler = READ_ONCE(event->overflow_handler);
+       WRITE_ONCE(event->overflow_handler, bpf_overflow_handler);
+       return 0;
+ }
+ static void perf_event_free_bpf_handler(struct perf_event *event)
+ {
+       struct bpf_prog *prog = event->prog;
+       if (!prog)
+               return;
+       WRITE_ONCE(event->overflow_handler, event->orig_overflow_handler);
+       event->prog = NULL;
+       bpf_prog_put(prog);
+ }
+ #else
+ static int perf_event_set_bpf_handler(struct perf_event *event, u32 prog_fd)
+ {
+       return -EOPNOTSUPP;
+ }
+ static void perf_event_free_bpf_handler(struct perf_event *event)
+ {
+ }
+ #endif
  static int perf_event_set_bpf_prog(struct perf_event *event, u32 prog_fd)
  {
        bool is_kprobe, is_tracepoint;
        struct bpf_prog *prog;
  
+       if (event->attr.type == PERF_TYPE_HARDWARE ||
+           event->attr.type == PERF_TYPE_SOFTWARE)
+               return perf_event_set_bpf_handler(event, prog_fd);
        if (event->attr.type != PERF_TYPE_TRACEPOINT)
                return -EINVAL;
  
@@@ -7739,6 -7781,8 +7811,8 @@@ static void perf_event_free_bpf_prog(st
  {
        struct bpf_prog *prog;
  
+       perf_event_free_bpf_handler(event);
        if (!event->tp_event)
                return;
  
@@@ -9055,6 -9099,19 +9129,19 @@@ perf_event_alloc(struct perf_event_att
        if (!overflow_handler && parent_event) {
                overflow_handler = parent_event->overflow_handler;
                context = parent_event->overflow_handler_context;
+ #if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_EVENT_TRACING)
+               if (overflow_handler == bpf_overflow_handler) {
+                       struct bpf_prog *prog = bpf_prog_inc(parent_event->prog);
+                       if (IS_ERR(prog)) {
+                               err = PTR_ERR(prog);
+                               goto err_ns;
+                       }
+                       event->prog = prog;
+                       event->orig_overflow_handler =
+                               parent_event->orig_overflow_handler;
+               }
+ #endif
        }
  
        if (overflow_handler) {
@@@ -9535,9 -9592,6 +9622,9 @@@ SYSCALL_DEFINE5(perf_event_open
                        goto err_alloc;
        }
  
 +      if (pmu->task_ctx_nr == perf_sw_context)
 +              event->event_caps |= PERF_EV_CAP_SOFTWARE;
 +
        if (group_leader &&
            (is_software_event(event) != is_software_event(group_leader))) {
                if (is_software_event(event)) {
                         */
                        pmu = group_leader->pmu;
                } else if (is_software_event(group_leader) &&
 -                         (group_leader->group_flags & PERF_GROUP_SOFTWARE)) {
 +                         (group_leader->group_caps & PERF_EV_CAP_SOFTWARE)) {
                        /*
                         * In case the group is a pure software group, and we
                         * try to add a hardware event, move the whole group to
@@@ -10486,8 -10540,6 +10573,8 @@@ static void __init perf_event_init_all_
  
                INIT_LIST_HEAD(&per_cpu(pmu_sb_events.list, cpu));
                raw_spin_lock_init(&per_cpu(pmu_sb_events.lock, cpu));
 +
 +              INIT_LIST_HEAD(&per_cpu(sched_cb_list, cpu));
        }
  }