summaryrefslogtreecommitdiff
path: root/arch/arm64/lib/Makefile
blob: 69ff9887f724d930a09457dc9cc08936c94bf452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# SPDX-License-Identifier: GPL-2.0
lib-y		:= clear_user.o delay.o copy_from_user.o		\
		   copy_to_user.o copy_in_user.o copy_page.o		\
		   clear_page.o memchr.o memcpy.o memmove.o memset.o	\
		   memcmp.o strcmp.o strncmp.o strlen.o strnlen.o	\
		   strchr.o strrchr.o tishift.o

# Tell the compiler to treat all general purpose registers (with the
# exception of the IP registers, which are already handled by the caller
# in case of a PLT) as callee-saved, which allows for efficient runtime
# patching of the bl instruction in the caller with an atomic instruction
# when supported by the CPU. Result and argument registers are handled
# correctly, based on the function prototype.
lib-$(CONFIG_ARM64_LSE_ATOMICS) += atomic_ll_sc.o
CFLAGS_atomic_ll_sc.o	:= -ffixed-x1 -ffixed-x2        		\
		   -ffixed-x3 -ffixed-x4 -ffixed-x5 -ffixed-x6		\
		   -ffixed-x7 -fcall-saved-x8 -fcall-saved-x9		\
		   -fcall-saved-x10 -fcall-saved-x11 -fcall-saved-x12	\
		   -fcall-saved-x13 -fcall-saved-x14 -fcall-saved-x15	\
		   -fcall-saved-x18 -fomit-frame-pointer
CFLAGS_REMOVE_atomic_ll_sc.o := -pg
GCOV_PROFILE_atomic_ll_sc.o	:= n
KASAN_SANITIZE_atomic_ll_sc.o	:= n
KCOV_INSTRUMENT_atomic_ll_sc.o	:= n
UBSAN_SANITIZE_atomic_ll_sc.o	:= n

lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o

obj-$(CONFIG_CRC32) += crc32.o
d>Ahmad Fatoum The "stm32_pwr_wakeup" is optional per the binding and the driver handles its absence gracefully. Request it with platform_get_irq_byname_optional, so its absence doesn't needlessly clutter the log. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net: ethernet: stmmac: demote warnings about missing optional clocksAhmad Fatoum The specification of a "eth-ck" and a "ptp_ref" clock is optional per the binding and the driver handles them gracefully. Demote the output to an info message accordingly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net: bcmgenet: reduce severity of missing clock warningsJeremy Linton If one types "failed to get enet clock" or similar into google there are ~370k hits. The vast majority are people debugging problems unrelated to this adapter, or bragging about their rpi's. Further, the DT clock bindings here are optional. Given that its not a fatal situation with common DT based systems, lets reduce the severity so people aren't seeing failure messages in everyday operation. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net: bcmgenet: Fetch MAC address from the adapterJeremy Linton ARM/ACPI machines should utilize self describing hardware when possible. The MAC address on the BCMGENET can be read from the adapter if a full featured firmware has already programmed it. Lets try using the address already programmed, if it appears to be valid. It should be noted that while we move the macaddr logic below the clock and power logic in the driver, none of that code will ever be active in an ACPI environment as the device will be attached to the acpi power domain, and brought to full power with all clocks enabled immediately before the device probe routine is called. One side effect of the above tweak is that while its now possible to read the MAC address via _DSD properties, it should be avoided. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net: bcmgenet: Initial bcmgenet ACPI supportJeremy Linton The rpi4 is capable of booting in ACPI mode with the latest edk2-platform commits. As such it would be helpful if the genet platform device were usable. To achieve this we add a new MODULE_DEVICE_TABLE, and convert a few dt specific methods to their generic device_ calls. Until the next patch, ACPI based machines will fallback on random mac addresses. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net: bcmgenet: enable automatic phy discoveryJeremy Linton The unimac mdio driver falls back to scanning the entire bus if its given an appropriate mask. In ACPI mode we expect that the system is well behaved and conforms to recent versions of the specification. We then utilize phy_find_first(), and phy_connect_direct() to find and attach to the discovered phy during net_device open. While its apparently possible to build a genet based device with multiple phys on a single mdio bus, this works for current machines. Further, this driver makes a number of assumptions about the platform device, mac, mdio and phy all being 1:1. Lastly, It also avoids having to create references across the ACPI namespace hierarchy. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net: bcmgenet: refactor phy mode configurationJeremy Linton The DT phy mode is similar to what we want for ACPI lets factor it out of the of path, and change the of_ call to device_. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mdio_bus: Add generic mdio_find_bus()Jeremy Linton It appears most ethernet drivers follow one of two main strategies for mdio bus/phy management. A monolithic model where the net driver itself creates, probes and uses the phy, and one where an external mdio/phy driver instantiates the mdio bus/phy and the net driver only attaches to a known phy. Usually in this latter model the phys are discovered via DT relationships or simply phy name/address hardcoding. This is a shame because modern well behaved mdio buses are self describing and can be probed. The mdio layer itself is fully capable of this, yet there isn't a clean way for a standalone net driver to attach and enumerate the discovered devices. This is because outside of of_mdio_find_bus() there isn't a straightforward way to acquire the mii_bus pointer. So, lets add a mdio_find_bus which can return the mii_bus based only on its name. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24freescale: Replace zero-length array with flexible-array memberGustavo A. R. Silva The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24intel: Replace zero-length array with flexible-array memberGustavo A. R. Silva The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24netronome: Replace zero-length array with flexible-array memberGustavo A. R. Silva The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24toshiba: Replace zero-length array with flexible-array memberGustavo A. R. Silva The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24chelsio: Replace zero-length array with flexible-array memberGustavo A. R. Silva The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net: dsa: felix: Use PHY_INTERFACE_MODE_INTERNAL instead of GMIIVladimir Oltean phy-mode = "gmii" is confusing because it may mean that the port supports the 8-bit-wide parallel data interface pinout, which it doesn't. It may also be confusing because one of the "gmii" internal ports is actually overclocked to run at 2.5Gbps (even though, yes, as far as the switch MAC is concerned, it still thinks it's gigabit). So use the phy-mode = "internal" property to describe the internal ports inside the NXP LS1028A chip (the ones facing the ENETC). The change should be fine, because the device tree bindings document is yet to be introduced, and there are no stable DT blobs in use. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Michael Walle <michael@walle.cc> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24bareudp: Fix uninitialized variable warnings.David S. Miller drivers/net/bareudp.c: In function 'bareudp_xmit_skb': drivers/net/bareudp.c:346:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] 346 | return err; | ^~~ drivers/net/bareudp.c: In function 'bareudp6_xmit_skb': drivers/net/bareudp.c:407:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] 407 | return err; Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net: Special handling for IP & MPLS.Martin Varghese Special handling is needed in bareudp module for IP & MPLS as they support more than one ethertypes. MPLS has 2 ethertypes. 0x8847 for MPLS unicast and 0x8848 for MPLS multicast. While decapsulating MPLS packet from UDP packet the tunnel destination IP address is checked to determine the ethertype. The ethertype of the packet will be set to 0x8848 if the tunnel destination IP address is a multicast IP address. The ethertype of the packet will be set to 0x8847 if the tunnel destination IP address is a unicast IP address. IP has 2 ethertypes.0x0800 for IPV4 and 0x86dd for IPv6. The version field of the IP header tunnelled will be checked to determine the ethertype. This special handling to tunnel additional ethertypes will be disabled by default and can be enabled using a flag called multiproto. This flag can be used only with ethertypes 0x8847 and 0x0800. Signed-off-by: Martin Varghese <martin.varghese@nokia.com> Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net: UDP tunnel encapsulation module for tunnelling different protocols like ↵Martin Varghese MPLS, IP, NSH etc. The Bareudp tunnel module provides a generic L3 encapsulation tunnelling module for tunnelling different protocols like MPLS, IP,NSH etc inside a UDP tunnel. Signed-off-by: Martin Varghese <martin.varghese@nokia.com> Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: spectrum_trap: Add ACL devlink-trap supportJiri Pirko Add the trap group used to report ACL drops. Setup the trap IDs for ingress/egress flow action drop. Register the two packet traps associated with ACL trap group with devlink during driver initialization. As these are "source traps", set the disabled trap group to be the dummy, discarding as many packets in HW as possible. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: spectrum_trap: Introduce dummy group with thin policerJiri Pirko For "source traps" it is not possible to change HPKT action to discard. But there is still need to disallow packets arriving to CPU as much as possible. Handle this by introduction of a "dummy group". It has a "thin" policer, which passes as less packets to CPU as possible. The rest is going to be discarded there. The "dummy group" is to be used later on by ACL trap (which is a "source trap"). Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: core: Extend MLXSW_RXL_DIS to register disabled trap groupJiri Pirko Extend the mlxsw_listener struct to contain trap group for disabled traps too. Rename the original "trap_group" item to "en_trap_group" as it represents enabled state. Let both groups be the same for MLXSW_RXL however extend MLXSW_RXL_DIS to register separate groups for enable and disable. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: core: Allow to enable/disable rx_listener for trapJiri Pirko For source traps, the "thin policer" is going to be used in order to reduce the amount of trapped packets to minimum. However, there will be still small number of packets coming in that need to be dropped in the driver. Allow to enable/disable rx_listener related to specific trap in order to prevent unwanted packets to go up the stack. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: acl_flex_actions: Trap all ACL dropped packets to DISCARD_*_ACL trapsJiri Pirko Introduce a new set of traps: DISCARD_INGRESS_ACL and DISCARD_EGRESS_ACL Set the trap_action from NOP to TRAP which causes the packets dropped by the TRAP action to be trapped under new trap IDs, depending on the ingress/egress binding point. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: spectrum_acl: Pass the ingress indication down to flex actionJiri Pirko The ACL flex action will have to know if it is in ingress or egress, so it can use correct trap ID. Pass the ingress indication down to it. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: spectrum_flower: Disable mixed bound blocks to contain action dropJiri Pirko Action drop is going to be tracked by two separate traps, one for ingress and one for egress. Prepare for it and disallow the possibility to have drop action in blocks which are bound to both ingress and egress. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: spectrum_acl: Track ingress and egress block bindingsJiri Pirko Count the number of ingress and egress block bindings. Use the egress counter in "is_egress_bound" helper. Add couple of helpers to check ingress and mixed bound. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: spectrum_trap: Prepare mlxsw_core_trap_action_set() to handle not ↵Jiri Pirko only action Rename function mlxsw_core_trap_action_set() to mlxsw_core_trap_state_set() and pass bool enabled instead of action. Figure out the action according to the enabled state there. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: spectrum_trap: Use listener->en/dis_action instead of hard-coded valuesJiri Pirko The listener fields en_action and dis_action now contain the actions to be used for TRAP and DROP devlink trap actions. Use them directly instead of the hard-coded values. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: core: Allow to register disabled traps using MLXSW_RXL_DISJiri Pirko Introduce a new macro MLXSW_RXL_DIS that allows to register listeners as disabled. That allows that from now on, the "action" can be understood always as "enabled action" and "unreg_action" as "disabled action". Rename them and treat them accordingly. Use the new macro for defining drops in spectrum_trap.c. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24mlxsw: spectrum_trap: Set unreg_action to be SET_FW_DEFAULTJiri Pirko Currently it does not really matter if it is set to DISCARD or SET_FW_DEFAULT because it is set only during unregister of the listener. The unreg_action is going to be used for disabling the listener too, so change to SET_FW_DEFAULT and ensure the HW is going to behave correctly. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2020-02-24net/atheros: Clean atheros code from driver versionLeon Romanovsky Use linux kernel version for ethtool and module versions. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Acked-by: Chris Snook <chris.snook@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>