From patchwork Thu Mar 28 12:49:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pu Lehui X-Patchwork-Id: 13608505 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D4477C54E64 for ; Thu, 28 Mar 2024 12:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nRYxWgb/A6lxNX4sn3m3s5yVR4P0koY+CfdUwrwvXQY=; b=jmFb1wgxZXvkNz fdXS89+9ezA1nF0vqys9yjyGYD3/dveu0NR+sRADdpnpNMjRqMaR/X9VDIdWMlf4nUKQM36Y9F0/T HAmTz2Pk3pJWgblalOqEld9Yadp5DvZjMawqw21nqIvVvFqA7Mieqq+MxzA+nsvxmbiRNUNgHR9YN ALI/V2le1En2bcXgwe7Khe2C/AkMpfzIrIFskwXSh+v6q54iMPzmyG7QIliP9q1JWfll0iahrW3dj RWRDkoF7LEKcUHPqLuHxdR80GZ5/hAfPXJvjiMfsf/uluwgnNKM9NJyHqwPAjkSsT7n5rjkCwv0xf pTRo8aMUlVBu+zP7/LlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rppB6-0000000DzOS-3oyz; Thu, 28 Mar 2024 12:48:20 +0000 Received: from [45.249.212.56] (helo=dggsgout12.his.huawei.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rppB4-0000000DzLZ-2Si6 for linux-riscv@lists.infradead.org; Thu, 28 Mar 2024 12:48:20 +0000 Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4V53Gz31Kjz4f3kht for ; Thu, 28 Mar 2024 20:47:55 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id AD8521A0232 for ; Thu, 28 Mar 2024 20:48:01 +0800 (CST) Received: from ultra.huawei.com (unknown [10.90.53.71]) by APP2 (Coremail) with SMTP id Syh0CgAnlQj+ZgVmTvYNIg--.31354S4; Thu, 28 Mar 2024 20:48:01 +0800 (CST) From: Pu Lehui To: bpf@vger.kernel.org, linux-riscv@lists.infradead.org, netdev@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Manu Bretelle , Pu Lehui , Pu Lehui Subject: [PATCH bpf-next 2/5] riscv, bpf: Relax restrictions on Zbb instructions Date: Thu, 28 Mar 2024 12:49:13 +0000 Message-Id: <20240328124916.293173-3-pulehui@huaweicloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240328124916.293173-1-pulehui@huaweicloud.com> References: <20240328124916.293173-1-pulehui@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAnlQj+ZgVmTvYNIg--.31354S4 X-Coremail-Antispam: 1UD129KBjvdXoW7GF4kuw4DAw4fJFW3Cw4UJwb_yoWfGrgEkr yxtryI9w4Fy3Z7X3WDGr4rJr17C395tFy8GF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lameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240328_054818_843756_12C562A0 X-CRM114-Status: UNSURE ( 8.29 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Pu Lehui This patch relaxes the restrictions on the Zbb instructions. The hardware is capable of recognizing the Zbb instructions independently, eliminating the need for reliance on kernel compile configurations. Signed-off-by: Pu Lehui Reviewed-by: Björn Töpel --- arch/riscv/net/bpf_jit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/net/bpf_jit.h b/arch/riscv/net/bpf_jit.h index 5fc374ed98ea..bcf109b88df5 100644 --- a/arch/riscv/net/bpf_jit.h +++ b/arch/riscv/net/bpf_jit.h @@ -20,7 +20,7 @@ static inline bool rvc_enabled(void) static inline bool rvzbb_enabled(void) { - return IS_ENABLED(CONFIG_RISCV_ISA_ZBB) && riscv_has_extension_likely(RISCV_ISA_EXT_ZBB); + return riscv_has_extension_likely(RISCV_ISA_EXT_ZBB); } enum {