linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] arm64: mm: use ubfm for dcache_line_size
@ 2014-01-20  5:00 Jingoo Han
  2014-01-21 11:05 ` Will Deacon
  0 siblings, 1 reply; 2+ messages in thread
From: Jingoo Han @ 2014-01-20  5:00 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
Change since v1
- Remove unnecessary prefix '0x' from immediates, per Will Deacon
- Add '#' to immediates for consistency, per Ard Biesheuvel

 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..005d29e 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, #16, #19		// cache line size encoding
 	mov	\reg, #4			// bytes per word
 	lsl	\reg, \reg, \tmp		// actual cache line size
 	.endm
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2] arm64: mm: use ubfm for dcache_line_size
  2014-01-20  5:00 [PATCH v2] arm64: mm: use ubfm for dcache_line_size Jingoo Han
@ 2014-01-21 11:05 ` Will Deacon
  0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2014-01-21 11:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 20, 2014 at 05:00:21AM +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>

  Acked-by: Will Deacon <will.deacon@arm.com>

Thanks,

Will

> ---
> Change since v1
> - Remove unnecessary prefix '0x' from immediates, per Will Deacon
> - Add '#' to immediates for consistency, per Ard Biesheuvel
> 
>  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..005d29e 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, #16, #19		// cache line size encoding
>  	mov	\reg, #4			// bytes per word
>  	lsl	\reg, \reg, \tmp		// actual cache line size
>  	.endm
> -- 
> 1.7.10.4
> 
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-21 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20  5:00 [PATCH v2] arm64: mm: use ubfm for dcache_line_size Jingoo Han
2014-01-21 11:05 ` Will Deacon

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