[RFC] ARM: lockless get_user_pages_fast()

2013-10-03 Thread Zi Shen Lim
lement get_user_pages_fast without locking in the fastpath on ARM. This work is derived from the x86 version and adapted to ARM. Signed-off-by: Zi Shen Lim --- arch/arm/mm/Makefile | 4 +- arch/arm/mm/gup.c| 330 +++ 2 files changed, 332 insertions(+), 2 del

Re: [RFC] ARM: lockless get_user_pages_fast()

2013-10-03 Thread Zi Shen Lim
Thanks for your feedback Will. On Thu, Oct 3, 2013 at 10:27 AM, Will Deacon wrote: > On Thu, Oct 03, 2013 at 06:15:15PM +0100, Zi Shen Lim wrote: >> Futex uses GUP. Currently on ARM, the default __get_user_pages_fast >> being used always returns 0, leading to a forever loop i

[PATCH] vfio: fix documentation

2013-09-05 Thread Zi Shen Lim
Signed-off-by: Zi Shen Lim --- Documentation/vfio.txt | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/vfio.txt b/Documentation/vfio.txt index d7993dc..b9ca023 100644 --- a/Documentation/vfio.txt +++ b/Documentation/vfio.txt @@ -167,8 +167,8 @@ group and

[PATCH] staging: ashmem: Fix coding style

2014-04-05 Thread Zi Shen Lim
Keep checkpatch happy by addressing the following: CHECK: Alignment should match open parenthesis CHECK: Blank lines aren't necessary after an open brace '{' CHECK: No space is necessary after a cast Signed-off-by: Zi Shen Lim --- drivers/staging/android/ashmem.c | 12 +

[PATCH 09/14] arm64: introduce aarch64_insn_gen_add_sub_shifted_reg()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate add/subtract (shifted register) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 11 ++ arch/arm64/kernel/insn.c | 49 +++ 2 files changed, 60 insertions(+) diff --git a/arch/arm64

[PATCH 11/14] arm64: introduce aarch64_insn_gen_data2()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate data-processing (2 source) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 20 ++ arch/arm64/kernel/insn.c | 48 +++ 2 files changed, 68 insertions(+) diff --git a/arch

[PATCH 12/14] arm64: introduce aarch64_insn_gen_data3()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate data-processing (3 source) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 14 ++ arch/arm64/kernel/insn.c | 42 ++ 2 files changed, 56 insertions(+) diff --git a/arch/arm64

[PATCH 14/14] arm64: eBPF JIT compiler

2014-07-18 Thread Zi Shen Lim
oc/sys/net/core/bpf_jit_enable See Documentation/networking/filter.txt for more information. The implementation passes all 57 tests in lib/test_bpf.c on ARMv8 Foundation Model :) Signed-off-by: Zi Shen Lim Acked-by: Alexei Starovoitov --- RFCv3->v1: Addressed review comments from Will wr

[PATCH 01/14] arm64: introduce aarch64_insn_gen_comp_branch_imm()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate compare & branch (immediate) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 57 arch/arm64/kernel/insn.c | 88 --- 2 files changed, 140 insertions(+

[PATCH 04/14] arm64: introduce aarch64_insn_gen_load_store_reg()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate load/store (register offset) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 20 ++ arch/arm64/kernel/insn.c | 62 +++ 2 files changed, 82 insertions(+) diff --git a/arch/arm64

[PATCH 13/14] arm64: introduce aarch64_insn_gen_logical_shifted_reg()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate logical (shifted register) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 25 ++ arch/arm64/kernel/insn.c | 60 +++ 2 files changed, 85 insertions(+) diff --git a/arch

[PATCH 10/14] arm64: introduce aarch64_insn_gen_data1()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate data-processing (1 source) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 13 + arch/arm64/kernel/insn.c | 37 + 2 files changed, 50 insertions(+) diff --git a/arch/arm64/include

[PATCH 07/14] arm64: introduce aarch64_insn_gen_bitfield()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate bitfield instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 16 + arch/arm64/kernel/insn.c | 56 +++ 2 files changed, 72 insertions(+) diff --git a/arch/arm64/include/asm/insn.h b

[PATCH 03/14] arm64: introduce aarch64_insn_gen_cond_branch_imm()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate conditional branch (immediate) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 21 + arch/arm64/kernel/insn.c | 17 + 2 files changed, 38 insertions(+) diff --git a/arch/arm64/include/asm

[PATCH 08/14] arm64: introduce aarch64_insn_gen_movewide()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate move wide (immediate) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 13 + arch/arm64/kernel/insn.c | 43 +++ 2 files changed, 56 insertions(+) diff --git a/arch/arm64/include

[PATCH 06/14] arm64: introduce aarch64_insn_gen_add_sub_imm()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate add/subtract (immediate) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 16 arch/arm64/kernel/insn.c | 44 +++ 2 files changed, 60 insertions(+) diff --git a/arch/arm64

[PATCH 05/14] arm64: introduce aarch64_insn_gen_load_store_pair()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate load/store pair instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 16 +++ arch/arm64/kernel/insn.c | 65 +++ 2 files changed, 81 insertions(+) diff --git a/arch/arm64/include/asm

[PATCH 02/14] arm64: introduce aarch64_insn_gen_branch_reg()

2014-07-18 Thread Zi Shen Lim
Introduce function to generate unconditional branch (register) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 7 +++ arch/arm64/kernel/insn.c | 35 +-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/arch

[PATCH 00/14] arm64: eBPF JIT compiler

2014-07-18 Thread Zi Shen Lim
14-07-18 11:06:28 -0700) ------------ Zi Shen Lim (14): arm64: introduce aarch64_insn_gen_comp_branch_imm() arm64: introduce aarch64_insn_gen_branch_reg() arm64: introduce aarch64_insn_gen_cond_branch_imm() arm64: introduce aarch64_insn_gen_load_store_reg() arm64: introduce aarch64_i

[PATCH 1/2] arm64, sched: Remove unused mc_capable() and smt_capable()

2014-04-22 Thread Zi Shen Lim
"). Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/topology.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 0172e6d..7ebcd31 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm

[PATCH 0/2] arm64 topology updates

2014-04-22 Thread Zi Shen Lim
tp://www.spinics.net/lists/arm-kernel/msg324506.html Zi Shen Lim (2): arm64, sched: Remove unused mc_capable() and smt_capable() arm64: topology: add MPIDR-based detection arch/arm64/include/asm/cputype.h | 2 ++ arch/arm64/include/asm/topology.h | 3 --- arch/arm

[PATCH 2/2] arm64: topology: add MPIDR-based detection

2014-04-22 Thread Zi Shen Lim
Create cpu topology based on MPIDR. When hardware sets MPIDR to sane values, this method will always work. Therefore it should also work well as the fallback method. [1] [1] http://www.spinics.net/lists/arm-kernel/msg317445.html Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/cputype.h

[PATCH] smc91x: improve definition of debug macros

2014-04-22 Thread Zi Shen Lim
: Joe Perches Signed-off-by: Zi Shen Lim --- Note: This patch is based on suggestion by Joe Perches. I added his Signed-off-by as well since I didn't receive an objection. drivers/net/ethernet/smsc/smc91x.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff

Re: [PATCH 2/2] arm64: topology: add MPIDR-based detection

