All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: decompressor: remove unused cache flush code
@ 2015-01-22  5:22 ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2015-01-22  5:22 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sascha Hauer, Masahiro Yamada, Russell King, Nicolas Pitre,
	Kukjin Kim, Ben Dooks, Heiko Stuebner, Will Deacon, linux-kernel

As ARM ARM says, the bit 19-16 of ID_MMFR1 is always 0b0000 because
ARMv7 requires a hierarchical cache implementation.
The line "mcr    p15, 0, r10, c7, c14, 0" is not reachable.

Moreover, the v7_flush_dcache_all in arch/arm/mm/cache-v7.S does not
check the ID_MMFR1.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 arch/arm/boot/compressed/head.S | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 9dff614..32f0d79 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -1085,15 +1085,9 @@ __armv6_mmu_cache_flush:
 __armv7_mmu_cache_flush:
 		tst	r4, #1
 		bne	iflush
-		mrc	p15, 0, r10, c0, c1, 5	@ read ID_MMFR1
-		tst	r10, #0xf << 16		@ hierarchical cache (ARMv7)
+		stmfd	sp!, {r0-r7, r9-r11}
 		mov	r10, #0
-		beq	hierarchical
-		mcr	p15, 0, r10, c7, c14, 0	@ clean+invalidate D
-		b	iflush
-hierarchical:
 		mcr	p15, 0, r10, c7, c10, 5	@ DMB
-		stmfd	sp!, {r0-r7, r9-r11}
 		mrc	p15, 1, r0, c0, c0, 1	@ read clidr
 		ands	r3, r0, #0x7000000	@ extract loc from clidr
 		mov	r3, r3, lsr #23		@ left align loc bit field
-- 
1.9.1


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

* [PATCH] ARM: decompressor: remove unused cache flush code
@ 2015-01-22  5:22 ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2015-01-22  5:22 UTC (permalink / raw)
  To: linux-arm-kernel

As ARM ARM says, the bit 19-16 of ID_MMFR1 is always 0b0000 because
ARMv7 requires a hierarchical cache implementation.
The line "mcr    p15, 0, r10, c7, c14, 0" is not reachable.

Moreover, the v7_flush_dcache_all in arch/arm/mm/cache-v7.S does not
check the ID_MMFR1.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 arch/arm/boot/compressed/head.S | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 9dff614..32f0d79 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -1085,15 +1085,9 @@ __armv6_mmu_cache_flush:
 __armv7_mmu_cache_flush:
 		tst	r4, #1
 		bne	iflush
-		mrc	p15, 0, r10, c0, c1, 5	@ read ID_MMFR1
-		tst	r10, #0xf << 16		@ hierarchical cache (ARMv7)
+		stmfd	sp!, {r0-r7, r9-r11}
 		mov	r10, #0
-		beq	hierarchical
-		mcr	p15, 0, r10, c7, c14, 0	@ clean+invalidate D
-		b	iflush
-hierarchical:
 		mcr	p15, 0, r10, c7, c10, 5	@ DMB
-		stmfd	sp!, {r0-r7, r9-r11}
 		mrc	p15, 1, r0, c0, c0, 1	@ read clidr
 		ands	r3, r0, #0x7000000	@ extract loc from clidr
 		mov	r3, r3, lsr #23		@ left align loc bit field
-- 
1.9.1

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

* Re: [PATCH] ARM: decompressor: remove unused cache flush code
  2015-01-22  5:22 ` Masahiro Yamada
@ 2015-01-22  8:06   ` Uwe Kleine-König
  -1 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2015-01-22  8:06 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-arm-kernel, Nicolas Pitre, Kukjin Kim, Russell King,
	Heiko Stuebner, Sascha Hauer, Will Deacon, linux-kernel,
	Ben Dooks

Hello,

