From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: mm: Simplify act_mm macro
Date: Tue, 26 May 2020 15:37:56 +0100 [thread overview]
Message-ID: <20200526143756.GZ1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <20200526143249.68202-1-linus.walleij@linaro.org>
On Tue, May 26, 2020 at 04:32:49PM +0200, Linus Walleij wrote:
> The act_mm assembly macro is actually partly reimplementing
> get_thread_info so let's just use that.
>
> Suggested-by: Russell King <linux@armlinux.org.uk>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> arch/arm/mm/proc-macros.S | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
> index 60ac7c5999a9..65eaea85d3d6 100644
> --- a/arch/arm/mm/proc-macros.S
> +++ b/arch/arm/mm/proc-macros.S
> @@ -5,7 +5,6 @@
> * VMA_VM_FLAGS
> * VM_EXEC
> */
> -#include <linux/const.h>
> #include <asm/asm-offsets.h>
> #include <asm/thread_info.h>
>
> @@ -31,9 +30,7 @@
> * act_mm - get current->active_mm
> */
> .macro act_mm, rd
> - bic \rd, sp, #(THREAD_SIZE - 1) & ~63
> - bic \rd, \rd, #63
> - ldr \rd, [\rd, #TI_TASK]
> + get_thread_info \rd
This is not quite the same thing.
get_thread_info loads into \rd the address of the thread_info structure.
That's what the two bic instructions are doing. The LDR is then loading
the address of the task_struct into \rd.
> .if (TSK_ACTIVE_MM > IMM12_MASK)
> add \rd, \rd, #TSK_ACTIVE_MM & ~IMM12_MASK
> .endif
So this change alters which structure \rd is pointing to.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC for 0.8m (est. 1762m) line in suburbia: sync at 13.1Mbps down 424kbps up
_______________________________________________
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:[~2020-05-26 14:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-26 14:32 [PATCH] ARM: mm: Simplify act_mm macro Linus Walleij
2020-05-26 14:37 ` Russell King - ARM Linux admin [this message]
2020-05-26 18:08 ` Linus Walleij
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=20200526143756.GZ1551@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--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).