Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-10 Thread Z Lim
On Tue, Nov 10, 2015 at 11:46 AM, Shi, Yang wrote: > On 11/9/2015 12:00 PM, Z Lim wrote: >> >> How about splitting this into two patches? One for the BPF-related >> bug, and another for A64 FP-handling. > > I'm not sure if this is a good approach or not. IMHO, they are kind of > atomic. Without

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-10 Thread Shi, Yang
On 11/9/2015 12:00 PM, Z Lim wrote: On Mon, Nov 9, 2015 at 10:08 AM, Shi, Yang wrote: I added it to stay align with ARMv8 AAPCS to maintain the correct FP during function call. It makes us get correct stack backtrace. I think we'd better to keep compliant with ARMv8 AAPCS in BPF JIT prologue

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-10 Thread Shi, Yang
On 11/9/2015 12:00 PM, Z Lim wrote: On Mon, Nov 9, 2015 at 10:08 AM, Shi, Yang wrote: I added it to stay align with ARMv8 AAPCS to maintain the correct FP during function call. It makes us get correct stack backtrace. I think we'd better to keep compliant with ARMv8 AAPCS

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-10 Thread Z Lim
On Tue, Nov 10, 2015 at 11:46 AM, Shi, Yang wrote: > On 11/9/2015 12:00 PM, Z Lim wrote: >> >> How about splitting this into two patches? One for the BPF-related >> bug, and another for A64 FP-handling. > > I'm not sure if this is a good approach or not. IMHO, they are kind

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-09 Thread Z Lim
On Mon, Nov 9, 2015 at 10:08 AM, Shi, Yang wrote: > I added it to stay align with ARMv8 AAPCS to maintain the correct FP during > function call. It makes us get correct stack backtrace. > > I think we'd better to keep compliant with ARMv8 AAPCS in BPF JIT prologue > too. > > If nobody thinks it

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-09 Thread Shi, Yang
On 11/8/2015 2:29 PM, Z Lim wrote: On Sat, Nov 7, 2015 at 6:27 PM, Alexei Starovoitov wrote: On Fri, Nov 06, 2015 at 09:36:17PM -0800, Yang Shi wrote: 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

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-09 Thread Shi, Yang
On 11/8/2015 2:29 PM, Z Lim wrote: On Sat, Nov 7, 2015 at 6:27 PM, Alexei Starovoitov wrote: On Fri, Nov 06, 2015 at 09:36:17PM -0800, Yang Shi wrote: ARM64 JIT used FP (x29) as eBPF fp register, but FP is subjected to change during function call so it may cause

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-09 Thread Z Lim
On Mon, Nov 9, 2015 at 10:08 AM, Shi, Yang wrote: > I added it to stay align with ARMv8 AAPCS to maintain the correct FP during > function call. It makes us get correct stack backtrace. > > I think we'd better to keep compliant with ARMv8 AAPCS in BPF JIT prologue > too. > >

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-08 Thread Z Lim
On Sat, Nov 7, 2015 at 6:27 PM, Alexei Starovoitov wrote: > On Fri, Nov 06, 2015 at 09:36:17PM -0800, Yang Shi wrote: >> 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

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-08 Thread Z Lim
On Sat, Nov 7, 2015 at 6:27 PM, Alexei Starovoitov wrote: > On Fri, Nov 06, 2015 at 09:36:17PM -0800, Yang Shi wrote: >> 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

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-07 Thread Alexei Starovoitov
On Fri, Nov 06, 2015 at 09:36:17PM -0800, Yang Shi wrote: > 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. >

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-07 Thread Alexei Starovoitov
On Fri, Nov 06, 2015 at 09:36:17PM -0800, Yang Shi wrote: > 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. >

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-06 Thread Shi, Yang
Please ignore this one, forgot to cc to linux-arm-kernel list. Sorry for the inconvenience. Yang On 11/6/2015 9:34 PM, Yang Shi wrote: 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.

[PATCH] arm64: bpf: fix JIT stack setup

2015-11-06 Thread Yang Shi
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 -

[PATCH] arm64: bpf: fix JIT stack setup

2015-11-06 Thread Yang Shi
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 -

[PATCH] arm64: bpf: fix JIT stack setup

2015-11-06 Thread Yang Shi
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 -

[PATCH] arm64: bpf: fix JIT stack setup

2015-11-06 Thread Yang Shi
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 -

Re: [PATCH] arm64: bpf: fix JIT stack setup

2015-11-06 Thread Shi, Yang
Please ignore this one, forgot to cc to linux-arm-kernel list. Sorry for the inconvenience. Yang On 11/6/2015 9:34 PM, Yang Shi wrote: 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.