configure: arm: Fixes to build and run tests on Apple Silicon
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
@@ -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
@@ -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)
Andrew Jones
AppliedQuoted 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.
Signed-off-by Nikos Nikoleris <[email protected]>--- arm/run | 3 +++ configure | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)arm/run +3
-0@@ -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" ]; thenconfigure +1
-1@@ -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
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.
Signed-off-by Nikos Nikoleris <[email protected]>--- arm/run | 3 +++ configure | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)arm/run +3
-0@@ -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" ]; thenconfigure +1
-1@@ -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
-0host=$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