Hi Marc,
I hit some hard problem on the pcie backporting to 3.18. I tried to
pick up pcie related change to 3.18 kernel, the result is here:
git://git.linaro.org/kernel/linux-linaro-stable.git v3.18/topic/pcie/master
but it failed to setup juno r1 pcie port:
=====
pci 0000:00:00.0: reg 0x10: [mem 0x57c00000-0x57c03fff 64bit pref]
...
pcieport 0000:00:00.0: can't enable device: BAR 0 [mem
0x57c00000-0x57c03fff 64bit pref] not claimed
pcieport: probe of 0000:00:00.0 failed with error -22
=====
The full pcie.txt log is attached.
I also tried to seek some clues from 3.18/4.1 commits comparing, as
following command. but failed on leaking related experience. The 4.1
kernel with pcie backport works good.
$git log --oneline v3.18.24.. --cherry-mark --right-only
3.18/pcie/master...origin/v4.1/topic/pcie-junor1 &> full-4.1.diff.commits
Could you like to give me some comments here? How to do the debug or
what I missed?
Thanks a lot!
Alex
ARM64 JIT used FP (x29) as eBPF fp register, but FP is subjected to
change during function call so it may cause the BPF prog stack base address
change too. Whenever, it pointed to the bottom of BPF prog stack instead of
the top.
So, when copying data via bpf_probe_read, it will be copied to (SP - offset),
then it may overwrite the saved FP/LR.
Use x25 to replace FP as BPF stack base register (fp). Since x25 is callee
saved register, so it will keep intact during function call.
It is initialized in BPF prog prologue when BPF prog is started to run
everytime. When BPF prog exits, it could be just tossed.
Other than this the BPf prog stack base need to be setup before function
call stack.
So, the BPF stack layout looks like:
high
original A64_SP => 0:+-----+ BPF prologue
| | FP/LR and callee saved registers
BPF fp register => +64:+-----+
| |
| ... | BPF prog stack
| |
| |
current A64_SP => +-----+
| |
| ... | Function call stack
| |
+-----+
low
Signed-off-by: Yang Shi <yang.shi(a)linaro.org>
CC: Zi Shen Lim <zlim.lnx(a)gmail.com>
CC: Xi Wang <xi.wang(a)gmail.com>
---
arch/arm64/net/bpf_jit_comp.c | 38 +++++++++++++++++++++++++++++++-------
1 file changed, 31 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index a44e529..6809647 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -50,7 +50,7 @@ static const int bpf2a64[] = {
[BPF_REG_8] = A64_R(21),
[BPF_REG_9] = A64_R(22),
/* read-only frame pointer to access stack */
- [BPF_REG_FP] = A64_FP,
+ [BPF_REG_FP] = A64_R(25),
/* temporary register for internal BPF JIT */
[TMP_REG_1] = A64_R(23),
[TMP_REG_2] = A64_R(24),
@@ -155,18 +155,42 @@ static void build_prologue(struct jit_ctx *ctx)
stack_size += 4; /* extra for skb_copy_bits buffer */
stack_size = STACK_ALIGN(stack_size);
+ /*
+ * BPF prog stack layout
+ *
+ * high
+ * original A64_SP => 0:+-----+ BPF prologue
+ * | | FP/LR and callee saved registers
+ * BPF fp register => +64:+-----+
+ * | |
+ * | ... | BPF prog stack
+ * | |
+ * | |
+ * current A64_SP => +-----+
+ * | |
+ * | ... | Function call stack
+ * | |
+ * +-----+
+ * low
+ *
+ */
+
+ /* Save FP and LR registers to stay align with ARM64 AAPCS */
+ emit(A64_PUSH(A64_FP, A64_LR, A64_SP), ctx);
+
/* Save callee-saved register */
emit(A64_PUSH(r6, r7, A64_SP), ctx);
emit(A64_PUSH(r8, r9, A64_SP), ctx);
if (ctx->tmp_used)
emit(A64_PUSH(tmp1, tmp2, A64_SP), ctx);
- /* Set up BPF stack */
- emit(A64_SUB_I(1, A64_SP, A64_SP, stack_size), ctx);
-
- /* Set up frame pointer */
+ /* Set up BPF prog stack base register (x25) */
emit(A64_MOV(1, fp, A64_SP), ctx);
+ /* Set up function call stack */
+ emit(A64_SUB_I(1, A64_SP, A64_SP, stack_size), ctx);
+ emit(A64_MOV(1, A64_FP, A64_SP), ctx);
+
/* Clear registers A and X */
emit_a64_mov_i64(ra, 0, ctx);
emit_a64_mov_i64(rx, 0, ctx);
@@ -196,8 +220,8 @@ static void build_epilogue(struct jit_ctx *ctx)
emit(A64_POP(r8, r9, A64_SP), ctx);
emit(A64_POP(r6, r7, A64_SP), ctx);
- /* Restore frame pointer */
- emit(A64_MOV(1, fp, A64_SP), ctx);
+ /* Restore FP/LR registers */
+ emit(A64_POP(A64_FP, A64_LR, A64_SP), ctx);
/* Set return value */
emit(A64_MOV(1, A64_R(0), r0), ctx);
--
2.0.2
Tree/Branch: master
Git describe: v4.3-10418-g3934bbc
Commit: 3934bbc044 Merge tag 'md/4.4-rc0-fix' of git://neil.brown.name/md
Build Time: 5 min 29 sec
Passed: 3 / 8 ( 37.50 %)
Failed: 5 / 8 ( 62.50 %)
Errors: 87
Warnings: 7
Section Mismatches: 0
Failed defconfigs:
arm64-allnoconfig
arm64-allmodconfig
arm-multi_v5_defconfig
arm-multi_v7_defconfig
arm64-defconfig
Errors:
arm64-allnoconfig
grep: write error: No space left on device
../arch/arm64/kernel/vdso/gettimeofday.S:24:0: fatal error: closing dependency file arch/arm64/kernel/vdso/.gettimeofday.o.d: No space left on device
../arch/arm64/kernel/vdso/note.S:25:0: fatal error: closing dependency file arch/arm64/kernel/vdso/.note.o.d: No space left on device
../arch/arm64/kernel/vdso/sigreturn.S:24:0: fatal error: closing dependency file arch/arm64/kernel/vdso/.sigreturn.o.d: No space left on device
../arch/arm64/mm/dma-mapping.c:992:1: fatal error: error writing to /tmp/ccmzO6ck.s: No space left on device
../arch/arm64/kernel/head.S:40:0: fatal error: closing dependency file arch/arm64/kernel/.head.o.d: No space left on device
<built-in>: fatal error: closing dependency file arch/arm64/kernel/.vmlinux.lds.d: No space left on device
../init/main.c:1040:1: fatal error: error writing to /tmp/ccRQHNqj.s: No space left on device
../fs/open.c:1154:1: fatal error: closing dependency file fs/.open.o.d: No space left on device
../arch/arm64/mm/fault.c:556:1: fatal error: error writing to /tmp/ccHxsjUi.s: No space left on device
../init/do_mounts.c:648:1: fatal error: error writing to /tmp/ccerpoAa.s: No space left on device
../kernel/fork.c:2117:1: fatal error: error writing to /tmp/cc9SHjVD.s: No space left on device
../init/noinitramfs.c:52:1: fatal error: error closing /tmp/ccTokTHg.s: No space left on device
../security/commoncap.c:1061:1: fatal error: error writing to /tmp/ccanrKtp.s: No space left on device
../kernel/exec_domain.c:58:1: fatal error: error closing /tmp/ccG9uvgk.s: No space left on device
../mm/filemap.c:2732:1: fatal error: error writing to /tmp/cc2bvY9E.s: No space left on device
../arch/arm64/mm/init.c:364:1: fatal error: error writing to /tmp/ccWGFzg5.s: No space left on device
../fs/read_write.c:1289:1: fatal error: error writing to /tmp/ccdS3wvY.s: No space left on device
../kernel/capability.c:449:1: fatal error: error closing /tmp/ccTCtei7.s: No space left on device
../fs/namei.c:4616:1: fatal error: error closing /tmp/ccXwVWc9.s: No space left on device
../lib/halfmd4.c:67:1: fatal error: error writing to /tmp/ccKOA8np.s: No space left on device
../mm/page-writeback.c:2815:1: fatal error: error writing to /tmp/cc8XlSts.s: No space left on device
../lib/debug_locks.c:48:1: fatal error: error closing /tmp/ccdJkaPC.s: No space left on device
../drivers/base/class.c:600:1: fatal error: error writing to /tmp/cc41aP2h.s: No space left on device
../lib/random32.c:302:1: fatal error: error writing to /tmp/ccFEgMpS.s: No space left on device
../fs/select.c:1040:1: fatal error: error writing to /tmp/ccffTOhv.s: No space left on device
../mm/readahead.c:570:1: fatal error: error writing to /tmp/ccU38jlH.s: No space left on device
../lib/memweight.c:38:1: fatal error: error closing /tmp/ccvY3iGV.s: No space left on device
../mm/vmacache.c:109:1: fatal error: error closing /tmp/ccSSxB3V.s: No space left on device
../drivers/base/cpu.c:507:1: fatal error: error writing to /tmp/ccaQkLAV.s: No space left on device
../kernel/cred.c:696:1: fatal error: error writing to /tmp/cchAoMTY.s: No space left on device
../drivers/base/firmware.c:27:1: fatal error: error closing /tmp/cctkTN8F.s: No space left on device
../fs/dcache.c:3463:1: fatal error: error writing to /tmp/cckQpGIx.s: No space left on device
../lib/kfifo.c:605:1: fatal error: error writing to /tmp/cciFg0za.s: No space left on device
../mm/interval_tree.c:104:1: fatal error: error writing to /tmp/ccasuRYn.s: No space left on device
../drivers/base/init.c:39:1: fatal error: error closing /tmp/ccd0ZsIU.s: No space left on device
../fs/inode.c:2030:1: fatal error: error writing to /tmp/ccZb7vJk.s: No space left on device
../fs/attr.c:278:1: fatal error: error writing to /tmp/cc2evlB1.s: No space left on device
../include/linux/init.h:247:16: fatal error: error writing to /tmp/cc4SHxZG.s: No space left on device
../drivers/base/map.c:154:1: fatal error: error writing to /tmp/ccxpfizb.s: No space left on device
../lib/percpu-refcount.c:331:1: fatal error: error writing to /tmp/cclfocz2.s: No space left on device
../fs/bad_inode.c:214:1: fatal error: error writing to /tmp/ccWF1oZd.s: No space left on device
../mm/list_lru.c:583:1: fatal error: error writing to /tmp/ccq3Mh0b.s: No space left on device
../kernel/async.c:328:1: fatal error: error writing to /tmp/ccv6uh1t.s: No space left on device
../drivers/base/devres.c:987:1: fatal error: error writing to /tmp/ccwWcg2w.s: No space left on device
../drivers/base/attribute_container.c:442:1: fatal error: error writing to /tmp/ccEThIMB.s: No space left on device
../lib/percpu_ida.c:390:1: fatal error: error writing to /tmp/ccFQYwnz.s: No space left on device
../kernel/range.c:163:1: fatal error: error writing to /tmp/cc2ocFz5.s: No space left on device
../mm/workingset.c:415:1: fatal error: error writing to /tmp/ccNbGYgT.s: No space left on device
../drivers/base/transport_class.c:280:1: fatal error: error writing to /tmp/cco1OXud.s: No space left on device
../fs/file.c:981:1: fatal error: error writing to /tmp/ccaiVFLp.s: No space left on device
../drivers/base/topology.c:155:1: fatal error: closing dependency file drivers/base/.topology.o.d: No space left on device
../kernel/smpboot.c:455:1: fatal error: error writing to /tmp/ccDl2MDd.s: No space left on device
../mm/debug.c:107:1: fatal error: closing dependency file mm/.debug.o.d: No space left on device
../drivers/base/container.c:44:1: fatal error: error closing /tmp/ccfpl3mJ.s: No space left on device
../fs/filesystems.c:288:1: fatal error: error writing to /tmp/ccvRIpJA.s: No space left on device
../kernel/irq/irqdesc.c:647:1: fatal error: error writing to /tmp/ccgHQsMq.s: No space left on device
../lib/rhashtable.c:842:1: fatal error: error writing to /tmp/ccmjJU7a.s: No space left on device
arm64-allmodconfig
cat: write error: No space left on device
cat: write error: No space left on device
../scripts/mod/empty.c:1:0: fatal error: error closing /tmp/cc11HMqF.s: No space left on device
../scripts/genksyms/genksyms.c:875:1: fatal error: error writing to /tmp/cclVuTHa.s: No space left on device
../scripts/selinux/genheaders/genheaders.c:138:1: fatal error: error writing to /tmp/ccGvoo3J.s: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
../scripts/recordmcount.c:509:1: fatal error: error writing to /tmp/ccskBJpo.s: No space left on device
../scripts/sign-file.c:323:1: fatal error: error writing to /tmp/ccDduidV.s: No space left on device
../scripts/asn1_compiler.c:1615:1: fatal error: error writing to /tmp/cc7LMZYG.s: No space left on device
collect2: error: ld returned 1 exit status
arm-multi_v7_defconfig
../arch/arm/vdso/vgettimeofday.c:282:1: fatal error: error writing to /tmp/ccideKMd.s: No space left on device
../arch/arm/vdso/datapage.S:3:0: fatal error: closing dependency file arch/arm/vdso/.datapage.o.d: No space left on device
../arch/arm/kernel/elf.c:91:1: fatal error: error writing to /tmp/cchFpJxd.s: No space left on device
../arch/arm/kernel/entry-common.S:308:0: fatal error: closing dependency file arch/arm/kernel/.entry-common.o.d: No space left on device
../arch/arm/vdso/vdsomunge.c:220:1: fatal error: error writing to /tmp/cc0xLmO8.s: No space left on device
../arch/arm/vfp/vfpmodule.c:824:1: fatal error: error writing to /tmp/ccF0HXEZ.s: No space left on device
../arch/arm/vfp/entry.S:17:0: fatal error: closing dependency file arch/arm/vfp/.entry.o.d: No space left on device
../arch/arm/mach-bcm/bcm_kona_smc.c:182:1: fatal error: error writing to /tmp/cclKkb11.s: No space left on device
../arch/arm/mach-bcm/bcm_5301x.c:57:1: fatal error: error closing /tmp/cc720GDc.s: No space left on device
../arch/arm/crypto/sha512-glue.c:121:1: fatal error: error writing to /tmp/ccKZfEYR.s: No space left on device
../arch/arm/kernel/suspend.c:102:1: fatal error: error writing to /tmp/cc9eVeK0.s: No space left on device
../arch/arm/mm/copypage-v6.c:140:1: fatal error: error closing /tmp/ccA6143i.s: No space left on device
../arch/arm/mach-bcm/brcmstb.c:28:1: fatal error: error closing /tmp/cchuynLC.s: No space left on device
../arch/arm/mach-bcm/platsmp-brcmstb.c:368:1: fatal error: error writing to /tmp/ccM17zGK.s: No space left on device
../arch/arm/mm/context.c:266:1: fatal error: error writing to /tmp/cczvTZD6.s: No space left on device
../arch/arm/kernel/smp.c:767:1: fatal error: error writing to /tmp/cc4dxvPg.s: No space left on device
../arch/arm/mm/tlb-v7.S:21:0: fatal error: closing dependency file arch/arm/mm/.tlb-v7.o.d: No space left on device
../arch/arm/mm/proc-v7.S:26:0: fatal error: closing dependency file arch/arm/mm/.proc-v7.o.d: No space left on device
../arch/arm/kernel/smp_tlb.c:213:1: fatal error: error writing to /tmp/cc49YjcU.s: No space left on device
../arch/arm/kernel/smp_scu.c:96:1: fatal error: error closing /tmp/ccWngrZe.s: No space left on device
../arch/arm/crypto/sha512-neon-glue.c:98:1: fatal error: error writin../scripts/Makefile.build:258: recipe for target 'block/partitions/msdos.o' failed
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
1 warnings 0 mismatches : arm64-allnoconfig
1 warnings 0 mismatches : arm64-allmodconfig
2 warnings 0 mismatches : arm-multi_v5_defconfig
4 warnings 0 mismatches : arm-multi_v7_defconfig
1 warnings 0 mismatches : x86_64-defconfig
1 warnings 0 mismatches : arm-allnoconfig
1 warnings 0 mismatches : arm64-defconfig
-------------------------------------------------------------------------------
Errors summary: 87
6 cat: write error: No space left on device
1 grep: write error: No space left on device
1 collect2: error: ld returned 1 exit status
1 <built-in>: fatal error: closing dependency file arch/arm64/kernel/.vmlinux.lds.d: No space left on device
1 ../security/commoncap.c:1061:1: fatal error: error writing to /tmp/ccanrKtp.s: No space left on device
1 ../scripts/sign-file.c:323:1: fatal error: error writing to /tmp/ccDduidV.s: No space left on device
1 ../scripts/selinux/genheaders/genheaders.c:138:1: fatal error: error writing to /tmp/ccGvoo3J.s: No space left on device
1 ../scripts/recordmcount.c:509:1: fatal error: error writing to /tmp/ccskBJpo.s: No space left on device
1 ../scripts/mod/empty.c:1:0: fatal error: error closing /tmp/cc11HMqF.s: No space left on device
1 ../scripts/genksyms/genksyms.c:875:1: fatal error: error writing to /tmp/cclVuTHa.s: No space left on device
1 ../scripts/asn1_compiler.c:1615:1: fatal error: error writing to /tmp/cc7LMZYG.s: No space left on device
1 ../mm/workingset.c:415:1: fatal error: error writing to /tmp/ccNbGYgT.s: No space left on device
1 ../mm/vmacache.c:109:1: fatal error: error closing /tmp/ccSSxB3V.s: No space left on device
1 ../mm/readahead.c:570:1: fatal error: error writing to /tmp/ccU38jlH.s: No space left on device
1 ../mm/page-writeback.c:2815:1: fatal error: error writing to /tmp/cc8XlSts.s: No space left on device
1 ../mm/list_lru.c:583:1: fatal error: error writing to /tmp/ccq3Mh0b.s: No space left on device
1 ../mm/interval_tree.c:104:1: fatal error: error writing to /tmp/ccasuRYn.s: No space left on device
1 ../mm/filemap.c:2732:1: fatal error: error writing to /tmp/cc2bvY9E.s: No space left on device
1 ../mm/debug.c:107:1: fatal error: closing dependency file mm/.debug.o.d: No space left on device
1 ../lib/rhashtable.c:842:1: fatal error: error writing to /tmp/ccmjJU7a.s: No space left on device
1 ../lib/random32.c:302:1: fatal error: error writing to /tmp/ccFEgMpS.s: No space left on device
1 ../lib/percpu_ida.c:390:1: fatal error: error writing to /tmp/ccFQYwnz.s: No space left on device
1 ../lib/percpu-refcount.c:331:1: fatal error: error writing to /tmp/cclfocz2.s: No space left on device
1 ../lib/memweight.c:38:1: fatal error: error closing /tmp/ccvY3iGV.s: No space left on device
1 ../lib/kfifo.c:605:1: fatal error: error writing to /tmp/cciFg0za.s: No space left on device
1 ../lib/halfmd4.c:67:1: fatal error: error writing to /tmp/ccKOA8np.s: No space left on device
1 ../lib/debug_locks.c:48:1: fatal error: error closing /tmp/ccdJkaPC.s: No space left on device
1 ../kernel/smpboot.c:455:1: fatal error: error writing to /tmp/ccDl2MDd.s: No space left on device
1 ../kernel/range.c:163:1: fatal error: error writing to /tmp/cc2ocFz5.s: No space left on device
1 ../kernel/irq/irqdesc.c:647:1: fatal error: error writing to /tmp/ccgHQsMq.s: No space left on device
1 ../kernel/fork.c:2117:1: fatal error: error writing to /tmp/cc9SHjVD.s: No space left on device
1 ../kernel/exec_domain.c:58:1: fatal error: error closing /tmp/ccG9uvgk.s: No space left on device
1 ../kernel/cred.c:696:1: fatal error: error writing to /tmp/cchAoMTY.s: No space left on device
1 ../kernel/capability.c:449:1: fatal error: error closing /tmp/ccTCtei7.s: No space left on device
1 ../kernel/async.c:328:1: fatal error: error writing to /tmp/ccv6uh1t.s: No space left on device
1 ../init/noinitramfs.c:52:1: fatal error: error closing /tmp/ccTokTHg.s: No space left on device
1 ../init/main.c:1040:1: fatal error: error writing to /tmp/ccRQHNqj.s: No space left on device
1 ../init/do_mounts.c:648:1: fatal error: error writing to /tmp/ccerpoAa.s: No space left on device
1 ../include/linux/init.h:247:16: fatal error: error writing to /tmp/cc4SHxZG.s: No space left on device
1 ../fs/select.c:1040:1: fatal error: error writing to /tmp/ccffTOhv.s: No space left on device
1 ../fs/read_write.c:1289:1: fatal error: error writing to /tmp/ccdS3wvY.s: No space left on device
1 ../fs/open.c:1154:1: fatal error: closing dependency file fs/.open.o.d: No space left on device
1 ../fs/namei.c:4616:1: fatal error: error closing /tmp/ccXwVWc9.s: No space left on device
1 ../fs/inode.c:2030:1: fatal error: error writing to /tmp/ccZb7vJk.s: No space left on device
1 ../fs/filesystems.c:288:1: fatal error: error writing to /tmp/ccvRIpJA.s: No space left on device
1 ../fs/file.c:981:1: fatal error: error writing to /tmp/ccaiVFLp.s: No space left on device
1 ../fs/dcache.c:3463:1: fatal error: error writing to /tmp/cckQpGIx.s: No space left on device
1 ../fs/bad_inode.c:214:1: fatal error: error writing to /tmp/ccWF1oZd.s: No space left on device
1 ../fs/attr.c:278:1: fatal error: error writing to /tmp/cc2evlB1.s: No space left on device
1 ../drivers/base/transport_class.c:280:1: fatal error: error writing to /tmp/cco1OXud.s: No space left on device
1 ../drivers/base/topology.c:155:1: fatal error: closing dependency file drivers/base/.topology.o.d: No space left on device
1 ../drivers/base/map.c:154:1: fatal error: error writing to /tmp/ccxpfizb.s: No space left on device
1 ../drivers/base/init.c:39:1: fatal error: error closing /tmp/ccd0ZsIU.s: No space left on device
1 ../drivers/base/firmware.c:27:1: fatal error: error closing /tmp/cctkTN8F.s: No space left on device
1 ../drivers/base/devres.c:987:1: fatal error: error writing to /tmp/ccwWcg2w.s: No space left on device
1 ../drivers/base/cpu.c:507:1: fatal error: error writing to /tmp/ccaQkLAV.s: No space left on device
1 ../drivers/base/container.c:44:1: fatal error: error closing /tmp/ccfpl3mJ.s: No space left on device
1 ../drivers/base/class.c:600:1: fatal error: error writing to /tmp/cc41aP2h.s: No space left on device
1 ../drivers/base/attribute_container.c:442:1: fatal error: error writing to /tmp/ccEThIMB.s: No space left on device
1 ../arch/arm64/mm/init.c:364:1: fatal error: error writing to /tmp/ccWGFzg5.s: No space left on device
1 ../arch/arm64/mm/fault.c:556:1: fatal error: error writing to /tmp/ccHxsjUi.s: No space left on device
1 ../arch/arm64/mm/dma-mapping.c:992:1: fatal error: error writing to /tmp/ccmzO6ck.s: No space left on device
1 ../arch/arm64/kernel/vdso/sigreturn.S:24:0: fatal error: closing dependency file arch/arm64/kernel/vdso/.sigreturn.o.d: No space left on device
1 ../arch/arm64/kernel/vdso/note.S:25:0: fatal error: closing dependency file arch/arm64/kernel/vdso/.note.o.d: No space left on device
1 ../arch/arm64/kernel/vdso/gettimeofday.S:24:0: fatal error: closing dependency file arch/arm64/kernel/vdso/.gettimeofday.o.d: No space left on device
1 ../arch/arm64/kernel/head.S:40:0: fatal error: closing dependency file arch/arm64/kernel/.head.o.d: No space left on device
1 ../arch/arm/vfp/vfpmodule.c:824:1: fatal error: error writing to /tmp/ccF0HXEZ.s: No space left on device
1 ../arch/arm/vfp/entry.S:17:0: fatal error: closing dependency file arch/arm/vfp/.entry.o.d: No space left on device
1 ../arch/arm/vdso/vgettimeofday.c:282:1: fatal error: error writing to /tmp/ccideKMd.s: No space left on device
1 ../arch/arm/vdso/vdsomunge.c:220:1: fatal error: error writing to /tmp/cc0xLmO8.s: No space left on device
1 ../arch/arm/vdso/datapage.S:3:0: fatal error: closing dependency file arch/arm/vdso/.datapage.o.d: No space left on device
1 ../arch/arm/mm/tlb-v7.S:21:0: fatal error: closing dependency file arch/arm/mm/.tlb-v7.o.d: No space left on device
1 ../arch/arm/mm/proc-v7.S:26:0: fatal error: closing dependency file arch/arm/mm/.proc-v7.o.d: No space left on device
1 ../arch/arm/mm/copypage-v6.c:140:1: fatal error: error closing /tmp/ccA6143i.s: No space left on device
1 ../arch/arm/mm/context.c:266:1: fatal error: error writing to /tmp/cczvTZD6.s: No space left on device
1 ../arch/arm/mach-bcm/platsmp-brcmstb.c:368:1: fatal error: error writing to /tmp/ccM17zGK.s: No space left on device
1 ../arch/arm/mach-bcm/brcmstb.c:28:1: fatal error: error closing /tmp/cchuynLC.s: No space left on device
1 ../arch/arm/mach-bcm/bcm_kona_smc.c:182:1: fatal error: error writing to /tmp/cclKkb11.s: No space left on device
1 ../arch/arm/mach-bcm/bcm_5301x.c:57:1: fatal error: error closing /tmp/cc720GDc.s: No space left on device
1 ../arch/arm/kernel/suspend.c:102:1: fatal error: error writing to /tmp/cc9eVeK0.s: No space left on device
1 ../arch/arm/kernel/smp_tlb.c:213:1: fatal error: error writing to /tmp/cc49YjcU.s: No space left on device
1 ../arch/arm/kernel/smp_scu.c:96:1: fatal error: error closing /tmp/ccWngrZe.s: No space left on device
1 ../arch/arm/kernel/smp.c:767:1: fatal error: error writing to /tmp/cc4dxvPg.s: No space left on device
1 ../arch/arm/kernel/entry-common.S:308:0: fatal error: closing dependency file arch/arm/kernel/.entry-common.o.d: No space left on device
1 ../arch/arm/kernel/elf.c:91:1: fatal error: error writing to /tmp/cchFpJxd.s: No space left on device
1 ../arch/arm/crypto/sha512-neon-glue.c:98:1: fatal error: error writin../scripts/Makefile.build:258: recipe for target 'block/partitions/msdos.o' failed
1 ../arch/arm/crypto/sha512-glue.c:121:1: fatal error: error writing to /tmp/ccKZfEYR.s: No space left on device
Warnings Summary: 7
3 <stdin>:1304:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
3 ../drivers/regulator/core.c:142:6: warning: unused variable 'i' [-Wunused-variable]
1 ../scripts/mod/devicetable-offsets.c:206:1: warning: error writing 'scripts/mod/devicetable-offsets.gcno'
1 ../net/netfilter/nfnetlink_log.c:320:14: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../net/bluetooth/mgmt.c:6635:8: warning: 'r192' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../net/bluetooth/mgmt.c:6635:8: warning: 'h192' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../kernel/sched/rt.c:68:13: warning: 'push_irq_work_func' declared 'static' but never defined [-Wunused-function]
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm64-allnoconfig : FAIL, 58 errors, 1 warnings, 0 section mismatches
Errors:
grep: write error: No space left on device
../arch/arm64/kernel/vdso/gettimeofday.S:24:0: fatal error: closing dependency file arch/arm64/kernel/vdso/.gettimeofday.o.d: No space left on device
../arch/arm64/kernel/vdso/note.S:25:0: fatal error: closing dependency file arch/arm64/kernel/vdso/.note.o.d: No space left on device
../arch/arm64/kernel/vdso/sigreturn.S:24:0: fatal error: closing dependency file arch/arm64/kernel/vdso/.sigreturn.o.d: No space left on device
../arch/arm64/mm/dma-mapping.c:992:1: fatal error: error writing to /tmp/ccmzO6ck.s: No space left on device
../arch/arm64/kernel/head.S:40:0: fatal error: closing dependency file arch/arm64/kernel/.head.o.d: No space left on device
<built-in>: fatal error: closing dependency file arch/arm64/kernel/.vmlinux.lds.d: No space left on device
../init/main.c:1040:1: fatal error: error writing to /tmp/ccRQHNqj.s: No space left on device
../fs/open.c:1154:1: fatal error: closing dependency file fs/.open.o.d: No space left on device
../arch/arm64/mm/fault.c:556:1: fatal error: error writing to /tmp/ccHxsjUi.s: No space left on device
../init/do_mounts.c:648:1: fatal error: error writing to /tmp/ccerpoAa.s: No space left on device
../kernel/fork.c:2117:1: fatal error: error writing to /tmp/cc9SHjVD.s: No space left on device
../init/noinitramfs.c:52:1: fatal error: error closing /tmp/ccTokTHg.s: No space left on device
../security/commoncap.c:1061:1: fatal error: error writing to /tmp/ccanrKtp.s: No space left on device
../kernel/exec_domain.c:58:1: fatal error: error closing /tmp/ccG9uvgk.s: No space left on device
../mm/filemap.c:2732:1: fatal error: error writing to /tmp/cc2bvY9E.s: No space left on device
../arch/arm64/mm/init.c:364:1: fatal error: error writing to /tmp/ccWGFzg5.s: No space left on device
../fs/read_write.c:1289:1: fatal error: error writing to /tmp/ccdS3wvY.s: No space left on device
../kernel/capability.c:449:1: fatal error: error closing /tmp/ccTCtei7.s: No space left on device
../fs/namei.c:4616:1: fatal error: error closing /tmp/ccXwVWc9.s: No space left on device
../lib/halfmd4.c:67:1: fatal error: error writing to /tmp/ccKOA8np.s: No space left on device
../mm/page-writeback.c:2815:1: fatal error: error writing to /tmp/cc8XlSts.s: No space left on device
../lib/debug_locks.c:48:1: fatal error: error closing /tmp/ccdJkaPC.s: No space left on device
../drivers/base/class.c:600:1: fatal error: error writing to /tmp/cc41aP2h.s: No space left on device
../lib/random32.c:302:1: fatal error: error writing to /tmp/ccFEgMpS.s: No space left on device
../fs/select.c:1040:1: fatal error: error writing to /tmp/ccffTOhv.s: No space left on device
../mm/readahead.c:570:1: fatal error: error writing to /tmp/ccU38jlH.s: No space left on device
../lib/memweight.c:38:1: fatal error: error closing /tmp/ccvY3iGV.s: No space left on device
../mm/vmacache.c:109:1: fatal error: error closing /tmp/ccSSxB3V.s: No space left on device
../drivers/base/cpu.c:507:1: fatal error: error writing to /tmp/ccaQkLAV.s: No space left on device
../kernel/cred.c:696:1: fatal error: error writing to /tmp/cchAoMTY.s: No space left on device
../drivers/base/firmware.c:27:1: fatal error: error closing /tmp/cctkTN8F.s: No space left on device
../fs/dcache.c:3463:1: fatal error: error writing to /tmp/cckQpGIx.s: No space left on device
../lib/kfifo.c:605:1: fatal error: error writing to /tmp/cciFg0za.s: No space left on device
../mm/interval_tree.c:104:1: fatal error: error writing to /tmp/ccasuRYn.s: No space left on device
../drivers/base/init.c:39:1: fatal error: error closing /tmp/ccd0ZsIU.s: No space left on device
../fs/inode.c:2030:1: fatal error: error writing to /tmp/ccZb7vJk.s: No space left on device
../fs/attr.c:278:1: fatal error: error writing to /tmp/cc2evlB1.s: No space left on device
../include/linux/init.h:247:16: fatal error: error writing to /tmp/cc4SHxZG.s: No space left on device
../drivers/base/map.c:154:1: fatal error: error writing to /tmp/ccxpfizb.s: No space left on device
../lib/percpu-refcount.c:331:1: fatal error: error writing to /tmp/cclfocz2.s: No space left on device
../fs/bad_inode.c:214:1: fatal error: error writing to /tmp/ccWF1oZd.s: No space left on device
../mm/list_lru.c:583:1: fatal error: error writing to /tmp/ccq3Mh0b.s: No space left on device
../kernel/async.c:328:1: fatal error: error writing to /tmp/ccv6uh1t.s: No space left on device
../drivers/base/devres.c:987:1: fatal error: error writing to /tmp/ccwWcg2w.s: No space left on device
../drivers/base/attribute_container.c:442:1: fatal error: error writing to /tmp/ccEThIMB.s: No space left on device
../lib/percpu_ida.c:390:1: fatal error: error writing to /tmp/ccFQYwnz.s: No space left on device
../kernel/range.c:163:1: fatal error: error writing to /tmp/cc2ocFz5.s: No space left on device
../mm/workingset.c:415:1: fatal error: error writing to /tmp/ccNbGYgT.s: No space left on device
../drivers/base/transport_class.c:280:1: fatal error: error writing to /tmp/cco1OXud.s: No space left on device
../fs/file.c:981:1: fatal error: error writing to /tmp/ccaiVFLp.s: No space left on device
../drivers/base/topology.c:155:1: fatal error: closing dependency file drivers/base/.topology.o.d: No space left on device
../kernel/smpboot.c:455:1: fatal error: error writing to /tmp/ccDl2MDd.s: No space left on device
../mm/debug.c:107:1: fatal error: closing dependency file mm/.debug.o.d: No space left on device
../drivers/base/container.c:44:1: fatal error: error closing /tmp/ccfpl3mJ.s: No space left on device
../fs/filesystems.c:288:1: fatal error: error writing to /tmp/ccvRIpJA.s: No space left on device
../kernel/irq/irqdesc.c:647:1: fatal error: error writing to /tmp/ccgHQsMq.s: No space left on device
../lib/rhashtable.c:842:1: fatal error: error writing to /tmp/ccmjJU7a.s: No space left on device
Warnings:
../kernel/sched/rt.c:68:13: warning: 'push_irq_work_func' declared 'static' but never defined [-Wunused-function]
-------------------------------------------------------------------------------
arm64-allmodconfig : FAIL, 13 errors, 1 warnings, 0 section mismatches
Errors:
cat: write error: No space left on device
cat: write error: No space left on device
../scripts/mod/empty.c:1:0: fatal error: error closing /tmp/cc11HMqF.s: No space left on device
../scripts/genksyms/genksyms.c:875:1: fatal error: error writing to /tmp/cclVuTHa.s: No space left on device
../scripts/selinux/genheaders/genheaders.c:138:1: fatal error: error writing to /tmp/ccGvoo3J.s: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
../scripts/recordmcount.c:509:1: fatal error: error writing to /tmp/ccskBJpo.s: No space left on device
../scripts/sign-file.c:323:1: fatal error: error writing to /tmp/ccDduidV.s: No space left on device
../scripts/asn1_compiler.c:1615:1: fatal error: error writing to /tmp/cc7LMZYG.s: No space left on device
collect2: error: ld returned 1 exit status
Warnings:
../scripts/mod/devicetable-offsets.c:206:1: warning: error writing 'scripts/mod/devicetable-offsets.gcno'
-------------------------------------------------------------------------------
arm-multi_v5_defconfig : FAIL, 0 errors, 2 warnings, 0 section mismatches
Warnings:
<stdin>:1304:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
../drivers/regulator/core.c:142:6: warning: unused variable 'i' [-Wunused-variable]
-------------------------------------------------------------------------------
arm-multi_v7_defconfig : FAIL, 21 errors, 4 warnings, 0 section mismatches
Errors:
../arch/arm/vdso/vgettimeofday.c:282:1: fatal error: error writing to /tmp/ccideKMd.s: No space left on device
../arch/arm/vdso/datapage.S:3:0: fatal error: closing dependency file arch/arm/vdso/.datapage.o.d: No space left on device
../arch/arm/kernel/elf.c:91:1: fatal error: error writing to /tmp/cchFpJxd.s: No space left on device
../arch/arm/kernel/entry-common.S:308:0: fatal error: closing dependency file arch/arm/kernel/.entry-common.o.d: No space left on device
../arch/arm/vdso/vdsomunge.c:220:1: fatal error: error writing to /tmp/cc0xLmO8.s: No space left on device
../arch/arm/vfp/vfpmodule.c:824:1: fatal error: error writing to /tmp/ccF0HXEZ.s: No space left on device
../arch/arm/vfp/entry.S:17:0: fatal error: closing dependency file arch/arm/vfp/.entry.o.d: No space left on device
../arch/arm/mach-bcm/bcm_kona_smc.c:182:1: fatal error: error writing to /tmp/cclKkb11.s: No space left on device
../arch/arm/mach-bcm/bcm_5301x.c:57:1: fatal error: error closing /tmp/cc720GDc.s: No space left on device
../arch/arm/crypto/sha512-glue.c:121:1: fatal error: error writing to /tmp/ccKZfEYR.s: No space left on device
../arch/arm/kernel/suspend.c:102:1: fatal error: error writing to /tmp/cc9eVeK0.s: No space left on device
../arch/arm/mm/copypage-v6.c:140:1: fatal error: error closing /tmp/ccA6143i.s: No space left on device
../arch/arm/mach-bcm/brcmstb.c:28:1: fatal error: error closing /tmp/cchuynLC.s: No space left on device
../arch/arm/mach-bcm/platsmp-brcmstb.c:368:1: fatal error: error writing to /tmp/ccM17zGK.s: No space left on device
../arch/arm/mm/context.c:266:1: fatal error: error writing to /tmp/cczvTZD6.s: No space left on device
../arch/arm/kernel/smp.c:767:1: fatal error: error writing to /tmp/cc4dxvPg.s: No space left on device
../arch/arm/mm/tlb-v7.S:21:0: fatal error: closing dependency file arch/arm/mm/.tlb-v7.o.d: No space left on device
../arch/arm/mm/proc-v7.S:26:0: fatal error: closing dependency file arch/arm/mm/.proc-v7.o.d: No space left on device
../arch/arm/kernel/smp_tlb.c:213:1: fatal error: error writing to /tmp/cc49YjcU.s: No space left on device
../arch/arm/kernel/smp_scu.c:96:1: fatal error: error closing /tmp/ccWngrZe.s: No space left on device
../arch/arm/crypto/sha512-neon-glue.c:98:1: fatal error: error writin../scripts/Makefile.build:258: recipe for target 'block/partitions/msdos.o' failed
Warnings:
<stdin>:1304:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
../net/bluetooth/mgmt.c:6635:8: warning: 'r192' may be used uninitialized in this function [-Wmaybe-uninitialized]
../net/bluetooth/mgmt.c:6635:8: warning: 'h192' may be used uninitialized in this function [-Wmaybe-uninitialized]
../drivers/regulator/core.c:142:6: warning: unused variable 'i' [-Wunused-variable]
-------------------------------------------------------------------------------
x86_64-defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../net/netfilter/nfnetlink_log.c:320:14: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
-------------------------------------------------------------------------------
arm-allnoconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
<stdin>:1304:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
-------------------------------------------------------------------------------
arm64-defconfig : FAIL, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../drivers/regulator/core.c:142:6: warning: unused variable 'i' [-Wunused-variable]
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
x86_64-allnoconfig
FRAME_POINTER is defined in lib/Kconfig.debug, it is unnecessary to redefine
it in arch/arm64/Kconfig.debug. Actually, the one defined in arm64 directory
is never used.
This adds a dependency on DEBUG_KERNEL for building with frame pointers.
ARM64 depends on frame pointer to get correct stack backtrace and need
FRAME_POINTER kconfig option enabled all the time.
However, currect implementation makes it could be disabled, so force it
to be selected by ARM64.
Signed-off-by: Yang Shi <yang.shi(a)linaro.org>
---
change v3 --> v2:
squash two patches into one.
arch/arm64/Kconfig | 1 +
arch/arm64/Kconfig.debug | 4 ----
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 440d906..b554da2 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -27,6 +27,7 @@ config ARM64
select CPU_PM if (SUSPEND || CPU_IDLE)
select DCACHE_WORD_ACCESS
select EDAC_SUPPORT
+ select FRAME_POINTER
select GENERIC_ALLOCATOR
select GENERIC_CLOCKEVENTS
select GENERIC_CLOCKEVENTS_BROADCAST
diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug
index d6285ef..915dea7 100644
--- a/arch/arm64/Kconfig.debug
+++ b/arch/arm64/Kconfig.debug
@@ -2,10 +2,6 @@ menu "Kernel hacking"
source "lib/Kconfig.debug"
-config FRAME_POINTER
- bool
- default y
-
config ARM64_PTDUMP
bool "Export kernel pagetable layout to userspace via debugfs"
depends on DEBUG_KERNEL
--
2.0.2
Hi Rafael,
All the bindings are Reviewed by Stephen now and Rob didn't had a
problem with them (though he didn't Ack them separately yet) :)
The first patch enables us to select only a subset of OPPs from the
bigger table, based on what version of the hardware we are running on.
The second one enables us to select slightly different values for
multiple properties, based on what kind of hardware they are running on.
The third one removes an (unused) binding, which is replaced by the
second patch with a better solution.
The fourth patch is based on what Stephen suggested (and then reviewed)
in the earlier series, and the 5th one updates the existing users of
these bindings for it.
Viresh Kumar (5):
PM / OPP: Add "opp-supported-hw" binding
PM / OPP: Add
{opp-microvolt|opp-microamp|turbo-mode|opp-suspend}-<name> binding
PM / OPP: Remove 'operating-points-names' binding
PM / OPP: Rename OPP nodes as opp@<opp-hz>
ARM: dts: exynos4412: Rename OPP nodes as opp@<opp-hz>
Documentation/devicetree/bindings/opp/opp.txt | 143 +++++++++++++++++++-------
arch/arm/boot/dts/exynos4412.dtsi | 28 ++---
2 files changed, 118 insertions(+), 53 deletions(-)
--
2.6.2.198.g614a2ac
According to the discussion on the mailing list, this version adds a new patch
to force select FRAME_POINTER for ARM64.
Change v2 --> v1:
1. Adds a new patch to force select FRAME_POINTER
2. Notes that this change adds a dependency on DEBUG_KERNEL for building with
frame pointers
Yang Shi (2):
arm64: remove redundant FRAME_POINTER kconfig option
arm64: force to select FRAME_POINTER
arch/arm64/Kconfig | 1 +
arch/arm64/Kconfig.debug | 4 ----
2 files changed, 1 insertion(+), 4 deletions(-)
FRAME_POINTER is defined in lib/Kconfig.debug, it is unnecessary to redefine
it in arch/arm64/Kconfig.debug.
Signed-off-by: Yang Shi <yang.shi(a)linaro.org>
---
arch/arm64/Kconfig.debug | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug
index d6285ef..915dea7 100644
--- a/arch/arm64/Kconfig.debug
+++ b/arch/arm64/Kconfig.debug
@@ -2,10 +2,6 @@ menu "Kernel hacking"
source "lib/Kconfig.debug"
-config FRAME_POINTER
- bool
- default y
-
config ARM64_PTDUMP
bool "Export kernel pagetable layout to userspace via debugfs"
depends on DEBUG_KERNEL
--
2.0.2
aarch64 and s390x support eBPF JIT too, correct document to reflect this and
avoid any confusion.
Signed-off-by: Yang Shi <yang.shi(a)linaro.org>
---
Documentation/networking/filter.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/networking/filter.txt b/Documentation/networking/filter.txt
index 135581f..96da119 100644
--- a/Documentation/networking/filter.txt
+++ b/Documentation/networking/filter.txt
@@ -596,9 +596,9 @@ skb pointer). All constraints and restrictions from bpf_check_classic() apply
before a conversion to the new layout is being done behind the scenes!
Currently, the classic BPF format is being used for JITing on most of the
-architectures. Only x86-64 performs JIT compilation from eBPF instruction set,
-however, future work will migrate other JIT compilers as well, so that they
-will profit from the very same benefits.
+architectures. x86-64, aarch64 and s390x perform JIT compilation from eBPF
+instruction set, however, future work will migrate other JIT compilers as well,
+so that they will profit from the very same benefits.
Some core changes of the new internal format:
--
2.0.2
ARM64 JIT used FP (x29) as eBPF fp register, but FP is subjected to
change during function call so it may cause the BPF prog stack base address
change too. Whenever, it pointed to the bottom of BPF prog stack instead of
the top.
So, when copying data via bpf_probe_read, it will be copied to (SP - offset),
then it may overwrite the saved FP/LR.
Use x25 to replace FP as BPF stack base register (fp). Since x25 is callee
saved register, so it will keep intact during function call.
It is initialized in BPF prog prologue when BPF prog is started to run
everytime. When BPF prog exits, it could be just tossed.
Other than this the BPf prog stack base need to be setup before function
call stack.
So, the BPF stack layout looks like:
high
original A64_SP => 0:+-----+ BPF prologue
| | FP/LR and callee saved registers
BPF fp register => +64:+-----+
| |
| ... | BPF prog stack
| |
| |
current A64_SP => +-----+
| |
| ... | Function call stack
| |
+-----+
low
Signed-off-by: Yang Shi <yang.shi(a)linaro.org>
CC: Zi Shen Lim <zlim.lnx(a)gmail.com>
CC: Xi Wang <xi.wang(a)gmail.com>
---
arch/arm64/net/bpf_jit_comp.c | 38 +++++++++++++++++++++++++++++++-------
1 file changed, 31 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index a44e529..6809647 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -50,7 +50,7 @@ static const int bpf2a64[] = {
[BPF_REG_8] = A64_R(21),
[BPF_REG_9] = A64_R(22),
/* read-only frame pointer to access stack */
- [BPF_REG_FP] = A64_FP,
+ [BPF_REG_FP] = A64_R(25),
/* temporary register for internal BPF JIT */
[TMP_REG_1] = A64_R(23),
[TMP_REG_2] = A64_R(24),
@@ -155,18 +155,42 @@ static void build_prologue(struct jit_ctx *ctx)
stack_size += 4; /* extra for skb_copy_bits buffer */
stack_size = STACK_ALIGN(stack_size);
+ /*
+ * BPF prog stack layout
+ *
+ * high
+ * original A64_SP => 0:+-----+ BPF prologue
+ * | | FP/LR and callee saved registers
+ * BPF fp register => +64:+-----+
+ * | |
+ * | ... | BPF prog stack
+ * | |
+ * | |
+ * current A64_SP => +-----+
+ * | |
+ * | ... | Function call stack
+ * | |
+ * +-----+
+ * low
+ *
+ */
+
+ /* Save FP and LR registers to stay align with ARM64 AAPCS */
+ emit(A64_PUSH(A64_FP, A64_LR, A64_SP), ctx);
+
/* Save callee-saved register */
emit(A64_PUSH(r6, r7, A64_SP), ctx);
emit(A64_PUSH(r8, r9, A64_SP), ctx);
if (ctx->tmp_used)
emit(A64_PUSH(tmp1, tmp2, A64_SP), ctx);
- /* Set up BPF stack */
- emit(A64_SUB_I(1, A64_SP, A64_SP, stack_size), ctx);
-
- /* Set up frame pointer */
+ /* Set up BPF prog stack base register (x25) */
emit(A64_MOV(1, fp, A64_SP), ctx);
+ /* Set up function call stack */
+ emit(A64_SUB_I(1, A64_SP, A64_SP, stack_size), ctx);
+ emit(A64_MOV(1, A64_FP, A64_SP), ctx);
+
/* Clear registers A and X */
emit_a64_mov_i64(ra, 0, ctx);
emit_a64_mov_i64(rx, 0, ctx);
@@ -196,8 +220,8 @@ static void build_epilogue(struct jit_ctx *ctx)
emit(A64_POP(r8, r9, A64_SP), ctx);
emit(A64_POP(r6, r7, A64_SP), ctx);
- /* Restore frame pointer */
- emit(A64_MOV(1, fp, A64_SP), ctx);
+ /* Restore FP/LR registers */
+ emit(A64_POP(A64_FP, A64_LR, A64_SP), ctx);
/* Set return value */
emit(A64_MOV(1, A64_R(0), r0), ctx);
--
2.0.2