Message ID | 20151124200730.GA25963@codeaurora.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Nov 24, 2015 at 12:07:30PM -0800, Stephen Boyd wrote: > Ok. Presumably the order of arch-$(CONFIG) lines in the Makefile > are done in an order to allow the build to degrade to the lowest > common denominator among architecture support. Correct. Make processes the directives in the order listed in the makefile, which means that a variable final value results from its last assignment. > CPU_V7 selects > CPU_32v7 and we're using that config to select -march=armv7-a in > the Makefile. The patch currently uses CPU_32v7VE to select > -march=armv7ve. If CPU_V7VE selects CPU_V7 we'll never be able to > use -march=armv7ve because CPU_V7 will be selecting CPU_32v7 and > that will come after CPU_32v7VE in the Makefile. Right, but look at how the V6K stuff is handled: arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) # Only override the compiler option if ARMv6. The ARMv6K extensions are # always available in ARMv7 ifeq ($(CONFIG_CPU_32v6),y) arch-$(CONFIG_CPU_32v6K) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k) endif We'd need to do something similar for v7VE as well. As we're getting more of this, I'd suggest we move to: arch-v7a-y =$(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a) arch-v7a-$(CONFIG_CPU_32v7VE) =... whatever it was... arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(arch-v7a-y) arch-v6-y =$(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) arch-v6-$(CONFIG_CPU_32v6K) =$(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k) arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(arch-v6-y) > My understanding is that we want to support CPU_V7VE without > CPU_V7 enabled so that it uses the idiv instructions in that > configuration. When V7VE and V7 are both enabled, we should > degrade to the aeabi functions, and the same is true for when > V7VE is disabled. Let me have another look at this, it's been a while since I touched these options...
On Tuesday 24 November 2015 20:35:16 Russell King - ARM Linux wrote: > We'd need to do something similar for v7VE as well. As we're getting > more of this, I'd suggest we move to: > > arch-v7a-y =$(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a) > arch-v7a-$(CONFIG_CPU_32v7VE) =... whatever it was... > arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(arch-v7a-y) > arch-v6-y =$(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) > arch-v6-$(CONFIG_CPU_32v6K) =$(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k) > arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(arch-v6-y) I would argue that V7VE is different from V6K here: The instructions that are added in V6K compared to V6 are not generated by gcc but are typically used in assembly like static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size) { ... #ifndef CONFIG_CPU_V6 asm volatile(...); /* v6k specific instruction */ #endif } while the logic in your example above would break normal v7 support when both V7 and V7VE are enabled. > > My understanding is that we want to support CPU_V7VE without > > CPU_V7 enabled so that it uses the idiv instructions in that > > configuration. When V7VE and V7 are both enabled, we should > > degrade to the aeabi functions, and the same is true for when > > V7VE is disabled. > > Let me have another look at this, it's been a while since I touched these > options... There is one idea that I've had in the back of my mind for a long while, and probably mentioned on the list before: We could decide to simplify the CPU architecture selection for multiplatform a lot if we turn the somewhat overengineered ARCH_MULTI_* options into a choice statement, where each of them implies the higher architecture levels. That way we can linearize ARMv6/v6k/v7/v7VE/v8/v8.1 so that you just pick which platforms you want to see by selecting the minimum level, and all higher ones will automatically be available (for v8 and v8.1 that means just MACH_VIRT, as we don't really want to run 32-bit kernels on bare metal v8-A machines). That way, we can have LPAE and -march=armv7ve support depend on CONFIG_ARCH_MULTI_V7VE, which would imply that we don't support CPU_V7 based platforms. Arnd
On 11/24, Russell King - ARM Linux wrote: > On Tue, Nov 24, 2015 at 12:07:30PM -0800, Stephen Boyd wrote: > > > My understanding is that we want to support CPU_V7VE without > > CPU_V7 enabled so that it uses the idiv instructions in that > > configuration. When V7VE and V7 are both enabled, we should > > degrade to the aeabi functions, and the same is true for when > > V7VE is disabled. > > Let me have another look at this, it's been a while since I touched these > options... > Any ideas on how to move forward on this? I don't have a problem removing the duplication, but I'm not sure what else can be done.
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ccd0d5553d38..158ffb983387 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -626,7 +626,7 @@ config ARCH_SHMOBILE_LEGACY select ARCH_SHMOBILE select ARM_PATCH_PHYS_VIRT if MMU select CLKDEV_LOOKUP - select CPU_V7 + select CPU_V7_NOEXT select GENERIC_CLOCKEVENTS select HAVE_ARM_SCU if SMP select HAVE_ARM_TWD if SMP @@ -802,7 +802,7 @@ config ARCH_MULTI_V7 bool "ARMv7 based platforms (Cortex-A, PJ4, Scorpion, Krait)" default y select ARCH_MULTI_V6_V7 - select CPU_V7 + select CPU_V7_NOEXT select HAVE_SMP config ARCH_MULTI_V7VE diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig index 9ab8932403e5..7e1b36400e14 100644 --- a/arch/arm/mach-prima2/Kconfig +++ b/arch/arm/mach-prima2/Kconfig @@ -25,7 +25,7 @@ config ARCH_ATLAS7 bool "CSR SiRFSoC ATLAS7 ARM Cortex A7 Platform" default y select ARM_GIC - select CPU_V7 + select CPU_V7_NOEXT select HAVE_ARM_SCU if SMP select HAVE_SMP help diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig index 565925f37dc5..7e084c34071c 100644 --- a/arch/arm/mach-realview/Kconfig +++ b/arch/arm/mach-realview/Kconfig @@ -24,7 +24,7 @@ config MACH_REALVIEW_EB config REALVIEW_EB_A9MP bool "Support Multicore Cortex-A9 Tile" depends on MACH_REALVIEW_EB - select CPU_V7 + select CPU_V7_NOEXT select HAVE_ARM_SCU if SMP select HAVE_ARM_TWD if SMP select HAVE_SMP @@ -93,7 +93,7 @@ config REALVIEW_PB1176_SECURE_FLASH config MACH_REALVIEW_PBA8 bool "Support RealView(R) Platform Baseboard for Cortex(tm)-A8 platform" select ARM_GIC - select CPU_V7 + select CPU_V7_NOEXT select HAVE_PATA_PLATFORM help Include support for the ARM(R) RealView Platform Baseboard for diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index e4ff161da98f..02a887235155 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -350,11 +350,11 @@ config CPU_FEROCEON_OLD_ID config CPU_PJ4 bool select ARM_THUMBEE - select CPU_V7 + select CPU_V7_NOEXT config CPU_PJ4B bool - select CPU_V7 + select CPU_V7_NOEXT # ARMv6 config CPU_V6 @@ -383,11 +383,9 @@ config CPU_V6K select CPU_PABRT_V6 select CPU_TLB_V6 if MMU -# ARMv7 config CPU_V7 - bool "Support ARM V7 processor" if (!ARCH_MULTIPLATFORM || ARCH_MULTI_V7) && (ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX) + bool select CPU_32v6K - select CPU_32v7 select CPU_ABRT_EV7 select CPU_CACHE_V7 select CPU_CACHE_VIPT @@ -398,6 +396,12 @@ config CPU_V7 select CPU_PABRT_V7 select CPU_TLB_V7 if MMU +# ARMv7 +config CPU_V7_NOEXT + bool "Support ARM V7 processor" if (!ARCH_MULTIPLATFORM || ARCH_MULTI_V7) && (ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX) + select CPU_32v7 + select CPU_V7 + # ARMv7M config CPU_V7M bool @@ -410,17 +414,8 @@ config CPU_V7M # ARMv7ve config CPU_V7VE bool "Support ARM V7 processor w/ virtualization extensions" if (!ARCH_MULTIPLATFORM || ARCH_MULTI_V7VE) && (ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX) - select CPU_32v6K select CPU_32v7VE - select CPU_ABRT_EV7 - select CPU_CACHE_V7 - select CPU_CACHE_VIPT - select CPU_COPY_V6 if MMU - select CPU_CP15_MMU if MMU - select CPU_CP15_MPU if !MMU - select CPU_HAS_ASID if MMU - select CPU_PABRT_V7 - select CPU_TLB_V7 if MMU + select CPU_V7 config CPU_THUMBONLY bool