From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH bpf-next v3 06/10] tools: bpftool: resolve calls without using imm field Date: Tue, 22 May 2018 12:36:43 -0700 Message-ID: <20180522123643.5ed1e391@cakuba> References: <02b16a573269b492d4449c0e587ccc0020973e8c.1527008647.git.sandipan@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, naveen.n.rao@linux.vnet.ibm.com To: Sandipan Das Return-path: Received: from mail-qt0-f193.google.com ([209.85.216.193]:43204 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbeEVTgr (ORCPT ); Tue, 22 May 2018 15:36:47 -0400 Received: by mail-qt0-f193.google.com with SMTP id f13-v6so25008104qtp.10 for ; Tue, 22 May 2018 12:36:47 -0700 (PDT) In-Reply-To: <02b16a573269b492d4449c0e587ccc0020973e8c.1527008647.git.sandipan@linux.vnet.ibm.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 22 May 2018 22:46:09 +0530, Sandipan Das wrote: > Currently, we resolve the callee's address for a JITed function > call by using the imm field of the call instruction as an offset > from __bpf_call_base. If bpf_jit_kallsyms is enabled, we further > use this address to get the callee's kernel symbol's name. > > For some architectures, such as powerpc64, the imm field is not > large enough to hold this offset. So, instead of assigning this > offset to the imm field, the verifier now assigns the subprog > id. Also, a list of kernel symbol addresses for all the JITed > functions is provided in the program info. We now use the imm > field as an index for this list to lookup a callee's symbol's > address and resolve its name. > > Suggested-by: Daniel Borkmann > Signed-off-by: Sandipan Das Reviewed-by: Jakub Kicinski