From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95179C2D0DB for ; Thu, 23 Jan 2020 14:35:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B4E02087E for ; Thu, 23 Jan 2020 14:35:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JYW1zj2m"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="0BsJ627k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B4E02087E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=inwV5rGAphuOS5P48i0r1D75h8iEOq5aME7hKuvVBI8=; b=JYW1zj2mhgK3Ti ZX/FkzzWIasuC91j3X98Vi4cAJ/CuTi8DuIBGfx+Zj5OXX45YCyTcf8iYbpOZ63RkFaliTg+x/P3Y caosnNar+drt4HTgjxuFBRnefA0jWiGhUU3BEI/UzyfOdFdFvu+z7edHtm7DfqYOJK4xOgVraKkRS xtNPLuo/f+2rqfvumr7xZmKP8erqXe8ur1zsQmKiGqRA4ax6/xk1p3PpK3L6jddU/P0zI6ZB1S7VO zFWpJqSnkatcjYTOy5BZ/nAPxbXCZ0dGQNuKEVps2JaJbqac/0NEgiSlcnasGXuzUVWCMyKUUnVTj 0q/aoeiuXclDBp0lOoGw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iudZg-0003UN-LQ; Thu, 23 Jan 2020 14:35:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iudZc-0003OS-Vh for linux-arm-kernel@lists.infradead.org; Thu, 23 Jan 2020 14:35:10 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 43BAF2087E; Thu, 23 Jan 2020 14:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579790108; bh=JNtixxJ/yw1iFwwAJ9ohnh46vXkDLO9OMR488psZi7Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0BsJ627kvWrt2CDSqPfrDlznsX+RCpuOBXBDDOxDvG++isOd/KeDDX6iSaEZtPmvG YRkdpadtdV/Obl9NJ3Dmn9Kd7PaJJW3s+dOrbPn8k/X/sGC1vy8sHxnObLD/1LjGMX WF8lClEQHLsDqE2aLHc1FlTqaHupTpHJm+0o42Y4= Date: Thu, 23 Jan 2020 14:35:03 +0000 From: Will Deacon To: Julien Thierry Subject: Re: [RFC v5 00/57] objtool: Add support for arm64 Message-ID: <20200123143503.GA19649@willie-the-truck> References: <20200109160300.26150-1-jthierry@redhat.com> <20200121103025.GC11154@willie-the-truck> <400d402d-c964-6f0c-2954-6f6afcb94635@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <400d402d-c964-6f0c-2954-6f6afcb94635@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200123_063509_071993_73B6B544 X-CRM114-Status: GOOD ( 16.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peterz@infradead.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, raphael.gault@arm.com, jpoimboe@redhat.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 23, 2020 at 01:52:17PM +0000, Julien Thierry wrote: > > > On 1/21/20 10:30 AM, Will Deacon wrote: > > On Thu, Jan 09, 2020 at 04:02:03PM +0000, Julien Thierry wrote: > > > This patch series is the continuation of Raphael's work [1]. All the > > > patches can be retrieved from: > > > git clone -b arm64-objtool-v5 https://github.com/julien-thierry/linux.git > > > > [...] > > > > > objtool: arm64: Decode unknown instructions > > > objtool: arm64: Decode simple data processing instructions > > > objtool: arm64: Decode add/sub immediate instructions > > > objtool: arm64: Decode logical data processing instructions > > > objtool: arm64: Decode system instructions not affecting the flow > > > objtool: arm64: Decode calls to higher EL > > > objtool: arm64: Decode brk instruction > > > objtool: arm64: Decode instruction triggering context switch > > > objtool: arm64: Decode branch instructions with PC relative immediates > > > objtool: arm64: Decode branch to register instruction > > > objtool: arm64: Decode basic load/stores > > > objtool: arm64: Decode load/store with register offset > > > objtool: arm64: Decode load/store register pair instructions > > > objtool: arm64: Decode FP/SIMD load/store instructions > > > objtool: arm64: Decode load/store exclusive > > > objtool: arm64: Decode atomic load/store > > > objtool: arm64: Decode pointer auth load instructions > > > objtool: arm64: Decode load acquire/store release > > > objtool: arm64: Decode load/store with memory tag > > > objtool: arm64: Decode load literal > > > objtool: arm64: Decode register data processing instructions > > > objtool: arm64: Decode FP/SIMD data processing instructions > > > objtool: arm64: Decode SVE instructions > > > > That's a lot of decoding logic which we already have in > > arch/arm64/{kernel/insn.c,include/asm/insn.h}. I'd prefer to see this stuff > > reused or generated from a single source, since it's really easy to get it > > wrong, has a tendency to bitrot and is nasty to debug. > > > > The thing is that the code in those files is mostly encoding logic > (motivated by BPF) rather than decoding (except for the instruction that > might be trapped, but these rarely overlap with instructions that objtools > cares about). I agree that ideally the decoding/encoding should be under > arch/arm64/lib, I was just a bit weary introducing a lot of decoding code > under arch/arm64 that wouldn't even be used in kernel code. Hmm, but kprobes decodes instructions somehow :p Not saying you have to refactor everything, but I'd hope you could reuse some of the aarch64_insn_is* and aarch64_insn_extract* functions at least. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel