public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: jg1.han@samsung.com (Jingoo Han)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: mm: use ubfm for dcache_line_size
Date: Mon, 20 Jan 2014 11:04:31 +0900	[thread overview]
Message-ID: <002001cf1583$f54f0790$dfed16b0$%han@samsung.com> (raw)
In-Reply-To: <20140117111307.GE16003@mudshark.cambridge.arm.com>



> -----Original Message-----
> From: Will Deacon [mailto:will.deacon at arm.com]
> Sent: Friday, January 17, 2014 8:13 PM
> To: Jingoo Han
> Cc: Catalin Marinas; linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH] arm64: mm: use ubfm for dcache_line_size
> 
> On Fri, Jan 17, 2014 at 08:04:32AM +0000, Jingoo Han wrote:
> > Use 'ubfm' for the bitfield move instruction; thus, single
> > instruction can be used instead of two instructions, when
> > getting the minimum D-cache line size from CTR_EL0 register.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > ---
> >  arch/arm64/mm/proc-macros.S |    3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/arch/arm64/mm/proc-macros.S b/arch/arm64/mm/proc-macros.S
> > index 8957b82..c31f41e 100644
> > --- a/arch/arm64/mm/proc-macros.S
> > +++ b/arch/arm64/mm/proc-macros.S
> > @@ -38,8 +38,7 @@
> >   */
> >  	.macro	dcache_line_size, reg, tmp
> >  	mrs	\tmp, ctr_el0			// read CTR
> > -	lsr	\tmp, \tmp, #16
> > -	and	\tmp, \tmp, #0xf		// cache line size encoding
> > +	ubfm	\tmp, \tmp, #0x16, 0x19		// cache line size encoding
> 
> 0x16 and 0x19. Are you sure?

(+cc Ard Biesheuvel)

Oh, it's my mistake.
CTR_EL0[19:16] is a proper bit-field; it means 'DminLine'.
So, I will fit it as below:

ubfm    \tmp, \tmp, #16, #19

> 
> You can also grep for other occurences of this pattern and change
> those too (pgtable stuff in head.S, clidr in cache.S).

OK, I will change others of this pattern.
I appreciate your comments. :-)

Best regards,
Jingoo Han

  reply	other threads:[~2014-01-20  2:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17  8:04 [PATCH] arm64: mm: use ubfm for dcache_line_size Jingoo Han
2014-01-17 11:13 ` Will Deacon
2014-01-20  2:04   ` Jingoo Han [this message]
2014-01-20  4:28   ` Jingoo Han
2014-01-17 11:22 ` Ard Biesheuvel
2014-01-17 12:24   ` Will Deacon

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='002001cf1583$f54f0790$dfed16b0$%han@samsung.com' \
    --to=jg1.han@samsung.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