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: 56477 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp679562lbb; Thu, 12 Nov 2015 14:16:26 -0800 (PST) X-Received: by 10.66.228.137 with SMTP id si9mr26280301pac.63.1447366586696; Thu, 12 Nov 2015 14:16:26 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bv3si22502577pbd.105.2015.11.12.14.16.26; Thu, 12 Nov 2015 14:16:26 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754381AbbKLWQX (ORCPT + 28 others); Thu, 12 Nov 2015 17:16:23 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36556 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754199AbbKLWPv (ORCPT ); Thu, 12 Nov 2015 17:15:51 -0500 Received: by pacdm15 with SMTP id dm15so77575967pac.3 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=Q62BnPKMzfXEmHvPH4DKisMbZdFbF8Ye1213bLyHkrJNwQuZBEBEPnXD9X1Wyzqi2K /myRGpwJ7zlWocvMovPfRg2AhychiX+0fOghEc7diD86s1lOOdnwqyH/iraL2jeUfCiV jNwKNfZ2B5QsnCkpmjpbsqLXZUGOR37eD3/mIs3B6QjVgODGf/VictivhkDwWYQKSISQ /c7ukmgYcVUvr3cUjj+Ed8tFQrDXEBgl3oEGViC9asHROysNJo+7812yq/gv6vIxrrpQ +j5SEKOlvCdTKCi03YMVJLO0ffD+PeUp0duIVWLgY49PrUVeVHOajPSWI7Bbapn/DE+o CNjw== X-Gm-Message-State: ALoCoQn++6CQ4XvP3x+zWQJ8dZGeaDY7XsCMQ21NUdW8QJ18UjnOqih//ZaQtO7x6nuGxQn7sjGU 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 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, yang.shi@linaro.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/arm64/net/bpf_jit_comp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.0.2 -- 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/ 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);