Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp588807imi; Thu, 21 Jul 2022 07:10:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sLV+snsB5ONDQFlT6fo8NA80ncO59c7LEsVwraGSs4vnp3TUuRSZkf2GELpaX9YXP0qZgl X-Received: by 2002:a17:907:7d8e:b0:72b:8205:9e67 with SMTP id oz14-20020a1709077d8e00b0072b82059e67mr40800591ejc.392.1658412613367; Thu, 21 Jul 2022 07:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658412613; cv=none; d=google.com; s=arc-20160816; b=f99U4JcYhg7TKuZ0spaPSive3bGkQmvYlLPijpIRK+Dnm4amSSkw/AmJMgYw1jyeN9 D1DPWVZzjQigIF3QxYr08VPdPn1IVCTkQavaqbEaHtMmpoNh805sSm5C3OQOclxnMnBG rZ4+opqzhQs319QkIzTkJPsmeciImAjj6zjUXkRhhw9ZZhjDGuGkU8O5kc//5FZdmo5P RBhGx1TueYLEV0f8MRYtRp0U/Yq1fTbl/dwU2GZKqjaNYMvZlQCguhPZkJoM2q5HNiol mUo650GRa3+Sb/A6XVy6um77XkIJIKdqxj/PusaF4hlZNUSXsDbn5FyZZG6nK2nft1bW L3vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1ZOd/Gq++6P9/egrjfq0hLbqfmWCQrpYvj+T6OMIRcA=; b=CoYuu3kqBYIcUc9MhZx7+OmgSvzh+vbxFzPze4oB7Q3A8K8nk2ZfGIXA6QnPbqhVYA 5ZwkI0K+2nb4GuMTjeoWl0Hg5Wp87m1yCfpFK2FBemusFbZH7n4dW/zowI1IMGG/fvq4 on5pTin6GYoZF0Irf9UyMHle8gvbhHTlcPiQ/skzf+Aj10HU1jMt+Tu4gGbb3A9paSTv n1w2uRVMgMz+eBVgy7fX+03nDXpQV1eSQs3JuphT85ZeC8pABYz0GhYhu5IiJdkxpIBe U3U8LDgxhjWOPdj7aPt10XgJSlXjfKjo86wXn45iseRURaiLTfLygiv5IQjsgn91+oDU OHLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XePPEM4R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds10-20020a170907724a00b0072a4249e9b5si2664615ejc.17.2022.07.21.07.09.48; Thu, 21 Jul 2022 07:10:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XePPEM4R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbiGUNlq (ORCPT + 99 others); Thu, 21 Jul 2022 09:41:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiGUNlo (ORCPT ); Thu, 21 Jul 2022 09:41:44 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E9E86E2EE for ; Thu, 21 Jul 2022 06:41:43 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id w8-20020a05600c014800b003a32e89bc4eso845198wmm.5 for ; Thu, 21 Jul 2022 06:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=1ZOd/Gq++6P9/egrjfq0hLbqfmWCQrpYvj+T6OMIRcA=; b=XePPEM4RRwanEDLwjDstnSZCVj1tto3cW5NKsAzKSn1mccMSMC/Kuk1+bODT32j6ro lU0EQLFZO/jmM0fADBWn/HBeLcOHrmKOpxS51Bdj+Mo9u2PfEGdD05msKOxw09yc5/fJ +14EaD9uzzG2/OGgSkWSBGhgbSbIy3sa2pBORDupvOHcLrvzjHFwEGPSAqL/WLkoBBkB 3cEIGnGKxCX/iNlsspBW+UJmxQidu1C2WcAw4k8jSaqnV2D32xwSXeGcZH8BPxiVdaOA kiZZQ7alXk5g7dtU0VcGXBk/z9MwXQry8wno1WiMdGaz5+9rOmgAj8QJuwc0X3Wu7t/X 7OrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1ZOd/Gq++6P9/egrjfq0hLbqfmWCQrpYvj+T6OMIRcA=; b=t/ifN1TLnIINxAP+T55+bzCzOlIJsQVfD/FeYUAvLQdzwTflYRis5v5zhz014pwv0/ h2gDPytQdzUUWos0jCINZBhaN1G7bIsTsKgm90rG1c5Xqg1JEIfQmYO4CgX3m8vDYaBG 3RR2E1lrDgDLTF3FrvIS5acu2KjjJBdmLBIib9VvjrL7jyjH6akHuuWS6B7N9ju9oZ+L 5cH+m5pFjb8RlV+JizXStcF5gQmOPKpykiQlMDV4Z0LnWGMLEiJlq+ezyRm07x1VcET9 8F32i6Z5vlfsVRhjUGIFJTEll/W23DWQizupTnbHJSheMmyV0wxlSYUEr3GWWJ7i+iYz RFXw== X-Gm-Message-State: AJIora9godpf15f2PjNluyT3Cd78D7OrgUzjLgFuIyQu9BLhseGBXiVQ g9VFABeVWMhmekuBmlydqlQXZA== X-Received: by 2002:a05:600c:35d5:b0:3a3:2490:c984 with SMTP id r21-20020a05600c35d500b003a32490c984mr8823738wmq.162.1658410901611; Thu, 21 Jul 2022 06:41:41 -0700 (PDT) Received: from myrica (cpc92880-cmbg19-2-0-cust679.5-4.cable.virginm.net. [82.27.106.168]) by smtp.gmail.com with ESMTPSA id i13-20020adff30d000000b0021e4982270asm2078759wro.13.2022.07.21.06.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 06:41:41 -0700 (PDT) Date: Thu, 21 Jul 2022 14:41:15 +0100 From: Jean-Philippe Brucker To: Xu Kuohai Cc: bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexei Starovoitov , Andrii Nakryiko , Catalin Marinas , Daniel Borkmann , Hao Luo , Jakub Sitnicki , Jiri Olsa , John Fastabend , Jon Hunter , KP Singh , Martin KaFai Lau , Song Liu , Stanislav Fomichev , Will Deacon , Yonghong Song , Zi Shen Lim Subject: Re: [PATCH bpf-next] bpf, arm64: Fix compile error in dummy_tramp() Message-ID: References: <20220721121319.2999259-1-xukuohai@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220721121319.2999259-1-xukuohai@huaweicloud.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 21, 2022 at 08:13:19AM -0400, Xu Kuohai wrote: > From: Xu Kuohai > > dummy_tramp() uses "lr" to refer to the x30 register, but some assembler > does not recognize "lr" and reports a build failure: > > /tmp/cc52xO0c.s: Assembler messages: > /tmp/cc52xO0c.s:8: Error: operand 1 should be an integer register -- `mov lr,x9' > /tmp/cc52xO0c.s:7: Error: undefined symbol lr used as an immediate value > make[2]: *** [scripts/Makefile.build:250: arch/arm64/net/bpf_jit_comp.o] Error 1 > make[1]: *** [scripts/Makefile.build:525: arch/arm64/net] Error 2 > > So replace "lr" with "x30" to fix it. > > Fixes: b2ad54e1533e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64") > Reported-by: Jon Hunter > Tested-by: Jon Hunter > Signed-off-by: Xu Kuohai Right, it looks like the lr alias was only added to binutils 2.30, and Linux supports 2.23+ Reviewed-by: Jean-Philippe Brucker > --- > arch/arm64/net/bpf_jit_comp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c > index dcc572b7d4da..7ca8779ae34f 100644 > --- a/arch/arm64/net/bpf_jit_comp.c > +++ b/arch/arm64/net/bpf_jit_comp.c > @@ -610,8 +610,8 @@ asm ( > #if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL) > " bti j\n" /* dummy_tramp is called via "br x10" */ > #endif > -" mov x10, lr\n" > -" mov lr, x9\n" > +" mov x10, x30\n" > +" mov x30, x9\n" > " ret x10\n" > " .size dummy_tramp, .-dummy_tramp\n" > " .popsection\n" > -- > 2.30.2 >