Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752252AbbKPTtC (ORCPT ); Mon, 16 Nov 2015 14:49:02 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:36588 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbbKPTs7 (ORCPT ); Mon, 16 Nov 2015 14:48:59 -0500 Message-ID: <564A3329.1070504@linaro.org> Date: Mon, 16 Nov 2015 11:48:57 -0800 From: "Shi, Yang" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Z Lim CC: Alexei Starovoitov , Daniel Borkmann , Catalin Marinas , Will Deacon , Xi Wang , LKML , Network Development , "linux-arm-kernel@lists.infradead.org" , linaro-kernel@lists.linaro.org Subject: Re: [PATCH V3 2/2] arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS References: <1447438197-31838-1-git-send-email-yang.shi@linaro.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1256 Lines: 32 On 11/13/2015 6:39 PM, Z Lim wrote: > Yang, I noticed another thing... > > On Fri, Nov 13, 2015 at 10:09 AM, Yang Shi wrote: >> 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. > > Can you please add save/restore for x25 also? :) Sure. BTW, since PUSH invokes stp instruction and SP need 16-bytes alignment, so we have to save x26 with x25 together. Anyway, it won't introduce any harm overhead since one instruction saves two registers. Yang > >> It is initialized in BPF prog prologue when BPF prog is started to run >> everytime. When BPF prog exits, it could be just tossed. >> -- 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/