Skip to contentSkip to conversation

ARM: V7M: Set cacheid iff DminLine or IminLine is nonzero

PATCH New Vladimir Murzin 2 participants 7 messages Apr 26, 2017 – Jun 8, 2017 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: V7M: Set cacheid iff DminLine or IminLine is nonzero

Cache support is optional feature in M-class cores, thus DminLine or IminLine of Cache Type Register is zero if caches are not implemented, but we check the whole CTR which has other features encoded there. Let's be more precise and check for DminLine and IminLine of CTR before we set cacheid.

---
 arch/arm/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/setup.c +1 -1
index f4e5450..231a1d83 100644
@@ -315,7 +315,7 @@ static void __init cacheid_init(void)
 	if (arch >= CPU_ARCH_ARMv6) {
 		unsigned int cachetype = read_cpuid_cachetype();
 
-		if ((arch == CPU_ARCH_ARMv7M) && !cachetype) {
+		if ((arch == CPU_ARCH_ARMv7M) && !(cachetype & 0xf000f)) {
 			cacheid = 0;
 		} else if ((cachetype & (7 << 29)) == 4 << 29) {
 			/* ARMv7 register format */
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ARM: V7M: Set cacheid iff DminLine or IminLine is nonzero

Quoted 17 lines · Vladimir Murzin

Cache support is optional feature in M-class cores, thus DminLine or IminLine of Cache Type Register is zero if caches are not implemented, but we check the whole CTR which has other features encoded there. Let's be more precise and check for DminLine and IminLine of CTR before we set cacheid.

---
 arch/arm/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/setup.c +0 -0
index f4e5450..231a1d83 100644

arch/arm/kernel/setup.c static void __init cacheid_init(void) · line 321

Quoted 8 lines
arch/arm/kernel/setup.c +1 -1
@@ -315,7 +315,7 @@ static void __init cacheid_init(void)
 	if (arch >= CPU_ARCH_ARMv6) {
 		unsigned int cachetype = read_cpuid_cachetype();
 
-		if ((arch == CPU_ARCH_ARMv7M) && !cachetype) {
+		if ((arch == CPU_ARCH_ARMv7M) && !(cachetype & 0xf000f)) {
 			cacheid = 0;
 		} else if ((cachetype & (7 << 29)) == 4 << 29) {
 			/* ARMv7 register format */

Ok for patch tracker?

Vladimir

#2 lore raw

PATCH 1/1 ARM: V7M: Set cacheid iff DminLine or IminLine is nonzero

Quoted 20 lines · Vladimir Murzin
Quoted 19 lines · Vladimir Murzin

Cache support is optional feature in M-class cores, thus DminLine or IminLine of Cache Type Register is zero if caches are not implemented, but we check the whole CTR which has other features encoded there. Let's be more precise and check for DminLine and IminLine of CTR before we set cacheid.

---
 arch/arm/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/setup.c +0 -0
index f4e5450..231a1d83 100644
@@ -315,7 +315,7 @@ static void __init cacheid_init(void)
 	if (arch >= CPU_ARCH_ARMv6) {
 		unsigned int cachetype = read_cpuid_cachetype();
 
Quoted 8 lines

arch/arm/kernel/setup.c static void __init cacheid_init(void) · line 321

Quoted 6 lines
arch/arm/kernel/setup.c +1 -1
-		if ((arch == CPU_ARCH_ARMv7M) && !cachetype) {
+		if ((arch == CPU_ARCH_ARMv7M) && !(cachetype & 0xf000f)) {
 			cacheid = 0;
 		} else if ((cachetype & (7 << 29)) == 4 << 29) {
 			/* ARMv7 register format */

Ok for patch tracker?

Not yet, I've been away and I've no time right now to evaluate this change. I'm hopefully going to catch up with some email in the coming days.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
#3 lore raw

PATCH 1/1 ARM: V7M: Set cacheid iff DminLine or IminLine is nonzero

Quoted 30 lines · Russell King - ARM Linux
Quoted 20 lines · Vladimir Murzin
Quoted 19 lines · Vladimir Murzin

Cache support is optional feature in M-class cores, thus DminLine or IminLine of Cache Type Register is zero if caches are not implemented, but we check the whole CTR which has other features encoded there. Let's be more precise and check for DminLine and IminLine of CTR before we set cacheid.

---
 arch/arm/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/setup.c +0 -0
index f4e5450..231a1d83 100644
@@ -315,7 +315,7 @@ static void __init cacheid_init(void)
 	if (arch >= CPU_ARCH_ARMv6) {
 		unsigned int cachetype = read_cpuid_cachetype();
 
Quoted 8 lines

arch/arm/kernel/setup.c static void __init cacheid_init(void) · line 321

Quoted 6 lines
arch/arm/kernel/setup.c +1 -1
-		if ((arch == CPU_ARCH_ARMv7M) && !cachetype) {
+		if ((arch == CPU_ARCH_ARMv7M) && !(cachetype & 0xf000f)) {
 			cacheid = 0;
 		} else if ((cachetype & (7 << 29)) == 4 << 29) {
 			/* ARMv7 register format */

Ok for patch tracker?

Quoted 4 lines

Not yet, I've been away and I've no time right now to evaluate this change. I'm hopefully going to catch up with some email in the coming days.

Noted.

Cheers
Vladimir

#4 lore raw

PATCH 1/1 ARM: V7M: Set cacheid iff DminLine or IminLine is nonzero

Gentle ping...

Quoted 46 lines · Vladimir Murzin
Quoted 30 lines · Russell King - ARM Linux
Quoted 20 lines · Vladimir Murzin
Quoted 19 lines · Vladimir Murzin

Cache support is optional feature in M-class cores, thus DminLine or IminLine of Cache Type Register is zero if caches are not implemented, but we check the whole CTR which has other features encoded there. Let's be more precise and check for DminLine and IminLine of CTR before we set cacheid.

---
 arch/arm/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/setup.c +0 -0
index f4e5450..231a1d83 100644
@@ -315,7 +315,7 @@ static void __init cacheid_init(void)
 	if (arch >= CPU_ARCH_ARMv6) {
 		unsigned int cachetype = read_cpuid_cachetype();
 
Quoted 8 lines

arch/arm/kernel/setup.c static void __init cacheid_init(void) · line 321

Quoted 6 lines
arch/arm/kernel/setup.c +1 -1
-		if ((arch == CPU_ARCH_ARMv7M) && !cachetype) {
+		if ((arch == CPU_ARCH_ARMv7M) && !(cachetype & 0xf000f)) {
 			cacheid = 0;
 		} else if ((cachetype & (7 << 29)) == 4 << 29) {
 			/* ARMv7 register format */

Ok for patch tracker?

Quoted 4 lines

Not yet, I've been away and I've no time right now to evaluate this change. I'm hopefully going to catch up with some email in the coming days.

Noted.

Cheers
Vladimir

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw

PATCH 1/1 ARM: V7M: Set cacheid iff DminLine or IminLine is nonzero

Ping!

Quoted 56 lines · Vladimir Murzin

Gentle ping...

Quoted 38 lines · Vladimir Murzin
Quoted 30 lines · Russell King - ARM Linux
Quoted 20 lines · Vladimir Murzin
Quoted 19 lines · Vladimir Murzin

Cache support is optional feature in M-class cores, thus DminLine or IminLine of Cache Type Register is zero if caches are not implemented, but we check the whole CTR which has other features encoded there. Let's be more precise and check for DminLine and IminLine of CTR before we set cacheid.

---
 arch/arm/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/setup.c +0 -0
index f4e5450..231a1d83 100644
@@ -315,7 +315,7 @@ static void __init cacheid_init(void)
 	if (arch >= CPU_ARCH_ARMv6) {
 		unsigned int cachetype = read_cpuid_cachetype();
 
Quoted 8 lines

arch/arm/kernel/setup.c static void __init cacheid_init(void) · line 321

Quoted 6 lines
arch/arm/kernel/setup.c +1 -1
-		if ((arch == CPU_ARCH_ARMv7M) && !cachetype) {
+		if ((arch == CPU_ARCH_ARMv7M) && !(cachetype & 0xf000f)) {
 			cacheid = 0;
 		} else if ((cachetype & (7 << 29)) == 4 << 29) {
 			/* ARMv7 register format */

Ok for patch tracker?

Quoted 4 lines

Not yet, I've been away and I've no time right now to evaluate this change. I'm hopefully going to catch up with some email in the coming days.

Noted.

Quoted 8 lines

Cheers
Vladimir

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#6 lore raw

PATCH 1/1 ARM: V7M: Set cacheid iff DminLine or IminLine is nonzero

Yea, found a copy of the ARMv7M ARM, and this seems to be sane, as the minimum cache line size (according to CCSIDR) is 4 words, so the minimum value in CTR for these fields should be 2 when caches are implemented.

Quoted 60 lines · Vladimir Murzin

Ping!

Quoted 56 lines · Vladimir Murzin

Gentle ping...

Quoted 38 lines · Vladimir Murzin
Quoted 30 lines · Russell King - ARM Linux
Quoted 20 lines · Vladimir Murzin
Quoted 19 lines · Vladimir Murzin

Cache support is optional feature in M-class cores, thus DminLine or IminLine of Cache Type Register is zero if caches are not implemented, but we check the whole CTR which has other features encoded there. Let's be more precise and check for DminLine and IminLine of CTR before we set cacheid.

---
 arch/arm/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/setup.c +0 -0
index f4e5450..231a1d83 100644
@@ -315,7 +315,7 @@ static void __init cacheid_init(void)
 	if (arch >= CPU_ARCH_ARMv6) {
 		unsigned int cachetype = read_cpuid_cachetype();
 
Quoted 8 lines

arch/arm/kernel/setup.c static void __init cacheid_init(void) · line 321

Quoted 6 lines
arch/arm/kernel/setup.c +1 -1
-		if ((arch == CPU_ARCH_ARMv7M) && !cachetype) {
+		if ((arch == CPU_ARCH_ARMv7M) && !(cachetype & 0xf000f)) {
 			cacheid = 0;
 		} else if ((cachetype & (7 << 29)) == 4 << 29) {
 			/* ARMv7 register format */

Ok for patch tracker?

Quoted 4 lines

Not yet, I've been away and I've no time right now to evaluate this change. I'm hopefully going to catch up with some email in the coming days.

Noted.

Quoted 8 lines

Cheers
Vladimir

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.