On 08/15/2014 01:56 AM, chenj wrote:
Signed-off-by: chenj <chenj@xxxxxxxxxx>
---
This patch is modified from http://patchwork.linux-mips.org/patch/7054/
The original author is ralf.
v2: using "#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_LOONGSON3)"
instead of "#if cpu_has_wsbh" in csum_partial.S
arch/mips/include/asm/cpu-features.h | 10 ++++++++++
.../include/asm/mach-cavium-octeon/cpu-feature-overrides.h | 1 +
.../mips/include/asm/mach-loongson/cpu-feature-overrides.h | 2 ++
arch/mips/include/uapi/asm/swab.h | 14 ++++++++++++--
arch/mips/lib/csum_partial.S | 10 ++++++++--
arch/mips/net/bpf_jit.c | 2 +-
6 files changed, 34 insertions(+), 5 deletions(-)
[...]
diff --git a/arch/mips/include/uapi/asm/swab.h b/arch/mips/include/uapi/asm/swab.h
index ac9a8f9..20b884a 100644
--- a/arch/mips/include/uapi/asm/swab.h
+++ b/arch/mips/include/uapi/asm/swab.h
[...]
@@ -46,8 +53,11 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
{
__asm__(
+ " .set push \n"
+ " .set arch=mips64r2 \n"
" dsbh %0, %1\n"
" dshd %0, %0"
+ " .set pop \n"
: "=r" (x)
: "r" (x));
This section of the patch is defective. It appears to have not been
compile tested.
On mips-for-linux-next commit d4c5edf76f14720a32805202129dfa8206560035
produces:
.
.
.
mips64-octeon-linux-gnu-gcc -Wp,-MD,kernel/bpf/.core.o.d -nostdinc
-isystem
/nfs/sdk/daily/tools-140726/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/include
-I./arch/mips/include -Iarch/mips/include/generated -Iinclude
-I./arch/mips/include/uapi -Iarch/mips/include/generated/uapi
-I./include/uapi -Iinclude/generated/uapi -include
./include/linux/kconfig.h -D__KERNEL__
-DVMLINUX_LOAD_ADDRESS=0xffffffff81100000 -DDATAOFFSET=0 -Wall -Wundef
-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-Werror-implicit-function-declaration -Wno-format-security
-mno-check-zero-division -mabi=64 -G 0 -mno-abicalls -fno-pic -pipe
-msoft-float -ffreestanding -march=octeon -Wa,--trap -Wa,-mfix-cn63xxp1
-I./arch/mips/include/asm/mach-cavium-octeon
-I./arch/mips/include/asm/mach-generic -msym32 -DKBUILD_64BIT_SYM32
-fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0
-Wframe-larger-than=2048 -fno-stack-protector
-Wno-unused-but-set-variable -fomit-frame-pointer
-fno-var-tracking-assignments -g -Wdeclaration-after-statement
-Wno-pointer-sign -fno-strict-overflow -fconserve-stack
-Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(core)"
-D"KBUILD_MODNAME=KBUILD_STR(core)" -c -o kernel/bpf/core.o
kernel/bpf/core.c
{standard input}: Assembler messages:
{standard input}:3016: Error: Illegal operands `dshd $3,$3 .set pop'
.
.
.
Each line except the final line needs to be terminated with a '\n', but
you did not do this following the "dshd" line.
David Daney