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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7FFFC43334 for ; Tue, 5 Jul 2022 16:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231213AbiGEQjz (ORCPT ); Tue, 5 Jul 2022 12:39:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbiGEQjy (ORCPT ); Tue, 5 Jul 2022 12:39:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75C3019C30; Tue, 5 Jul 2022 09:39:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 319CFB8184A; Tue, 5 Jul 2022 16:39:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BBC8C341C7; Tue, 5 Jul 2022 16:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657039190; bh=yh6ho/I9Easg45efAjcjXhmjoEVVloWhd5h1kDc+BuE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=J6oB/6FmOqrzEPGosLm/BuEXHlJ1fH5J0iuxnnd04Zz2XgSNHKXlmpUagdkqu2PZ9 oNIbKkEAAiH26bCLCkBt9OaU3jdkXjuTIzm2k/p6JI7quVtlyvSXfnDbtXAbpZH26j TYKDNGzUBu1kB/hN8eNv9qnIdPYn7GVrwKphsUVF1hyagmMRyBj4y0dBmtqcO9DlEI 9rLHTwwahd6WsWj+SZgxux8kWhT5BXvgAnKZJyeQ+jJqazQsA/4OeMy6sxovhOP1/h +brVdBiChvLBM00b9dNXfSUA/TukQ0ULR93hOnGsYQ2xd/WZtNJFIHWYlcN/K3vjYS yfnl+xoDZ/NFQ== Date: Tue, 5 Jul 2022 17:39:41 +0100 From: Will Deacon To: Xu Kuohai Cc: bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Mark Rutland , Catalin Marinas , Daniel Borkmann , Alexei Starovoitov , Zi Shen Lim , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Jakub Kicinski , Jesper Dangaard Brouer , Russell King , James Morse , Hou Tao , Jason Wang Subject: Re: [PATCH bpf-next v6 2/4] arm64: Add LDR (literal) instruction Message-ID: <20220705163941.GA1339@willie-the-truck> References: <20220625161255.547944-1-xukuohai@huawei.com> <20220625161255.547944-3-xukuohai@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220625161255.547944-3-xukuohai@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Sat, Jun 25, 2022 at 12:12:53PM -0400, Xu Kuohai wrote: > Add LDR (literal) instruction to load data from address relative to PC. > This instruction will be used to implement long jump from bpf prog to > bpf rampoline in the follow-up patch. typo: trampoline > > The instruction encoding: > > 3 2 2 2 0 0 > 0 7 6 4 5 0 > +-----+-------+---+-----+-------------------------------------+--------+ > | 0 x | 0 1 1 | 0 | 0 0 | imm19 | Rt | > +-----+-------+---+-----+-------------------------------------+--------+ > > for 32-bit, variant x == 0; for 64-bit, x == 1. > > branch_imm_common() is used to check the distance between pc and target > address, since it's reused by this patch and LDR (literal) is not a branch > instruction, rename it to aarch64_imm_common(). nit, but I think "label_imm_common()" would be a better name. Anyway, I checked the encodings and the code looks good, so: Acked-by: Will Deacon Will