1. Nov 07, 2019
    • Brice Goglin's avatar
      ACPI: HMAT: don't mix pxm and nid when setting memory target processor_pxm · 4caa525b
      Brice Goglin authored
      
      
      On systems where PXMs and nids are in different order, memory initiators
      exposed in sysfs could be wrong: On dual-socket CLX with SNC enabled
      (4 nodes, 1 and 2 swapped between PXMs and nids), node1 would only
      get node2 as initiator, and node2 would only get node1.
      
      With this patch, we get node1 as the only initiator of itself,
      and node2 as the only initiator of itself, as expected.
      
      This should likely go to stable up to 5.2.
      
      Signed-off-by: default avatarBrice Goglin <Brice.Goglin@inria.fr>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4caa525b
    • Dan Williams's avatar
      ACPI: NUMA: HMAT: Register "soft reserved" memory as an "hmem" device · cf8741ac
      Dan Williams authored
      
      
      Memory that has been tagged EFI_MEMORY_SP, and has performance
      properties described by the ACPI HMAT is expected to have an application
      specific consumer.
      
      Those consumers may want 100% of the memory capacity to be reserved from
      any usage by the kernel. By default, with this enabling, a platform
      device is created to represent this differentiated resource.
      
      The device-dax "hmem" driver claims these devices by default and
      provides an mmap interface for the target application.  If the
      administrator prefers, the hmem resource range can be made available to
      the core-mm via the device-dax hotplug facility, kmem, to online the
      memory with its own numa node.
      
      This was tested with an emulated HMAT produced by qemu (with the pending
      HMAT enabling patches), and "efi_fake_mem=8G@9G:0x40000" on the kernel
      command line to mark the memory ranges associated with node2 and node3
      as EFI_MEMORY_SP.
      
      qemu numa configuration options:
      
      -numa node,mem=4G,cpus=0-19,nodeid=0
      -numa node,mem=4G,cpus=20-39,nodeid=1
      -numa node,mem=4G,nodeid=2
      -numa node,mem=4G,nodeid=3
      -numa dist,src=0,dst=0,val=10
      -numa dist,src=0,dst=1,val=21
      -numa dist,src=0,dst=2,val=21
      -numa dist,src=0,dst=3,val=21
      -numa dist,src=1,dst=0,val=21
      -numa dist,src=1,dst=1,val=10
      -numa dist,src=1,dst=2,val=21
      -numa dist,src=1,dst=3,val=21
      -numa dist,src=2,dst=0,val=21
      -numa dist,src=2,dst=1,val=21
      -numa dist,src=2,dst=2,val=10
      -numa dist,src=2,dst=3,val=21
      -numa dist,src=3,dst=0,val=21
      -numa dist,src=3,dst=1,val=21
      -numa dist,src=3,dst=2,val=21
      -numa dist,src=3,dst=3,val=10
      -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,base-lat=10,latency=5
      -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=5
      -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,base-lat=10,latency=10
      -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=10
      -numa hmat-lb,initiator=0,target=2,hierarchy=memory,data-type=access-latency,base-lat=10,latency=15
      -numa hmat-lb,initiator=0,target=2,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=15
      -numa hmat-lb,initiator=0,target=3,hierarchy=memory,data-type=access-latency,base-lat=10,latency=20
      -numa hmat-lb,initiator=0,target=3,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=20
      -numa hmat-lb,initiator=1,target=0,hierarchy=memory,data-type=access-latency,base-lat=10,latency=10
      -numa hmat-lb,initiator=1,target=0,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=10
      -numa hmat-lb,initiator=1,target=1,hierarchy=memory,data-type=access-latency,base-lat=10,latency=5
      -numa hmat-lb,initiator=1,target=1,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=5
      -numa hmat-lb,initiator=1,target=2,hierarchy=memory,data-type=access-latency,base-lat=10,latency=15
      -numa hmat-lb,initiator=1,target=2,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=15
      -numa hmat-lb,initiator=1,target=3,hierarchy=memory,data-type=access-latency,base-lat=10,latency=20
      -numa hmat-lb,initiator=1,target=3,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=20
      
      Result:
      
      [
        {
          "path":"\/platform\/hmem.1",
          "id":1,
          "size":"4.00 GiB (4.29 GB)",
          "align":2097152,
          "devices":[
            {
              "chardev":"dax1.0",
              "size":"4.00 GiB (4.29 GB)"
            }
          ]
        },
        {
          "path":"\/platform\/hmem.0",
          "id":0,
          "size":"4.00 GiB (4.29 GB)",
          "align":2097152,
          "devices":[
            {
              "chardev":"dax0.0",
              "size":"4.00 GiB (4.29 GB)"
            }
          ]
        }
      ]
      
      [..]
      240000000-43fffffff : Soft Reserved
        240000000-33fffffff : hmem.0
          240000000-33fffffff : dax0.0
        340000000-43fffffff : hmem.1
          340000000-43fffffff : dax1.0
      
      Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cf8741ac
    • Dan Williams's avatar
      ACPI: NUMA: HMAT: Register HMAT at device_initcall level · 0f847f8c
      Dan Williams authored
      
      
      In preparation for registering device-dax instances for accessing EFI
      specific-purpose memory, arrange for the HMAT registration to occur
      later in the init process. Critically HMAT initialization needs to occur
      after e820__reserve_resources_late() which is the point at which the
      iomem resource tree is populated with "Application Reserved"
      (IORES_DESC_APPLICATION_RESERVED). e820__reserve_resources_late()
      happens at subsys_initcall time.
      
      Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0f847f8c
    • Dan Williams's avatar
      device-dax: Add a driver for "hmem" devices · a6c7f4c6
      Dan Williams authored
      
      
      Platform firmware like EFI/ACPI may publish "hmem" platform devices.
      Such a device is a performance differentiated memory range likely
      reserved for an application specific use case. The driver gives access
      to 100% of the capacity via a device-dax mmap instance by default.
      
      However, if over-subscription and other kernel memory management is
      desired the resulting dax device can be assigned to the core-mm via the
      kmem driver.
      
      This consumes "hmem" devices the producer of "hmem" devices is saved for
      a follow-on patch so that it can reference the new CONFIG_DEV_DAX_HMEM
      symbol to gate performing the enumeration work.
      
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a6c7f4c6
    • Dan Williams's avatar
      dax: Fix alloc_dax_region() compile warning · 460370ab
      Dan Williams authored
      
      
      PFN flags are (unsigned long long), fix the alloc_dax_region() calling
      convention to fix warnings of the form:
      
      >> include/linux/pfn_t.h:18:17: warning: large integer implicitly truncated to unsigned type [-Woverflow]
          #define PFN_DEV (1ULL << (BITS_PER_LONG_LONG - 3))
      
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      460370ab
    • Dan Williams's avatar
      lib: Uplevel the pmem "region" ida to a global allocator · 33dd7075
      Dan Williams authored
      
      
      In preparation for handling platform differentiated memory types beyond
      persistent memory, uplevel the "region" identifier to a global number
      space. This enables a device-dax instance to be registered to any memory
      type with guaranteed unique names.
      
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      33dd7075
    • Dan Williams's avatar
      x86/efi: Add efi_fake_mem support for EFI_MEMORY_SP · 199c8471
      Dan Williams authored
      
      
      Given that EFI_MEMORY_SP is platform BIOS policy decision for marking
      memory ranges as "reserved for a specific purpose" there will inevitably
      be scenarios where the BIOS omits the attribute in situations where it
      is desired. Unlike other attributes if the OS wants to reserve this
      memory from the kernel the reservation needs to happen early in init. So
      early, in fact, that it needs to happen before e820__memblock_setup()
      which is a pre-requisite for efi_fake_memmap() that wants to allocate
      memory for the updated table.
      
      Introduce an x86 specific efi_fake_memmap_early() that can search for
      attempts to set EFI_MEMORY_SP via efi_fake_mem and update the e820 table
      accordingly.
      
      The KASLR code that scans the command line looking for user-directed
      memory reservations also needs to be updated to consider
      "efi_fake_mem=nn@ss:0x40000" requests.
      
      Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      199c8471
    • Dan Williams's avatar
      arm/efi: EFI soft reservation to memblock · 16993c0f
      Dan Williams authored
      
      
      UEFI 2.8 defines an EFI_MEMORY_SP attribute bit to augment the
      interpretation of the EFI Memory Types as "reserved for a specific
      purpose".
      
      The proposed Linux behavior for specific purpose memory is that it is
      reserved for direct-access (device-dax) by default and not available for
      any kernel usage, not even as an OOM fallback.  Later, through udev
      scripts or another init mechanism, these device-dax claimed ranges can
      be reconfigured and hot-added to the available System-RAM with a unique
      node identifier. This device-dax management scheme implements "soft" in
      the "soft reserved" designation by allowing some or all of the
      reservation to be recovered as typical memory. This policy can be
      disabled at compile-time with CONFIG_EFI_SOFT_RESERVE=n, or runtime with
      efi=nosoftreserve.
      
      For this patch, update the ARM paths that consider
      EFI_CONVENTIONAL_MEMORY to optionally take the EFI_MEMORY_SP attribute
      into account as a reservation indicator. Publish the soft reservation as
      IORES_DESC_SOFT_RESERVED memory, similar to x86.
      
      (Based on an original patch by Ard)
      
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      16993c0f
    • Dan Williams's avatar
      x86/efi: EFI soft reservation to E820 enumeration · 262b45ae
      Dan Williams authored
      UEFI 2.8 defines an EFI_MEMORY_SP attribute bit to augment the
      interpretation of the EFI Memory Types as "reserved for a specific
      purpose".
      
      The proposed Linux behavior for specific purpose memory is that it is
      reserved for direct-access (device-dax) by default and not available for
      any kernel usage, not even as an OOM fallback.  Later, through udev
      scripts or another init mechanism, these device-dax claimed ranges can
      be reconfigured and hot-added to the available System-RAM with a unique
      node identifier. This device-dax management scheme implements "soft" in
      the "soft reserved" designation by allowing some or all of the
      reservation to be recovered as typical memory. This policy can be
      disabled at compile-time with CONFIG_EFI_SOFT_RESERVE=n, or runtime with
      efi=nosoftreserve.
      
      This patch introduces 2 new concepts at once given the entanglement
      between early boot enumeration relative to memory that can optionally be
      reserved from the kernel page allocator by default. The new concepts
      are:
      
      - E820_TYPE_SOFT_RESERVED: Upon detecting the EFI_MEMORY_SP
        attribute on EFI_CONVENTIONAL memory, update the E820 map with this
        new type. Only perform this classification if the
        CONFIG_EFI_SOFT_RESERVE=y policy is enabled, otherwise treat it as
        typical ram.
      
      - IORES_DESC_SOFT_RESERVED: Add a new I/O resource descriptor for
        a device driver to search iomem resources for application specific
        memory. Teach the iomem code to identify such ranges as "Soft Reserved".
      
      Note that the comment for do_add_efi_memmap() needed refreshing since it
      seemed to imply that the efi map might overflow the e820 table, but that
      is not an issue as of commit 7b6e4ba3
      
       "x86/boot/e820: Clean up the
      E820_X_MAX definition" that removed the 128 entry limit for
      e820__range_add().
      
      A follow-on change integrates parsing of the ACPI HMAT to identify the
      node and sub-range boundaries of EFI_MEMORY_SP designated memory. For
      now, just identify and reserve memory of this type.
      
      Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      262b45ae
    • Dan Williams's avatar
      efi: Common enable/disable infrastructure for EFI soft reservation · b617c526
      Dan Williams authored
      
      
      UEFI 2.8 defines an EFI_MEMORY_SP attribute bit to augment the
      interpretation of the EFI Memory Types as "reserved for a specific
      purpose".
      
      The proposed Linux behavior for specific purpose memory is that it is
      reserved for direct-access (device-dax) by default and not available for
      any kernel usage, not even as an OOM fallback.  Later, through udev
      scripts or another init mechanism, these device-dax claimed ranges can
      be reconfigured and hot-added to the available System-RAM with a unique
      node identifier. This device-dax management scheme implements "soft" in
      the "soft reserved" designation by allowing some or all of the
      reservation to be recovered as typical memory. This policy can be
      disabled at compile-time with CONFIG_EFI_SOFT_RESERVE=n, or runtime with
      efi=nosoftreserve.
      
      As for this patch, define the common helpers to determine if the
      EFI_MEMORY_SP attribute should be honored. The determination needs to be
      made early to prevent the kernel from being loaded into soft-reserved
      memory, or otherwise allowing early allocations to land there. Follow-on
      changes are needed per architecture to leverage these helpers in their
      respective mem-init paths.
      
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b617c526
    • Dan Williams's avatar
      x86/efi: Push EFI_MEMMAP check into leaf routines · 6950e31b
      Dan Williams authored
      
      
      In preparation for adding another EFI_MEMMAP dependent call that needs
      to occur before e820__memblock_setup() fixup the existing efi calls to
      check for EFI_MEMMAP internally. This ends up being cleaner than the
      alternative of checking EFI_MEMMAP multiple times in setup_arch().
      
      Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6950e31b
    • Dan Williams's avatar
      efi: Enumerate EFI_MEMORY_SP · fe3e5e65
      Dan Williams authored
      
      
      UEFI 2.8 defines an EFI_MEMORY_SP attribute bit to augment the
      interpretation of the EFI Memory Types as "reserved for a specific
      purpose". The intent of this bit is to allow the OS to identify precious
      or scarce memory resources and optionally manage it separately from
      EfiConventionalMemory. As defined older OSes that do not know about this
      attribute are permitted to ignore it and the memory will be handled
      according to the OS default policy for the given memory type.
      
      In other words, this "specific purpose" hint is deliberately weaker than
      EfiReservedMemoryType in that the system continues to operate if the OS
      takes no action on the attribute. The risk of taking no action is
      potentially unwanted / unmovable kernel allocations from the designated
      resource that prevent the full realization of the "specific purpose".
      For example, consider a system with a high-bandwidth memory pool. Older
      kernels are permitted to boot and consume that memory as conventional
      "System-RAM" newer kernels may arrange for that memory to be set aside
      (soft reserved) by the system administrator for a dedicated
      high-bandwidth memory aware application to consume.
      
      Specifically, this mechanism allows for the elimination of scenarios
      where platform firmware tries to game OS policy by lying about ACPI SLIT
      values, i.e. claiming that a precious memory resource has a high
      distance to trigger the OS to avoid it by default. This reservation hint
      allows platform-firmware to instead tell the truth about performance
      characteristics by indicate to OS memory management to put immovable
      allocations elsewhere.
      
      Implement simple detection of the bit for EFI memory table dumps and
      save the kernel policy for a follow-on change.
      
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fe3e5e65
    • Dan Williams's avatar
      ACPI: NUMA: Establish a new drivers/acpi/numa/ directory · c710fcc5
      Dan Williams authored
      
      
      Currently hmat.c lives under an "hmat" directory which does not enhance
      the description of the file. The initial motivation for giving hmat.c
      its own directory was to delineate it as mm functionality in contrast to
      ACPI device driver functionality.
      
      As ACPI continues to play an increasing role in conveying
      memory location and performance topology information to the OS take the
      opportunity to co-locate these NUMA relevant tables in a combined
      directory.
      
      numa.c is renamed to srat.c and moved to drivers/acpi/numa/ along with
      hmat.c.
      
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c710fcc5
  2. Nov 04, 2019
    • Linus Torvalds's avatar
      Linux 5.4-rc6 · a99d8080
      Linus Torvalds authored
      a99d8080
    • Linus Torvalds's avatar
      Merge tag 'usb-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 3a69c9e5
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "The USB sub-maintainers woke up this past week and sent a bunch of
        tiny fixes. Here are a lot of small patches that that resolve a bunch
        of reported issues in the USB core, drivers, serial drivers, gadget
        drivers, and of course, xhci :)
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (31 commits)
        usb: dwc3: gadget: fix race when disabling ep with cancelled xfers
        usb: cdns3: gadget: Fix g_audio use case when connected to Super-Speed host
        usb: cdns3: gadget: reset EP_CLAIMED flag while unloading
        USB: serial: whiteheat: fix line-speed endianness
        USB: serial: whiteheat: fix potential slab corruption
        USB: gadget: Reject endpoints with 0 maxpacket value
        UAS: Revert commit 3ae62a42 ("UAS: fix alignment of scatter/gather segments")
        usb-storage: Revert commit 747668db ("usb-storage: Set virt_boundary_mask to avoid SG overflows")
        usbip: Fix free of unallocated memory in vhci tx
        usbip: tools: Fix read_usb_vudc_device() error path handling
        usb: xhci: fix __le32/__le64 accessors in debugfs code
        usb: xhci: fix Immediate Data Transfer endianness
        xhci: Fix use-after-free regression in xhci clear hub TT implementation
        USB: ldusb: fix control-message timeout
        USB: ldusb: use unsigned size format specifiers
        USB: ldusb: fix ring-buffer locking
        USB: Skip endpoints with 0 maxpacket length
        usb: cdns3: gadget: Don't manage pullups
        usb: dwc3: remove the call trace of USBx_GFLADJ
        usb: gadget: configfs: fix concurrent issue between composite APIs
        ...
      3a69c9e5
  3. Nov 03, 2019
  4. Nov 02, 2019
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 1204c70d
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix free/alloc races in batmanadv, from Sven Eckelmann.
      
       2) Several leaks and other fixes in kTLS support of mlx5 driver, from
          Tariq Toukan.
      
       3) BPF devmap_hash cost calculation can overflow on 32-bit, from Toke
          Høiland-Jørgensen.
      
       4) Add an r8152 device ID, from Kazutoshi Noguchi.
      
       5) Missing include in ipv6's addrconf.c, from Ben Dooks.
      
       6) Use siphash in flow dissector, from Eric Dumazet. Attackers can
          easily infer the 32-bit secret otherwise etc.
      
       7) Several netdevice nesting depth fixes from Taehee Yoo.
      
       8) Fix several KCSAN reported errors, from Eric Dumazet. For example,
          when doing lockless skb_queue_empty() checks, and accessing
          sk_napi_id/sk_incoming_cpu lockless as well.
      
       9) Fix jumbo packet handling in RXRPC, from David Howells.
      
      10) Bump SOMAXCONN and tcp_max_syn_backlog values, from Eric Dumazet.
      
      11) Fix DMA synchronization in gve driver, from Yangchun Fu.
      
      12) Several bpf offload fixes, from Jakub Kicinski.
      
      13) Fix sk_page_frag() recursion during memory reclaim, from Tejun Heo.
      
      14) Fix ping latency during high traffic rates in hisilicon driver, from
          Jiangfent Xiao.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (146 commits)
        net: fix installing orphaned programs
        net: cls_bpf: fix NULL deref on offload filter removal
        selftests: bpf: Skip write only files in debugfs
        selftests: net: reuseport_dualstack: fix uninitalized parameter
        r8169: fix wrong PHY ID issue with RTL8168dp
        net: dsa: bcm_sf2: Fix IMP setup for port different than 8
        net: phylink: Fix phylink_dbg() macro
        gve: Fixes DMA synchronization.
        inet: stop leaking jiffies on the wire
        ixgbe: Remove duplicate clear_bit() call
        Documentation: networking: device drivers: Remove stray asterisks
        e1000: fix memory leaks
        i40e: Fix receive buffer starvation for AF_XDP
        igb: Fix constant media auto sense switching when no cable is connected
        net: ethernet: arc: add the missed clk_disable_unprepare
        igb: Enable media autosense for the i350.
        igb/igc: Don't warn on fatal read failures when the device is removed
        tcp: increase tcp_max_syn_backlog max value
        net: increase SOMAXCONN to 4096
        netdevsim: Fix use-after-free during device dismantle
        ...
      1204c70d
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.4-3' of git://git.linux-nfs.org/projects/anna/linux-nfs · 372bf6c1
      Linus Torvalds authored
      Pull NFS client bugfixes from Anna Schumaker:
       "This contains two delegation fixes (with the RCU lock leak fix marked
        for stable), and three patches to fix destroying the the sunrpc back
        channel.
      
        Stable bugfixes:
      
         - Fix an RCU lock leak in nfs4_refresh_delegation_stateid()
      
        Other fixes:
      
         - The TCP back channel mustn't disappear while requests are
           outstanding
      
         - The RDMA back channel mustn't disappear while requests are
           outstanding
      
         - Destroy the back channel when we destroy the host transport
      
         - Don't allow a cached open with a revoked delegation"
      
      * tag 'nfs-for-5.4-3' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        NFS: Fix an RCU lock leak in nfs4_refresh_delegation_stateid()
        NFSv4: Don't allow a cached open with a revoked delegation
        SUNRPC: Destroy the back channel when we destroy the host transport
        SUNRPC: The RDMA back channel mustn't disappear while requests are outstanding
        SUNRPC: The TCP back channel mustn't disappear while requests are outstanding
      372bf6c1
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20191101' of git://git.kernel.dk/linux-block · 0821de28
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - Two small nvme fixes, one is a fabrics connection fix, the other one
         a cleanup made possible by that fix (Anton, via Keith)
      
       - Fix requeue handling in umb ubd (Anton)
      
       - Fix spin_lock_irq() nesting in blk-iocost (Dan)
      
       - Three small io_uring fixes:
           - Install io_uring fd after done with ctx (me)
           - Clear ->result before every poll issue (me)
           - Fix leak of shadow request on error (Pavel)
      
      * tag 'for-linus-20191101' of git://git.kernel.dk/linux-block:
        iocost: don't nest spin_lock_irq in ioc_weight_write()
        io_uring: ensure we clear io_kiocb->result before each issue
        um-ubd: Entrust re-queue to the upper layers
        nvme-multipath: remove unused groups_only mode in ana log
        nvme-multipath: fix possible io hang after ctrl reconnect
        io_uring: don't touch ctx in setup after ring fd install
        io_uring: Fix leaked shadow_req
      0821de28
    • Linus Torvalds's avatar
      Merge tag 'riscv/for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · e5897c7d
      Linus Torvalds authored
      Pull RISC-V fixes from Paul Walmsley:
       "One fix for PCIe users:
      
         - Fix legacy PCI I/O port access emulation
      
        One set of cleanups:
      
         - Resolve most of the warnings generated by sparse across arch/riscv.
           No functional changes
      
        And one MAINTAINERS update:
      
         - Update Palmer's E-mail address"
      
      * tag 'riscv/for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        MAINTAINERS: Change to my personal email address
        RISC-V: Add PCIe I/O BAR memory mapping
        riscv: for C functions called only from assembly, mark with __visible
        riscv: fp: add missing __user pointer annotations
        riscv: add missing header file includes
        riscv: mark some code and data as file-static
        riscv: init: merge split string literals in preprocessor directive
        riscv: add prototypes for assembly language functions from head.S
      e5897c7d
    • Linus Torvalds's avatar
      Merge branch 'parisc-5.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · 31408fbe
      Linus Torvalds authored
      Pull parisc fix from Helge Deller:
       "Fix a parisc kernel crash with ftrace functions when compiled without
        frame pointers"
      
      * 'parisc-5.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: fix frame pointer in ftrace_regs_caller()
      31408fbe
    • David S. Miller's avatar
      Merge branch 'fix-BPF-offload-related-bugs' · aeb1b85c
      David S. Miller authored
      
      
      Jakub Kicinski says:
      
      ====================
      fix BPF offload related bugs
      
      test_offload.py catches some recently added bugs.
      
      First of a bug in test_offload.py itself after recent changes
      to netdevsim is fixed.
      
      Second patch fixes a bug in cls_bpf, and last one addresses
      a problem with the recently added XDP installation optimization.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aeb1b85c
    • Jakub Kicinski's avatar
      net: fix installing orphaned programs · aefc3e72
      Jakub Kicinski authored
      When netdevice with offloaded BPF programs is destroyed
      the programs are orphaned and removed from the program
      IDA - their IDs get released (the programs may remain
      accessible via existing open file descriptors and pinned
      files). After IDs are released they are set to 0.
      
      This confuses dev_change_xdp_fd() because it compares
      the __dev_xdp_query() result where 0 means no program
      with prog->aux->id where 0 means orphaned.
      
      dev_change_xdp_fd() would have incorrectly returned success
      even though it had not installed the program.
      
      Since drivers already catch this case via bpf_offload_dev_match()
      let them handle this case. The error message drivers produce in
      this case ("program loaded for a different device") is in fact
      correct as the orphaned program must had to be loaded for a
      different device.
      
      Fixes: c14a9f63
      
       ("net: Don't call XDP_SETUP_PROG when nothing is changed")
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aefc3e72
    • Jakub Kicinski's avatar
      net: cls_bpf: fix NULL deref on offload filter removal · 41aa29a5
      Jakub Kicinski authored
      Commit 40119211 ("net: sched: refactor block offloads counter
      usage") missed the fact that either new prog or old prog may be
      NULL.
      
      Fixes: 40119211
      
       ("net: sched: refactor block offloads counter usage")
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41aa29a5
    • Jakub Kicinski's avatar
      selftests: bpf: Skip write only files in debugfs · 8101e069
      Jakub Kicinski authored
      DebugFS for netdevsim now contains some "action trigger" files
      which are write only. Don't try to capture the contents of those.
      
      Note that we can't use os.access() because the script requires
      root.
      
      Fixes: 4418f862
      
       ("netdevsim: implement support for devlink region and snapshots")
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8101e069
    • Wei Wang's avatar
      selftests: net: reuseport_dualstack: fix uninitalized parameter · d64479a3
      Wei Wang authored
      This test reports EINVAL for getsockopt(SOL_SOCKET, SO_DOMAIN)
      occasionally due to the uninitialized length parameter.
      Initialize it to fix this, and also use int for "test_family" to comply
      with the API standard.
      
      Fixes: d6a61f80
      
       ("soreuseport: test mixed v4/v6 sockets")
      Reported-by: default avatarMaciej Żenczykowski <maze@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarWei Wang <weiwan@google.com>
      Cc: Craig Gallek <cgallek@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d64479a3
    • Heiner Kallweit's avatar
      r8169: fix wrong PHY ID issue with RTL8168dp · 62bdc8fd
      Heiner Kallweit authored
      As reported in [0] at least one RTL8168dp version has problems
      establishing a link. This chip version has an integrated RTL8211b PHY,
      however the chip seems to report a wrong PHY ID, resulting in a wrong
      PHY driver (for Generic Realtek PHY) being loaded.
      Work around this issue by adding a hook to r8168dp_2_mdio_read()
      for returning the correct PHY ID.
      
      [0] https://bbs.archlinux.org/viewtopic.php?id=246508
      
      Fixes: 242cd9b5
      
       ("r8169: use phy_resume/phy_suspend")
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      62bdc8fd
    • Florian Fainelli's avatar
      net: dsa: bcm_sf2: Fix IMP setup for port different than 8 · 5fc0f212
      Florian Fainelli authored
      Since it became possible for the DSA core to use a CPU port different
      than 8, our bcm_sf2_imp_setup() function was broken because it assumes
      that registers are applicable to port 8. In particular, the port's MAC
      is going to stay disabled, so make sure we clear the RX_DIS and TX_DIS
      bits if we are not configured for port 8.
      
      Fixes: 9f91484f
      
       ("net: dsa: make "label" property optional for dsa2")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5fc0f212
    • Florian Fainelli's avatar
      net: phylink: Fix phylink_dbg() macro · 9d68db50
      Florian Fainelli authored
      The phylink_dbg() macro does not follow dynamic debug or defined(DEBUG)
      and as a result, it spams the kernel log since a PR_DEBUG level is
      currently used. Fix it to be defined appropriately whether
      CONFIG_DYNAMIC_DEBUG or defined(DEBUG) are set.
      
      Fixes: 17091180
      
       ("net: phylink: Add phylink_{printk, err, warn, info, dbg} macros")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d68db50
    • Yangchun Fu's avatar
      gve: Fixes DMA synchronization. · 9cfeeb57
      Yangchun Fu authored
      
      
      Synces the DMA buffer properly in order for CPU and device to see
      the most up-to-data data.
      
      Signed-off-by: default avatarYangchun Fu <yangchun@google.com>
      Reviewed-by: default avatarCatherine Sullivan <csully@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9cfeeb57
    • Eric Dumazet's avatar
      inet: stop leaking jiffies on the wire · a904a069
      Eric Dumazet authored
      Historically linux tried to stick to RFC 791, 1122, 2003
      for IPv4 ID field generation.
      
      RFC 6864 made clear that no matter how hard we try,
      we can not ensure unicity of IP ID within maximum
      lifetime for all datagrams with a given source
      address/destination address/protocol tuple.
      
      Linux uses a per socket inet generator (inet_id), initialized
      at connection startup with a XOR of 'jiffies' and other
      fields that appear clear on the wire.
      
      Thiemo Nagel pointed that this strategy is a privacy
      concern as this provides 16 bits of entropy to fingerprint
      devices.
      
      Let's switch to a random starting point, this is just as
      good as far as RFC 6864 is concerned and does not leak
      anything critical.
      
      Fixes: 1da177e4
      
       ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarThiemo Nagel <tnagel@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a904a069
    • David S. Miller's avatar
      Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue · c8c2cd81
      David S. Miller authored
      
      
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2019-11-01
      
      This series contains updates to e1000, igb, igc, ixgbe, i40e and driver
      documentation.
      
      Lyude Paul fixes an issue where a fatal read error occurs when the
      device is unplugged from the machine.  So change the read error into a
      warn while the device is still present.
      
      Manfred Rudigier found that the i350 device was not apart of the "Media
      Auto Sense" feature, yet the device supports it.  So add the missing
      i350 device to the check and fix an issue where the media auto sense
      would flip/flop when no cable was connected to the port causing spurious
      kernel log messages.
      
      I fixed an issue where the fix to resolve receive buffer starvation was
      applied in more than one place in the driver, one being the incorrect
      location in the i40e driver.
      
      Wenwen Wang fixes a potential memory leak in e1000 where allocated
      memory is not properly cleaned up in one of the error paths.
      
      Jonathan Neuschäfer cleans up the driver documentation to be consistent
      and remove the footnote reference, since the footnote no longer exists in
      the documentation.
      
      Igor Pylypiv cleans up a duplicate clearing of a bit, no need to clear
      it twice.
      
      v2: Fixed alignment issue in patch 3 of the series based on community
          feedback.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c8c2cd81
    • Igor Pylypiv's avatar
      ixgbe: Remove duplicate clear_bit() call · 451fe015
      Igor Pylypiv authored
      
      
      __IXGBE_RX_BUILD_SKB_ENABLED bit is already cleared.
      
      Signed-off-by: default avatarIgor Pylypiv <igor.pylypiv@gmail.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      451fe015
    • Jonathan Neuschäfer's avatar
      Documentation: networking: device drivers: Remove stray asterisks · 17df5ae1
      Jonathan Neuschäfer authored
      These asterisks were once references to a line that said:
        "* Other names and brands may be claimed as the property of others."
      But now, they serve no purpose; they can only irritate the reader.
      
      Fixes: de3edab4 ("e1000: update README for e1000")
      Fixes: a3fb6568 ("e100.txt: Cleanup license info in kernel doc")
      Fixes: da8c01c4 ("e1000e.txt: Add e1000e documentation")
      Fixes: f12a84a9 ("Documentation: fm10k: Add kernel documentation")
      Fixes: b55c52b1 ("igb.txt: Add igb documentation")
      Fixes: c4e9b56e ("igbvf.txt: Add igbvf Documentation")
      Fixes: d7064f4c ("Documentation/networking/: Update Intel wired LAN driver documentation")
      Fixes: c4b8c011 ("ixgbevf.txt: Update ixgbevf documentation")
      Fixes: 1e06edcc ("Documentation: i40e: Prepare documentation for RST conversion")
      Fixes: 105bf2fe ("i40evf: add driver to kernel build system")
      Fixes: 1fae869b ("Documentation: ice: Prepare documentation for RST conversion")
      Fixes: df69ba43
      
       ("ionic: Add basic framework for IONIC Network device driver")
      Signed-off-by: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      17df5ae1
    • Wenwen Wang's avatar
      e1000: fix memory leaks · 8472ba62
      Wenwen Wang authored
      
      
      In e1000_set_ringparam(), 'tx_old' and 'rx_old' are not deallocated if
      e1000_up() fails, leading to memory leaks. Refactor the code to fix this
      issue.
      
      Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      8472ba62