2014-04-23 Thread Zi Shen Lim
On Wed, Apr 23, 2014 at 11:36:48AM +0100, Mark Brown wrote: > On Tue, Apr 22, 2014 at 06:40:14PM -0700, Zi Shen Lim wrote: > > > + /* Multiprocessor system */ > > + if (mpidr & MPIDR_MT_BITMASK) { > > +

Re: [PATCH 2/2] arm64: topology: add MPIDR-based detection

2014-04-23 Thread Zi Shen Lim
On Wed, Apr 23, 2014 at 07:26:11PM +0100, Mark Brown wrote: > On Wed, Apr 23, 2014 at 10:27:20AM -0700, Zi Shen Lim wrote: > > It will at least ensure that all clusters get assigned a unique ID and > we don't end up discarding some of the information and coming out with > two

[PATCHv2 0/2] arm64 topology updates

2014-04-24 Thread Zi Shen Lim
ing multi-level clusters in DT. Many thanks to Mark for review and comments! Link to initial posting of this series: https://lkml.org/lkml/2014/4/22/950 Zi Shen Lim (2): arm64, sched: Remove unused mc_capable() and smt_capable() arm64: topology: add MPIDR-based detection arch/arm

[PATCHv2 1/2] arm64, sched: Remove unused mc_capable() and smt_capable()

2014-04-24 Thread Zi Shen Lim
quot;). Reviewed-by: Mark Brown Signed-off-by: Zi Shen Lim --- v1->v2: No changes. - Added Mark's review-by. arch/arm64/include/asm/topology.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 0172e6d..7eb

[PATCHv2 2/2] arm64: topology: add MPIDR-based detection

2014-04-24 Thread Zi Shen Lim
to highest) to threads (if they exist), cores, and clusters. We combine data from all higher affinity levels into cluster_id so we don't lose any information from MPIDR. [2] [1] http://www.spinics.net/lists/arm-kernel/msg317445.html [2] https://lkml.org/lkml/2014/4/23/703 Signed-off-by: Zi

[PATCH] arm64: bpf: add 'shift by register' instructions

2014-09-16 Thread Zi Shen Lim
) noted support for 'shift by register' in eBPF and added support for it for x64. Let's enable this for arm64 as well. The arm64 eBPF JIT compiler now passes the new 'shift by register' test case introduced in the same commit 72b603ee8cfc. Signed-off-by: Zi Shen Lim Cc: C

[PATCH] arm64: bpf: add 'load 64-bit immediate' instruction

2014-09-16 Thread Zi Shen Lim
e (net: filter: add "load 64-bit immediate" eBPF instruction) introduced a new eBPF instruction. Let's add support for this for arm64 as well. Our arm64 eBPF JIT compiler now passes the new "load 64-bit immediate" test case introduced in the same commit 02ab695bb37e. Signed-o

Re: [PATCHv2 2/2] arm64: topology: add MPIDR-based detection

2014-04-25 Thread Zi Shen Lim
Hi Lorenzo, On Fri, Apr 25, 2014 at 12:18:43PM +0100, Lorenzo Pieralisi wrote: > On Fri, Apr 25, 2014 at 04:18:42AM +0100, Zi Shen Lim wrote: > > Create cpu topology based on MPIDR. When hardware sets MPIDR to sane > > values, this method will always work. Therefore it should

[PATCHv3] arm64: topology: add MPIDR-based detection

2014-04-29 Thread Zi Shen Lim
to highest) to threads (if they exist), cores, and clusters. We combine data from all higher affinity levels into cluster_id so we don't lose any information from MPIDR. [2] [1] http://www.spinics.net/lists/arm-kernel/msg317445.html [2] https://lkml.org/lkml/2014/4/23/703 Signed-off-by: Zi

[PATCH] staging/lustre: fix sparse warnings in o2iblnd_cb.c

2014-05-11 Thread Zi Shen Lim
#x27;kiblnd_disconnect_conn' was not declared. Should it be static? drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:3247:1: warning: symbol 'kiblnd_complete' was not declared. Should it be static? drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:904:20: warning: context im

[PATCH RFCv3 00/14] arm64: eBPF JIT compiler

2014-07-14 Thread Zi Shen Lim
This series implements eBPF JIT compiler for arm64. See [14/14] for change log. Patches [1-13/14] implement code generation functions. Patch [14/14] implements the actual eBPF JIT compiler. Zi Shen Lim (14): arm64: introduce aarch64_insn_gen_comp_branch_imm() arm64: introduce

[PATCH RFCv3 10/14] arm64: introduce aarch64_insn_gen_data1()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate data-processing (1 source) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 13 + arch/arm64/kernel/insn.c | 37 + 2 files changed, 50 insertions(+) diff --git a/arch/arm64/include

[PATCH RFCv3 11/14] arm64: introduce aarch64_insn_gen_data2()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate data-processing (2 source) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 20 ++ arch/arm64/kernel/insn.c | 48 +++ 2 files changed, 68 insertions(+) diff --git a/arch

[PATCH RFCv3 05/14] arm64: introduce aarch64_insn_gen_load_store_pair()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate load/store pair instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 16 +++ arch/arm64/kernel/insn.c | 65 +++ 2 files changed, 81 insertions(+) diff --git a/arch/arm64/include/asm

[PATCH RFCv3 06/14] arm64: introduce aarch64_insn_gen_add_sub_imm()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate add/subtract (immediate) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 16 arch/arm64/kernel/insn.c | 44 +++ 2 files changed, 60 insertions(+) diff --git a/arch/arm64

[PATCH RFCv3 08/14] arm64: introduce aarch64_insn_gen_movewide()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate move wide (immediate) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 13 + arch/arm64/kernel/insn.c | 43 +++ 2 files changed, 56 insertions(+) diff --git a/arch/arm64/include

[PATCH RFCv3 07/14] arm64: introduce aarch64_insn_gen_bitfield()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate bitfield instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 16 + arch/arm64/kernel/insn.c | 56 +++ 2 files changed, 72 insertions(+) diff --git a/arch/arm64/include/asm/insn.h b

[PATCH RFCv3 09/14] arm64: introduce aarch64_insn_gen_add_sub_shifted_reg()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate add/subtract (shifted register) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 11 ++ arch/arm64/kernel/insn.c | 49 +++ 2 files changed, 60 insertions(+) diff --git a/arch/arm64

[PATCH RFCv3 12/14] arm64: introduce aarch64_insn_gen_data3()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate data-processing (3 source) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 14 ++ arch/arm64/kernel/insn.c | 42 ++ 2 files changed, 56 insertions(+) diff --git a/arch/arm64

[PATCH RFCv3 14/14] arm64: eBPF JIT compiler

2014-07-14 Thread Zi Shen Lim
oc/sys/net/core/bpf_jit_enable See Documentation/networking/filter.txt for more information. The implementation passes all 57 tests in lib/test_bpf.c on ARMv8 Foundation Model :) Signed-off-by: Zi Shen Lim Acked-by: Alexei Starovoitov --- RFCv2->RFCv3: - clarify 16B stack alignment requir

[PATCH RFCv3 04/14] arm64: introduce aarch64_insn_gen_load_store_reg()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate load/store (register offset) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 20 ++ arch/arm64/kernel/insn.c | 62 +++ 2 files changed, 82 insertions(+) diff --git a/arch/arm64

[PATCH RFCv3 02/14] arm64: introduce aarch64_insn_gen_branch_reg()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate unconditional branch (register) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 7 +++ arch/arm64/kernel/insn.c | 35 +-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/arch

[PATCH RFCv3 03/14] arm64: introduce aarch64_insn_gen_cond_branch_imm()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate conditional branch (immediate) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 21 + arch/arm64/kernel/insn.c | 17 + 2 files changed, 38 insertions(+) diff --git a/arch/arm64/include/asm

[PATCH RFCv3 01/14] arm64: introduce aarch64_insn_gen_comp_branch_imm()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate compare & branch (immediate) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 57 arch/arm64/kernel/insn.c | 86 --- 2 files changed, 138 insertions(+

[PATCH RFCv3 13/14] arm64: introduce aarch64_insn_gen_logical_shifted_reg()

2014-07-14 Thread Zi Shen Lim
Introduce function to generate logical (shifted register) instructions. Signed-off-by: Zi Shen Lim --- arch/arm64/include/asm/insn.h | 25 ++ arch/arm64/kernel/insn.c | 60 +++ 2 files changed, 85 insertions(+) diff --git a/arch

[PATCH RFC] arm64: eBPF JIT compiler

2014-07-01 Thread Zi Shen Lim
oc/sys/net/core/bpf_jit_enable See Documentation/networking/filter.txt for more information. The implementation passes all 57 tests in lib/test_bpf.c on ARMv8 Foundation Model :) Signed-off-by: Zi Shen Lim NOTES: * This patch applies on top of current net-next @ 763e0ecd72fe ("bonding: a

[PATCH net-next] net: filter: move load_pointer() into filter.h

2014-07-03 Thread Zi Shen Lim
load_pointer() is already a static inline function. Let's move it into filter.h so BPF JIT implementations can reuse this function. Signed-off-by: Zi Shen Lim --- This patch is based on discussion with Alexei in the context of reusing load_pointer for upcoming arm64 BPF JIT compile

[PATCHv2 net-next] net: filter: move load_pointer() into filter.h

2014-07-03 Thread Zi Shen Lim
load_pointer() is already a static inline function. Let's move it into filter.h so BPF JIT implementations can reuse this function. Since we're exporting this function, let's also rename it to bpf_load_pointer() for clarity. Signed-off-by: Zi Shen Lim --- v1->v2: * Renamed to

Re: [PATCH RFCv3 01/14] arm64: introduce aarch64_insn_gen_comp_branch_imm()

2014-07-16 Thread Zi Shen Lim
On Wed, Jul 16, 2014 at 05:04:50PM +0100, Will Deacon wrote: > On Tue, Jul 15, 2014 at 07:24:59AM +0100, Zi Shen Lim wrote: [...] > > +enum aarch64_insn_register { > > + AARCH64_INSN_REG_0 = 0, > > + AARCH64_INSN_REG_1 = 1, > > + AARCH64_INSN_REG_2 = 2, >

Re: [PATCH RFCv3 08/14] arm64: introduce aarch64_insn_gen_movewide()

2014-07-16 Thread Zi Shen Lim
On Wed, Jul 16, 2014 at 05:17:15PM +0100, Will Deacon wrote: > On Tue, Jul 15, 2014 at 07:25:06AM +0100, Zi Shen Lim wrote: > > Introduce function to generate move wide (immediate) instructions. > > [...] > > > +u32 aarch64_insn_gen_movewide(enum a

Re: [PATCH RFCv3 00/14] arm64: eBPF JIT compiler

2014-07-16 Thread Zi Shen Lim
On Wed, Jul 16, 2014 at 05:21:47PM +0100, Will Deacon wrote: > On Wed, Jul 16, 2014 at 11:41:53AM +0100, Will Deacon wrote: > > On Tue, Jul 15, 2014 at 07:24:58AM +0100, Zi Shen Lim wrote: > > > This series implements eBPF JIT compiler for arm64. > > >

[PATCH RFCv2] arm64: eBPF JIT compiler

2014-07-08 Thread Zi Shen Lim
oc/sys/net/core/bpf_jit_enable See Documentation/networking/filter.txt for more information. The implementation passes all 57 tests in lib/test_bpf.c on ARMv8 Foundation Model :) Signed-off-by: Zi Shen Lim --- RFCv1->RFCv2: Addressed review comments from Alexei: - use core-$(CONFIG_NET

[PATCH] smc91x: fix compile error when SMC_DEBUG >= 2

2014-04-18 Thread Zi Shen Lim
ot;, CARDNAME, __func__); ^ Fix it by passing in the appropriate netdev pointer. Signed-off-by: Zi Shen Lim --- drivers/net/ethernet/smsc/smc91x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c

Re: [PATCH] smc91x: fix compile error when SMC_DEBUG >= 2

2014-04-19 Thread Zi Shen Lim
Hi Joe, On Fri, Apr 18, 2014 at 09:06:53PM -0700, Joe Perches wrote: > On Fri, 2014-04-18 at 20:47 -0700, Zi Shen Lim wrote: > > When SMC_DEBUG >= 2, we hit the following compilation error: > > > > drivers/net/ethernet/smsc/smc91x.c:85:0: > > drivers/net/ether

[PATCHv2 02/14] arm64: introduce aarch64_insn_gen_branch_reg()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate unconditional branch (register) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 7 +++ arch/arm64/kernel/insn.c | 35 +-- 2 files changed, 40 insertions(+), 2 deletions

[PATCHv2 07/14] arm64: introduce aarch64_insn_gen_bitfield()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate bitfield instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 16 + arch/arm64/kernel/insn.c | 56 +++ 2 files changed, 72 insertions(+) diff --git a/arch

[PATCHv2 14/14] arm64: eBPF JIT compiler

2014-08-26 Thread Zi Shen Lim
oc/sys/net/core/bpf_jit_enable See Documentation/networking/filter.txt for more information. The implementation passes all 57 tests in lib/test_bpf.c on ARMv8 Foundation Model :) Also tested by Will on Juno platform. Signed-off-by: Zi Shen Lim Acked-by: Alexei Starovoitov Acked-by: Will Deacon

[PATCHv2 13/14] arm64: introduce aarch64_insn_gen_logical_shifted_reg()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate logical (shifted register) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 25 ++ arch/arm64/kernel/insn.c | 60 +++ 2 files changed, 85 insertions

[PATCHv2 12/14] arm64: introduce aarch64_insn_gen_data3()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate data-processing (3 source) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 14 ++ arch/arm64/kernel/insn.c | 42 ++ 2 files changed, 56 insertions(+) diff

[PATCHv2 09/14] arm64: introduce aarch64_insn_gen_add_sub_shifted_reg()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate add/subtract (shifted register) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 11 ++ arch/arm64/kernel/insn.c | 49 +++ 2 files changed, 60 insertions

[PATCHv2 11/14] arm64: introduce aarch64_insn_gen_data2()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate data-processing (2 source) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 20 ++ arch/arm64/kernel/insn.c | 48 +++ 2 files changed, 68 insertions

[PATCHv2 06/14] arm64: introduce aarch64_insn_gen_add_sub_imm()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate add/subtract (immediate) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 16 arch/arm64/kernel/insn.c | 44 +++ 2 files changed, 60 insertions

[PATCHv2 08/14] arm64: introduce aarch64_insn_gen_movewide()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate move wide (immediate) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 13 + arch/arm64/kernel/insn.c | 43 +++ 2 files changed, 56 insertions(+) diff

[PATCHv2 05/14] arm64: introduce aarch64_insn_gen_load_store_pair()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate load/store pair instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 16 +++ arch/arm64/kernel/insn.c | 65 +++ 2 files changed, 81 insertions(+) diff --git a/arch

[PATCHv2 10/14] arm64: introduce aarch64_insn_gen_data1()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate data-processing (1 source) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 13 + arch/arm64/kernel/insn.c | 37 + 2 files changed, 50 insertions(+) diff --git

[PATCHv2 03/14] arm64: introduce aarch64_insn_gen_cond_branch_imm()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate conditional branch (immediate) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 21 + arch/arm64/kernel/insn.c | 17 + 2 files changed, 38 insertions(+) diff --git a/arch

[PATCHv2 00/14] arm64: eBPF JIT compiler

2014-08-26 Thread Zi Shen Lim
4/net/bpf_jit_comp.c Zi Shen Lim (14): arm64: introduce aarch64_insn_gen_comp_branch_imm() arm64: introduce aarch64_insn_gen_branch_reg() arm64: introduce aarch64_insn_gen_cond_branch_imm() arm64: introduce aarch64_insn_gen_load_store_reg() arm64: introduce aarch64_insn_gen_load_store_pair()

[PATCHv2 01/14] arm64: introduce aarch64_insn_gen_comp_branch_imm()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate compare & branch (immediate) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 57 arch/arm64/kernel/insn.c | 88 --- 2 files changed,

[PATCHv2 04/14] arm64: introduce aarch64_insn_gen_load_store_reg()

2014-08-26 Thread Zi Shen Lim
Introduce function to generate load/store (register offset) instructions. Signed-off-by: Zi Shen Lim Acked-by: Will Deacon --- arch/arm64/include/asm/insn.h | 20 ++ arch/arm64/kernel/insn.c | 62 +++ 2 files changed, 82 insertions

Re: [Linaro-acpi] [PATCH v2 06/18] ARM64 / ACPI: Parse MADT to map logical cpu to MPIDR and get cpu_possible/present_map

2014-08-19 Thread Zi Shen Lim
Hanjun, On Tue, Aug 19, 2014 at 6:00 AM, Hanjun Guo wrote: > Will INTERRUPT_CONTROLLER confuse people? There is only one GIC redistributor > (some people regard it as interrupt controller) in ARM system, if we use > INTERRUPT_CONTROLLER people will regard it as multi-redistributors in the > syste

[PATCH] arm64: bpf: fix buffer pointer

2015-11-18 Thread Zi Shen Lim
During code review, I noticed we were passing a bad buffer pointer to bpf_load_pointer helper function called by jitted code. Point to the buffer allocated by JIT, so we don't silently corrupt other parts of the stack. Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_comp.c

[PATCH] bpf: arm64: lift restriction on last instruction

2014-12-03 Thread Zi Shen Lim
ction. > It has BPF_EXIT insn which can appear anywhere in the program > one or more times and it doesn't have to be last insn. [1] https://lkml.org/lkml/2014/11/27/2 Fixes: e54bcde3d69d ("arm64: eBPF JIT compiler") Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_c

[PATCH] arm64: bpf: fix mod-by-zero case

2015-11-04 Thread Zi Shen Lim
Turns out in the case of modulo by zero in a BPF program: A = A % X; (X == 0) the expected behavior is to terminate with return value 0. The bug in JIT is exposed by a new test case [1]. [1] https://lkml.org/lkml/2015/11/4/499 Signed-off-by: Zi Shen Lim Reported-by: Yang Shi Reported

[PATCH] arm64: bpf: fix div-by-zero case

2015-11-03 Thread Zi Shen Lim
eported-by: Shi, Yang CC: Xi Wang CC: Alexei Starovoitov CC: Catalin Marinas CC: linux-arm-ker...@lists.infradead.org CC: linux-kernel@vger.kernel.org Fixes: e54bcde3d69d ("arm64: eBPF JIT compiler") Cc: # 3.18+ Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit.h | 3

[PATCH net-next v3 0/4] arm64 BPF JIT updates

2016-06-08 Thread Zi Shen Lim
since v1: - Added patch #1 to address build error due to missing header inclusion in linux/bpf.h. (Thanks to suggestion and ack by Daniel Borkmann) Ordered it ahead of bpf_tail_call patch #2 so build error is not triggered. Zi Shen Lim (4): bpf: fix missing header inclusion arm64

[PATCH net-next v3 2/4] arm64: bpf: implement bpf_tail_call() helper

2016-06-08 Thread Zi Shen Lim
0644 --- a/arch/arm64/net/bpf_jit.h +++ b/arch/arm64/net/bpf_jit.h @@ -1,7 +1,7 @@ /* * BPF JIT compiler for ARM64 * - * Copyright (C) 2014-2015 Zi Shen Lim + * Copyright (C) 2014-2016 Zi Shen Lim * * This program is free software; you can redistribute it and/or modify * it under the terms

[PATCH net-next v3 4/4] arm64: bpf: optimize LD_ABS, LD_IND

2016-06-08 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every LD_ABS or LD_IND. Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 7ae304e..b2fc97a 100644

[PATCH net-next v3 1/4] bpf: fix missing header inclusion

2016-06-08 Thread Zi Shen Lim
(-EOPNOTSUPP); ^ ... Fixes: 0fc174dea545 ("ebpf: make internal bpf API independent of CONFIG_BPF_SYSCALL ifdefs") Suggested-by: Daniel Borkmann Signed-off-by: Zi Shen Lim Acked-by: Daniel Borkmann --- include/linux/bpf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/incl

[PATCH net-next v3 3/4] arm64: bpf: optimize JMP_CALL

2016-06-08 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every JMP_CALL. Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 51abc97..7ae304e 100644 --- a/arch

Re: [PATCH net-next 1/3] arm64: bpf: implement bpf_tail_call() helper

2016-06-06 Thread Zi Shen Lim
On Mon, Jun 6, 2016 at 1:11 AM, Daniel Borkmann wrote: > On 06/06/2016 06:56 AM, Z Lim wrote: > [...] >> >> How about the attached patch? Fixes compilation error on build >> !CONFIG_BPF_SYSCALL. >> >> Also, should this patch be sent to net or net-next (along with this >> series)? > > > Looks good,

[PATCH net-next v2 0/4] arm64 BPF JIT updates

2016-06-06 Thread Zi Shen Lim
to missing header inclusion in linux/bpf.h. (Thanks to suggestion and ack by Daniel Borkmann) Ordered it ahead of bpf_tail_call patch #2 so build error is not triggered. Zi Shen Lim (4): bpf: fix missing header inclusion arm64: bpf: implement bpf_tail_call() helper arm64: bpf

[PATCH net-next v2 3/4] arm64: bpf: optimize JMP_CALL

2016-06-06 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every JMP_CALL. Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 51abc97..7ae304e 100644 --- a/arch

[PATCH net-next v2 4/4] arm64: bpf: optimize LD_ABS, LD_IND

2016-06-06 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every LD_ABS or LD_IND. Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 7ae304e..b2fc97a 100644

[PATCH net-next v2 1/4] bpf: fix missing header inclusion

2016-06-06 Thread Zi Shen Lim
(-EOPNOTSUPP); ^ ... Fixes: 0fc174dea545 ("ebpf: make internal bpf API independent of CONFIG_BPF_SYSCALL ifdefs") Suggested-by: Daniel Borkmann Signed-off-by: Zi Shen Lim Acked-by: Daniel Borkmann --- include/linux/bpf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/incl

[PATCH net-next v2 2/4] arm64: bpf: implement bpf_tail_call() helper

2016-06-07 Thread Zi Shen Lim
0644 --- a/arch/arm64/net/bpf_jit.h +++ b/arch/arm64/net/bpf_jit.h @@ -1,7 +1,7 @@ /* * BPF JIT compiler for ARM64 * - * Copyright (C) 2014-2015 Zi Shen Lim + * Copyright (C) 2014-2016 Zi Shen Lim * * This program is free software; you can redistribute it and/or modify * it under the terms

[PATCH net-next 1/3] arm64: bpf: implement bpf_tail_call() helper

2016-06-04 Thread Zi Shen Lim
0644 --- a/arch/arm64/net/bpf_jit.h +++ b/arch/arm64/net/bpf_jit.h @@ -1,7 +1,7 @@ /* * BPF JIT compiler for ARM64 * - * Copyright (C) 2014-2015 Zi Shen Lim + * Copyright (C) 2014-2016 Zi Shen Lim * * This program is free software; you can redistribute it and/or modify * it under the terms

[PATCH net-next 2/3] arm64: bpf: optimize JMP_CALL

2016-06-04 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every JMP_CALL. Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 51abc97..7ae304e 100644 --- a/arch

[PATCH net-next 3/3] arm64: bpf: optimize LD_ABS, LD_IND

2016-06-04 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every LD_ABS or LD_IND. Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 7ae304e..b2fc97a 100644