linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 10/14] arm64: assembler: allow adr_this_cpu to use the stack pointer
Date: Mon, 14 Aug 2017 18:42:59 +0100	[thread overview]
Message-ID: <20170814174259.GA25890@leverpostej> (raw)
In-Reply-To: <20170814171338.gvtn76awussgxctn@armageddon.cambridge.arm.com>

On Mon, Aug 14, 2017 at 06:13:39PM +0100, Catalin Marinas wrote:
> On Mon, Aug 07, 2017 at 07:36:01PM +0100, Mark Rutland wrote:

> >  	.macro adr_this_cpu, dst, sym, tmp
> > -	adr_l	\dst, \sym
> > +	adrp	\tmp, \sym
> > +	add	\dst, \tmp, #:lo12:\sym
> >  	mrs	\tmp, tpidr_el1
> >  	add	\dst, \dst, \tmp
> >  	.endm
> 
> Nitpick: it may be worth adding an #ifndef MODULE around these macros,
> together with a comment, just in case. There are other macros in this
> file like adr_l which are used in modules (crypto).

I've folded in the below, in keeping with the other MODULE fallbacks.

Thanks,
Mark.

---->8----
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index 4775af5..50c5592 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -230,13 +230,18 @@
        .endm
 
        /*
-        * @dst: Result of per_cpu(sym, smp_processor_id())
+        * @dst: Result of per_cpu(sym, smp_processor_id()), can be SP for
+        *       non-module code
         * @sym: The name of the per-cpu variable
         * @tmp: scratch register
         */
        .macro adr_this_cpu, dst, sym, tmp
+#ifndef MODULE
        adrp    \tmp, \sym
        add     \dst, \tmp, #:lo12:\sym
+#else
+       adr_l   \tmp, \sym
+#endif
        mrs     \tmp, tpidr_el1
        add     \dst, \dst, \tmp
        .endm

  reply	other threads:[~2017-08-14 17:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 18:35 [PATCH 00/14] arm64: VMAP_STACK support Mark Rutland
2017-08-07 18:35 ` [PATCH 01/14] arm64: remove __die()'s stack dump Mark Rutland
2017-08-07 18:35 ` [PATCH 02/14] fork: allow arch-override of VMAP stack alignment Mark Rutland
2017-08-07 18:35 ` [PATCH 03/14] arm64: kernel: remove {THREAD,IRQ_STACK}_START_SP Mark Rutland
2017-08-07 18:35 ` [PATCH 04/14] arm64: factor out PAGE_* and CONT_* definitions Mark Rutland
2017-08-07 18:35 ` [PATCH 05/14] arm64: clean up THREAD_* definitions Mark Rutland
2017-08-14 11:59   ` Catalin Marinas
2017-08-14 13:10     ` Mark Rutland
2017-08-07 18:35 ` [PATCH 06/14] arm64: clean up irq stack definitions Mark Rutland
2017-08-07 18:35 ` [PATCH 07/14] arm64: move SEGMENT_ALIGN to <asm/memory.h> Mark Rutland
2017-08-07 18:35 ` [PATCH 08/14] efi/arm64: add EFI_KIMG_ALIGN Mark Rutland
2017-08-07 18:36 ` [PATCH 09/14] arm64: factor out entry stack manipulation Mark Rutland
2017-08-07 18:36 ` [PATCH 10/14] arm64: assembler: allow adr_this_cpu to use the stack pointer Mark Rutland
2017-08-14 17:13   ` Catalin Marinas
2017-08-14 17:42     ` Mark Rutland [this message]
2017-08-07 18:36 ` [PATCH 11/14] arm64: use an irq " Mark Rutland
2017-08-07 18:36 ` [PATCH 12/14] arm64: add basic VMAP_STACK support Mark Rutland
2017-08-07 18:36 ` [PATCH 13/14] arm64: add on_accessible_stack() Mark Rutland
2017-08-07 18:36 ` [PATCH 14/14] arm64: add VMAP_STACK overflow detection Mark Rutland
2017-08-14 15:32   ` Will Deacon
2017-08-14 17:25     ` Mark Rutland
2017-08-15 11:10   ` Catalin Marinas
2017-08-15 11:19     ` Mark Rutland

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=20170814174259.GA25890@leverpostej \
    --to=mark.rutland@arm.com \
    --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).