From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id 235533858C27 for ; Mon, 13 Feb 2023 19:59:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 235533858C27 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x531.google.com with SMTP id bt8so8737957edb.12 for ; Mon, 13 Feb 2023 11:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4nC669+OF4TKBjn87mvZKGsh0OWM91ZptCDCD8GsaJ4=; b=nPNz6x5S+wAS2DaUee0Ytv1Pba0Pj+nVtsxgvNI43sMMvh/XQPoJMGjtZwsAhPNYyN bohKQtfptWObi5QyuH9jRt0wQS/bDosoasP8TCpwp+108k2ulYL+nTu+Vdngw7TSyUF3 OB9KUyPkPEKbAcv0zJAMmrPcCenh4sLayH8OT0X881g2JubRdwc3OtFV34ip1eTw5HN+ O6Qq/u9DGUeQ/ea97Z0CGvG8d+N7x1P0ObkqkcyYcUQD+fpGYM2CxnLsf7JYpjhyKcVI BU5cfPmraMNkgtCdBO8pszyn+ssnURR16UqxPTOrwMnOCInnbHdkfTfBVfBHXeAGD99N Huxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4nC669+OF4TKBjn87mvZKGsh0OWM91ZptCDCD8GsaJ4=; b=a2yeeCtD2O0ncQi9+K9hipL4nFlmMY3P7aEhtdUnsUiC08Aw14Fra7oif1kjwc9un6 yOAA9PWS9GtOK75eow+4ZOyZuLlCf1WlcXWNS7vlpt77TMPCU5p5RaNbnUK+LEeclYKG g/X0TEyLt5zHrZWhNwuhm3JKXKcD9R/uwfIO0kwhWm89MxtebppkL+tjfWPcrifg408X AkUmvteU4UlvslL02+UsWAfJpdjMe1DpOyxHgckpOE43AVIHDAVGMlbH7QJOXAL2roFN 1tVCs3P/QUJpyNuzXIFAY7hK89zPC7H9M/gDorf8m0AFFionI6M6InrFwE58aXdpkmfX 4f/Q== X-Gm-Message-State: AO0yUKUcO4dMtdDmXHWksLW+bQmbzk1fviyOCqUiz3moACBcm9BceCGG 1KOgnEaDjFOSVFj0ysnMvb3wgC6DOkgn7c+Nti0= X-Google-Smtp-Source: AK7set+kKmmCIlYytXeNxKVeVVbSzdPAGsSrsoLkf64kD3E0L/2BKerwQR7+Oe0WTHrc9sUMJpA0+uhsNBNfbun/how= X-Received: by 2002:a50:9eac:0:b0:4ab:1dcc:2785 with SMTP id a41-20020a509eac000000b004ab1dcc2785mr5605169edf.2.1676318372718; Mon, 13 Feb 2023 11:59:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Zach 1 Date: Mon, 13 Feb 2023 11:59:21 -0800 Message-ID: Subject: Re: Using the kernel thread pointer on aarch64 (tpidr_el1) To: Kyrylo Tkachov Cc: "gcc-help@gcc.gnu.org" Content-Type: multipart/alternative; boundary="00000000000022ec9405f49a4976" X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000022ec9405f49a4976 Content-Type: text/plain; charset="UTF-8" Thanks, I have filed a Bugzilla report here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108779. On Mon, Feb 13, 2023 at 4:43 AM Kyrylo Tkachov wrote: > Hello, > > > -----Original Message----- > > From: Gcc-help > > On Behalf Of Zach 1 via Gcc-help > > Sent: Monday, February 13, 2023 2:04 AM > > To: gcc-help@gcc.gnu.org > > Subject: Using the kernel thread pointer on aarch64 (tpidr_el1) > > > > 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. > > Looks like this exists for AArch32 (the arm port of GCC): > https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html > > AArch64 doesn't support but I suppose it wouldn't be hard to add given arm > supports it and clang as well. > Could you file a bug report in Bugzilla to keep track of the request > please? > > Thanks, > Kyrill > > > > > Zach > --00000000000022ec9405f49a4976--