···557557 pulls in some header files containing file scope host assembly codes.558558 - You can add "-fno-jump-tables" to work around the switch table issue.559559560560- Otherwise, you can use bpf target.560560+ Otherwise, you can use bpf target. Additionally, you _must_ use bpf target561561+ when:562562+563563+ - Your program uses data structures with pointer or long / unsigned long564564+ types that interface with BPF helpers or context data structures. Access565565+ into these structures is verified by the BPF verifier and may result566566+ in verification failures if the native architecture is not aligned with567567+ the BPF architecture, e.g. 64-bit. An example of this is568568+ BPF_PROG_TYPE_SK_MSG require '-target bpf'561569562570Happy BPF hacking!
+11-1
arch/x86/net/bpf_jit_comp.c
···10271027 break;1028102810291029 case BPF_JMP | BPF_JA:10301030- jmp_offset = addrs[i + insn->off] - addrs[i];10301030+ if (insn->off == -1)10311031+ /* -1 jmp instructions will always jump10321032+ * backwards two bytes. Explicitly handling10331033+ * this case avoids wasting too many passes10341034+ * when there are long sequences of replaced10351035+ * dead code.10361036+ */10371037+ jmp_offset = -2;10381038+ else10391039+ jmp_offset = addrs[i + insn->off] - addrs[i];10401040+10311041 if (!jmp_offset)10321042 /* optimize out nop jumps */10331043 break;
+10-1
drivers/net/phy/phy_device.c
···535535536536 /* Grab the bits from PHYIR1, and put them in the upper half */537537 phy_reg = mdiobus_read(bus, addr, MII_PHYSID1);538538- if (phy_reg < 0)538538+ if (phy_reg < 0) {539539+ /* if there is no device, return without an error so scanning540540+ * the bus works properly541541+ */542542+ if (phy_reg == -EIO || phy_reg == -ENODEV) {543543+ *phy_id = 0xffffffff;544544+ return 0;545545+ }546546+539547 return -EIO;548548+ }540549541550 *phy_id = (phy_reg & 0xffff) << 16;542551
···978978 }979979980980out:981981- if (lsmc->clcsock) {982982- sock_release(lsmc->clcsock);983983- lsmc->clcsock = NULL;984984- }985981 release_sock(lsk);986982 sock_put(&lsmc->sk); /* sock_hold in smc_listen */987983}
+5-2
samples/sockmap/Makefile
···6565# asm/sysreg.h - inline assembly used by it is incompatible with llvm.6666# But, there is no easy way to fix it, so just exclude it since it is6767# useless for BPF samples.6868+#6969+# -target bpf option required with SK_MSG programs, this is to ensure7070+# reading 'void *' data types for data and data_end are __u64 reads.6871$(obj)/%.o: $(src)/%.c6972 $(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \7073 -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \7174 -Wno-compare-distinct-pointer-types \7275 -Wno-gnu-variable-sized-type-not-at-end \7376 -Wno-address-of-packed-member -Wno-tautological-compare \7474- -Wno-unknown-warning-option \7575- -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@7777+ -Wno-unknown-warning-option -O2 -target bpf \7878+ -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@