From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751345AbdAYH23 (ORCPT ); Wed, 25 Jan 2017 02:28:29 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:46531 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbdAYH22 (ORCPT ); Wed, 25 Jan 2017 02:28:28 -0500 Subject: Re: [PATCH 2/2] perf tools: Introduce regs_query_register_offset() for arm64 To: Arnaldo Carvalho de Melo , Will Deacon References: <20170124103015.1936-1-hekuang@huawei.com> <20170124103015.1936-3-hekuang@huawei.com> <20170124182515.GA26744@arm.com> <20170124190908.GG10340@kernel.org> CC: , , , , , , , From: Hekuang Message-ID: <58885334.8080604@huawei.com> Date: Wed, 25 Jan 2017 15:26:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20170124190908.GG10340@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.108.110.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.5888534B.039E,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: c5b30ea9190e1e8dc91ddf3b4895314a Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi 在 2017/1/25 3:09, Arnaldo Carvalho de Melo 写道: > Em Tue, Jan 24, 2017 at 06:25:18PM +0000, Will Deacon escreveu: >> On Tue, Jan 24, 2017 at 10:30:15AM +0000, He Kuang wrote: >>> Since HAVE_KPROBES can be enabled in arm64, this patch introduces >>> regs_query_register_offset() to convert register name to offset for >>> arm64, so the BPF prologue feature is ready to use. >>> >>> This patch also changes the 'dwarfnum' to 'offset' in register table, >>> so the related functions are consistent with x86. >>> >>> Signed-off-by: He Kuang > >> It would've been nice to have been cc'd on this. In future, please at least >> cc linux-arm-kernel for patches directly changing arm/arm64 code. > >>> + GPR_OFFSET_NAME(30), >>> + {.name = "lr", .offset = offsetof(struct user_pt_regs, regs[30])}, >>> + REG_OFFSET_NAME(sp), > >> Don't sp and lr need the leading '%'? > >>> + REG_OFFSET_NAME(pc), >>> + REG_OFFSET_NAME(pstate), > >> The AArch64 DWARF spec says that DWARF register 32 is "RESERVED" and >> register 33 is the ELR, so these pc/pstate entries are wrong. > >> However, with those changes, I think this patch can simply be ignored and >> mainline is doing the right thing. > Ok, thanks for checking, dropping this patch then. > > - Arnaldo > The purpose of this patch is mainly on enable bpf prologue on arm64, a new v2 version is sent and fix the problem mentioned by Will, thank you for reviewing this.