BPF List
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Pu Lehui <pulehui@huawei.com>, Xiao Wang <xiao.w.wang@intel.com>,
	paul.walmsley@sifive.com, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, luke.r.nels@gmail.com, xi.wang@gmail.com,
	bjorn@kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
	yonghong.song@linux.dev, john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
	jolsa@kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	haicheng.li@intel.com
Subject: Re: [PATCH] riscv, bpf: Optimize zextw insn with Zba extension
Date: Tue, 7 May 2024 15:00:04 +0100	[thread overview]
Message-ID: <b7421822-4c07-40e2-b2a4-3599ba6b39da@codethink.co.uk> (raw)
In-Reply-To: <6836eb5c-f135-4e58-987b-987ab446b27c@huawei.com>

On 07/05/2024 13:47, Pu Lehui wrote:
> 
> On 2024/5/7 18:45, Xiao Wang wrote:
>> The Zba extension provides add.uw insn which can be used to implement
>> zext.w with rs2 set as ZERO.
>>
>> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
>> ---
>>   arch/riscv/Kconfig       | 19 +++++++++++++++++++
>>   arch/riscv/net/bpf_jit.h | 18 ++++++++++++++++++
>>   2 files changed, 37 insertions(+)
>>
>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>> index 6bec1bce6586..0679127cc0ea 100644
>> --- a/arch/riscv/Kconfig
>> +++ b/arch/riscv/Kconfig
>> @@ -586,6 +586,14 @@ config RISCV_ISA_V_PREEMPTIVE
>>         preemption. Enabling this config will result in higher memory
>>         consumption due to the allocation of per-task's kernel Vector 
>> context.
>> +config TOOLCHAIN_HAS_ZBA
>> +    bool
>> +    default y
>> +    depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zba)
>> +    depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zba)
>> +    depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
>> +    depends on AS_HAS_OPTION_ARCH
>> +
>>   config TOOLCHAIN_HAS_ZBB

At this point would it be easier to ask the toolchain what's enabled
and put into kconfig via some sort of script?

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html


  reply	other threads:[~2024-05-07 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 10:45 [PATCH] riscv, bpf: Optimize zextw insn with Zba extension Xiao Wang
2024-05-07 12:47 ` Pu Lehui
2024-05-07 14:00   ` Ben Dooks [this message]
2024-05-09  9:31     ` Wang, Xiao W
2024-05-08 11:20   ` Wang, Xiao W
2024-05-10 20:56 ` Conor Dooley
2024-05-11  1:17   ` Wang, Xiao W

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7421822-4c07-40e2-b2a4-3599ba6b39da@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=andrii@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haicheng.li@intel.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=luke.r.nels@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pulehui@huawei.com \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=xi.wang@gmail.com \
    --cc=xiao.w.wang@intel.com \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox