1. 22 2月, 2019 2 次提交
  2. 20 2月, 2019 3 次提交
  3. 19 2月, 2019 1 次提交
  4. 18 2月, 2019 6 次提交
  5. 17 2月, 2019 1 次提交
  6. 16 2月, 2019 13 次提交
    • A
      efi/arm: Revert "Defer persistent reservations until after paging_init()" · 582a32e7
      Ard Biesheuvel 提交于
      This reverts commit eff89628, which
      deferred the processing of persistent memory reservations to a point
      where the memory may have already been allocated and overwritten,
      defeating the purpose.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20190215123333.21209-3-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      582a32e7
    • A
      arm64, mm, efi: Account for GICv3 LPI tables in static memblock reserve table · 8a5b403d
      Ard Biesheuvel 提交于
      In the irqchip and EFI code, we have what basically amounts to a quirk
      to work around a peculiarity in the GICv3 architecture, which permits
      the system memory address of LPI tables to be programmable only once
      after a CPU reset. This means kexec kernels must use the same memory
      as the first kernel, and thus ensure that this memory has not been
      given out for other purposes by the time the ITS init code runs, which
      is not very early for secondary CPUs.
      
      On systems with many CPUs, these reservations could overflow the
      memblock reservation table, and this was addressed in commit:
      
        eff89628 ("efi/arm: Defer persistent reservations until after paging_init()")
      
      However, this turns out to have made things worse, since the allocation
      of page tables and heap space for the resized memblock reservation table
      itself may overwrite the regions we are attempting to reserve, which may
      cause all kinds of corruption, also considering that the ITS will still
      be poking bits into that memory in response to incoming MSIs.
      
      So instead, let's grow the static memblock reservation table on such
      systems so it can accommodate these reservations at an earlier time.
      This will permit us to revert the above commit in a subsequent patch.
      
      [ mingo: Minor cleanups. ]
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NMike Rapoport <rppt@linux.ibm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20190215123333.21209-2-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      8a5b403d
    • W
      net: validate untrusted gso packets without csum offload · d5be7f63
      Willem de Bruijn 提交于
      Syzkaller again found a path to a kernel crash through bad gso input.
      By building an excessively large packet to cause an skb field to wrap.
      
      If VIRTIO_NET_HDR_F_NEEDS_CSUM was set this would have been dropped in
      skb_partial_csum_set.
      
      GSO packets that do not set checksum offload are suspicious and rare.
      Most callers of virtio_net_hdr_to_skb already pass them to
      skb_probe_transport_header.
      
      Move that test forward, change it to detect parse failure and drop
      packets on failure as those cleary are not one of the legitimate
      VIRTIO_NET_HDR_GSO types.
      
      Fixes: bfd5f4a3 ("packet: Add GSO/csum offload support.")
      Fixes: f43798c2 ("tun: Allow GSO using virtio_net_hdr")
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Reviewed-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d5be7f63
    • H
      net: Fix for_each_netdev_feature on Big endian · 3b89ea9c
      Hauke Mehrtens 提交于
      The features attribute is of type u64 and stored in the native endianes on
      the system. The for_each_set_bit() macro takes a pointer to a 32 bit array
      and goes over the bits in this area. On little Endian systems this also
      works with an u64 as the most significant bit is on the highest address,
      but on big endian the words are swapped. When we expect bit 15 here we get
      bit 47 (15 + 32).
      
      This patch converts it more or less to its own for_each_set_bit()
      implementation which works on 64 bit integers directly. This is then
      completely in host endianness and should work like expected.
      
      Fixes: fd867d51 ("net/core: generic support for disabling netdev features down stack")
      Signed-off-by: NHauke Mehrtens <hauke.mehrtens@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3b89ea9c
    • B
      net/mlx5: E-Switch, Consider ECPF vport depends on eswitch ownership · 81cd229c
      Bodong Wang 提交于
      ECPF connects to the eswitch through vport 0xfffe. ECPF may or may
      not be the eswitch manager depending on firmware configuration.
      
      1. If ECPF is eswitch manager: ECPF will take over the eswitch manager
         responsibility. A rep of the host PF shall be created at the ECPF
         side for the eswitch manager to control.
      
      2. If ECPF is not eswitch manager: host PF will be the eswitch manager,
         ECPF acts similar as a VF to the host PF. Host PF will be aware
         of the ECPF vport presence and control it's rep.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      81cd229c
    • B
      net/mlx5: E-Switch, Assign a different position for uplink rep and vport · 5ae51620
      Bodong Wang 提交于
      In offloads mode, the current implementation puts the uplink
      representor at index zero of the vport reps array. It is not "natural"
      to place it at index 0 since we want to put the representor for vport
      0 at index 0 with the introduction of SmartNIC. A separate patch will
      handle the case whether a rep is needed for vport 0 (PF vport).
      
      So, we want to have a different placeholder for uplink vport and
      representor. It was placed at the end of vport and rep array. Since
      vport number can no longer act as an index into the vport or
      representors arrays, use functions to map vport numbers to indices
      when accessing the vports or representors arrays, and vice versa.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      5ae51620
    • B
      net/mlx5: E-Switch, Centralize repersentor reg/unreg to eswitch driver · f8e8fa02
      Bodong Wang 提交于
      Eswitch has two users: IB and ETH. They both register repersentors
      when mlx5 interface is added, and unregister the repersentors when
      mlx5 interface is removed. Ideally, each driver should only deal with
      the entities which are unique to itself. However, current IB and ETH
      drivers have to perform the following eswitch operations:
      
      1. When registering, specify how many vports to register. This number
         is the same for both drivers which is the total available vport
         numbers.
      2. When unregistering, specify the number of registered vports to do
         unregister. Also, unload the repersentors which are already loaded.
      
      It's unnecessary for eswitch driver to hands out the control of above
      operations to individual driver users, as they're not unique to each
      driver. Instead, such operations should be centralized to eswitch
      driver. This consolidates eswitch control flow, and simplified IB and
      ETH driver.
      
      This patch doesn't change any functionality.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      f8e8fa02
    • B
      net/mlx5: E-Switch, Add state to eswitch vport representors · f121e0ea
      Bodong Wang 提交于
      Currently the eswitch vport reps have a valid indicator, which is
      set on register and unset on unregister. However, a rep can be loaded
      or not loaded when doing unregister, current driver checks if the
      vport of that rep is enabled as a flag to imply the rep is loaded.
      However, for ECPF, this is not valid as the host PF will enable the
      vports for its VFs instead.
      
      Add three states: {unregistered, registered, loaded}, with the
      following state changes across different operations:
      
      	create: (none)       -> unregistered
      	reg:    unregistered -> registered
      	load:   registered   -> loaded
      	unload: loaded       -> registered
      	unreg:  registered   -> unregistered
      
      Note that the state shall only be updated inside eswitch driver rather
      than individual drivers such as ETH or IB.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Suggested-by: NMark Bloch <markb@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      f121e0ea
    • B
      net/mlx5: E-Switch, Split VF and special vports for offloads mode · c9b99abc
      Bodong Wang 提交于
      When driver is entering offloads mode, there are two major tasks to
      do: initialize flow steering and create representors. Flow steering
      should make sure enough flow table/group spaces are reserved for all
      reps. Representors will be created in a group, all or none.
      
      With the introduction of ECPF, flow steering should still reserve the
      same spaces. But, the representors are not always loaded/unloaded in a
      single piece. Once ECPF is in offloads mode, it will get the number
      of VF changing event from host PF. In such scenario, only the VF reps
      should be loaded/unloaded, not the reps for special vports (such as
      the uplink vport).
      
      Thus, when entering offloads mode, driver should specify the total
      number of reps, and the number of VF reps separately. When leaving
      offloads mode, the cleanup should use the information self-contained
      in eswitch such as number of VFs.
      
      This patch doesn't change any functionality.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      c9b99abc
    • B
      net/mlx5: E-Switch, Properly refer to host PF vport as other vport · cbc44e76
      Bodong Wang 提交于
      Commands referring to vports use the following scheme:
      
      1. When referring to my own vport, put 0 in vport and 0 in other_vport.
      2. When referring to another vport, put the vport number of the
         referred vport and put 1 in other_vport. It was assumed that driver
         is accessing other vport when vport number is greater than 0.
      
      With the above scheme, the case that ECPF eswitch manager is trying
      to access host PF vport will fall over with scheme 1 as the vport
      number is 0. This is apparently wrong as driver is trying to refer
      other vport.
      
      As such usage can only happen in the eswitch context, change relevant
      functions to provide other vport input properly.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      cbc44e76
    • B
      net/mlx5: E-Switch, Properly refer to the esw manager vport · a1b3839a
      Bodong Wang 提交于
      In SmartNIC mode, the eswitch manager is not necessarily the PF
      (vport 0). Use a helper function to get the correct eswitch manager
      vport number and cache on the eswitch instance for fast reference.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      a1b3839a
    • M
      include/linux/module.h: copy __init/__exit attrs to init/cleanup_module · a6e60d84
      Miguel Ojeda 提交于
      The upcoming GCC 9 release extends the -Wmissing-attributes warnings
      (enabled by -Wall) to C and aliases: it warns when particular function
      attributes are missing in the aliases but not in their target.
      
      In particular, it triggers for all the init/cleanup_module
      aliases in the kernel (defined by the module_init/exit macros),
      ending up being very noisy.
      
      These aliases point to the __init/__exit functions of a module,
      which are defined as __cold (among other attributes). However,
      the aliases themselves do not have the __cold attribute.
      
      Since the compiler behaves differently when compiling a __cold
      function as well as when compiling paths leading to calls
      to __cold functions, the warning is trying to point out
      the possibly-forgotten attribute in the alias.
      
      In order to keep the warning enabled, we decided to silence
      this case. Ideally, we would mark the aliases directly
      as __init/__exit. However, there are currently around 132 modules
      in the kernel which are missing __init/__exit in their init/cleanup
      functions (either because they are missing, or for other reasons,
      e.g. the functions being called from somewhere else); and
      a section mismatch is a hard error.
      
      A conservative alternative was to mark the aliases as __cold only.
      However, since we would like to eventually enforce __init/__exit
      to be always marked,  we chose to use the new __copy function
      attribute (introduced by GCC 9 as well to deal with this).
      With it, we copy the attributes used by the target functions
      into the aliases. This way, functions that were not marked
      as __init/__exit won't have their aliases marked either,
      and therefore there won't be a section mismatch.
      
      Note that the warning would go away marking either the extern
      declaration, the definition, or both. However, we only mark
      the definition of the alias, since we do not want callers
      (which only see the declaration) to be compiled as if the function
      was __cold (and therefore the paths leading to those calls
      would be assumed to be unlikely).
      
      Link: https://lore.kernel.org/lkml/20190123173707.GA16603@gmail.com/
      Link: https://lore.kernel.org/lkml/20190206175627.GA20399@gmail.com/Suggested-by: NMartin Sebor <msebor@gcc.gnu.org>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Signed-off-by: NMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      a6e60d84
    • M
      Compiler Attributes: add support for __copy (gcc >= 9) · c0d9782f
      Miguel Ojeda 提交于
      From the GCC manual:
      
        copy
        copy(function)
      
          The copy attribute applies the set of attributes with which function
          has been declared to the declaration of the function to which
          the attribute is applied. The attribute is designed for libraries
          that define aliases or function resolvers that are expected
          to specify the same set of attributes as their targets. The copy
          attribute can be used with functions, variables, or types. However,
          the kind of symbol to which the attribute is applied (either
          function or variable) must match the kind of symbol to which
          the argument refers. The copy attribute copies only syntactic and
          semantic attributes but not attributes that affect a symbol’s
          linkage or visibility such as alias, visibility, or weak.
          The deprecated attribute is also not copied.
      
        https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
      
      The upcoming GCC 9 release extends the -Wmissing-attributes warnings
      (enabled by -Wall) to C and aliases: it warns when particular function
      attributes are missing in the aliases but not in their target, e.g.:
      
          void __cold f(void) {}
          void __alias("f") g(void);
      
      diagnoses:
      
          warning: 'g' specifies less restrictive attribute than
          its target 'f': 'cold' [-Wmissing-attributes]
      
      Using __copy(f) we can copy the __cold attribute from f to g:
      
          void __cold f(void) {}
          void __copy(f) __alias("f") g(void);
      
      This attribute is most useful to deal with situations where an alias
      is declared but we don't know the exact attributes the target has.
      
      For instance, in the kernel, the widely used module_init/exit macros
      define the init/cleanup_module aliases, but those cannot be marked
      always as __init/__exit since some modules do not have their
      functions marked as such.
      Suggested-by: NMartin Sebor <msebor@gcc.gnu.org>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      c0d9782f
  7. 15 2月, 2019 14 次提交