live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Weinan Liu <wnliu@google.com>
To: song@kernel.org
Cc: indu.bhagat@oracle.com, irogers@google.com,
	joe.lawrence@redhat.com,  jpoimboe@kernel.org,
	kernel-team@meta.com,  linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,  linux-toolchains@vger.kernel.org,
	live-patching@vger.kernel.org,  mark.rutland@arm.com,
	peterz@infradead.org, puranjay@kernel.org,
	 roman.gushchin@linux.dev, rostedt@goodmis.org, will@kernel.org,
	 wnliu@google.com
Subject: [PATCH v3 1/2] arm64: Implement arch_stack_walk_reliable
Date: Thu, 20 Mar 2025 17:46:41 +0000	[thread overview]
Message-ID: <20250320174642.855602-1-wnliu@google.com> (raw)
In-Reply-To: <20250320171559.3423224-2-song@kernel.org>

On Thu, Mar 20, 2025 at 10:16 AM Song Liu <song@kernel.org> wrote:
>
>  static __always_inline void
> @@ -230,8 +231,26 @@ kunwind_next_frame_record(struct kunwind_state *state)
>         new_fp = READ_ONCE(record->fp);
>         new_pc = READ_ONCE(record->lr);
>
> -       if (!new_fp && !new_pc)
> -               return kunwind_next_frame_record_meta(state);
> +       if (!new_fp && !new_pc) {
> +               int ret;
> +
> +               ret = kunwind_next_frame_record_meta(state);

The exception case kunwind_next_regs_pc() will return 0 when unwind success.
Should we return a different value for the success case of kunwind_next_regs_pc()?


> +               if (ret < 0) {
> +                       /*
> +                        * This covers two different conditions:
> +                        *  1. ret == -ENOENT, unwinding is done.
> +                        *  2. ret == -EINVAL, unwinding hit error.
> +                        */
> +                       return ret;
> +               }
> +               /*
> +                * Searching across exception boundaries. The stack is now
> +                * unreliable.
> +                */
> +               if (state->end_on_unreliable)
> +                       return -EINVAL;
> +               return 0;
> +       }


  reply	other threads:[~2025-03-20 17:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 17:15 [PATCH v3 0/2] arm64: livepatch: Enable livepatch without sframe Song Liu
2025-03-20 17:15 ` [PATCH v3 1/2] arm64: Implement arch_stack_walk_reliable Song Liu
2025-03-20 17:46   ` Weinan Liu [this message]
2025-03-20 17:54     ` Song Liu
2025-03-21  7:11   ` Josh Poimboeuf
2025-03-26 13:48   ` Miroslav Benes
2025-03-31  9:06   ` Andrea della Porta
2025-05-19 13:41   ` Mark Rutland
2025-05-19 16:57     ` Song Liu
2025-05-20 14:28     ` Will Deacon
2025-05-20 16:59       ` Mark Rutland
2025-03-20 17:15 ` [PATCH v3 2/2] arm64: Implement HAVE_LIVEPATCH Song Liu
2025-03-31  9:07   ` Andrea della Porta
2025-03-25 12:53 ` [PATCH v3 0/2] arm64: livepatch: Enable livepatch without sframe Petr Mladek
2025-03-25 13:37   ` Song Liu
2025-04-10 15:17 ` Petr Mladek
2025-05-16 16:53   ` Song Liu
2025-05-19 12:57     ` Mark Rutland
2025-05-19 14:22     ` Will Deacon
2025-05-19 16:40     ` Mark Rutland
2025-05-19 17:11       ` Dylan Hatch

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=20250320174642.855602-1-wnliu@google.com \
    --to=wnliu@google.com \
    --cc=indu.bhagat@oracle.com \
    --cc=irogers@google.com \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peterz@infradead.org \
    --cc=puranjay@kernel.org \
    --cc=roman.gushchin@linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=song@kernel.org \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).