Skip to contentSkip to conversation

ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

PATCH Superseded Jonathan Austin 8 participants 18 messages Jan 9, 2013 – Jan 10, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

From: Will Deacon <[email protected]>

Since 617276307cd4c ("ARM: vexpress: convert to multi-platform") it has been impossible to select ARCH_VEXPRESS without ARCH_MULTIPLATFORM.

ARCH_MULTIPLATFORM doesn't make sense for NOMMU targets, not least because of the need to hard-code the memory map. However, it should still be possible to run NOMMU kernels on top of the Versatile Express by selecting it as the only platform.

This patch creates a shim ARCH_VEXPRESS_NOMMU config option in the 'choice' for "ARM system type" to make this possible again.

---

Arnd and Nicolas: I've removed your acks as I've changed the location of the new block (as Nicolas suggested) and ever so slightly tweaked the name of the new option.

 arch/arm/Kconfig |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/Kconfig +5 -0
index 335e220..3357d0b 100644
@@ -322,6 +322,11 @@ config ARCH_VERSATILE
 	help
 	  This enables support for ARM Ltd Versatile board.
 
+config ARCH_VEXPRESS_NOMMU
+	bool "ARM Ltd. Versatile Express family for NOMMU"
+	depends on !MMU
+	select ARCH_VEXPRESS
+
 config ARCH_AT91
 	bool "Atmel AT91"
 	select ARCH_REQUIRE_GPIOLIB
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 1 line · Jonathan Austin

From: Will Deacon <[email protected]>

Did Will actually write the patch? It rather looks like you are the one folloing through, in which case you deserve the credits.

Quoted 15 lines

Since 617276307cd4c ("ARM: vexpress: convert to multi-platform") it has been impossible to select ARCH_VEXPRESS without ARCH_MULTIPLATFORM.

ARCH_MULTIPLATFORM doesn't make sense for NOMMU targets, not least because of the need to hard-code the memory map. However, it should still be possible to run NOMMU kernels on top of the Versatile Express by selecting it as the only platform.

This patch creates a shim ARCH_VEXPRESS_NOMMU config option in the 'choice' for "ARM system type" to make this possible again.

Quoted 5 lines

---

Arnd and Nicolas: I've removed your acks as I've changed the location of the new block (as Nicolas suggested) and ever so slightly tweaked the name of the new option.

Please add some help text to explain what this is for as well.

And you may add my ACK back.

Quoted 24 lines
 arch/arm/Kconfig |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/Kconfig +5 -0
index 335e220..3357d0b 100644
@@ -322,6 +322,11 @@ config ARCH_VERSATILE
 	help
 	  This enables support for ARM Ltd Versatile board.
 
+config ARCH_VEXPRESS_NOMMU
+	bool "ARM Ltd. Versatile Express family for NOMMU"
+	depends on !MMU
+	select ARCH_VEXPRESS
+
 config ARCH_AT91
 	bool "Atmel AT91"
 	select ARCH_REQUIRE_GPIOLIB
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 6 lines · Nicolas Pitre
Quoted 1 line · Jonathan Austin

From: Will Deacon <[email protected]>

Did Will actually write the patch? It rather looks like you are the one folloing through, in which case you deserve the credits.

I wrote the initial patch, but it's pretty simple and I just want it fixed, so I'm not especially bothered about the attribution. If you do remove me as the author, you can leave my S-o-B after yours.

Cheers,

Will

#3 lore raw

PATCH v2 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Since 617276307cd4c ("ARM: vexpress: convert to multi-platform") it has been impossible to select ARCH_VEXPRESS without ARCH_MULTIPLATFORM.

ARCH_MULTIPLATFORM doesn't make sense for NOMMU targets, not least because of the need to hard-code the memory map. However, it should still be possible to run NOMMU kernels on top of the Versatile Express by selecting it as the only platform.

This patch creates a shim ARCH_VEXPRESS_NOMMU config option in the 'choice' for "ARM system type" to make this possible again.

---
Changes since v1:
Added the help text and changed authorship from Will to me (Jonathan)

 arch/arm/Kconfig |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/Kconfig +15 -0
index 335e220..5b8a925 100644
@@ -322,6 +322,21 @@ config ARCH_VERSATILE
 	help
 	  This enables support for ARM Ltd Versatile board.
 
+config ARCH_VEXPRESS_NOMMU
+	bool "ARM Ltd. Versatile Express family for NOMMU"
+	depends on !MMU
+	select ARCH_VEXPRESS
+	help
+	  This option enables support for systems using Cortex processor based
+	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
+	  in configurations WITHOUT an MMU. You must boot using a Flattened
+	  Device Tree - the traditional ATAGs boot method is not usable with
+	  this configuration.
+
+	  If your system has an MMU and you want to make use of it, you
+	  should instead choose to build a multiplatform kernel and
+	  select ARCH_VEXPRESS
+
 config ARCH_AT91
 	bool "Atmel AT91"
 	select ARCH_REQUIRE_GPIOLIB
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

In reply to Jonathan Austin
Quoted 17 lines · Jonathan Austin

From: Will Deacon <[email protected]>

Since 617276307cd4c ("ARM: vexpress: convert to multi-platform") it has been impossible to select ARCH_VEXPRESS without ARCH_MULTIPLATFORM.

ARCH_MULTIPLATFORM doesn't make sense for NOMMU targets, not least because of the need to hard-code the memory map. However, it should still be possible to run NOMMU kernels on top of the Versatile Express by selecting it as the only platform.

This patch creates a shim ARCH_VEXPRESS_NOMMU config option in the 'choice' for "ARM system type" to make this possible again.

Quoted 5 lines

---

Arnd and Nicolas: I've removed your acks as I've changed the location of the new block (as Nicolas suggested) and ever so slightly tweaked the name of the new option.

The patch is still good. Generally you can leave an Ack when doing small changes but leaving the patch conceptually the same.

On a related topic, I still think we should fix ARCH_MULTI_V7 not to select ARCH_VEXPRESS unconditionally and come up with a better way to avoid having an empty platform list to make 'allnoconfig' still work.

Arnd

#5 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 4 lines · Arnd Bergmann

On a related topic, I still think we should fix ARCH_MULTI_V7 not to select ARCH_VEXPRESS unconditionally and come up with a better way to avoid having an empty platform list to make 'allnoconfig' still work.

The virtual guest platform support that Will and Marc did is small enough that it could always be selected in place of vexpress.

Nicolas

#6 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 9 lines · Nicolas Pitre
Quoted 4 lines · Arnd Bergmann

On a related topic, I still think we should fix ARCH_MULTI_V7 not to select ARCH_VEXPRESS unconditionally and come up with a better way to avoid having an empty platform list to make 'allnoconfig' still work.

The virtual guest platform support that Will and Marc did is small enough that it could always be selected in place of vexpress.

But that only helps when ARMv7 is selected, unless we want to build it only for ARMv4, v5 or v6 kernels.

Besides, the only reason we can't have a kernel without any platform selected is that the linker script has code in it to intentionally barf on that because it's guaranteed not to boot on any hardware.

If we decide that building an allnoconfig without any platform is actually ok, we could just as well rip out that error statement.

Arnd

#7 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 14 lines · Arnd Bergmann
Quoted 9 lines · Nicolas Pitre
Quoted 4 lines · Arnd Bergmann

On a related topic, I still think we should fix ARCH_MULTI_V7 not to select ARCH_VEXPRESS unconditionally and come up with a better way to avoid having an empty platform list to make 'allnoconfig' still work.

The virtual guest platform support that Will and Marc did is small enough that it could always be selected in place of vexpress.

But that only helps when ARMv7 is selected, unless we want to build it only for ARMv4, v5 or v6 kernels.

Quoted 7 lines

Besides, the only reason we can't have a kernel without any platform selected is that the linker script has code in it to intentionally barf on that because it's guaranteed not to boot on any hardware.

If we decide that building an allnoconfig without any platform is actually ok, we could just as well rip out that error statement.

