Skip to contentSkip to conversation

ARM: Thumb-2: Fix Kconfig rules to avoid nonworking configs

PATCH New Dave Martin 4 participants 11 messages Dec 9, 2010 – Feb 4, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover ARM: Thumb-2: Fix Kconfig rules to avoid nonworking configs

Some configurations don't make sense with Thumb-2, or don't currently work and are unlikely to be relevant.

The patches avoid Kconfig from allowing these problematic combinations, for now.

Dave Martin (2):
ARM: Thumb-2: Make CONFIG_THUMB2_KERNEL depend on !CPU_V6
ARM: Make CONFIG_FPE_NWFPE depend on !CONFIG_THUMB2_KERNEL

 arch/arm/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
#1 lore raw

PATCH 1/2 ARM: Thumb-2: Make CONFIG_THUMB2_KERNEL depend on !CPU_V6

This makes sense, because Thumb-2 code can't execute on plain ARMv6 processors.

This will avoid accidentally configuring a broken kernel where the config otherwise would allow multiple architecture versions to coexist in the same kernel.

Not adding !CPU_V5 etc., because the chance of anyone trying to put v5 and v7 in the same kernel is low, and I'm not aware of any mach which can do this. These could be added later if it matters.

Note that the rules may need to be refined if support for the ARM1156J(F)-S processor is later added to the kernel, since this processor supports the rare ARMv6T2 extensions, which add support for Thumb-2 and a few other ARMv7 features.

---
 arch/arm/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/Kconfig +1 -1
index db524e7..f9ca7f3 100644
@@ -1311,7 +1311,7 @@ config HZ
 
 config THUMB2_KERNEL
 	bool "Compile the kernel in Thumb-2 mode"
-	depends on CPU_V7 && EXPERIMENTAL
+	depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL
 	select AEABI
 	select ARM_ASM_UNIFIED
 	help
Signature · 1 line
1.7.1
#2 lore raw

PATCH 1/2 ARM: Thumb-2: Make CONFIG_THUMB2_KERNEL depend on !CPU_V6

Quoted 12 lines · Dave Martin

This makes sense, because Thumb-2 code can't execute on plain ARMv6 processors.

This will avoid accidentally configuring a broken kernel where the config otherwise would allow multiple architecture versions to coexist in the same kernel.

Not adding !CPU_V5 etc., because the chance of anyone trying to put v5 and v7 in the same kernel is low, and I'm not aware of any mach which can do this. These could be added later if it matters.

Quoted 7 lines

Note that the rules may need to be refined if support for the ARM1156J(F)-S processor is later added to the kernel, since this processor supports the rare ARMv6T2 extensions, which add support for Thumb-2 and a few other ARMv7 features.

Quoted 26 lines
---
 arch/arm/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/Kconfig +1 -1
index db524e7..f9ca7f3 100644
@@ -1311,7 +1311,7 @@ config HZ
 
 config THUMB2_KERNEL
 	bool "Compile the kernel in Thumb-2 mode"
-	depends on CPU_V7 && EXPERIMENTAL
+	depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL
 	select AEABI
 	select ARM_ASM_UNIFIED
 	help
Signature · 7 lines
1.7.1


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

PATCH 1/2 ARM: Thumb-2: Make CONFIG_THUMB2_KERNEL depend on !CPU_V6

In reply to Dave Martin
Quoted 20 lines

-----Original Message-----
From: Dave Martin [mailto:dave.martin at linaro.org]
Sent: Thursday, December 09, 2010 5:30 PM
To: linux-arm-kernel at lists.infradead.org
Cc: Dave Martin; Santosh Shilimkar; linux-omap at vger.kernel.org
Subject: [PATCH 1/2] ARM: Thumb-2: Make CONFIG_THUMB2_KERNEL depend on !CPU_V6

This makes sense, because Thumb-2 code can't execute on plain ARMv6 processors.

This will avoid accidentally configuring a broken kernel where the config otherwise would allow multiple architecture versions to coexist in the same kernel.

Not adding !CPU_V5 etc., because the chance of anyone trying to put v5 and v7 in the same kernel is low, and I'm not aware of any mach which can do this. These could be added later if it matters.

Quoted 7 lines

Note that the rules may need to be refined if support for the ARM1156J(F)-S processor is later added to the kernel, since this processor supports the rare ARMv6T2 extensions, which add support for Thumb-2 and a few other ARMv7 features.

If you like,

Quoted 19 lines
---
 arch/arm/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/Kconfig +1 -2
index db524e7..f9ca7f3 100644
@@ -1311,7 +1311,7 @@ config HZ
 
 config THUMB2_KERNEL
 	bool "Compile the kernel in Thumb-2 mode"
-	depends on CPU_V7 && EXPERIMENTAL
+	depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL
 	select AEABI
 	select ARM_ASM_UNIFIED
 	help
--

1.7.1

#4 lore raw

PATCH 1/2 ARM: Thumb-2: Make CONFIG_THUMB2_KERNEL depend on !CPU_V6

In reply to Dave Martin
Quoted 20 lines

-----Original Message-----
From: Dave Martin [mailto:dave.martin at linaro.org]
Sent: Thursday, December 09, 2010 5:30 PM
To: linux-arm-kernel at lists.infradead.org
Cc: Dave Martin; Santosh Shilimkar; linux-omap at vger.kernel.org
Subject: [PATCH 1/2] ARM: Thumb-2: Make CONFIG_THUMB2_KERNEL depend on !CPU_V6

This makes sense, because Thumb-2 code can't execute on plain ARMv6 processors.

This will avoid accidentally configuring a broken kernel where the config otherwise would allow multiple architecture versions to coexist in the same kernel.

Not adding !CPU_V5 etc., because the chance of anyone trying to put v5 and v7 in the same kernel is low, and I'm not aware of any mach which can do this. These could be added later if it matters.

Quoted 7 lines

Note that the rules may need to be refined if support for the ARM1156J(F)-S processor is later added to the kernel, since this processor supports the rare ARMv6T2 extensions, which add support for Thumb-2 and a few other ARMv7 features.

Quoted 19 lines
---
 arch/arm/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/Kconfig +1 -2
index db524e7..f9ca7f3 100644
@@ -1311,7 +1311,7 @@ config HZ
 
 config THUMB2_KERNEL
 	bool "Compile the kernel in Thumb-2 mode"
-	depends on CPU_V7 && EXPERIMENTAL
+	depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL
 	select AEABI
 	select ARM_ASM_UNIFIED
 	help
--

1.7.1

#5 lore raw

PATCH 2/2 ARM: Make CONFIG_FPE_NWFPE depend on !CONFIG_THUMB2_KERNEL

In reply to Dave Martin

Because the nwfpe support is unlikely to be used on new platforms and requires CONFIG_OABI_COMPAT, which is not generally used with ARMv7+, we shouldn't expect to build nwfpe support into a Thumb-2 kernel.

At present, nwfpe contains assembly code which isn't Thumb-2 compatible, and for now it doesn't appear useful to port this code.

All ARMv7-A/R platforms necessarily have VFPv3 hardware floating- point natively, making emulation unnecessary.

---
 arch/arm/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/Kconfig +1 -1
index f9ca7f3..7e825c3 100644
@@ -1759,7 +1759,7 @@ comment "At least one emulation must be selected"
 
 config FPE_NWFPE
 	bool "NWFPE math emulation"
-	depends on !AEABI || OABI_COMPAT
+	depends on (!AEABI || OABI_COMPAT) && !THUMB2_KERNEL
 	---help---
 	  Say Y to include the NWFPE floating point emulator in the kernel.
 	  This is necessary to run most binaries. Linux does not currently
Signature · 1 line
1.7.1
#6 lore raw

PATCH 2/2 ARM: Make CONFIG_FPE_NWFPE depend on !CONFIG_THUMB2_KERNEL

Quoted 9 lines · Dave Martin

Because the nwfpe support is unlikely to be used on new platforms and requires CONFIG_OABI_COMPAT, which is not generally used with ARMv7+, we shouldn't expect to build nwfpe support into a Thumb-2 kernel.

At present, nwfpe contains assembly code which isn't Thumb-2 compatible, and for now it doesn't appear useful to port this code.

Quoted 5 lines

All ARMv7-A/R platforms necessarily have VFPv3 hardware floating- point natively, making emulation unnecessary.

Quoted 26 lines
---
 arch/arm/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/Kconfig +1 -1
index f9ca7f3..7e825c3 100644
@@ -1759,7 +1759,7 @@ comment "At least one emulation must be selected"
 
 config FPE_NWFPE
 	bool "NWFPE math emulation"
-	depends on !AEABI || OABI_COMPAT
+	depends on (!AEABI || OABI_COMPAT) && !THUMB2_KERNEL
 	---help---
 	  Say Y to include the NWFPE floating point emulator in the kernel.
 	  This is necessary to run most binaries. Linux does not currently
Signature · 7 lines
1.7.1


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

PATCH 2/2 ARM: Make CONFIG_FPE_NWFPE depend on !CONFIG_THUMB2_KERNEL

In reply to Dave Martin
Quoted 17 lines

-----Original Message-----
From: Dave Martin [mailto:dave.martin at linaro.org]
Sent: Thursday, December 09, 2010 5:30 PM
To: linux-arm-kernel at lists.infradead.org
Cc: Dave Martin; Santosh Shilimkar; linux-omap at vger.kernel.org
Subject: [PATCH 2/2] ARM: Make CONFIG_FPE_NWFPE depend on !CONFIG_THUMB2_KERNEL

Because the nwfpe support is unlikely to be used on new platforms and requires CONFIG_OABI_COMPAT, which is not generally used with ARMv7+, we shouldn't expect to build nwfpe support into a Thumb-2 kernel.

At present, nwfpe contains assembly code which isn't Thumb-2 compatible, and for now it doesn't appear useful to port this code.

Quoted 5 lines

All ARMv7-A/R platforms necessarily have VFPv3 hardware floating- point natively, making emulation unnecessary.

If you like.

Quoted 9 lines
---
 arch/arm/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index f9ca7f3..7e825c3 100644

arch/arm/Kconfig comment "At least one emulation must be selected" · line 1764

Quoted 7 lines
arch/arm/Kconfig +1 -1
@@ -1759,7 +1759,7 @@ comment "At least one emulation must be selected"
 
 config FPE_NWFPE
 	bool "NWFPE math emulation"
-	depends on !AEABI || OABI_COMPAT
+	depends on (!AEABI || OABI_COMPAT) && !THUMB2_KERNEL
 	---help---
 	  Say Y to include the NWFPE floating point emulator in the

kernel.

Quoted 3 lines
arch/arm/Kconfig +0 -1
 	  This is necessary to run most binaries. Linux does not currently
--

1.7.1

#8 lore raw

PATCH 2/2 ARM: Make CONFIG_FPE_NWFPE depend on !CONFIG_THUMB2_KERNEL

In reply to Dave Martin
Quoted 17 lines

-----Original Message-----
From: Dave Martin [mailto:dave.martin at linaro.org]
Sent: Thursday, December 09, 2010 5:30 PM
To: linux-arm-kernel at lists.infradead.org
Cc: Dave Martin; Santosh Shilimkar; linux-omap at vger.kernel.org
Subject: [PATCH 2/2] ARM: Make CONFIG_FPE_NWFPE depend on !CONFIG_THUMB2_KERNEL

Because the nwfpe support is unlikely to be used on new platforms and requires CONFIG_OABI_COMPAT, which is not generally used with ARMv7+, we shouldn't expect to build nwfpe support into a Thumb-2 kernel.

At present, nwfpe contains assembly code which isn't Thumb-2 compatible, and for now it doesn't appear useful to port this code.

Quoted 6 lines

All ARMv7-A/R platforms necessarily have VFPv3 hardware floating- point natively, making emulation unnecessary.

---

Quoted 21 lines
 arch/arm/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index f9ca7f3..7e825c3 100644
@@ -1759,7 +1759,7 @@ comment "At least one emulation must be

selected"

config FPE_NWFPE

arch/arm/Kconfig +1 -1
 	bool "NWFPE math emulation"
-	depends on !AEABI || OABI_COMPAT
+	depends on (!AEABI || OABI_COMPAT) && !THUMB2_KERNEL
 	---help---
 	  Say Y to include the NWFPE floating point emulator in the

kernel.
This is necessary to run most binaries. Linux does not
currently
--
1.7.1

#9 lore raw

PATCH 2/2 ARM: Make CONFIG_FPE_NWFPE depend on !CONFIG_THUMB2_KERNEL

In reply to Dave Martin
Quoted 8 lines · Dave Martin

Because the nwfpe support is unlikely to be used on new platforms and requires CONFIG_OABI_COMPAT, which is not generally used with ARMv7+, we shouldn't expect to build nwfpe support into a Thumb-2 kernel.

At present, nwfpe contains assembly code which isn't Thumb-2 compatible, and for now it doesn't appear useful to port this code.

You might as well make OABI_COMPAT depend on !THUMB2_KERNEL. OABI userland is useless without FPA support.

#10 lore raw

PATCH 2/2 ARM: Make CONFIG_FPE_NWFPE depend on !CONFIG_THUMB2_KERNEL

Quoted 6 lines · Russell King - ARM Linux
Quoted 5 lines · Dave Martin

Because the nwfpe support is unlikely to be used on new platforms and requires CONFIG_OABI_COMPAT, which is not generally used with ARMv7+, we shouldn't expect to build nwfpe support into a Thumb-2 kernel.

Quoted 7 lines
Quoted 3 lines

At present, nwfpe contains assembly code which isn't Thumb-2 compatible, and for now it doesn't appear useful to port this code.

You might as well make OABI_COMPAT depend on !THUMB2_KERNEL. ?OABI userland is useless without FPA support.

Sure. The original patch is already upstream, but I can roll a supplementary patch for this.

Cheers
---Dave