From patchwork Thu Nov 12 21:57:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 7605561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2FA60BF90C for ; Thu, 12 Nov 2015 22:18:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E2FE207D9 for ; Thu, 12 Nov 2015 22:18:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CC1C207A5 for ; Thu, 12 Nov 2015 22:18:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zx0AK-0002Ye-RC; Thu, 12 Nov 2015 22:16:24 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zx0A7-0002Q2-86 for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2015 22:16:12 +0000 Received: by pabfh17 with SMTP id fh17so77764191pab.0 for ; Thu, 12 Nov 2015 14:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=q3ha6ccPUuZUSXvEpZ21zYnymW5q02NWYdyemtcT1WY=; b=SIfaoS3Pj1ahaJxQ+W217rvJMSo9h+kJ4Hx3zeN2SLS871X0vNw64pY4It4MpOKAm5 KJrJLPaL3pYOLj22jHH7upmq/wLS9eoEYIgh2BaQu5g5Q1D5V1sxIwpOB0Cp6QV18pf3 2DoL+tSV3JKSY2a+kkpNjfnZZs2B1zFbCQoEz6SqwLqGEyyBaffIwXevHc6ZSnJOX1T6 XelY8muoxgGIK3o9Hm7RkbVNPzGoYFlrr0XbCPwwcXjLadtDEVQG7QW9qmDPmdpDKHsR xMKNbQB5ljM6Iax7FEtkCPMuL21JRQ6Rk7pKJHWxa/cr5Ucyx4j1srL0ZHNSWHpfrqo0 uTJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=q3ha6ccPUuZUSXvEpZ21zYnymW5q02NWYdyemtcT1WY=; b=d2wKTRWZHQ8JAcEPgBUh+oIiEAOXucgochPPFSvY4o3l0wEqc6ntwUfWePtLT7aYWJ GfTOg4XAsrMlsrw1uRTJa1pTHeAMvfDzstYr1t5bCjY+2Ebq743d92SKSPKAK/0Dr79U K9LenLaQrpgGY/HM4nQRqtSE7p7NvbILVFgcUWDqdcdlBTJ5XnSxAtlwDAAJlCQLPtKs tz/3amf6XQdATkYTKNTSoKIzOU4Dfy50I/hqc5+WR/3HkdQVANDdP5jdu3HmU4xR29vS v3sPAN2KVoFOzPwyu7fYIqxRntNFKhSCW5qOcyD0vqiE6LKkIm+XwzOqiMxfslEVFq34 XZSQ== X-Gm-Message-State: ALoCoQnGAeTSCKLBT8le5MUbNlFlTcbYYlvYsRNMOfv3saJNyynObz3pV345+kaTFhJVy9o27LTO X-Received: by 10.66.229.2 with SMTP id sm2mr26971236pac.28.1447366550012; Thu, 12 Nov 2015 14:15:50 -0800 (PST) Received: from yshi-Precision-T5600.corp.ad.wrs.com (unknown-216-82.windriver.com. [147.11.216.82]) by smtp.gmail.com with ESMTPSA id ur1sm829267pbc.44.2015.11.12.14.15.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2015 14:15:49 -0800 (PST) From: Yang Shi To: ast@kernel.org, daniel@iogearbox.net, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH 1/2] arm64: bpf: fix JIT frame pointer setup Date: Thu, 12 Nov 2015 13:57:00 -0800 Message-Id: <1447365421-1309-2-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1447365421-1309-1-git-send-email-yang.shi@linaro.org> References: <1447365421-1309-1-git-send-email-yang.shi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151112_141611_357160_4EFEFB9F X-CRM114-Status: GOOD ( 10.01 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yang.shi@linaro.org, linaro-kernel@lists.linaro.org, zlim.lnx@gmail.com, linux-kernel@vger.kernel.org, xi.wang@gmail.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP BPF fp should point to the top of the BPF prog stack. The original implementation made it point to the bottom incorrectly. Move A64_SP to fp before reserve BPF prog stack space. CC: Zi Shen Lim CC: Xi Wang Signed-off-by: Yang Shi Reviewed-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_comp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index a44e529..ac8b548 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -161,12 +161,12 @@ static void build_prologue(struct jit_ctx *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 */ emit(A64_MOV(1, fp, A64_SP), ctx); + /* Set up BPF stack */ + emit(A64_SUB_I(1, A64_SP, A64_SP, stack_size), ctx); + /* Clear registers A and X */ emit_a64_mov_i64(ra, 0, ctx); emit_a64_mov_i64(rx, 0, ctx);