Skip to contentSkip to conversation

configure: arm: Fixes to build and run tests on Apple Silicon

PATCH Applied Nikos Nikoleris 2 participants 3 messages Feb 17, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: arm: Fixes to build and run tests on Apple Silicon

On MacOS:

$> uname -m

returns:

arm64

To unify how we handle the achitecture detection across different systems, sed it to aarch64 which is what's typically reported on Linux.

In addition, when HVF is the acceleration method on aarch64, make sure we select the right processor when invoking qemu.

---
 arm/run   | 3 +++
 configure | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
arm/run +3 -0
index 2153bd3..0629b69 100755
@@ -27,6 +27,9 @@ if [ "$ACCEL" = "kvm" ]; then
 	if $qemu $M,\? 2>&1 | grep gic-version > /dev/null; then
 		M+=',gic-version=host'
 	fi
+fi
+
+if [ "$ACCEL" = "kvm" ] || [ "$ACCEL" = "hvf" ]; then
 	if [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ]; then
 		processor="host"
 		if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then
configure +1 -1
index 2d9c3e0..ff840c1 100755
@@ -14,7 +14,7 @@ objcopy=objcopy
 objdump=objdump
 ar=ar
 addr2line=addr2line
-arch=$(uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/')
+arch=$(uname -m | sed -e 's/i.86/i386/;s/arm64/aarch64/;s/arm.*/arm/;s/ppc64.*/ppc64/')
 host=$arch
 cross_prefix=
 endian=""
Signature · 1 line
2.32.0 (Apple Git-132)
Applied
#1 lore raw
Quoted 10 lines · Nikos Nikoleris

On MacOS:

$> uname -m

returns:

arm64

To unify how we handle the achitecture detection across different systems, sed it to aarch64 which is what's typically reported on

Was "sed" a typo or a new verb for "sedding" stuff :-)

Quoted 41 lines

Linux.

In addition, when HVF is the acceleration method on aarch64, make sure we select the right processor when invoking qemu.

---
 arm/run   | 3 +++
 configure | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
arm/run +3 -0
index 2153bd3..0629b69 100755
@@ -27,6 +27,9 @@ if [ "$ACCEL" = "kvm" ]; then
 	if $qemu $M,\? 2>&1 | grep gic-version > /dev/null; then
 		M+=',gic-version=host'
 	fi
+fi
+
+if [ "$ACCEL" = "kvm" ] || [ "$ACCEL" = "hvf" ]; then
 	if [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ]; then
 		processor="host"
 		if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then
configure +1 -1
index 2d9c3e0..ff840c1 100755
@@ -14,7 +14,7 @@ objcopy=objcopy
 objdump=objdump
 ar=ar
 addr2line=addr2line
-arch=$(uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/')
+arch=$(uname -m | sed -e 's/i.86/i386/;s/arm64/aarch64/;s/arm.*/arm/;s/ppc64.*/ppc64/')
 host=$arch
 cross_prefix=
 endian=""
Signature · 1 line
2.32.0 (Apple Git-132)

So, with this, we've got kvm-unit-tests running on HVF now?

Applied to arm/queue

https://gitlab.com/rhdrjones/kvm-unit-tests/-/commits/arm/queue

Thanks,
drew

#2 lore raw
Quoted 5 lines · Andrew Jones
Quoted 4 lines · Nikos Nikoleris

On MacOS:

$> uname -m

Quoted 8 lines
Quoted 6 lines

returns:

arm64

To unify how we handle the achitecture detection across different systems, sed it to aarch64 which is what's typically reported on

Was "sed" a typo or a new verb for "sedding" stuff :-)

A much needed amendment to English :)

Quoted 36 lines
Quoted 36 lines

Linux.

In addition, when HVF is the acceleration method on aarch64, make sure we select the right processor when invoking qemu.

---
  arm/run   | 3 +++
  configure | 2 +-
  2 files changed, 4 insertions(+), 1 deletion(-)
arm/run +3 -0
index 2153bd3..0629b69 100755
@@ -27,6 +27,9 @@ if [ "$ACCEL" = "kvm" ]; then
  	if $qemu $M,\? 2>&1 | grep gic-version > /dev/null; then
  		M+=',gic-version=host'
  	fi
+fi
+
+if [ "$ACCEL" = "kvm" ] || [ "$ACCEL" = "hvf" ]; then
  	if [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ]; then
  		processor="host"
  		if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then
configure +1 -1
index 2d9c3e0..ff840c1 100755
@@ -14,7 +14,7 @@ objcopy=objcopy
  objdump=objdump
  ar=ar
  addr2line=addr2line
-arch=$(uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/')
+arch=$(uname -m | sed -e 's/i.86/i386/;s/arm64/aarch64/;s/arm.*/arm/;s/ppc64.*/ppc64/')
Quoted 9 lines
Quoted 6 lines
configure +0 -0
  host=$arch
  cross_prefix=
  endian=""
Signature · 1 line
2.32.0 (Apple Git-132)

So, with this, we've got kvm-unit-tests running on HVF now?

Just a step to get everything up and running. Not all tests pass, but I haven't had the time to understand what's supported with HVF and what's not:

PASS selftest-setup (2 tests)
FAIL selftest-vectors-kernel (timeout; duration=90s) PASS selftest-vectors-user (2 tests)
PASS selftest-smp (1 tests)
SKIP pci-test (KVM is needed, but not available on this host) SKIP pmu-cycle-counter (0 tests)
SKIP pmu-event-introspection (0 tests)
SKIP pmu-event-counter-config (0 tests)
SKIP pmu-basic-event-count (0 tests)
SKIP pmu-mem-access (0 tests)
SKIP pmu-sw-incr (0 tests)
SKIP pmu-chained-counters (0 tests)
SKIP pmu-chained-sw-incr (0 tests)
SKIP pmu-chain-promotion (0 tests)
SKIP pmu-overflow-interrupt (0 tests)
PASS gicv2-ipi (3 tests)
PASS gicv2-mmio (17 tests, 1 skipped)
FAIL gicv2-mmio-up (17 tests, 2 unexpected failures) FAIL gicv2-mmio-3p (17 tests, 3 unexpected failures) FAIL gicv3-ipi
PASS gicv2-active (1 tests)
FAIL gicv3-active
PASS its-introspection (5 tests)
FAIL its-trigger
SKIP its-migration
SKIP its-pending-migration
SKIP its-migrate-unmapped-collection
PASS psci (4 tests)
FAIL timer (10 tests, 1 unexpected failures)
SKIP micro-bench (test marked as manual run only) PASS cache (1 tests)
PASS debug-bp (6 tests)
SKIP debug-bp-migration
PASS debug-wp (8 tests)
SKIP debug-wp-migration
PASS debug-sstep (1 tests)
SKIP debug-sstep-migration

Quoted 4 lines

Applied to arm/queue

https://gitlab.com/rhdrjones/kvm-unit-tests/-/commits/arm/queue

Thanks for the review!

Nikos

Quoted 3 lines

Thanks,
drew