mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen Zhongjin <chenzhongjin@huawei.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: <linux@armlinux.org.uk>, <alexander.sverdlin@nokia.com>,
	<ardb@kernel.org>, <nico@fluxnic.net>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] ARM: module: Add all unwind tables when load module
Date: Fri, 29 Apr 2022 11:17:45 +0800	[thread overview]
Message-ID: <3e4bdf67-bd11-e839-7852-36e91f54b4df@huawei.com> (raw)
In-Reply-To: <CACRpkdbxDyasZxNeJXa9-AniTbgrzsuoLcu9CBJmzOLDg3hy5w@mail.gmail.com>

Added,
9204/1 	module: Add all unwind tables when load module

Thanks!
Chen

On 2022/4/29 6:45, Linus Walleij wrote:
> On Fri, Apr 1, 2022 at 3:16 PM Chen Zhongjin <chenzhongjin@huawei.com> wrote:
> 
>> For EABI stack unwinding, when loading .ko module
>> the EXIDX sections will be added to a unwind_table list.
>>
>> However not all EXIDX sections are added because EXIDX
>> sections are searched by hardcoded section names.
>>
>> For functions in other sections such as .ref.text
>> or .kprobes.text, gcc generates seprated EXIDX sections
>> (such as .ARM.exidx.ref.text or .ARM.exidx.kprobes.text).
>>
>> These extra EXIDX sections are not loaded, so when unwinding
>> functions in these sections, we will failed with:
>>
>>         unwind: Index not found xxx
>>
>> To fix that, I refactor the code for searching and adding
>> EXIDX sections:
>>
>> - Check section type to search EXIDX tables (0x70000001)
>> instead of strcmp() the hardcoded names. Then find the
>> corresponding text sections by their section names.
>>
>> - Add a unwind_table list in module->arch to save their own
>> unwind_table instead of the fixed-lenth array.
>>
>> - Save .ARM.exidx.init.text section ptr, because it should
>> be cleaned after module init.
>>
>> Now all EXIDX sections of .ko can be added correctly.
>>
>> Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
> 
> This looks reasonable to me:
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> If no one else comments I would say you should put this
> into Russell's patch tracker for consideration.
> 
> Yours,
> Linus Walleij
> .


  reply	other threads:[~2022-04-29  3:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01 13:15 Chen Zhongjin
2022-04-11  2:26 ` Chen Zhongjin
2022-04-20  3:37 ` Chen Zhongjin
2022-04-28 22:45 ` Linus Walleij
2022-04-29  3:17   ` Chen Zhongjin [this message]
2022-05-17 14:19 ` Russell King (Oracle)
2022-05-20  7:53   ` Chen Zhongjin

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=3e4bdf67-bd11-e839-7852-36e91f54b4df@huawei.com \
    --to=chenzhongjin@huawei.com \
    --cc=alexander.sverdlin@nokia.com \
    --cc=ardb@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nico@fluxnic.net \
    /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

all inboxes | Powered by JetHome®