linux-next: manual merge of the tip tree with the bpf-next tree

Mark Brown posted 1 patch 6 days, 9 hours ago
linux-next: manual merge of the tip tree with the bpf-next tree
Posted by Mark Brown 6 days, 9 hours ago
Hi all,

Today's linux-next merge of the tip tree got a conflict in:

  kernel/events/uprobes.c

between commit:

  4363264111e12 ("uprobe: Do not emulate/sstep original instruction when ip is changed")

from the bpf-next tree and commit:

  ba2bfc97b4629 ("uprobes/x86: Add support to optimize uprobes")

from the tip tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc kernel/events/uprobes.c
index c2ff256dd6419,996a81080d563..0000000000000
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@@ -2741,13 -2765,9 +2765,16 @@@ static void handle_swbp(struct pt_regs 
  
  	handler_chain(uprobe, regs);
  
 +	/*
 +	 * If user decided to take execution elsewhere, it makes little sense
 +	 * to execute the original instruction, so let's skip it.
 +	 */
 +	if (instruction_pointer(regs) != bp_vaddr)
 +		goto out;
 +
+ 	/* Try to optimize after first hit. */
+ 	arch_uprobe_optimize(&uprobe->arch, bp_vaddr);
+ 
  	if (arch_uprobe_skip_sstep(&uprobe->arch, regs))
  		goto out;
  
Re: linux-next: manual merge of the tip tree with the bpf-next tree
Posted by Alexei Starovoitov 6 days, 9 hours ago
On Thu, Sep 25, 2025 at 3:06 PM Mark Brown <broonie@kernel.org> wrote:
>
> Hi all,
>
> Today's linux-next merge of the tip tree got a conflict in:
>
>   kernel/events/uprobes.c
>
> between commit:
>
>   4363264111e12 ("uprobe: Do not emulate/sstep original instruction when ip is changed")
>
> from the bpf-next tree and commit:
>
>   ba2bfc97b4629 ("uprobes/x86: Add support to optimize uprobes")
>
> from the tip tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> diff --cc kernel/events/uprobes.c
> index c2ff256dd6419,996a81080d563..0000000000000
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@@ -2741,13 -2765,9 +2765,16 @@@ static void handle_swbp(struct pt_regs
>
>         handler_chain(uprobe, regs);
>
>  +      /*
>  +       * If user decided to take execution elsewhere, it makes little sense
>  +       * to execute the original instruction, so let's skip it.
>  +       */
>  +      if (instruction_pointer(regs) != bp_vaddr)
>  +              goto out;
>  +
> +       /* Try to optimize after first hit. */
> +       arch_uprobe_optimize(&uprobe->arch, bp_vaddr);
> +
>         if (arch_uprobe_skip_sstep(&uprobe->arch, regs))
>                 goto out;

Yep. That's exactly what we discussed.
I'll mention it in the PR during the merge window.