public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zach 1 <zach1.gcc@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Using the kernel thread pointer on aarch64 (tpidr_el1)
Date: Sun, 12 Feb 2023 18:03:49 -0800	[thread overview]
Message-ID: <CAN0EEuRCjL01rUa5L=3hM3npczZo0EJy=ap2_bOCTWqEh6Y9Kw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]

Hi,

On AArch64, GCC seems to use tpidr_el0 (user-mode accessible) to access the
thread pointer for loading thread-local variables by default. I can't find
any option to change this to tpidr_el1 (or tpidr_el2/tpidr_el3). This is
necessary for using thread-local variables in kernel code. Clang has the
`-mtp` option for AArch64 (
https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mtp)
that controls this, but it seems GCC does not? Does any such option exist,
and if not is there any chance to add support for it? Thanks for any help.

Zach

             reply	other threads:[~2023-02-13  2:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13  2:03 Zach 1 [this message]
2023-02-13 12:42 ` Kyrylo Tkachov
2023-02-13 19:59   ` Zach 1

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='CAN0EEuRCjL01rUa5L=3hM3npczZo0EJy=ap2_bOCTWqEh6Y9Kw@mail.gmail.com' \
    --to=zach1.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.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 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).