From: mengqinggang <mengqinggang@loongson.cn>
To: Xi Ruoyao <xry111@xry111.site>, libc-alpha@sourceware.org
Cc: adhemerval.zanella@linaro.org, xuchenghua@loongson.cn,
caiyinyu@loongson.cn, chenglulu@loongson.cn, cailulu@loongson.cn,
i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn,
wanglei@loongson.cn, hejinyang@loongson.cn
Subject: Re: [PATCH v5] LoongArch: Add support for TLS Descriptors
Date: Tue, 14 May 2024 09:43:43 +0800 [thread overview]
Message-ID: <be90dce8-eaef-77f1-623e-aaa7c3c72a11@loongson.cn> (raw)
In-Reply-To: <1549fe4e119f24921ac14fcca2e805e8a87d1df9.camel@xry111.site>
在 2024/4/29 下午3:13, Xi Ruoyao 写道:
> On Fri, 2024-04-26 at 15:01 +0800, mengqinggang wrote:
>
>> +_dl_tlsdesc_dynamic:
>> + /* Save just enough registers to support fast path, if we fall
>> + into slow path we will save additional registers. */
>> + ADDI sp, sp,-24
>> + REG_S t0, sp, 0
>> + REG_S t1, sp, 8
>> + REG_S t2, sp, 16
> So t3 is not saved in the fast path. And then...
>
>
>> +.Lslow:
>> + /* This is the slow path. We need to call __tls_get_addr() which
>> + means we need to save and restore all the register that the
>> + callee will trash. */
>> +
>> + /* Save the remaining registers that we must treat as caller save. */
>> + ADDI sp, sp, -FRAME_SIZE
>> + REG_S ra, sp, 0 * SZREG
>> + REG_S a1, sp, 1 * SZREG
>> + REG_S a2, sp, 2 * SZREG
>> + REG_S a3, sp, 3 * SZREG
>> + REG_S a4, sp, 4 * SZREG
>> + REG_S a5, sp, 5 * SZREG
>> + REG_S a6, sp, 6 * SZREG
>> + REG_S a7, sp, 7 * SZREG
> Missing t3 here. This causes tst-gnu2-tls2 segfault.
By the way, how did you find this problem? Missing t3 not cause
tst-gnu2-tls2 segfault on my environment.
>
>> + REG_S t4, sp, 8 * SZREG
>> + REG_S t5, sp, 9 * SZREG
>> + REG_S t6, sp, 10 * SZREG
>> + REG_S t7, sp, 11 * SZREG
>> + REG_S t8, sp, 12 * SZREG
next prev parent reply other threads:[~2024-05-14 1:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-26 7:01 mengqinggang
2024-04-29 5:51 ` Xi Ruoyao
2024-04-29 7:13 ` Xi Ruoyao
2024-05-14 1:43 ` mengqinggang [this message]
2024-05-14 5:25 ` Xi Ruoyao
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=be90dce8-eaef-77f1-623e-aaa7c3c72a11@loongson.cn \
--to=mengqinggang@loongson.cn \
--cc=adhemerval.zanella@linaro.org \
--cc=cailulu@loongson.cn \
--cc=caiyinyu@loongson.cn \
--cc=chenglulu@loongson.cn \
--cc=hejinyang@loongson.cn \
--cc=i.swmail@xen0n.name \
--cc=libc-alpha@sourceware.org \
--cc=luweining@loongson.cn \
--cc=maskray@google.com \
--cc=wanglei@loongson.cn \
--cc=xry111@xry111.site \
--cc=xuchenghua@loongson.cn \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).