patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Keith Packard <keithp@keithp.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	Nathan Chancellor <nathan@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>,
	Naveen N Rao <naveen@kernel.org>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	linuxppc-dev@lists.ozlabs.org, llvm@lists.linux.dev,
	patches@lists.linux.dev
Subject: Re: [PATCH 3/3] powerpc: Include -m32 / -m64 for stack protector Kconfig test
Date: Tue, 08 Oct 2024 09:08:18 -0700	[thread overview]
Message-ID: <87o73uvaq5.fsf@keithp.com> (raw)
In-Reply-To: <a57f21db-911c-4331-af7b-c02c0ea8b1e6@csgroup.eu>

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


> Why is there any restriction at all on which register can be used ? I 
> can't see such restriction in GCC documentation : 
> https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html

The clang implementation shares the same code paths as the user space
thread local storage implementation. That code uses a fixed register (2
for 32-bit, 13 for 64-bit) and a fixed offset (-0x7008 for 32-bit and
-0x7010 for 64-bit).

The new code controls the offset value with a command line parameter.

I didn't see any need to make the changes more complicated by including
support for arbitrary registers. The implementation would be reasonably
straightforward, but it would make testing a bunch harder.

The command line parsing code validates that you've selected the correct
register — if we allow other registers in the future, you'll be able to
verify whether the compiler supports that by testing at build time.

-- 
-keith

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2024-10-08 16:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  4:22 [PATCH 0/3] powerpc: Prepare for clang's per-task stack protector support Nathan Chancellor
2024-10-08  4:22 ` [PATCH 1/3] powerpc: Fix stack protector Kconfig test for clang Nathan Chancellor
2024-10-08  4:22 ` [PATCH 2/3] powerpc: Adjust adding stack protector flags to KBUILD_CLAGS " Nathan Chancellor
2024-10-08  5:10   ` Christophe Leroy
2024-10-08 13:39     ` Nathan Chancellor
2024-10-08  4:22 ` [PATCH 3/3] powerpc: Include -m32 / -m64 for stack protector Kconfig test Nathan Chancellor
2024-10-08  5:14   ` Christophe Leroy
2024-10-08 13:52     ` Nathan Chancellor
2024-10-08 16:08     ` Keith Packard [this message]
2024-10-08 16:09 ` [PATCH 0/3] powerpc: Prepare for clang's per-task stack protector support Keith Packard

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=87o73uvaq5.fsf@keithp.com \
    --to=keithp@keithp.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=justinstitt@google.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=llvm@lists.linux.dev \
    --cc=maddy@linux.ibm.com \
    --cc=morbo@google.com \
    --cc=mpe@ellerman.id.au \
    --cc=nathan@kernel.org \
    --cc=naveen@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=npiggin@gmail.com \
    --cc=patches@lists.linux.dev \
    /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 NNTP newsgroup(s).