From: Michael Ellerman <mpe@ellerman.id.au>
To: Alan Modra <amodra@gmail.com>,
Segher Boessenkool <segher@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/vdso: Fix incorrect CFI in gettimeofday.S
Date: Wed, 04 May 2022 22:34:06 +1000 [thread overview]
Message-ID: <875ymlv5mp.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <YnBu+Rb/0XJBSTJW@squeak.grove.modra.org>
Alan Modra <amodra@gmail.com> writes:
> On Mon, May 02, 2022 at 09:27:05AM -0500, Segher Boessenkool wrote:
>> > 2) If a function changes LR or any non-volatile register, the save
>> > location for those regs must be given. The cfi can be at any
>> > instruction after the saves up to the point that the reg is
>> > changed. (Exception: LR save should be described before a bl.)
>>
>> That isn't an exception? bl changes the current LR after all :-)
>
> The point is that in other cases the cfi can be as late as the
> instruction that changes the reg. For calls it must be at least one
> instruction before the call.
Got it.
> Also, I'll note for the wider audience that delaying cfi is slightly
> better than playing it safe as Michael has done in his patch in
> describing the saves right at the save instruction. Register save cfi
> can usually be grouped together, resulting in fewer CFI_advance codes
> in .eh_frame.
I didn't want to go overboard on combining them, because it's harder to
read the source, especially with the #ifdefs we have for 64-bit.
I was able to save one CFA_advance_loc by moving the LR restore down one
line.
The .eh_frame didn't shrink, I guess because it's padded to some
alignment anyway.
>> Alan proposed a larger patch that changed to a single stack frame, but it needs changes to
>> take into account the red zone.
>
> Yes, now that you mention it, I see the obvious error in the patch I
> wrote. I did say it was untested!
No worries, identifying the source of the bug as the missing CFI is the
key thing, it would have taken me a while to realise that.
cheers
next prev parent reply other threads:[~2022-05-04 12:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-02 12:50 [PATCH] powerpc/vdso: Fix incorrect CFI in gettimeofday.S Michael Ellerman
2022-05-02 14:27 ` Segher Boessenkool
2022-05-02 23:53 ` Alan Modra
2022-05-04 12:34 ` Michael Ellerman [this message]
2022-05-04 12:27 ` Michael Ellerman
2022-05-04 14:08 ` Segher Boessenkool
2022-05-08 11:11 ` Michael Ellerman
2022-05-17 7:33 ` Naveen N. Rao
2022-05-17 12:32 ` Michael Ellerman
2022-05-18 9:38 ` Naveen N. Rao
2022-05-19 1:30 ` Alan Modra
2022-05-20 12:14 ` Naveen N. Rao
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=875ymlv5mp.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=amodra@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=segher@kernel.crashing.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.