From f1e9317c0c41f838703961829e9c8a08f2d46444 Mon Sep 17 00:00:00 2001 From: Ivan Velickovic Date: Fri, 16 Feb 2024 17:59:51 +1100 Subject: [PATCH] Add ARM vCPU inject IRQ test This patch aims to test the scenario where we inject an IRQ on a vCPU that does not have a TCB associated with it. Currently this results in the kernel crashing inside invokeVCPUInjectIRQ. This test aims to confirm that the eventual fix to the kernel is correct. Signed-off-by: Ivan Velickovic --- apps/sel4test-tests/src/tests/vcpu.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 apps/sel4test-tests/src/tests/vcpu.c diff --git a/apps/sel4test-tests/src/tests/vcpu.c b/apps/sel4test-tests/src/tests/vcpu.c new file mode 100644 index 00000000..2ee4781b --- /dev/null +++ b/apps/sel4test-tests/src/tests/vcpu.c @@ -0,0 +1,26 @@ +/* + * Copyright 2023 + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* This file contains tests related to vCPU syscalls. */ + +#include +#include +#include +#include + +#include "../helpers.h" + +#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT +int test_vcpu_inject_without_tcb(env_t env) +{ + vka_object_t vcpu; + int error = vka_alloc_vcpu(&env->vka, &vcpu); + + error = seL4_ARM_VCPU_InjectIRQ(vcpu.cptr, 0, 0, 0, 0); + // TODO: check for error +} +DEFINE_TEST(VCPU0001, "Inject IRQ without TCB associated with vCPU", test_vcpu_inject_without_tcb, true) +#endif