That patch is already posted, but Russell doesn't like it as you can have a kernel that doesn't boot. You don't like the allno and randconfig failures, so we're stuck. I think there are dozens of config options that will make you not boot on any given platform, so failing to boot because you did not select your machine is a non-issue.

Rob

#8 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 23 lines · Rob Herring
Quoted 14 lines · Arnd Bergmann
Quoted 9 lines · Nicolas Pitre
Quoted 4 lines · Arnd Bergmann

On a related topic, I still think we should fix ARCH_MULTI_V7 not to select ARCH_VEXPRESS unconditionally and come up with a better way to avoid having an empty platform list to make 'allnoconfig' still work.

The virtual guest platform support that Will and Marc did is small enough that it could always be selected in place of vexpress.

But that only helps when ARMv7 is selected, unless we want to build it only for ARMv4, v5 or v6 kernels.

Quoted 7 lines

Besides, the only reason we can't have a kernel without any platform selected is that the linker script has code in it to intentionally barf on that because it's guaranteed not to boot on any hardware.

If we decide that building an allnoconfig without any platform is actually ok, we could just as well rip out that error statement.

Quoted 5 lines

That patch is already posted, but Russell doesn't like it as you can have a kernel that doesn't boot. You don't like the allno and randconfig failures, so we're stuck. I think there are dozens of config options that will make you not boot on any given platform, so failing to boot because you did not select your machine is a non-issue.

What I actually suggested is that we should be aiming for the DT side of things to get to the point where DT is just another _single_ platform as far as that code goes, and that DT should describe the hardware sufficiently well that we don't have multiple machine_desc things to select via DT - so a DT kernel would have exactly one machine_desc (or maybe even zero! - with the linker script check conditional on !CONFIG_OF)

That then gets rid of the issue entirely.

#9 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 30 lines · Russell King - ARM Linux
Quoted 23 lines · Rob Herring
Quoted 14 lines · Arnd Bergmann
Quoted 9 lines · Nicolas Pitre
Quoted 4 lines · Arnd Bergmann

On a related topic, I still think we should fix ARCH_MULTI_V7 not to select ARCH_VEXPRESS unconditionally and come up with a better way to avoid having an empty platform list to make 'allnoconfig' still work.

The virtual guest platform support that Will and Marc did is small enough that it could always be selected in place of vexpress.

But that only helps when ARMv7 is selected, unless we want to build it only for ARMv4, v5 or v6 kernels.

Quoted 7 lines

Besides, the only reason we can't have a kernel without any platform selected is that the linker script has code in it to intentionally barf on that because it's guaranteed not to boot on any hardware.

If we decide that building an allnoconfig without any platform is actually ok, we could just as well rip out that error statement.

Quoted 5 lines

That patch is already posted, but Russell doesn't like it as you can have a kernel that doesn't boot. You don't like the allno and randconfig failures, so we're stuck. I think there are dozens of config options that will make you not boot on any given platform, so failing to boot because you did not select your machine is a non-issue.

Quoted 8 lines

What I actually suggested is that we should be aiming for the DT side of things to get to the point where DT is just another _single_ platform as far as that code goes, and that DT should describe the hardware sufficiently well that we don't have multiple machine_desc things to select via DT - so a DT kernel would have exactly one machine_desc (or maybe even zero! - with the linker script check conditional on !CONFIG_OF)

That then gets rid of the issue entirely.

I agree completely. I look at mach-highbank (and mach-virt) as what else needs to be done in terms of refactoring or moving to DT. That's certainly a long term goal, but what is the short term solution?

Rob

#10 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 8 lines · Rob Herring
Quoted 8 lines

What I actually suggested is that we should be aiming for the DT side of things to get to the point where DT is just another single platform as far as that code goes, and that DT should describe the hardware sufficiently well that we don't have multiple machine_desc things to select via DT - so a DT kernel would have exactly one machine_desc (or maybe even zero! - with the linker script check conditional on !CONFIG_OF)

Quoted 4 lines
Quoted 1 line

That then gets rid of the issue entirely.

I agree completely. I look at mach-highbank (and mach-virt) as what else needs to be done in terms of refactoring or moving to DT.

It's also what we are doing on arm64 from the start, where there is no machine descriptor already. Any experience we make with arm64 will also help us improve arm in the long run, I hope.

Quoted 1 line

That's certainly a long term goal, but what is the short term solution?

I'd certainly be happy with

* removing the intentional build error for ARCH_MULTIPLATFORM, but leaving it in for !ARCH_MULTIPLATFORM
* having mach-virt enabled by default on ARCH_MULTIPLATFORM, and only visible for EXPERT.
* making mach-virt compatible with all CPUs starting with ARM7.

That would make allnoconfig, allyesconfig and allmodconfig work (besides all the other bugs) on qemu at least, avoid build errors with randconfig and make it hard enough to build a kernel that doesn't run on anything.

Arnd

#11 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

On 01/10/2013 05:16 AM, Arnd Bergmann wrote:

[...]

Quoted 11 lines

I'd certainly be happy with

* removing the intentional build error for ARCH_MULTIPLATFORM, but leaving it in for !ARCH_MULTIPLATFORM
* having mach-virt enabled by default on ARCH_MULTIPLATFORM, and only visible for EXPERT.
* making mach-virt compatible with all CPUs starting with ARM7.

That would make allnoconfig, allyesconfig and allmodconfig work (besides all the other bugs) on qemu at least, avoid build errors with randconfig and make it hard enough to build a kernel that doesn't run on anything.

If this is going to be the approach, I would like to once again suggest that paths, configuration options, and compatibility strings along the lines of "mach-genericarmv7", "Generic ARMv7 Machine", and "linux,genericarmv7" be considered in place of "mach-virt", "Dummy Virtual Machine" and "linux,dummy-virt", respectively.

Virtualization may have been the initial motivation for creating mach-virt, but the code is clearly also immediately applicable to other environments such as simulation/emulation, and sticking to a name like "Dummy Virtual Machine" makes it sound like such usage is erroneous.

Regards,
Christopher

Signature · 3 lines
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
the Linux Foundation
#12 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 22 lines · Christopher Covington

On 01/10/2013 05:16 AM, Arnd Bergmann wrote:

[...]

Quoted 11 lines

I'd certainly be happy with

* removing the intentional build error for ARCH_MULTIPLATFORM, but leaving it in for !ARCH_MULTIPLATFORM
* having mach-virt enabled by default on ARCH_MULTIPLATFORM, and only visible for EXPERT.
* making mach-virt compatible with all CPUs starting with ARM7.

That would make allnoconfig, allyesconfig and allmodconfig work (besides all the other bugs) on qemu at least, avoid build errors with randconfig and make it hard enough to build a kernel that doesn't run on anything.

If this is going to be the approach, I would like to once again suggest that paths, configuration options, and compatibility strings along the lines of "mach-genericarmv7", "Generic ARMv7 Machine", and "linux,genericarmv7" be considered in place of "mach-virt", "Dummy Virtual Machine" and "linux,dummy-virt", respectively.

Quoted 4 lines

Virtualization may have been the initial motivation for creating mach-virt, but the code is clearly also immediately applicable to other environments such as simulation/emulation, and sticking to a name like "Dummy Virtual Machine" makes it sound like such usage is erroneous.

mach-virt requires GIC, Architected Timers and PSCI. I'm not prepared to impose these requirements on all future v7 platforms yet.

When we reach a point where we have a completely DT driven setup, without any explicit hook, I'll be happy to add new compatibility strings.

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
#13 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

In reply to Rob Herring
Quoted 5 lines · Rob Herring

That patch is already posted, but Russell doesn't like it as you can have a kernel that doesn't boot. You don't like the allno and randconfig failures, so we're stuck. I think there are dozens of config options that will make you not boot on any given platform, so failing to boot because you did not select your machine is a non-issue.

Rather than simply accept that "there are dozens of config options that will make you not boot on any given platform" and allow for this to be used as an argument for future sloppiness, I think we should consider fixing the config rules to avoid that situation as much as possible instead.

Nicolas

