From: "Madhavan T. Venkataraman" <madvenka@linux.microsoft.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>, Mark Brown <broonie@kernel.org>
Cc: mark.rutland@arm.com, ardb@kernel.org, jthierry@redhat.com,
catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org,
pasha.tatashin@soleen.com, linux-arm-kernel@lists.infradead.org,
live-patching@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v4 1/2] arm64: Introduce stack trace reliability checks in the unwinder
Date: Fri, 21 May 2021 13:59:16 -0500 [thread overview]
Message-ID: <74d12457-7590-bca2-d1ce-5ff82d7ab0d8@linux.microsoft.com> (raw)
In-Reply-To: <20210521184817.envdg232b2aeyprt@treble>
On 5/21/21 1:48 PM, Josh Poimboeuf wrote:
> On Fri, May 21, 2021 at 06:53:18PM +0100, Mark Brown wrote:
>> On Fri, May 21, 2021 at 12:47:13PM -0500, Madhavan T. Venkataraman wrote:
>>> On 5/21/21 12:42 PM, Mark Brown wrote:
>>
>>>> Like I say we may come up with some use for the flag in error cases in
>>>> future so I'm not opposed to keeping the accounting there.
>>
>>> So, should I leave it the way it is now? Or should I not set reliable = false
>>> for errors? Which one do you prefer?
>>
>>> Josh,
>>
>>> Are you OK with not flagging reliable = false for errors in unwind_frame()?
>>
>> I think it's fine to leave it as it is.
>
> Either way works for me, but if you remove those 'reliable = false'
> statements for stack corruption then, IIRC, the caller would still have
> some confusion between the end of stack error (-ENOENT) and the other
> errors (-EINVAL).
>
I will leave it the way it is. That is, I will do reliable = false on errors
like you suggested.
> So the caller would have to know that -ENOENT really means success.
> Which, to me, seems kind of flaky.
>
Actually, that is why -ENOENT was introduced - to indicate successful
stack trace termination. A return value of 0 is for continuing with
the stack trace. A non-zero value is for terminating the stack trace.
So, either we return a positive value (say 1) to indicate successful
termination. Or, we return -ENOENT to say no more stack frames left.
I guess -ENOENT was chosen.
> BTW, not sure if you've seen what we do in x86, but we have a
> 'frame->error' which gets set for an error, and which is cumulative
> across frames. So non-fatal reliable-type errors don't necessarily have
> to stop the unwind. The end result is the same as your patch, but it
> seems less confusing to me because the 'error' is cumulative. But that
> might be personal preference and I'd defer to the arm64 folks.
>
OK. I will wait to see if any arm64 folks have an opinion on this.
I am fine with any approach.
Madhavan
WARNING: multiple messages have this Message-ID (diff)
From: "Madhavan T. Venkataraman" <madvenka@linux.microsoft.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>, Mark Brown <broonie@kernel.org>
Cc: mark.rutland@arm.com, ardb@kernel.org, jthierry@redhat.com,
catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org,
pasha.tatashin@soleen.com, linux-arm-kernel@lists.infradead.org,
live-patching@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v4 1/2] arm64: Introduce stack trace reliability checks in the unwinder
Date: Fri, 21 May 2021 13:59:16 -0500 [thread overview]
Message-ID: <74d12457-7590-bca2-d1ce-5ff82d7ab0d8@linux.microsoft.com> (raw)
In-Reply-To: <20210521184817.envdg232b2aeyprt@treble>
On 5/21/21 1:48 PM, Josh Poimboeuf wrote:
> On Fri, May 21, 2021 at 06:53:18PM +0100, Mark Brown wrote:
>> On Fri, May 21, 2021 at 12:47:13PM -0500, Madhavan T. Venkataraman wrote:
>>> On 5/21/21 12:42 PM, Mark Brown wrote:
>>
>>>> Like I say we may come up with some use for the flag in error cases in
>>>> future so I'm not opposed to keeping the accounting there.
>>
>>> So, should I leave it the way it is now? Or should I not set reliable = false
>>> for errors? Which one do you prefer?
>>
>>> Josh,
>>
>>> Are you OK with not flagging reliable = false for errors in unwind_frame()?
>>
>> I think it's fine to leave it as it is.
>
> Either way works for me, but if you remove those 'reliable = false'
> statements for stack corruption then, IIRC, the caller would still have
> some confusion between the end of stack error (-ENOENT) and the other
> errors (-EINVAL).
>
I will leave it the way it is. That is, I will do reliable = false on errors
like you suggested.
> So the caller would have to know that -ENOENT really means success.
> Which, to me, seems kind of flaky.
>
Actually, that is why -ENOENT was introduced - to indicate successful
stack trace termination. A return value of 0 is for continuing with
the stack trace. A non-zero value is for terminating the stack trace.
So, either we return a positive value (say 1) to indicate successful
termination. Or, we return -ENOENT to say no more stack frames left.
I guess -ENOENT was chosen.
> BTW, not sure if you've seen what we do in x86, but we have a
> 'frame->error' which gets set for an error, and which is cumulative
> across frames. So non-fatal reliable-type errors don't necessarily have
> to stop the unwind. The end result is the same as your patch, but it
> seems less confusing to me because the 'error' is cumulative. But that
> might be personal preference and I'd defer to the arm64 folks.
>
OK. I will wait to see if any arm64 folks have an opinion on this.
I am fine with any approach.
Madhavan
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-05-21 18:59 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <68eeda61b3e9579d65698a884b26c8632025e503>
2021-05-16 4:00 ` [RFC PATCH v4 0/2] arm64: Stack trace reliability checks in the unwinder madvenka
2021-05-16 4:00 ` madvenka
2021-05-16 4:00 ` [RFC PATCH v4 1/2] arm64: Introduce stack " madvenka
2021-05-16 4:00 ` madvenka
2021-05-21 16:11 ` Mark Brown
2021-05-21 16:11 ` Mark Brown
2021-05-21 17:23 ` Madhavan T. Venkataraman
2021-05-21 17:23 ` Madhavan T. Venkataraman
2021-05-21 17:42 ` Mark Brown
2021-05-21 17:42 ` Mark Brown
2021-05-21 17:47 ` Madhavan T. Venkataraman
2021-05-21 17:47 ` Madhavan T. Venkataraman
2021-05-21 17:53 ` Mark Brown
2021-05-21 17:53 ` Mark Brown
2021-05-21 18:48 ` Josh Poimboeuf
2021-05-21 18:48 ` Josh Poimboeuf
2021-05-21 18:59 ` Madhavan T. Venkataraman [this message]
2021-05-21 18:59 ` Madhavan T. Venkataraman
2021-05-21 19:11 ` Josh Poimboeuf
2021-05-21 19:11 ` Josh Poimboeuf
2021-05-21 19:16 ` Josh Poimboeuf
2021-05-21 19:16 ` Josh Poimboeuf
2021-05-21 19:41 ` Madhavan T. Venkataraman
2021-05-21 19:41 ` Madhavan T. Venkataraman
2021-05-21 20:08 ` Josh Poimboeuf
2021-05-21 20:08 ` Josh Poimboeuf
2021-05-25 21:44 ` Madhavan T. Venkataraman
2021-05-25 21:44 ` Madhavan T. Venkataraman
2021-05-16 4:00 ` [RFC PATCH v4 2/2] arm64: Create a list of SYM_CODE functions, blacklist them " madvenka
2021-05-16 4:00 ` madvenka
2021-05-19 2:06 ` nobuta.keiya
2021-05-19 2:06 ` nobuta.keiya
2021-05-19 3:38 ` Madhavan T. Venkataraman
2021-05-19 3:38 ` Madhavan T. Venkataraman
2021-05-19 19:27 ` Mark Brown
2021-05-19 19:27 ` Mark Brown
2021-05-20 2:00 ` Madhavan T. Venkataraman
2021-05-20 2:00 ` Madhavan T. Venkataraman
2021-05-21 17:18 ` [RFC PATCH v4 0/2] arm64: Stack trace reliability checks " Mark Brown
2021-05-21 17:18 ` Mark Brown
2021-05-21 17:32 ` Madhavan T. Venkataraman
2021-05-21 17:32 ` Madhavan T. Venkataraman
2021-05-21 17:47 ` Mark Brown
2021-05-21 17:47 ` Mark Brown
2021-05-21 17:48 ` Madhavan T. Venkataraman
2021-05-21 17:48 ` Madhavan T. Venkataraman
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=74d12457-7590-bca2-d1ce-5ff82d7ab0d8@linux.microsoft.com \
--to=madvenka@linux.microsoft.com \
--cc=ardb@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=jmorris@namei.org \
--cc=jpoimboe@redhat.com \
--cc=jthierry@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pasha.tatashin@soleen.com \
--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 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.