Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932479AbbKQTpE (ORCPT ); Tue, 17 Nov 2015 14:45:04 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:58402 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753785AbbKQTpB (ORCPT ); Tue, 17 Nov 2015 14:45:01 -0500 Date: Tue, 17 Nov 2015 14:44:58 -0500 (EST) Message-Id: <20151117.144458.1305922349920062634.davem@davemloft.net> To: yang.shi@linaro.org Cc: ast@kernel.org, daniel@iogearbox.net, catalin.marinas@arm.com, will.deacon@arm.com, 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 Subject: Re: [PATCH V4 2/2] arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS From: David Miller In-Reply-To: <1447713335-29707-1-git-send-email-yang.shi@linaro.org> References: <1447713335-29707-1-git-send-email-yang.shi@linaro.org> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 17 Nov 2015 11:45:00 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1137 Lines: 27 From: Yang Shi Date: Mon, 16 Nov 2015 14:35:35 -0800 > Save and restore FP/LR in BPF prog prologue and epilogue, save SP to FP > in prologue in order to get the correct stack backtrace. > > However, ARM64 JIT used FP (x29) as eBPF fp register, FP is subjected to > change during function call so it may cause the BPF prog stack base address > change too. > > Use x25 to replace FP as BPF stack base register (fp). Since x25 is callee > saved register, so it will keep intact during function call. > It is initialized in BPF prog prologue when BPF prog is started to run > everytime. Save and restore x25/x26 in BPF prologue and epilogue to keep > them intact for the outside of BPF. Actually, x26 is unnecessary, but SP > requires 16 bytes alignment. > > So, the BPF stack layout looks like: ... > Signed-off-by: Yang Shi Applied, thank you. -- 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/