Re: [PATCH bpf-next 02/12] libbpf: Permit 64bit relocation value

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

 



On 5/1/22 3:00 PM, Yonghong Song wrote:   
> Currently, the libbpf limits the relocation value to be 32bit
> since all current relocations have such a limit. But with
> BTF_KIND_ENUM64 support, the enum value could be 64bit.
> So let us permit 64bit relocation value in libbpf.
> 
> Signed-off-by: Yonghong Song <yhs@xxxxxx>
> ---
>  tools/lib/bpf/relo_core.c | 24 ++++++++++++------------
>  tools/lib/bpf/relo_core.h |  4 ++--
>  2 files changed, 14 insertions(+), 14 deletions(-)

[...]

> diff --git a/tools/lib/bpf/relo_core.c b/tools/lib/bpf/relo_core.c
> index ba4453dfd1ed..2ed94daabbe5 100644
> --- a/tools/lib/bpf/relo_core.c
> +++ b/tools/lib/bpf/relo_core.c

[...]


> @@ -1035,7 +1035,7 @@ int bpf_core_patch_insn(const char *prog_name, struct bpf_insn *insn,
>  
>  		insn[0].imm = new_val;
>  		insn[1].imm = 0; /* currently only 32-bit values are supported */
> -		pr_debug("prog '%s': relo #%d: patched insn #%d (LDIMM64) imm64 %llu -> %u\n",
> +		pr_debug("prog '%s': relo #%d: patched insn #%d (LDIMM64) imm64 %llu -> %llu\n",
>  			 prog_name, relo_idx, insn_idx,
>  			 (unsigned long long)imm, new_val);
>  		break;

Since new_val is 64bit now, should the insn[1].imm be set here, and the comment
about 32-bit be removed?



[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