Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] kvm-unit-tests: pass the --processor configure argument
@ 2016-11-20 13:50 Arnout Vandecappelle
  2016-11-20 13:50 ` [Buildroot] [PATCH 2/2] kvm-unit-tests: only enable for ARM on Cortex-A7 and A15 Arnout Vandecappelle
  2016-11-20 14:49 ` [Buildroot] [PATCH 1/2] kvm-unit-tests: pass the --processor configure argument Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2016-11-20 13:50 UTC (permalink / raw)
  To: buildroot

The configure script uses this to set the -mcpu option. If nothing is
passed, it defaults to -mcpu=cortex-a15 for arm, and -mcpu=cortex-a57
for aarch64, which may conflict with the actual architecture.

The --processor option is only really used for arm and aarch64, but it
doesn't hurt to also pass it for the other arches.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/kvm-unit-tests/kvm-unit-tests.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/kvm-unit-tests/kvm-unit-tests.mk b/package/kvm-unit-tests/kvm-unit-tests.mk
index 6e1c2df..0ddb017 100644
--- a/package/kvm-unit-tests/kvm-unit-tests.mk
+++ b/package/kvm-unit-tests/kvm-unit-tests.mk
@@ -28,6 +28,7 @@ endif
 
 KVM_UNIT_TESTS_CONF_OPTS =\
 	--arch="$(KVM_UNIT_TESTS_ARCH)" \
+	--processor="$(call qstrip,$(BR2_GCC_TARGET_CPU))" \
 	--endian="$(KVM_UNIT_TESTS_ENDIAN)"
 
 # For all architectures but x86-64, we use the target
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] kvm-unit-tests: only enable for ARM on Cortex-A7 and A15
  2016-11-20 13:50 [Buildroot] [PATCH 1/2] kvm-unit-tests: pass the --processor configure argument Arnout Vandecappelle
@ 2016-11-20 13:50 ` Arnout Vandecappelle
  2016-11-20 14:50   ` Thomas Petazzoni
  2016-11-20 14:49 ` [Buildroot] [PATCH 1/2] kvm-unit-tests: pass the --processor configure argument Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2016-11-20 13:50 UTC (permalink / raw)
  To: buildroot

The library uses the hypervisor instruction HVC, which is only
available on ARMv7-A with Hypervisor extensions. According to [1],
this is limited to Cortex-A7 and A15.

In addition the build unconditionally passes -marm so it also needs
ARM instructions to be available, but that is already implied by
the CPU selection.

Implicitly fixes
http://autobuild.buildroot.net/results/53d109fd9055fd20387bb857aced5f89cf3086fd
though it is still not clear why ld doesn't accept the -Ttext=...
option there.

[1] https://en.wikipedia.org/wiki/Comparison_of_ARMv7-A_cores

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/kvm-unit-tests/Config.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in
index f704a8e..a25495a 100644
--- a/package/kvm-unit-tests/Config.in
+++ b/package/kvm-unit-tests/Config.in
@@ -4,7 +4,8 @@ config BR2_PACKAGE_KVM_UNIT_TESTS
 	# 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)
-	depends on BR2_arm || \
+	# On ARM, it uses virtualization extensions
+	depends on (BR2_arm && (BR2_cortex_a7 || BR2_cortex_a15)) || \
 		(BR2_i386 && BR2_TOOLCHAIN_GCC_AT_LEAST_4_5) || \
 		BR2_powerpc64 || \
 		BR2_powerpc64le || \
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] kvm-unit-tests: pass the --processor configure argument
  2016-11-20 13:50 [Buildroot] [PATCH 1/2] kvm-unit-tests: pass the --processor configure argument Arnout Vandecappelle
  2016-11-20 13:50 ` [Buildroot] [PATCH 2/2] kvm-unit-tests: only enable for ARM on Cortex-A7 and A15 Arnout Vandecappelle
@ 2016-11-20 14:49 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-11-20 14:49 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 20 Nov 2016 14:50:05 +0100, Arnout Vandecappelle
(Essensium/Mind) wrote:
> The configure script uses this to set the -mcpu option. If nothing is
> passed, it defaults to -mcpu=cortex-a15 for arm, and -mcpu=cortex-a57
> for aarch64, which may conflict with the actual architecture.
> 
> The --processor option is only really used for arm and aarch64, but it
> doesn't hurt to also pass it for the other arches.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  package/kvm-unit-tests/kvm-unit-tests.mk | 1 +
>  1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] kvm-unit-tests: only enable for ARM on Cortex-A7 and A15
  2016-11-20 13:50 ` [Buildroot] [PATCH 2/2] kvm-unit-tests: only enable for ARM on Cortex-A7 and A15 Arnout Vandecappelle
@ 2016-11-20 14:50   ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-11-20 14:50 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 20 Nov 2016 14:50:06 +0100, Arnout Vandecappelle
(Essensium/Mind) wrote:
> The library uses the hypervisor instruction HVC, which is only
> available on ARMv7-A with Hypervisor extensions. According to [1],
> this is limited to Cortex-A7 and A15.
> 
> In addition the build unconditionally passes -marm so it also needs
> ARM instructions to be available, but that is already implied by
> the CPU selection.
> 
> Implicitly fixes
> http://autobuild.buildroot.net/results/53d109fd9055fd20387bb857aced5f89cf3086fd
> though it is still not clear why ld doesn't accept the -Ttext=...
> option there.
> 
> [1] https://en.wikipedia.org/wiki/Comparison_of_ARMv7-A_cores
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  package/kvm-unit-tests/Config.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

I've applied to master, but after adding A12 and A17 in the list of
supported cores. Indeed, your [1] reference is incomplete, and A12 and
A17 do have the hardware virtualization extensions, see:

  https://en.wikipedia.org/wiki/ARM_Cortex-A12
  https://en.wikipedia.org/wiki/ARM_Cortex-A17

I've also dropped the BR2_arm part of the condition: depending on
BR2_cortex_a7 || BR2_cortex_a12 || ... is sufficient.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-20 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-20 13:50 [Buildroot] [PATCH 1/2] kvm-unit-tests: pass the --processor configure argument Arnout Vandecappelle
2016-11-20 13:50 ` [Buildroot] [PATCH 2/2] kvm-unit-tests: only enable for ARM on Cortex-A7 and A15 Arnout Vandecappelle
2016-11-20 14:50   ` Thomas Petazzoni
2016-11-20 14:49 ` [Buildroot] [PATCH 1/2] kvm-unit-tests: pass the --processor configure argument Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox