2014-10-21 14:12:42

by Xia Kaixu

[permalink] [raw]
Subject: [PATCH 0/4] ARM: get a strict multiplatform kernel that can run on any hardware

The current allmodconfig kernel boot fails on OMAP4460. There
are several configuration options that can only work on a subset
of the available machines, and enabling them will break other
machines that may be enabled in a multiplatform kernel.

Now we introduce a CONFIG_ARCH_MULTIPLATFORM_STRICT Kconfig
option that prevent those other options from getting enabled
and get a strict multiplatform kernel.

This patch set is not complete yet(missing the console).

I am not sure who will pick up this patch set, so I just send
it to [email protected] and rmk.

Xia Kaixu (4):
ARM: introduce a CONFIG_ARCH_MULTIPLATFORM_STRICT Kconfig option
ARM: change the corresponding arm/mach defconfigs
ARM: restrict CPU_BIG_ENDIAN configuration option
ARM: allow errata and XIP options to be enabled without ARCH_MULTIPLATFORM_STRICT

arch/arm/Kconfig | 28 +++++++++++++++++++++-------
arch/arm/configs/bcm2835_defconfig | 1 +
arch/arm/configs/moxart_defconfig | 1 +
arch/arm/configs/s5pv210_defconfig | 1 +
arch/arm/configs/tegra_defconfig | 1 +
arch/arm/mm/Kconfig | 1 +
6 files changed, 26 insertions(+), 7 deletions(-)

--
2.1.1


2014-10-21 14:12:49

by Xia Kaixu

[permalink] [raw]
Subject: [PATCH 1/4] ARM: introduce a CONFIG_ARCH_MULTIPLATFORM_STRICT Kconfig option

The current allmodconfig kernel boot fails on OMAP4460. There
are several configuration options that can only work on a subset
of the available machines, and enabling them will break other
machines that may be enabled in a multiplatform kernel.

Now we introduce a CONFIG_ARCH_MULTIPLATFORM_STRICT Kconfig
option that prevent those other options from getting enabled
and get a strict multiplatform kernel.

Signed-off-by: Xia Kaixu <[email protected]>
---
arch/arm/Kconfig | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 89c4b5c..50762cc 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -840,6 +840,20 @@ config ARCH_MULTI_CPU_AUTO

endmenu

+config ARCH_MULTIPLATFORM_STRICT
+ bool "Only allow options that do not break other platforms"
+ depends on ARCH_MULTIPLATFORM
+ default y
+ help
+ There are several configuration options that can only work
+ on a subset of the available machines, and enabling them
+ will break running the kernel on other machines that may be
+ enabled in a multiplatform kernel.
+
+ Enabling ARCH_MULTIPLATFORM_STRICT will prevent those other
+ options from getting enabled, so the kernel should always
+ run on any hardware that is part of the configuration.
+
config ARCH_VIRT
bool "Dummy Virtual Machine" if ARCH_MULTI_V7
select ARM_AMBA
--
2.1.1

2014-10-21 14:12:55

by Xia Kaixu

[permalink] [raw]
Subject: [PATCH 2/4] ARM: change the corresponding arm/mach defconfigs

The DEBUG_LL will get a dependency on !ARCH_MULTIPLATFORM_STRICT.
So change the corresponding arm/mach defconfigs to disable
ARCH_MULTIPLATFORM_STRICT and avoid break them.

Signed-off-by: Xia Kaixu <[email protected]>
---
arch/arm/configs/bcm2835_defconfig | 1 +
arch/arm/configs/moxart_defconfig | 1 +
arch/arm/configs/s5pv210_defconfig | 1 +
arch/arm/configs/tegra_defconfig | 1 +
4 files changed, 4 insertions(+)

diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
index 31cb073..e644c8b 100644
--- a/arch/arm/configs/bcm2835_defconfig
+++ b/arch/arm/configs/bcm2835_defconfig
@@ -135,6 +135,7 @@ CONFIG_TEST_KSTRTOX=y
CONFIG_KGDB=y
CONFIG_KGDB_KDB=y
CONFIG_STRICT_DEVMEM=y
+# CONFIG_ARCH_MULTIPLATFORM_STRICT is not set
CONFIG_DEBUG_LL=y
CONFIG_EARLY_PRINTK=y
# CONFIG_XZ_DEC_ARM is not set
diff --git a/arch/arm/configs/moxart_defconfig b/arch/arm/configs/moxart_defconfig
index a3cb76c..7ba9343 100644
--- a/arch/arm/configs/moxart_defconfig
+++ b/arch/arm/configs/moxart_defconfig
@@ -140,6 +140,7 @@ CONFIG_DETECT_HUNG_TASK=y
CONFIG_PROVE_LOCKING=y
CONFIG_DMA_API_DEBUG=y
CONFIG_KGDB=y
+# CONFIG_ARCH_MULTIPLATFORM_STRICT is not set
CONFIG_DEBUG_LL=y
CONFIG_DEBUG_LL_UART_8250=y
CONFIG_DEBUG_UART_PHYS=0x98200000
diff --git a/arch/arm/configs/s5pv210_defconfig b/arch/arm/configs/s5pv210_defconfig
index fa98990..bc0cad4 100644
--- a/arch/arm/configs/s5pv210_defconfig
+++ b/arch/arm/configs/s5pv210_defconfig
@@ -67,6 +67,7 @@ CONFIG_DEBUG_INFO=y
CONFIG_SYSCTL_SYSCALL_CHECK=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_ERRORS=y
+# CONFIG_ARCH_MULTIPLATFORM_STRICT is not set
CONFIG_DEBUG_LL=y
CONFIG_EARLY_PRINTK=y
CONFIG_DEBUG_S3C_UART=1
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index 888fc15..851b80b 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -291,6 +291,7 @@ CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_PREEMPT is not set
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_SG=y
+# CONFIG_ARCH_MULTIPLATFORM_STRICT is not set
CONFIG_DEBUG_LL=y
CONFIG_EARLY_PRINTK=y
CONFIG_CRYPTO_TWOFISH=y
--
2.1.1

2014-10-21 14:13:01

by Xia Kaixu

[permalink] [raw]
Subject: [PATCH 4/4] ARM: allow errata and XIP options to be enabled without ARCH_MULTIPLATFORM_STRICT

With the ARCH_MULTIPLATFORM_STRICT option, it becomes much easier to
enable the ERRATA options when we know at configuration time that we
don't care about the generic case. The previous configuration makes
XIP_KERNEL option fundamentally non-MULTIPLATFORM, but it's still
valid to select it when building for !ARCH_MULTIPLATFORM_STRICT and
selecting only the one machine that you want to run on.

So allow ARM_ERRATA and XIP_KERNEL options to be enabled without
ARCH_MULTIPLATFORM_STRICT.

Signed-off-by: Xia Kaixu <[email protected]>
---
arch/arm/Kconfig | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 50762cc..14d0dce 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1091,7 +1091,7 @@ config ARM_ERRATA_430973
config ARM_ERRATA_458693
bool "ARM errata: Processor deadlock when a false hazard is created"
depends on CPU_V7
- depends on !ARCH_MULTIPLATFORM
+ depends on !ARCH_MULTIPLATFORM_STRICT
help
This option enables the workaround for the 458693 Cortex-A8 (r2p0)
erratum. For very specific sequences of memory operations, it is
@@ -1105,7 +1105,7 @@ config ARM_ERRATA_458693
config ARM_ERRATA_460075
bool "ARM errata: Data written to the L2 cache can be overwritten with stale data"
depends on CPU_V7
- depends on !ARCH_MULTIPLATFORM
+ depends on !ARCH_MULTIPLATFORM_STRICT
help
This option enables the workaround for the 460075 Cortex-A8 (r2p0)
erratum. Any asynchronous access to the L2 cache may encounter a
@@ -1118,7 +1118,7 @@ config ARM_ERRATA_460075
config ARM_ERRATA_742230
bool "ARM errata: DMB operation may be faulty"
depends on CPU_V7 && SMP
- depends on !ARCH_MULTIPLATFORM
+ depends on !ARCH_MULTIPLATFORM_STRICT
help
This option enables the workaround for the 742230 Cortex-A9
(r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction
@@ -1131,7 +1131,7 @@ config ARM_ERRATA_742230
config ARM_ERRATA_742231
bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption"
depends on CPU_V7 && SMP
- depends on !ARCH_MULTIPLATFORM
+ depends on !ARCH_MULTIPLATFORM_STRICT
help
This option enables the workaround for the 742231 Cortex-A9
(r2p0..r2p2) erratum. Under certain conditions, specific to the
@@ -1168,7 +1168,7 @@ config ARM_ERRATA_720789
config ARM_ERRATA_743622
bool "ARM errata: Faulty hazard checking in the Store Buffer may lead to data corruption"
depends on CPU_V7
- depends on !ARCH_MULTIPLATFORM
+ depends on !ARCH_MULTIPLATFORM_STRICT
help
This option enables the workaround for the 743622 Cortex-A9
(r2p*) erratum. Under very rare conditions, a faulty
@@ -1182,7 +1182,7 @@ config ARM_ERRATA_743622
config ARM_ERRATA_751472
bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation"
depends on CPU_V7
- depends on !ARCH_MULTIPLATFORM
+ depends on !ARCH_MULTIPLATFORM_STRICT
help
This option enables the workaround for the 751472 Cortex-A9 (prior
to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the
@@ -1987,7 +1987,7 @@ endchoice

config XIP_KERNEL
bool "Kernel Execute-In-Place from ROM"
- depends on !ARM_LPAE && !ARCH_MULTIPLATFORM
+ depends on !ARM_LPAE && !ARCH_MULTIPLATFORM_STRICT
help
Execute-In-Place allows the kernel to run from non-volatile storage
directly addressable by the CPU, such as NOR flash. This saves RAM
--
2.1.1

2014-10-21 14:13:04

by Xia Kaixu

[permalink] [raw]
Subject: [PATCH 3/4] ARM: restrict CPU_BIG_ENDIAN configuration option

Some platforms don't work when CPU_BIG_ENDIAN is enabled.
So It can get a dependency on !ARCH_MULTIPLATFORM_STRICT.

Signed-off-by: Xia Kaixu <[email protected]>
---
arch/arm/mm/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index ae69809..d510448 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -698,6 +698,7 @@ config SWP_EMULATE
config CPU_BIG_ENDIAN
bool "Build big-endian kernel"
depends on ARCH_SUPPORTS_BIG_ENDIAN
+ depends on !ARCH_MULTIPLATFORM_STRICT
help
Say Y if you plan on running a kernel in big-endian mode.
Note that your board must be properly built and your board
--
2.1.1