#14 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann
Quoted 7 lines · Nicolas Pitre
Quoted 4 lines · Arnd Bergmann

On a related topic, I still think we should fix ARCH_MULTI_V7 not to select ARCH_VEXPRESS unconditionally and come up with a better way to avoid having an empty platform list to make 'allnoconfig' still work.

Quoted 5 lines
Quoted 2 lines

The virtual guest platform support that Will and Marc did is small enough that it could always be selected in place of vexpress.

But that only helps when ARMv7 is selected, unless we want to build it only for ARMv4, v5 or v6 kernels.

That is still a problem. I assumed from your statement above that only ARCH_MULTI_V7 was affected.

Quoted 3 lines

Besides, the only reason we can't have a kernel without any platform selected is that the linker script has code in it to intentionally barf on that because it's guaranteed not to boot on any hardware.

I know -- that linker script assertion is mine. :-)

Quoted 2 lines

If we decide that building an allnoconfig without any platform is actually ok, we could just as well rip out that error statement.

Is it expected for allnoconfig kernels to still boot on other architectures? If so I think we should try to still provide a valid config even in the allnoconfig case.

Nicolas

#15 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 6 lines · Nicolas Pitre
Quoted 2 lines

If we decide that building an allnoconfig without any platform is actually ok, we could just as well rip out that error statement.

Is it expected for allnoconfig kernels to still boot on other architectures? If so I think we should try to still provide a valid config even in the allnoconfig case.

The practical use of a kernel without any device drivers or file systems is pretty low, I would not expect such a kernel to be any useful. Having a regular configuration where you just disable the platform support is a little different. This could happen when the platform you are building for depends on a specific feature to be enabled or disabled and that option is accidentally changed. E.g. when you turn off MMU support on a platform that depends on having that, we fall back to the default platform (versatile?). The same may happen when you build for a single board and one of it's dependencies goes away.

Arnd

#16 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 11 lines · Arnd Bergmann
Quoted 6 lines · Nicolas Pitre
Quoted 2 lines

If we decide that building an allnoconfig without any platform is actually ok, we could just as well rip out that error statement.

Is it expected for allnoconfig kernels to still boot on other architectures? If so I think we should try to still provide a valid config even in the allnoconfig case.

The practical use of a kernel without any device drivers or file systems is pretty low, I would not expect such a kernel to be any useful.

I didn't say "useful". But at least "booting" e.g. to print out a kernel oops because no root filesystem is available or the like should be a minimum. Having the wrong platform configured in might prevent even that from working, but at least we shouldn't allow for a kernel config that we know in advance has no chance of ever executing anywhere.

Nicolas

#17 lore raw

PATCH 1/1 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM

Quoted 14 lines · Nicolas Pitre
Quoted 11 lines · Arnd Bergmann
Quoted 6 lines · Nicolas Pitre
Quoted 2 lines

If we decide that building an allnoconfig without any platform is actually ok, we could just as well rip out that error statement.

Is it expected for allnoconfig kernels to still boot on other architectures? If so I think we should try to still provide a valid config even in the allnoconfig case.

The practical use of a kernel without any device drivers or file systems is pretty low, I would not expect such a kernel to be any useful.

Quoted 5 lines

I didn't say "useful". But at least "booting" e.g. to print out a kernel oops because no root filesystem is available or the like should be a minimum. Having the wrong platform configured in might prevent even that from working, but at least we shouldn't allow for a kernel config that we know in advance has no chance of ever executing anywhere.

x86 allows you disable support for all the CPU types at the same time, although the default is to not give you the option and enable them all together, which means that allnoconfig may still boot, but randconfig may not. That is probably a reasonable compromise.

Maybe we could have the virtual platform as the default but make it invisible if CONFIG_EXPERT is disable. That would also make allnoconfig be reasonable. Thinking a bit more about the CPU setting for the virtual platform, I guess it actually makes sense to let the user build this for any CPU: It makes a very nice minimal kernel for running in qemu and easily allows you to test a rootfs that was built for an arbitrary CPU without having to support a specific SoC in qemu.

Arnd