On 10/9/2026 12:25 PM, Brian Cain wrote:
> Add the lock_verify test case to verify the k0/tlblock behavior, add the
> minivm tests to cover start() and more.
> 
> Signed-off-by: Brian Cain <[email protected]>
> ---
>  tests/functional/hexagon/meson.build      |  1 +
>  tests/functional/hexagon/test_minivm.py   | 43 +++++++++++++++++++++++
>  tests/functional/hexagon/test_systests.py |  3 ++
>  3 files changed, 47 insertions(+)
>  create mode 100755 tests/functional/hexagon/test_minivm.py
> 
> diff --git a/tests/functional/hexagon/meson.build 
> b/tests/functional/hexagon/meson.build
> index 44053e64676..e182bc98a06 100644
> --- a/tests/functional/hexagon/meson.build
> +++ b/tests/functional/hexagon/meson.build
> @@ -3,6 +3,7 @@
>  tests_hexagon_system_thorough = [
>    'arch_tests',
>    'systests',
> +  'minivm',
>  ]
>  
>  test_hexagon_timeouts = {
> diff --git a/tests/functional/hexagon/test_minivm.py 
> b/tests/functional/hexagon/test_minivm.py
> new file mode 100755
> index 00000000000..a70edbcc987
> --- /dev/null
> +++ b/tests/functional/hexagon/test_minivm.py
> @@ -0,0 +1,43 @@
> +#!/usr/bin/env python3
> +#
> +# Copyright(c) 2024-2025 Qualcomm Innovation Center, Inc. All Rights 
> Reserved.
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +from qemu_test import QemuSystemTest, Asset, skipBigDataTest
> +
> +class MiniVMTest(QemuSystemTest):
> +    '''
> +    minivm is a Hexagon hypervisor that implements the Hexagon VM
> +    specification.  These test cases boot minivm and then load test cases
> +    to the address specified by MiniVMTest.GUEST_ENTRY and
> +    execute a minvm-guest program to exercise minivm virtualization
> +    features.
> +    '''
> +    timeout = 180
> +    GUEST_ENTRY = 0xc0000000
> +    REPO = 'https://artifacts.codelinaro.org/artifactory'
> +    ASSET_TARBALL = \
> +        Asset(f'{REPO}/codelinaro-toolchain-for-hexagon/'
> +               '19.1.5/hexagon_minivm_2024_Dec_15.tar.gz',
> +        'd7920b5ff14bed5a10b23ada7d4eb927ede08635281f25067e0d5711feee2c2a')
> +
> +    @skipBigDataTest()
> +    def test_minivm(self):
> +        self.set_machine('sim')
> +        self.archive_extract(self.ASSET_TARBALL)
> +        rootfs_path = self.scratch_file('hexagon-unknown-linux-musl-rootfs')
> +        kernel_path = f'{rootfs_path}/boot/minivm'
> +
> +        for test_case in ('test_mmu', 'test_interrupts', 'test_processors'):
> +            with self.subTest(test_case=test_case):
> +                vm = self.get_vm(name=test_case)
> +                vm.add_args('-kernel', kernel_path, '-device',
> +                            f'loader,addr={hex(self.GUEST_ENTRY)},'
> +                            f'file={rootfs_path}/boot/{test_case}')
> +                vm.launch()
> +                vm.wait()
> +                self.assertEqual(vm.exitcode(), 0)
> +

In case we decide to extend that with many other sub testcases, it could
be useful to define real sub tests. Just a suggestion though, it's not
necessary for the only 3 tests we have at the moment.

Reviewed-by: Pierrick Bouvier <[email protected]>

Regards,
Pierrick

Reply via email to