Skip to content

Commit

Permalink
Add ARM vCPU inject IRQ test
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Ivan-Velickovic authored and lsf37 committed Feb 21, 2024
1 parent eb1b944 commit 9ff0911
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions apps/sel4test-tests/src/tests/vcpu.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2024, UNSW
*
* SPDX-License-Identifier: BSD-2-Clause
*/

/* This file contains tests related to vCPU syscalls. */

#include <sel4/sel4.h>

#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);
assert(!error);

error = seL4_ARM_VCPU_InjectIRQ(vcpu.cptr, 0, 0, 0, 0);
test_eq(error, seL4_NoError);

return sel4test_get_result();
}
DEFINE_TEST(VCPU0001, "Inject IRQ without TCB associated with vCPU", test_vcpu_inject_without_tcb, true)
#endif

0 comments on commit 9ff0911

Please sign in to comment.