From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Linux ARM <linux-arm-kernel@lists.infradead.org>,
Keith Packard <keithpac@amazon.com>,
Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v4 4/5] ARM: smp: Store current pointer in TPIDRURO register if available
Date: Mon, 13 Sep 2021 14:52:45 +0100 [thread overview]
Message-ID: <YT9XrdCY5JbdpOMl@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAMj1kXF+B-N0bTykEsfPZNwRTP+YnwhNB=-+vf+nqi27AT0Y6g@mail.gmail.com>
On Mon, Sep 13, 2021 at 02:52:46PM +0200, Ard Biesheuvel wrote:
> Hi Russell,
>
> Thanks for taking a look.
>
> However, the next patch drops the 'ldr ip, [r4, #TI_TASK]' I am adding
> here, so I won't be able to use this as-is.
>
> I could just split the ldr/set_current sequence into two, and change
> the first one into a mov in the following patch, and move the
> set_current to right before where sp is updated.
>
> I.e., in this patch
>
> @@ -762,6 +764,8 @@ ENTRY(__switch_to)
> add r7, r7, #TSK_STACK_CANARY & ~IMM12_MASK
> .endif
> ldr r7, [r7, #TSK_STACK_CANARY & IMM12_MASK]
> +#elif defined(CONFIG_CURRENT_POINTER_IN_TPIDRURO)
> + ldr r7, [r2, #TI_TASK]
> #endif
> #ifdef CONFIG_CPU_USE_DOMAINS
> mcr p15, 0, r6, c3, c0, 0 @ Set domain register
> @@ -776,6 +780,7 @@ ENTRY(__switch_to)
> #endif
> THUMB( mov ip, r4 )
> mov r0, r5
> + set_current r7
> ARM( ldmia r4, {r4 - sl, fp, sp, pc} )
> THUMB( ldmia ip!, {r4 - sl, fp} )
> THUMB( ldr sp, [ip], #4 )
>
> and in the next one
>
> @@ -765,7 +765,7 @@ ENTRY(__switch_to)
> .endif
> ldr r7, [r7, #TSK_STACK_CANARY & IMM12_MASK]
> #elif defined(CONFIG_CURRENT_POINTER_IN_TPIDRURO)
> - ldr r7, [r2, #TI_TASK]
> + mov r7, r2 @ Preserve 'next'
> #endif
> #ifdef CONFIG_CPU_USE_DOMAINS
> mcr p15, 0, r6, c3, c0, 0 @ Set domain register
>
> Would that work for you?
Definitely does! Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-09-13 13:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 10:39 [PATCH v4 0/5] ARM: support THREAD_INFO_IN_TASK Ard Biesheuvel
2021-09-13 10:39 ` [PATCH v4 1/5] gcc-plugins: arm-ssp: Prepare for THREAD_INFO_IN_TASK support Ard Biesheuvel
2021-09-13 15:40 ` Kees Cook
2021-09-14 22:04 ` Linus Walleij
2021-09-15 6:37 ` Ard Biesheuvel
2021-09-15 16:26 ` Kees Cook
2021-09-13 10:39 ` [PATCH v4 2/5] ARM: smp: Pass task to secondary_start_kernel Ard Biesheuvel
2021-09-13 23:25 ` Linus Walleij
2021-09-13 10:39 ` [PATCH v4 3/5] ARM: smp: Free up the TLS register while running in the kernel Ard Biesheuvel
2021-09-13 10:40 ` [PATCH v4 4/5] ARM: smp: Store current pointer in TPIDRURO register if available Ard Biesheuvel
2021-09-13 11:22 ` Russell King (Oracle)
2021-09-13 12:52 ` Ard Biesheuvel
2021-09-13 13:52 ` Russell King (Oracle) [this message]
2021-09-13 10:40 ` [PATCH v4 5/5] ARM: smp: Enable THREAD_INFO_IN_TASK Ard Biesheuvel
2021-09-13 11:23 ` [PATCH v4 0/5] ARM: support THREAD_INFO_IN_TASK Russell King (Oracle)
2021-09-13 15:40 ` Kees Cook
2021-09-14 9:44 ` Arnd Bergmann
2021-09-14 9:50 ` Ard Biesheuvel
2021-09-14 13:07 ` Arnd Bergmann
2021-09-14 17:10 ` Ard Biesheuvel
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=YT9XrdCY5JbdpOMl@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=keescook@chromium.org \
--cc=keithpac@amazon.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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 NNTP newsgroup(s).