arch/arm: introduce big.LITTLE configurations
cover arch/arm: introduce big.LITTLE configurations
Hello All!
This series adds four new CPU variants to the arm choice, to enable optimising for big.LITTLE CPUs.
We first fix the current values inthe first two patches, then introduce the actual new variants, and then make use of the sole packages that needs to know of them.
This has been only slightly tested by simply building the toolchains for the six possibilities:
- the four variants in arm mode (32-bit),
- the two armv8 variants in aarch64 mode (64-bit).
The variants were introduced in various versions of gcc, so we protect the internal gcc as well as the external toolchains accordingly.
Regards,
Yann E. MORIN.
The following changes since commit 644c024edeb7e20bd96ce4426aeca2cbcd74d9b9
syslinux: drop patch 0003, not needed after gnu-efi update (2017-07-04 18:45:26 +0200)
are available in the git repository at:
git://git.buildroot.org/~ymorin/git/buildroot.git
for you to fetch changes up to cdc5ada0fd19765aff9779fc109a26284c9320b6
package/kvm-unit-test: available for big.LITTLE arm cores too (2017-07-05 12:07:49 +0200)
----------------------------------------------------------------
Yann E. MORIN (5):
arch/arm: fix -mcpu default values for AArch64 arch/arm: fix defaults for AArch64 in 64-bit mode package/kvm-unit-tests: introduce _ARCH_SUPPORTS arch/arm: add big.LITTLE cpu variants package/kvm-unit-test: available for big.LITTLE arm cores too
arch/Config.in.arm | 50 ++++++++++++++++++---- package/gcc/Config.in.host | 5 ++- package/kvm-unit-tests/Config.in | 19 ++++---- .../Config.in | 2 + .../toolchain-external-codesourcery-arm/Config.in | 4 ++ 5 files changed, 62 insertions(+), 18 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/5 arch/arm: fix -mcpu default values for AArch64
For AArch64, +fp and +simd are the default, so they are totally useless.
Remove them.
--- arch/Config.in.arm | 6 ------ 1 file changed, 6 deletions(-)
arch/Config.in.arm +0 -6
@@ -535,14 +535,8 @@ config BR2_GCC_TARGET_CPU default "xscale" if BR2_xscale default "iwmmxt" if BR2_iwmmxt default "cortex-a53" if (BR2_cortex_a53 && !BR2_ARCH_IS_64) - default "cortex-a53+fp" if (BR2_cortex_a53 && BR2_ARCH_IS_64 && BR2_ARM_FPU_FP_ARMV8) - default "cortex-a53+fp+simd" if (BR2_cortex_a53 && BR2_ARCH_IS_64 && BR2_ARM_FPU_NEON_FP_ARMV8) default "cortex-a57" if (BR2_cortex_a57 && !BR2_ARCH_IS_64) - default "cortex-a57+fp" if (BR2_cortex_a57 && BR2_ARCH_IS_64 && BR2_ARM_FPU_FP_ARMV8) - default "cortex-a57+fp+simd" if (BR2_cortex_a57 && BR2_ARCH_IS_64 && BR2_ARM_FPU_NEON_FP_ARMV8) default "cortex-a72" if (BR2_cortex_a72 && !BR2_ARCH_IS_64) - default "cortex-a72+fp" if (BR2_cortex_a72 && BR2_ARCH_IS_64 && BR2_ARM_FPU_FP_ARMV8) - default "cortex-a72+fp+simd" if (BR2_cortex_a72 && BR2_ARCH_IS_64 && BR2_ARM_FPU_NEON_FP_ARMV8) config BR2_GCC_TARGET_ABI default "aapcs-linux" if BR2_arm || BR2_armeb
Signature · 1 line
2.11.0
PATCH 2/5 arch/arm: fix defaults for AArch64 in 64-bit mode
In reply to Yann E. MORINEven in 64-bit mode we have to specify the -mcpu value.
--- arch/Config.in.arm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/Config.in.arm +3 -3
@@ -534,9 +534,9 @@ config BR2_GCC_TARGET_CPU default "strongarm" if BR2_strongarm default "xscale" if BR2_xscale default "iwmmxt" if BR2_iwmmxt - default "cortex-a53" if (BR2_cortex_a53 && !BR2_ARCH_IS_64) - default "cortex-a57" if (BR2_cortex_a57 && !BR2_ARCH_IS_64) - default "cortex-a72" if (BR2_cortex_a72 && !BR2_ARCH_IS_64) + default "cortex-a53" if (BR2_cortex_a53) + default "cortex-a57" if (BR2_cortex_a57) + default "cortex-a72" if (BR2_cortex_a72) config BR2_GCC_TARGET_ABI default "aapcs-linux" if BR2_arm || BR2_armeb
Signature · 1 line
2.11.0
PATCH 2/5 arch/arm: fix defaults for AArch64 in 64-bit mode
Hi Yann,
Quoted 13 lines · Yann E. MORIN
Even in 64-bit mode we have to specify the -mcpu value.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Thomas Petazzoni <[email protected]>--- arch/Config.in.arm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/Config.in.arm +0
-0
arch/Config.in.arm config BR2_GCC_TARGET_CPU · line 539
Quoted 9 lines
arch/Config.in.arm +3
-3@@ -534,9 +534,9 @@ config BR2_GCC_TARGET_CPU default "strongarm" if BR2_strongarm default "xscale" if BR2_xscale default "iwmmxt" if BR2_iwmmxt - default "cortex-a53" if (BR2_cortex_a53 && !BR2_ARCH_IS_64) - default "cortex-a57" if (BR2_cortex_a57 && !BR2_ARCH_IS_64) - default "cortex-a72" if (BR2_cortex_a72 && !BR2_ARCH_IS_64) + default "cortex-a53" if (BR2_cortex_a53) + default "cortex-a57" if (BR2_cortex_a57) + default "cortex-a72" if (BR2_cortex_a72)
What are the parentheses good for?
baruch
Quoted 3 lines
arch/Config.in.arm +0
-0config BR2_GCC_TARGET_ABI default "aapcs-linux" if BR2_arm || BR2_armeb
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH 2/5 arch/arm: fix defaults for AArch64 in 64-bit mode
Baruch, All,
On 2017-07-05 13:55 +0300, Baruch Siach spake thusly:
Quoted 9 lines · Yann E. MORIN
Quoted 8 lines
Even in 64-bit mode we have to specify the -mcpu value.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Thomas Petazzoni <[email protected]>--- arch/Config.in.arm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 16 lines
Quoted 5 lines
arch/Config.in.arm +0
-0arch/Config.in.arm config BR2_GCC_TARGET_CPU · line 539
Quoted 9 lines
arch/Config.in.arm +3
-3@@ -534,9 +534,9 @@ config BR2_GCC_TARGET_CPU default "strongarm" if BR2_strongarm default "xscale" if BR2_xscale default "iwmmxt" if BR2_iwmmxt - default "cortex-a53" if (BR2_cortex_a53 && !BR2_ARCH_IS_64) - default "cortex-a57" if (BR2_cortex_a57 && !BR2_ARCH_IS_64) - default "cortex-a72" if (BR2_cortex_a72 && !BR2_ARCH_IS_64) + default "cortex-a53" if (BR2_cortex_a53) + default "cortex-a57" if (BR2_cortex_a57) + default "cortex-a72" if (BR2_cortex_a72)What are the parentheses good for?
They are just so that the series is not applied on the first go. ;-)
Regards,
Yann E. MORIN.
Quoted 10 lines
baruch
Quoted 3 lines
arch/Config.in.arm +0
-0config BR2_GCC_TARGET_ABI default "aapcs-linux" if BR2_arm || BR2_armebSignature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 3/5 package/kvm-unit-tests: introduce _ARCH_SUPPORTS
In reply to Yann E. MORINMove all architecture options to their own symbol, so that it is easier to add more variants in the future.
--- package/kvm-unit-tests/Config.in | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
package/kvm-unit-tests/Config.in +10 -8
@@ -1,15 +1,17 @@ -config BR2_PACKAGE_KVM_UNIT_TESTS - bool "kvm-unit-tests" +config BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS + bool + default y if BR2_cortex_a7 || BR2_cortex_a12 || \ + BR2_cortex_a15 || BR2_cortex_a17 + default y if BR2_powerpc64 || BR2_powerpc64le # on i386 and x86-64, __builtin_reachable is used, so we need # gcc 4.5 at least. on i386, we use the target gcc, while on # x86-64 we use the host gcc (see .mk file for details) # On ARM, it uses virtualization extensions - depends on BR2_cortex_a7 || BR2_cortex_a12 || \ - BR2_cortex_a15 || BR2_cortex_a17 || \ - (BR2_i386 && BR2_TOOLCHAIN_GCC_AT_LEAST_4_5) || \ - BR2_powerpc64 || \ - BR2_powerpc64le || \ - (BR2_x86_64 && BR2_HOST_GCC_AT_LEAST_4_5) + default y if (BR2_i386 || BR2_x86_64) && BR2_TOOLCHAIN_GCC_AT_LEAST_4_5 + +config BR2_PACKAGE_KVM_UNIT_TESTS + bool "kvm-unit-tests" + depends on BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_x86_64=y help kvm-unit-tests is a project as old as KVM. As its name
Signature · 1 line
2.11.0
PATCH 4/5 arch/arm: add big.LITTLE cpu variants
In reply to Yann E. MORINThe big.LITTLE configurations can be optimised for by gcc, and a few users wonder what they should choose when they have such CPUs.
Add new entries for those big.LITTLE configurations.
--- arch/Config.in.arm | 38 ++++++++++++++++++++++ package/gcc/Config.in.host | 5 ++- .../Config.in | 2 ++ .../toolchain-external-codesourcery-arm/Config.in | 4 +++ 4 files changed, 48 insertions(+), 1 deletion(-)
arch/Config.in.arm +38 -0
@@ -182,6 +182,15 @@ config BR2_cortex_a15 select BR2_ARM_CPU_ARMV7A select BR2_ARCH_HAS_MMU_OPTIONAL depends on !BR2_ARCH_IS_64 +config BR2_cortex_a15_a7 + bool "cortex-A15/A7 big.LITTLE" + select BR2_ARM_CPU_HAS_ARM + select BR2_ARM_CPU_HAS_NEON + select BR2_ARM_CPU_HAS_VFPV4 + select BR2_ARM_CPU_HAS_THUMB2 + select BR2_ARM_CPU_ARMV7A + select BR2_ARCH_HAS_MMU_OPTIONAL + depends on !BR2_ARCH_IS_64 config BR2_cortex_a17 bool "cortex-A17" select BR2_ARM_CPU_HAS_ARM
@@ -191,6 +200,15 @@ config BR2_cortex_a17 select BR2_ARM_CPU_ARMV7A select BR2_ARCH_HAS_MMU_OPTIONAL depends on !BR2_ARCH_IS_64 +config BR2_cortex_a17_a7 + bool "cortex-A17/A7 big.LITTLE" + select BR2_ARM_CPU_HAS_ARM + select BR2_ARM_CPU_HAS_NEON + select BR2_ARM_CPU_HAS_VFPV4 + select BR2_ARM_CPU_HAS_THUMB2 + select BR2_ARM_CPU_ARMV7A + select BR2_ARCH_HAS_MMU_OPTIONAL + depends on !BR2_ARCH_IS_64 config BR2_cortex_a53 bool "cortex-A53" select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
@@ -207,6 +225,14 @@ config BR2_cortex_a57 select BR2_ARM_CPU_HAS_FP_ARMV8 select BR2_ARM_CPU_ARMV8 select BR2_ARCH_HAS_MMU_OPTIONAL +config BR2_cortex_a57_a53 + bool "cortex-A57/A53 big.LITTLE" + select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64 + select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64 + select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64 + select BR2_ARM_CPU_HAS_FP_ARMV8 + select BR2_ARM_CPU_ARMV8 + select BR2_ARCH_HAS_MMU_OPTIONAL config BR2_cortex_a72 bool "cortex-A72" select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
@@ -215,6 +241,14 @@ config BR2_cortex_a72 select BR2_ARM_CPU_HAS_FP_ARMV8 select BR2_ARM_CPU_ARMV8 select BR2_ARCH_HAS_MMU_OPTIONAL +config BR2_cortex_a72_a53 + bool "cortex-A72/A53 big.LITTLE" + select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64 + select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64 + select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64 + select BR2_ARM_CPU_HAS_FP_ARMV8 + select BR2_ARM_CPU_ARMV8 + select BR2_ARCH_HAS_MMU_OPTIONAL config BR2_cortex_m3 bool "cortex-M3" select BR2_ARM_CPU_HAS_THUMB2
@@ -526,7 +560,9 @@ config BR2_GCC_TARGET_CPU default "cortex-a9" if BR2_cortex_a9 default "cortex-a12" if BR2_cortex_a12 default "cortex-a15" if BR2_cortex_a15 + default "cortex-a15.cortex-a7" if BR2_cortex_a15_a7 default "cortex-a17" if BR2_cortex_a17 + default "cortex-a17.cortex-a7" if BR2_cortex_a17_a7 default "cortex-m3" if BR2_cortex_m3 default "cortex-m4" if BR2_cortex_m4 default "fa526" if BR2_fa526
@@ -536,7 +572,9 @@ config BR2_GCC_TARGET_CPU default "iwmmxt" if BR2_iwmmxt default "cortex-a53" if (BR2_cortex_a53) default "cortex-a57" if (BR2_cortex_a57) + default "cortex-a57.cortex-a53" if (BR2_cortex_a57_a53) default "cortex-a72" if (BR2_cortex_a72) + default "cortex-a72.cortex-a53" if (BR2_cortex_a72_a53) config BR2_GCC_TARGET_ABI default "aapcs-linux" if BR2_arm || BR2_armeb
package/gcc/Config.in.host +4 -1
@@ -25,7 +25,8 @@ config BR2_GCC_VERSION_4_9_X # Broken or unsupported architectures depends on !BR2_arc && !BR2_bfin && !BR2_or1k # Broken or unsupported ARM cores - depends on !BR2_cortex_a17 && !BR2_cortex_a72 + depends on !BR2_cortex_a17 && !BR2_cortex_a17_a7 + depends on !BR2_cortex_a72 && !BR2_cortex_a72_a53 # Unsupported MIPS cores depends on !BR2_mips_interaptiv # Unsupported for MIPS R5
@@ -45,6 +46,8 @@ config BR2_GCC_VERSION_5_X bool "gcc 5.x" # Broken or unsupported architectures depends on !BR2_arc && !BR2_bfin && !BR2_or1k + # Broken or unsupported ARM cores + depends on !BR2_cortex_a57_a53 && !BR2_cortex_a72_a53 # musl ppc64 unsupported depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_powerpc64 || BR2_powerpc64le)) # Unsupported MIPS cores
toolchain/toolchain-external/toolchain-external-codesourcery-aarch64/Config.in +2 -0
@@ -1,6 +1,8 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64 bool "CodeSourcery AArch64 2014.11" depends on BR2_aarch64 + # a57/a53 and a72/a53 appeared in gcc-6 or were broken before + depends on !BR2_cortex_a57_a53 && !BR2_cortex_a72_a53 depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" depends on !BR2_STATIC_LIBS select BR2_TOOLCHAIN_EXTERNAL_GLIBC
toolchain/toolchain-external/toolchain-external-codesourcery-arm/Config.in +4 -0
@@ -1,6 +1,10 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM bool "Sourcery CodeBench ARM 2014.05" depends on BR2_arm + # a15/a7 appeared in gcc-4.9, a17/a7 in gcc-5, a57/a53 and a72/a53 + # in gcc-6, or they were broken earlier than that. + depends on !BR2_cortex_a15_a7 && !BR2_cortex_a17_a7 + depends on !BR2_cortex_a57_53 && !BR2_cortex_a72_53 depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" depends on BR2_ARM_EABI # Unsupported ARM cores
Signature · 1 line
2.11.0
PATCH 5/5 package/kvm-unit-test: available for big.LITTLE arm cores too
In reply to Yann E. MORINSince it supports each variants individually, it should also supports the big.LITTLE configurations.
--- package/kvm-unit-tests/Config.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/kvm-unit-tests/Config.in +2 -1
@@ -1,7 +1,8 @@ config BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS bool default y if BR2_cortex_a7 || BR2_cortex_a12 || \ - BR2_cortex_a15 || BR2_cortex_a17 + BR2_cortex_a15 || BR2_cortex_a17 || \ + BR2_cortex_a15_a7 || BR2_cortex_a17_a7 default y if BR2_powerpc64 || BR2_powerpc64le # on i386 and x86-64, __builtin_reachable is used, so we need # gcc 4.5 at least. on i386, we use the target gcc, while on
Signature · 1 line
2.11.0