From: Xi Ruoyao <xry111@xry111.site>
To: mengqinggang <mengqinggang@loongson.cn>, 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: Mon, 29 Apr 2024 15:13:26 +0800 [thread overview]
Message-ID: <1549fe4e119f24921ac14fcca2e805e8a87d1df9.camel@xry111.site> (raw)
In-Reply-To: <20240426070132.2764244-1-mengqinggang@loongson.cn>
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.
> + 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
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2024-04-29 7:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-26 7:01 [PATCH v5] LoongArch: Add support for TLS Descriptors mengqinggang
2024-04-29 5:51 ` Xi Ruoyao
2024-04-29 7:13 ` Xi Ruoyao [this message]
2024-05-14 1:43 ` mengqinggang
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1549fe4e119f24921ac14fcca2e805e8a87d1df9.camel@xry111.site \
--to=xry111@xry111.site \
--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=mengqinggang@loongson.cn \
--cc=wanglei@loongson.cn \
--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).