Re: [PATCH bpf-next v5 1/6] bpf: Introduce load-acquire and store-release instructions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 3, 2025 at 4:13 PM Peilin Ye <yepeilin@xxxxxxxxxx> wrote:
>
>         switch (insn->imm) {
> @@ -7780,6 +7813,24 @@ static int check_atomic(struct bpf_verifier_env *env, struct bpf_insn *insn)
>         case BPF_XCHG:
>         case BPF_CMPXCHG:
>                 return check_atomic_rmw(env, insn);
> +       case BPF_LOAD_ACQ:
> +#ifndef CONFIG_64BIT
> +               if (BPF_SIZE(insn->code) == BPF_DW) {
> +                       verbose(env,
> +                               "64-bit load-acquires are only supported on 64-bit arches\n");
> +                       return -EOPNOTSUPP;
> +               }
> +#endif

Your earlier proposal of:
if (BPF_SIZE(insn->code) == BPF_DW && BITS_PER_LONG != 64) {

was cleaner.
Why did you pick ifndef ?

> +               return check_atomic_load(env, insn);
> +       case BPF_STORE_REL:
> +#ifndef CONFIG_64BIT
> +               if (BPF_SIZE(insn->code) == BPF_DW) {
> +                       verbose(env,
> +                               "64-bit store-releases are only supported on 64-bit arches\n");
> +                       return -EOPNOTSUPP;
> +               }
> +#endif





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux