diff options
author | Tamir Duberstein <tamird@gmail.com> | 2024-11-02 15:09:49 +0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2025-01-15 00:56:56 +0300 |
commit | 220374e70b0b9d44ab5ec1106bc16caf20f94d80 (patch) | |
tree | ea902cfeb086a810e66fdd9a91704fa56cd6dc30 /tools/testing/kunit/kunit_kernel.py | |
parent | 56530007cac0630140a0846dd6110d60105a58ac (diff) | |
download | linux-220374e70b0b9d44ab5ec1106bc16caf20f94d80.tar.xz |
kunit: enable hardware acceleration when available
Use KVM or HVF if supported by the QEMU binary and available on the
system.
This produces a nice improvement on my Apple M3 Pro running macOS 14.7:
Before:
./tools/testing/kunit/kunit.py exec --arch arm64
[HH:MM:SS] Elapsed time: 10.145s
After:
./tools/testing/kunit/kunit.py exec --arch arm64
[HH:MM:SS] Elapsed time: 1.773s
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/kunit/kunit_kernel.py')
-rw-r--r-- | tools/testing/kunit/kunit_kernel.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py index e76d7894b6c5..d30f90eae9a4 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -125,6 +125,9 @@ class LinuxSourceTreeOperationsQemu(LinuxSourceTreeOperations): '-append', ' '.join(params + [self._kernel_command_line]), '-no-reboot', '-nographic', + '-accel', 'kvm', + '-accel', 'hvf', + '-accel', 'tcg', '-serial', self._serial] + self._extra_qemu_params # Note: shlex.join() does what we want, but requires python 3.8+. print('Running tests with:\n$', ' '.join(shlex.quote(arg) for arg in qemu_command)) |