Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1158897imm; Wed, 1 Aug 2018 11:09:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeCyasD+D4ZcQPE5VDH3vn0bRq+F1LWUspmXuRAsSpneuxXuIDSXZkw9qMTWh8qInsHbEWN X-Received: by 2002:a63:d54e:: with SMTP id v14-v6mr26098729pgi.264.1533146955002; Wed, 01 Aug 2018 11:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533146954; cv=none; d=google.com; s=arc-20160816; b=BF6I6urA7tswEcH+DFHwu0mZp8Ud+Gj3DjrMfdtKG6Je+S+TnYSA8lIftOoogFiF2R ypqR4KdHKvCTPyPxG+O2oAFKUE2ThGiYbIUT/patXpupmTrzgcttJDrM+bOuRGsubaDy gpucdiOy3Avvp51H4E2AaoRznqB+l6jctW9GSeRfjpYC1eN4JXIgX9qV5wrVGTZE+yGs PGihBdx01+wRYqLQy/dF7ptORwZXVtlD6kmAj27m1pEbL8N78o3I2JJpk6QapwKVgH4B JKU7zQX/pfAn+dWYyXyBx831hxtYU1Wj7lXGrNhsXfmmc4XriI4PB52J4NinOrX1XfU6 n72A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=RCq/FjTEeFEud3922xsDzGdSJwPpIeoiz+4hNqeATys=; b=QlyrMclXsY/0FPaRfAzpVERfEM3Hh98QBYp8GbYiVj/HHRElZgSUXoCZSxfcV7l75N kI56Hp/9EQ9/HEOkevYZfCovwRP+7OTjDmfO7ltlCaFqIuFsowXUPx2BxmvOwMD4Ravh OmlUWsy+e3A5Mw5mJ2e1WP8rQcqrMF44QT0y4kDApAnRGh/smikcYwgmkuIxyvVIfZDP nAiRmwib/VxoaShYoqmadSmQJiUvpjx+OzfuaANTwr8SfGjOv6QCZfwI5KOuBDYSqc/K TSBEHafh46rq8FIVp8ftQtpotcji7rDPsQE9GRbbLmY9RuN2KDtFb4jHegp+pPFGmsEn 2F5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a18-v6si16444386plm.122.2018.08.01.11.09.00; Wed, 01 Aug 2018 11:09:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732799AbeHATyd (ORCPT + 99 others); Wed, 1 Aug 2018 15:54:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49890 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405781AbeHATIg (ORCPT ); Wed, 1 Aug 2018 15:08:36 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 67499136B; Wed, 1 Aug 2018 17:13:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wang YanQing , Shubham Bansal , linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, Daniel Borkmann , Sasha Levin Subject: [PATCH 4.14 042/246] bpf, arm32: fix inconsistent naming about emit_a32_lsr_{r64,i64} Date: Wed, 1 Aug 2018 18:49:12 +0200 Message-Id: <20180801165013.734586676@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wang YanQing [ Upstream commit 68565a1af9f7012e6f2fe2bdd612f67d2d830c28 ] The names for BPF_ALU64 | BPF_ARSH are emit_a32_arsh_*, the names for BPF_ALU64 | BPF_LSH are emit_a32_lsh_*, but the names for BPF_ALU64 | BPF_RSH are emit_a32_lsr_*. For consistence reason, let's rename emit_a32_lsr_* to emit_a32_rsh_*. This patch also corrects a wrong comment. Fixes: 39c13c204bb1 ("arm: eBPF JIT compiler") Signed-off-by: Wang YanQing Cc: Shubham Bansal Cc: linux-arm-kernel@lists.infradead.org Cc: linux@armlinux.org.uk Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm/net/bpf_jit_32.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c @@ -718,7 +718,7 @@ static inline void emit_a32_arsh_r64(con } /* dst = dst >> src */ -static inline void emit_a32_lsr_r64(const u8 dst[], const u8 src[], bool dstk, +static inline void emit_a32_rsh_r64(const u8 dst[], const u8 src[], bool dstk, bool sstk, struct jit_ctx *ctx) { const u8 *tmp = bpf2a32[TMP_REG_1]; const u8 *tmp2 = bpf2a32[TMP_REG_2]; @@ -734,7 +734,7 @@ static inline void emit_a32_lsr_r64(cons emit(ARM_LDR_I(rm, ARM_SP, STACK_VAR(dst_hi)), ctx); } - /* Do LSH operation */ + /* Do RSH operation */ emit(ARM_RSB_I(ARM_IP, rt, 32), ctx); emit(ARM_SUBS_I(tmp2[0], rt, 32), ctx); emit(ARM_MOV_SR(ARM_LR, rd, SRTYPE_LSR, rt), ctx); @@ -784,7 +784,7 @@ static inline void emit_a32_lsh_i64(cons } /* dst = dst >> val */ -static inline void emit_a32_lsr_i64(const u8 dst[], bool dstk, +static inline void emit_a32_rsh_i64(const u8 dst[], bool dstk, const u32 val, struct jit_ctx *ctx) { const u8 *tmp = bpf2a32[TMP_REG_1]; const u8 *tmp2 = bpf2a32[TMP_REG_2]; @@ -1340,7 +1340,7 @@ static int build_insn(const struct bpf_i case BPF_ALU64 | BPF_RSH | BPF_K: if (unlikely(imm > 63)) return -EINVAL; - emit_a32_lsr_i64(dst, dstk, imm, ctx); + emit_a32_rsh_i64(dst, dstk, imm, ctx); break; /* dst = dst << src */ case BPF_ALU64 | BPF_LSH | BPF_X: @@ -1348,7 +1348,7 @@ static int build_insn(const struct bpf_i break; /* dst = dst >> src */ case BPF_ALU64 | BPF_RSH | BPF_X: - emit_a32_lsr_r64(dst, src, dstk, sstk, ctx); + emit_a32_rsh_r64(dst, src, dstk, sstk, ctx); break; /* dst = dst >> src (signed) */ case BPF_ALU64 | BPF_ARSH | BPF_X: