All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [jolsa-perf:bpf/optimized_usdt_3 21/24] kernel/events/uprobes.c:2522:undefined reference to `arch_uprobe_optimize'
Date: Sun, 3 Nov 2024 12:33:14 +0800	[thread overview]
Message-ID: <202411031222.d41XHGa9-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/optimized_usdt_3
head:   2e0575143d13814d04f02a33a4110989ccdbf3a3
commit: 0200936b03cfee067eb7db4b44079104b561b726 [21/24] uprobes/x86: Add support to optimize uprobes
config: powerpc-randconfig-003-20241103 (https://download.01.org/0day-ci/archive/20241103/202411031222.d41XHGa9-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241103/202411031222.d41XHGa9-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411031222.d41XHGa9-lkp@intel.com/

All errors (new ones prefixed by >>):

   powerpc-linux-ld: kernel/events/uprobes.o: in function `handle_swbp':
>> kernel/events/uprobes.c:2522:(.text+0x76f8): undefined reference to `arch_uprobe_optimize'

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for GET_FREE_REGION
   Depends on [n]: SPARSEMEM [=n]
   Selected by [y]:
   - RESOURCE_KUNIT_TEST [=y] && RUNTIME_TESTING_MENU [=y] && KUNIT [=y]


vim +2522 kernel/events/uprobes.c

  2457	
  2458	/*
  2459	 * Run handler and ask thread to singlestep.
  2460	 * Ensure all non-fatal signals cannot interrupt thread while it singlesteps.
  2461	 */
  2462	static void handle_swbp(struct pt_regs *regs)
  2463	{
  2464		struct uprobe *uprobe;
  2465		unsigned long bp_vaddr;
  2466		int is_swbp;
  2467	
  2468		bp_vaddr = uprobe_get_swbp_addr(regs);
  2469		if (bp_vaddr == uprobe_get_trampoline_vaddr())
  2470			return uprobe_handle_trampoline(regs);
  2471	
  2472		rcu_read_lock_trace();
  2473	
  2474		uprobe = find_active_uprobe_rcu(bp_vaddr, &is_swbp);
  2475		if (!uprobe) {
  2476			if (is_swbp > 0) {
  2477				/* No matching uprobe; signal SIGTRAP. */
  2478				force_sig(SIGTRAP);
  2479			} else {
  2480				/*
  2481				 * Either we raced with uprobe_unregister() or we can't
  2482				 * access this memory. The latter is only possible if
  2483				 * another thread plays with our ->mm. In both cases
  2484				 * we can simply restart. If this vma was unmapped we
  2485				 * can pretend this insn was not executed yet and get
  2486				 * the (correct) SIGSEGV after restart.
  2487				 */
  2488				instruction_pointer_set(regs, bp_vaddr);
  2489			}
  2490			goto out;
  2491		}
  2492	
  2493		/* change it in advance for ->handler() and restart */
  2494		instruction_pointer_set(regs, bp_vaddr);
  2495	
  2496		/*
  2497		 * TODO: move copy_insn/etc into _register and remove this hack.
  2498		 * After we hit the bp, _unregister + _register can install the
  2499		 * new and not-yet-analyzed uprobe at the same address, restart.
  2500		 */
  2501		if (unlikely(!test_bit(UPROBE_COPY_INSN, &uprobe->flags)))
  2502			goto out;
  2503	
  2504		/*
  2505		 * Pairs with the smp_wmb() in prepare_uprobe().
  2506		 *
  2507		 * Guarantees that if we see the UPROBE_COPY_INSN bit set, then
  2508		 * we must also see the stores to &uprobe->arch performed by the
  2509		 * prepare_uprobe() call.
  2510		 */
  2511		smp_rmb();
  2512	
  2513		/* Tracing handlers use ->utask to communicate with fetch methods */
  2514		if (!get_utask())
  2515			goto out;
  2516	
  2517		if (arch_uprobe_ignore(&uprobe->arch, regs))
  2518			goto out;
  2519	
  2520		handler_chain(uprobe, regs);
  2521	
> 2522		arch_uprobe_optimize(&uprobe->arch, bp_vaddr);
  2523	
  2524		if (arch_uprobe_skip_sstep(&uprobe->arch, regs))
  2525			goto out;
  2526	
  2527		if (pre_ssout(uprobe, regs, bp_vaddr))
  2528			goto out;
  2529	
  2530	out:
  2531		/* arch_uprobe_skip_sstep() succeeded, or restart if can't singlestep */
  2532		rcu_read_unlock_trace();
  2533	}
  2534	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-11-03  4:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202411031222.d41XHGa9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jolsa@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.