Skip to content

Commit

Permalink
Merge branch 'flavour/stock-v4.19' into flavour/edge-v4.19
Browse files Browse the repository at this point in the history
This change tracks the upstream UDM Pro kernel for firmware version 1.12.22.
  • Loading branch information
fabianishere committed Jun 6, 2022
2 parents 560241d + 171ace5 commit eb0ac6b
Show file tree
Hide file tree
Showing 27 changed files with 2,982 additions and 487 deletions.
11 changes: 6 additions & 5 deletions .github/config/config.stock.udm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CONFIG_THREAD_INFO_IN_TASK=y
#
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION="-v1.11.4.3940-e66d85f"
CONFIG_LOCALVERSION="-v1.12.22.4309-4105ace"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
Expand Down Expand Up @@ -811,7 +811,7 @@ CONFIG_NETFILTER_NETLINK=y
CONFIG_NETFILTER_FAMILY_BRIDGE=y
# CONFIG_NETFILTER_NETLINK_ACCT is not set
CONFIG_NETFILTER_NETLINK_QUEUE=y
# CONFIG_NETFILTER_NETLINK_LOG is not set
CONFIG_NETFILTER_NETLINK_LOG=m
# CONFIG_NETFILTER_NETLINK_OSF is not set
CONFIG_NF_CONNTRACK=y
CONFIG_NF_LOG_COMMON=m
Expand Down Expand Up @@ -876,7 +876,7 @@ CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_TARGET_MARK=y
CONFIG_NETFILTER_XT_NAT=y
CONFIG_NETFILTER_XT_TARGET_NETMAP=y
# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
CONFIG_NETFILTER_XT_TARGET_NFLOG=m
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
CONFIG_NETFILTER_XT_TARGET_REDIRECT=y
Expand Down Expand Up @@ -933,7 +933,7 @@ CONFIG_NETFILTER_XT_MATCH_SOCKET=m
# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
# CONFIG_NETFILTER_XT_MATCH_STRING is not set
# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
# CONFIG_NETFILTER_XT_MATCH_TIME is not set
CONFIG_NETFILTER_XT_MATCH_TIME=y
# CONFIG_NETFILTER_XT_MATCH_U32 is not set
CONFIG_IP_SET=y
CONFIG_IP_SET_MAX=256
Expand Down Expand Up @@ -1560,6 +1560,7 @@ CONFIG_SCSI_PROC_FS=y
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_UBNT_STATIC_BOOT_DEV=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
Expand Down Expand Up @@ -2032,7 +2033,7 @@ CONFIG_FIXED_PHY=y
# CONFIG_MICROSEMI_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_QSEMI_PHY is not set
# CONFIG_REALTEK_PHY is not set
CONFIG_REALTEK_PHY=y
# CONFIG_RENESAS_PHY is not set
# CONFIG_ROCKCHIP_PHY is not set
# CONFIG_SMSC_PHY is not set
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/include/asm/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
}
#define ip_fast_csum ip_fast_csum

extern unsigned int do_csum(const unsigned char *buff, int len);
#define do_csum do_csum

#include <asm-generic/checksum.h>

#endif /* __ASM_CHECKSUM_H */
2 changes: 1 addition & 1 deletion arch/arm64/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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
strchr.o strrchr.o tishift.o csum.o

# Tell the compiler to treat all general purpose registers (with the
# exception of the IP registers, which are already handled by the caller
Expand Down
127 changes: 127 additions & 0 deletions arch/arm64/lib/csum.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2019 Linaro, Ltd. <ard.biesheuvel@linaro.org>
*/

#include <linux/linkage.h>
#include <asm/assembler.h>

ENTRY(do_csum)
adds x2, xzr, xzr // clear x2 and C flag

// 64 bytes at a time
lsr x3, x1, #6
and x1, x1, #63
cbz x3, 1f

// Eight 64-bit adds per iteration
0: ldp x4, x5, [x0], #64
ldp x6, x7, [x0, #-48]
ldp x8, x9, [x0, #-32]
ldp x10, x11, [x0, #-16]
adcs x2, x2, x4
sub x3, x3, #1
adcs x2, x2, x5
adcs x2, x2, x6
adcs x2, x2, x7
adcs x2, x2, x8
adcs x2, x2, x9
adcs x2, x2, x10
adcs x2, x2, x11
cbnz x3, 0b
adc x2, x2, xzr

cbz x1, 7f
bic x3, x1, #1
add x12, x0, x1
add x0, x0, x3
neg x3, x3
add x3, x3, #64
lsl x3, x3, #3

// Handle remaining 63 bytes or less using an overlapping 64-byte load
// and a branchless code path to complete the calculation
ldp x4, x5, [x0, #-64]
ldp x6, x7, [x0, #-48]
ldp x8, x9, [x0, #-32]
ldp x10, x11, [x0, #-16]
ldrb w12, [x12, #-1]

.irp reg, x4, x5, x6, x7, x8, x9, x10, x11
cmp x3, #64
csel \reg, \reg, xzr, lt
ccmp x3, xzr, #0, lt
csel x13, x3, xzr, gt
sub x3, x3, #64
CPU_LE( lsr \reg, \reg, x13 )
CPU_BE( lsl \reg, \reg, x13 )
.endr

adds x2, x2, x4
adcs x2, x2, x5
adcs x2, x2, x6
adcs x2, x2, x7
adcs x2, x2, x8
adcs x2, x2, x9
adcs x2, x2, x10
adcs x2, x2, x11
adc x2, x2, xzr

CPU_LE( adds x12, x2, x12 )
CPU_BE( adds x12, x2, x12, lsl #8 )
adc x12, x12, xzr
tst x1, #1
csel x2, x2, x12, eq

7: lsr x1, x2, #32
adds w2, w2, w1
adc w2, w2, wzr

lsr w1, w2, #16
uxth w2, w2
add w2, w2, w1

lsr w1, w2, #16 // handle the carry by hand
add w2, w2, w1

uxth w0, w2
ret

// Handle 63 bytes or less
1: tbz x1, #5, 2f
ldp x4, x5, [x0], #32
ldp x6, x7, [x0, #-16]
adds x2, x2, x4
adcs x2, x2, x5
adcs x2, x2, x6
adcs x2, x2, x7
adc x2, x2, xzr

2: tbz x1, #4, 3f
ldp x4, x5, [x0], #16
adds x2, x2, x4
adcs x2, x2, x5
adc x2, x2, xzr

3: tbz x1, #3, 4f
ldr x4, [x0], #8
adds x2, x2, x4
adc x2, x2, xzr

4: tbz x1, #2, 5f
ldr w4, [x0], #4
adds x2, x2, x4
adc x2, x2, xzr

5: tbz x1, #1, 6f
ldrh w4, [x0], #2
adds x2, x2, x4
adc x2, x2, xzr

6: tbz x1, #0, 7b
ldrb w4, [x0]
CPU_LE( adds x2, x2, x4 )
CPU_BE( adds x2, x2, x4, lsl #8 )
adc x2, x2, xzr
b 7b
ENDPROC(do_csum)
Loading

0 comments on commit eb0ac6b

Please sign in to comment.