Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7183364rwb; Tue, 6 Dec 2022 02:16:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf7JbSBvBbnbrqVm8/FBjHLW7CPhldbQNCU0wAECH++p+p3rUK16kjtC4CmkfkG6/Q/iW12p X-Received: by 2002:aa7:9257:0:b0:56c:cea7:8650 with SMTP id 23-20020aa79257000000b0056ccea78650mr69215199pfp.40.1670321800930; Tue, 06 Dec 2022 02:16:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670321800; cv=none; d=google.com; s=arc-20160816; b=gDhDoXEw9DXouxSjdxGDLPchIGuOBb9CcptAPszmLxJeQTknl6yko0LARRV0of4Xrd UuEJkWrbrLFPjyXuajSagkc2cMsC1LwHH6wfMc5H0ytfXvKkY4UWOw04r4qJSVrC90z0 gvMRmrSyu7dnJeyJc+W1MyTeHVGhNQBJ8pxyDFLnz5lMGZmZt0Upu5x2HH+/vhhDP6we 18VkVy4qBTI4oTFVj7tAm+Tgu4PO5NVkJezoJ14P47smxCSdnWD37gRQ1X2hB7y2wnrD tbDZSCBfu2jCPN2LLGkcic9Nx68jHcF7xG9IDqTFC1Uy2RGkU/ORKlh/7L0XKiH9UbOR QmOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=D+pxXj/2CVP8g6LvV+D2HD+p3j/ff+Jrjt7KBdzIfds=; b=wr5bfaKLHu5qGjN3Jk4QxZCGHFJnp63LQ6sSl0hkYmuG/jwHSi9/zUii/2Xlm4yA/r czD/UxdjeUE4I0c1/+aWam11v0RRIrrHlHQk5iGgppGBUE7rwJkiir9zFx+PBfv4Zv/6 J0qLFpjiYoqQxBE75kzGYwyJBLBa6YD5nD5PyxaBFw2tjAhjd9KttwGgoSy3SKAB9cIG p7eSfF4Hr9fPupQ9HhLLVY7QWbNQk9bnls/sjIps4W4qh92JLA1mZnjKnFeWACQyhGwr hOMj+dHpWdtBzpeftvC82KQZ8e3NUYymslFf6NRJAvG8MYSRJi523SGiG2GJ1hrSgRCV pbbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K5Fx+UCP; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a656687000000b004787bc1b47asi11976022pgw.805.2022.12.06.02.16.31; Tue, 06 Dec 2022 02:16:40 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=K5Fx+UCP; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233889AbiLFInC (ORCPT + 79 others); Tue, 6 Dec 2022 03:43:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233668AbiLFIm5 (ORCPT ); Tue, 6 Dec 2022 03:42:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AE1663A5; Tue, 6 Dec 2022 00:42:56 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 3902F615C5; Tue, 6 Dec 2022 08:42:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21606C433D6; Tue, 6 Dec 2022 08:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670316175; bh=/uuvuXgxZ5ZLrdsqrg9NhzM2RQM4AhSfL3k25vRXOq4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=K5Fx+UCPvzDZ57iIqGv6A6/V0/YFagMy6dGQhsdNCzNkO15+X6FCQs76HvbjnaJiz J7oTopzvH1whEtTzfGHU4+Dt2TUlk7ZAFnBVSRvygwYlvjzw77vVZj5+AVLzJ7pG/L 6mcAc2pT+q7s21NSTcItegl5mFfjJBr/x/YTfyGGgm05rVqrnTQKCY1g2GfgnX+2Os 92FdTONc0qM+aNYRrBNx4ZGw9dNU0tA3POc57D3D0YW4BEoTbFUZK1XuFx67naeIC+ j7hdpiJSUhqfzHVT99if05sDidfeh29Wa+qAbhNoyWFIElyHzIXFnrmuIW6G5Q7boP Ah9uc7fabHHuA== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Pu Lehui , bpf@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Paul Walmsley , Palmer Dabbelt , Albert Ou , Pu Lehui Subject: Re: [PATCH bpf v2] riscv, bpf: Emit fixed-length instructions for BPF_PSEUDO_FUNC In-Reply-To: <0620000f-4d06-de15-09d9-24b5b0c47410@huaweicloud.com> References: <20221202094837.3872444-1-pulehui@huaweicloud.com> <87y1rq848x.fsf@all.your.base.are.belong.to.us> <0ade59ea-6863-4d68-607c-22e4b9405a0d@huaweicloud.com> <87359t3r0h.fsf@all.your.base.are.belong.to.us> <0620000f-4d06-de15-09d9-24b5b0c47410@huaweicloud.com> Date: Tue, 06 Dec 2022 09:42:52 +0100 Message-ID: <87359szzw3.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Pu Lehui writes: >> Wouldn't that work? >> > > It definitely works. But auipc+addi may be some holes, while > lui+addi+slli support all the address of kernel and module. And this > might be help for the future feature porting. We're already using auipc/jalr for calls, and I'd say it *very* unlikely that we'll hit the non-covered range. I'd say go with auipc/addi + error, and we can change if this really is a problem.