Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp255076pxf; Wed, 31 Mar 2021 02:32:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJzuGctsd9kBMQqRLsWXIp+mfo/pfnZ/6TSf3IAGQFjrPndFNmfazFxk1S1LezyaMKLCNr X-Received: by 2002:a17:906:c102:: with SMTP id do2mr2505219ejc.305.1617183157094; Wed, 31 Mar 2021 02:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617183157; cv=none; d=google.com; s=arc-20160816; b=K7FnoRt/3t5Ci+j+1wloqHeHqplgU3jfw0anTkDD6qH+4pIQBqA8QbCFJHRmR+2Js/ YstUXwkhNd555mumY1raTLwBVgP22/gYoSGYQnfxWL5Hml8ZJR5GFKVUksQnr2TlSDhJ hQyDkMTdJ+a9HEreHyYBXqPJb1Z7Qsove/UsWnP7NltSi1NBLleovD75q5JaQy1xYdkT 0+0Iu9Wv8dVzDs/UbgjkHUVTghOPBGwhMDtp64ksM8WQsmNjBDTRbehYJuYsHF4Eo4xI SZxlCL3pek4Kn07Zc7qLWAh4qUf9dQnq8xOzLWH1HH6GPd65HXEgNtuQ79pjYVpZ4DsX wPAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wZ1aftY2TCheQmqtZlYyfEeCQjc6dy8UOjko3ZK9lss=; b=Z+qxe0zLqGwIQ2kMvz2fMOwyV5baMkFpgLYK6j2OPQ2eAVp46Pos5Jf+28EmFYPECj T01ego4im+A8+W876F9o+U6FsnYqQ8TXqutR88E3zoEsx6NfNGpsPIKVKG6W7Fc1keGK MPJ+yZiIA4wYi4aUiKtRP6lEPQr8aXrmKNCVKh5skrB/hifmg0Fmvl3VJVCHnubCuRVi owojVAwDNgviywsrh/RwoZ145PI3mKxJEroe1qEoVTP34b75+OSnXdFNL69Mjp3OibST 13K1GHEUWGcCJo0HIKKi5pqMSsfyYKiKAdFbqEruQVio+bylkBHoXoh8VKtJQDv+KDHW bYTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HalLlvoW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si1283657edq.493.2021.03.31.02.32.14; Wed, 31 Mar 2021 02:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HalLlvoW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234695AbhCaJ3F (ORCPT + 99 others); Wed, 31 Mar 2021 05:29:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:46884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbhCaJ2v (ORCPT ); Wed, 31 Mar 2021 05:28:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 04CA561606; Wed, 31 Mar 2021 09:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617182930; bh=Y2KIGR+vQOCwkenByF8/05tg8IxGcotlykRYxJa4B7Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HalLlvoWduM+QwONzIW12DvynzvUjVAvjRpYA+RzP4smHbvZtPKvPkMUSlZQJzYc5 AgkNYA76ZX8DlbphlosWeakn2beANedWUdKS5BlsacO4qrgSz1T4RzpEjym/HNKEnF gCyxUWhDJ6LJv240kr11HyxaeWR1nsswPE7ktzO+boJGpEwS2sx/riblCmpNh6FHO+ jNyQMnJIpmIaO5O96UFaA5cOycA+SU0Vxli5UFIMPmoc0RlSn+TrNd0ddTi5b8sP3R wR6x2DvpXnTxntemhmle0bxHp0b1GT8jy81nzhYPJqeYxT/ytu+vEMUrv3E1rx+BNF 4yxmIl7kiKiFQ== Date: Wed, 31 Mar 2021 10:28:44 +0100 From: Will Deacon To: Jianlin Lv Cc: Jianlin Lv , bpf , zlim.lnx@gmail.com, catalin.marinas@arm.com, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , LKML , Network Development , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH bpf-next] bpf: arm64: Redefine MOV consistent with arch insn Message-ID: <20210331092844.GA7205@willie-the-truck> References: <20210330074235.525747-1-Jianlin.Lv@arm.com> <20210330093149.GA5281@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 31, 2021 at 05:22:18PM +0800, Jianlin Lv wrote: > On Tue, Mar 30, 2021 at 5:31 PM Will Deacon wrote: > > > > On Tue, Mar 30, 2021 at 03:42:35PM +0800, Jianlin Lv wrote: > > > A64_MOV is currently mapped to Add Instruction. Architecturally MOV > > > (register) is an alias of ORR (shifted register) and MOV (to or from SP) > > > is an alias of ADD (immediate). > > > This patch redefines A64_MOV and uses existing functionality > > > aarch64_insn_gen_move_reg() in insn.c to encode MOV (register) instruction. > > > For moving between register and stack pointer, rename macro to A64_MOV_SP. > > > > What does this gain us? There's no requirement for a BPF "MOV" to match an > > arm64 architectural "MOV", so what's the up-side of aligning them like this? > > According to the description in the Arm Software Optimization Guide, > Arithmetic(basic) and Logical(basic) instructions have the same > Exec Latency and Execution Throughput. > This change did not bring about a performance improvement. > The original intention was to make the instruction map more 'natively'. I think we should leave the code as-is, then. Having a separate MOV_SP macro s confusing and, worse, I worry that somebody passing A64_SP to A64_MOV will end up using the zero register. Will