Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1281263

Re: [RESEND PATCH] arm64: bpf: add 'store immediate' instruction

Path csiph.com!au2pb.net!2.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!bofh.it!news.nic.it!robomod
From "Shi, Yang" <yang.shi@linaro.org>
Newsgroups linux.kernel
Subject Re: [RESEND PATCH] arm64: bpf: add 'store immediate' instruction
Date Tue, 01 Dec 2015 23:30:02 +0100
Message-ID <qB1AS-79P-11@gated-at.bofh.it> (permalink)
References <qAFqG-1ch-19@gated-at.bofh.it>
X-Original-To ast@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, davem@davemloft.net
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=f9kV+AG0FIyX9WkvOyrN5QIFUN8etV9NjIwppp4h+/0=; b=EQ0r9u2CPtqOqMDtV11c9t15FOhkSgqVrrM6YORcMvzyXvl6D8+JZHjdUnJPVe+N1s CPg1cgqaUQrQUwSIffdGLekwSgnBgHhnX8IByVg7xLo4FD+nIGRA0iwtbchi4xJX7vLh Gzcw15yHGpRrsnUFb2S1aS6ft+UR+lVCRgQ6uPfAhykwGbbVR7eC5Oj7yuBQfLVkorv9 t4pdv3cIb7wFLuqxSJmubVi9T6/nYG4T7YapP4aEGRBGUSkdAa/G+FNX05QDCi68HJDF WIw+cKe2D3jupbhMqzd8ZOiIiMkcZFHVsUkGHnuIYkV39TrOQVOQIhtYi/lBKhd+zo0z 76lA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=f9kV+AG0FIyX9WkvOyrN5QIFUN8etV9NjIwppp4h+/0=; b=Rem1vbFSBaB30JimTFRyAFg484GAb0M6dEKiErdeLyiTmqDSwVfRksnN2udtHp/1n7 Q+BVY75bGAJ6+EqHA6bzmc3Wud/rvG0Ngvh49ArmCV1emDZF7xkiDwCgXotzgv+ZZx8N XXpqKHtKLkM4+N6BuzDNgv4GV6DT37UmgoaA8P/gVg13N70H10Ej+AZzO4ruM8By3WN/ 5XLWU911N1YoSrxCMg1GS903rrHD4KA8H2Q4BxpuRuUB5OkSv1R3lue6bXmf+aX3hmU6 Mf3DgQv9adZ1Ed4SBduJMLqmLH/AmPT5mD9C+b0t9elGbegiv5TTezOBTa/LTauojxwg c9dA==
X-Gm-Message-State ALoCoQnPprPybiEp2MFIxZCNV01+aVrNJHIXiAsCbhKuwW3YjJjSz5omQw823kuoN9Sz2cIgWmta
X-Received by 10.98.74.72 with SMTP id x69mr83310846pfa.88.1449008442347; Tue, 01 Dec 2015 14:20:42 -0800 (PST)
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 69
Organization linux.* mail to news gateway
X-Original-Cc zlim.lnx@gmail.com, xi.wang@gmail.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org
X-Original-Date Tue, 01 Dec 2015 14:20:40 -0800
X-Original-Message-ID <565E1D38.7020906@linaro.org>
X-Original-References <1448922247-5692-1-git-send-email-yang.shi@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1281263

Show key headers only | View raw


On 11/30/2015 2:24 PM, Yang Shi wrote:
> aarch64 doesn't have native store immediate instruction, such operation
> has to be implemented by the below instruction sequence:
>
> Load immediate to register
> Store register
>
> Signed-off-by: Yang Shi <yang.shi@linaro.org>
> CC: Zi Shen Lim <zlim.lnx@gmail.com>

Had email exchange offline with Zi Shen Lim since he is traveling and 
cannot send text-only mail, quoted below for his reply:

"I've given reviewed-by in response to original posting. Unless 
something has changed, feel free to add it."

Since there is nothing changed, added his reviewed-by.

Reviewed-by: Zi Shen Lim <zlim.lnx@gmail.com>

Thanks,
Yang

> CC: Xi Wang <xi.wang@gmail.com>
> ---
> Thsi patch might be buried by the storm of xadd discussion, however, it is
> absolutely irrelevent to xadd, so resend the patch itself.
>
>   arch/arm64/net/bpf_jit_comp.c | 20 +++++++++++++++++++-
>   1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
> index 6809647..49c1f1b 100644
> --- a/arch/arm64/net/bpf_jit_comp.c
> +++ b/arch/arm64/net/bpf_jit_comp.c
> @@ -563,7 +563,25 @@ emit_cond_jmp:
>   	case BPF_ST | BPF_MEM | BPF_H:
>   	case BPF_ST | BPF_MEM | BPF_B:
>   	case BPF_ST | BPF_MEM | BPF_DW:
> -		goto notyet;
> +		/* Load imm to a register then store it */
> +		ctx->tmp_used = 1;
> +		emit_a64_mov_i(1, tmp2, off, ctx);
> +		emit_a64_mov_i(1, tmp, imm, ctx);
> +		switch (BPF_SIZE(code)) {
> +		case BPF_W:
> +			emit(A64_STR32(tmp, dst, tmp2), ctx);
> +			break;
> +		case BPF_H:
> +			emit(A64_STRH(tmp, dst, tmp2), ctx);
> +			break;
> +		case BPF_B:
> +			emit(A64_STRB(tmp, dst, tmp2), ctx);
> +			break;
> +		case BPF_DW:
> +			emit(A64_STR64(tmp, dst, tmp2), ctx);
> +			break;
> +		}
> +		break;
>
>   	/* STX: *(size *)(dst + off) = src */
>   	case BPF_STX | BPF_MEM | BPF_W:
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RESEND PATCH] arm64: bpf: add 'store immediate' instruction Yang Shi <yang.shi@linaro.org> - 2015-11-30 23:50 +0100
  Re: [RESEND PATCH] arm64: bpf: add 'store immediate' instruction "Shi, Yang" <yang.shi@linaro.org> - 2015-12-01 23:30 +0100
    Re: [RESEND PATCH] arm64: bpf: add 'store immediate' instruction Will Deacon <will.deacon@arm.com> - 2015-12-02 10:20 +0100
      Re: [RESEND PATCH] arm64: bpf: add 'store immediate' instruction David Miller <davem@davemloft.net> - 2015-12-02 21:50 +0100
  Re: [RESEND PATCH] arm64: bpf: add 'store immediate' instruction David Miller <davem@davemloft.net> - 2015-12-03 17:40 +0100

csiph-web