Re: [PATCH bpf-next v3 4/9] arm32, bpf: add support for unconditional bswap instruction

Russell King (Oracle)
2023-09-08T08:35:24Z

On Thu, Sep 07, 2023 at 11:05:45PM +0000, Puranjay Mohan wrote:
> The cpuv4 added a new unconditional bswap instruction with following
> behaviour:
>
> BPF_ALU64 | BPF_TO_LE | BPF_END with imm = 16/32/64 means:
> dst = bswap16(dst)
> dst = bswap32(dst)
> dst = bswap64(dst)
>
> As we already support converting to big-endian from little-endian we can
> use the same for unconditional bswap. just treat the unconditional scenario
> the same as big-endian conversion.
>
> Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!