All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: asm: Rewrite get_thread_info using BIC
Date: Tue, 21 Jul 2020 14:38:38 +0100	[thread overview]
Message-ID: <20200721133838.GZ1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <b8a361f8-2b61-b8d1-9405-0830e2b0be89@gmail.com>

On Tue, Jul 21, 2020 at 04:37:09PM +0300, Dmitry Osipenko wrote:
> 27.05.2020 15:22, Linus Walleij пишет:
> > By using two BIC instructions we can replace the ARM/thumb
> > split instructions with something that works on either
> > and also save one instruction.
> > 
> > Based on code from proc-macros.S and an idea from Ard
> > Biesheuvel.
> > 
> > We need to include <linux/const.h> to expand the
> > THREAD_SIZE definition properly in the preprocessor.
> > 
> > Suggested-by: Russell King <linux@armlinux.org.uk>
> > Suggested-by: Ard Biesheuvel <ardb@kernel.org>
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> >  arch/arm/include/asm/assembler.h | 7 +++----
> >  1 file changed, 3 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
> > index 99929122dad7..f218e8cf7f88 100644
> > --- a/arch/arm/include/asm/assembler.h
> > +++ b/arch/arm/include/asm/assembler.h
> > @@ -17,6 +17,7 @@
> >  #error "Only include this from assembly code"
> >  #endif
> >  
> > +#include <linux/const.h>
> >  #include <asm/ptrace.h>
> >  #include <asm/domain.h>
> >  #include <asm/opcodes-virt.h>
> > @@ -203,10 +204,8 @@
> >   * Get current thread_info.
> >   */
> >  	.macro	get_thread_info, rd
> > - ARM(	mov	\rd, sp, lsr #THREAD_SIZE_ORDER + PAGE_SHIFT	)
> > - THUMB(	mov	\rd, sp			)
> > - THUMB(	lsr	\rd, \rd, #THREAD_SIZE_ORDER + PAGE_SHIFT	)
> > -	mov	\rd, \rd, lsl #THREAD_SIZE_ORDER + PAGE_SHIFT
> > +	bic	\rd, sp, #(THREAD_SIZE - 1) & ~63
> > +	bic	\rd, \rd, #63
> >  	.endm
> >  
> >  /*
> > 
> 
> Hello, Linus!
> 
> This patch was merged into a recent linux-next, unfortunately it breaks
> CONFIG_THUMB2_KERNEL=y compilation:
> 
> arch/arm/kernel/entry-common.S: Assembler messages:
> arch/arm/kernel/entry-common.S:159: Error: r13 not allowed here -- `bic
> tsk,sp,#(((1<<12)<<1)-1)&~63'
> arch/arm/kernel/entry-common.S:246: Error: r13 not allowed here -- `bic
> tsk,sp,#(((1<<12)<<1)-1)&~63'
> make[2]: *** [scripts/Makefile.build:361:
> arch/arm/kernel/entry-common.o] Error 1

I've dropped it before you sent this email...

-- 
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

  reply	other threads:[~2020-07-21 13:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 12:22 [PATCH] ARM: asm: Rewrite get_thread_info using BIC Linus Walleij
2020-05-27 13:13 ` Russell King - ARM Linux admin
2020-07-21 13:37 ` Dmitry Osipenko
2020-07-21 13:38   ` Russell King - ARM Linux admin [this message]
2020-07-21 13:39     ` Dmitry Osipenko
2020-07-21 13:54   ` 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=20200721133838.GZ1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=ardb@kernel.org \
    --cc=digetx@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.