On Thu, Jan 22, 2015 at 02:22:58PM +0900, Masahiro Yamada wrote:
> As ARM ARM says, the bit 19-16 of ID_MMFR1 is always 0b0000 because
> ARMv7 requires a hierarchical cache implementation.
> The line "mcr    p15, 0, r10, c7, c14, 0" is not reachable.
> 
> Moreover, the v7_flush_dcache_all in arch/arm/mm/cache-v7.S does not
> check the ID_MMFR1.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
I stumbled about this some time ago, too. The thing is however that the
__armv7_mmu_cache functions are selected if
CPUID & 0x000f0000 == 0x000f0000, and that is (AFAIK at present only
theoretically) not implying that we have an ARMv7 machine. Only that it
uses the "CPUID Identification Scheme" which is required on ARMv7.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH] ARM: decompressor: remove unused cache flush code
@ 2015-01-22  8:06   ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2015-01-22  8:06 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Thu, Jan 22, 2015 at 02:22:58PM +0900, Masahiro Yamada wrote:
> As ARM ARM says, the bit 19-16 of ID_MMFR1 is always 0b0000 because
> ARMv7 requires a hierarchical cache implementation.
> The line "mcr    p15, 0, r10, c7, c14, 0" is not reachable.
> 
> Moreover, the v7_flush_dcache_all in arch/arm/mm/cache-v7.S does not
> check the ID_MMFR1.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
I stumbled about this some time ago, too. The thing is however that the
__armv7_mmu_cache functions are selected if
CPUID & 0x000f0000 == 0x000f0000, and that is (AFAIK at present only
theoretically) not implying that we have an ARMv7 machine. Only that it
uses the "CPUID Identification Scheme" which is required on ARMv7.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH] ARM: decompressor: remove unused cache flush code
  2015-01-22  8:06   ` Uwe Kleine-König
@ 2015-01-22 15:44     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2015-01-22 15:44 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Masahiro Yamada, Nicolas Pitre, Kukjin Kim, Heiko Stuebner,
	Sascha Hauer, Will Deacon, linux-kernel, Ben Dooks,
	linux-arm-kernel

On Thu, Jan 22, 2015 at 09:06:47AM +0100, Uwe Kleine-König wrote:
> Hello,
> 
> On Thu, Jan 22, 2015 at 02:22:58PM +0900, Masahiro Yamada wrote:
> > As ARM ARM says, the bit 19-16 of ID_MMFR1 is always 0b0000 because
> > ARMv7 requires a hierarchical cache implementation.
> > The line "mcr    p15, 0, r10, c7, c14, 0" is not reachable.
> > 
> > Moreover, the v7_flush_dcache_all in arch/arm/mm/cache-v7.S does not
> > check the ID_MMFR1.
> > 
> > Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> I stumbled about this some time ago, too. The thing is however that the
> __armv7_mmu_cache functions are selected if
> CPUID & 0x000f0000 == 0x000f0000, and that is (AFAIK at present only
> theoretically) not implying that we have an ARMv7 machine. Only that it
> uses the "CPUID Identification Scheme" which is required on ARMv7.

Correct, and there are ARMv6 CPUs which satisfy the "CPUID identification
scheme" test - and are probably not heirarchial.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH] ARM: decompressor: remove unused cache flush code
@ 2015-01-22 15:44     ` Russell King - ARM Linux
  0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2015-01-22 15:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 22, 2015 at 09:06:47AM +0100, Uwe Kleine-K?nig wrote:
> Hello,
> 
> On Thu, Jan 22, 2015 at 02:22:58PM +0900, Masahiro Yamada wrote:
> > As ARM ARM says, the bit 19-16 of ID_MMFR1 is always 0b0000 because
> > ARMv7 requires a hierarchical cache implementation.
> > The line "mcr    p15, 0, r10, c7, c14, 0" is not reachable.
> > 
> > Moreover, the v7_flush_dcache_all in arch/arm/mm/cache-v7.S does not
> > check the ID_MMFR1.
> > 
> > Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> I stumbled about this some time ago, too. The thing is however that the
> __armv7_mmu_cache functions are selected if
> CPUID & 0x000f0000 == 0x000f0000, and that is (AFAIK at present only
> theoretically) not implying that we have an ARMv7 machine. Only that it
> uses the "CPUID Identification Scheme" which is required on ARMv7.

Correct, and there are ARMv6 CPUs which satisfy the "CPUID identification
scheme" test - and are probably not heirarchial.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

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

end of thread, other threads:[~2015-01-22 15:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22  5:22 [PATCH] ARM: decompressor: remove unused cache flush code Masahiro Yamada
2015-01-22  5:22 ` Masahiro Yamada
2015-01-22  8:06 ` Uwe Kleine-König
2015-01-22  8:06   ` Uwe Kleine-König
2015-01-22 15:44   ` Russell King - ARM Linux
2015-01-22 15:44     ` Russell King - ARM Linux

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.