Re: [PATCH bpf-next 2/5] riscv, bpf: Relax restrictions on Zbb instructions

Pu Lehui
2024-04-03T10:19:10Z

On 2024/4/3 0:03, Daniel Borkmann wrote:
> On 4/2/24 4:27 PM, Björn Töpel wrote:
>> Pu Lehui <pulehui@huaweicloud.com> writes:
>>> From: Pu Lehui <pulehui@huawei.com>
>>>
>>> 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 <pulehui@huawei.com>
>>
>> Should this patch really be part of this series?
>
> No, that should be submitted independently.
>

My initial thought was that I didn't enable CONFIG_RISCV_ISA_ZBB in
config.riscv64, so I should loosen this restriction to enable zbb
optimization. It could not be part of this series.

By the way, after reading what Conor and Björn said, I think we should
align with kernel sematic, that is, emit zbb when CONFIG_RISCV_ISA_ZBB
is enabled and so that if Zbb is detected they can be used.

> Also, given Eduard's comment, it would be great if you could add the
> instructions to tools/testing/selftests/bpf/README.rst even if not in
> a perfect shape, but it would give developers a chance to get started.
>
> Thanks,
> Daniel