From ca1a18368d764f9b29ab0c79b3ddd712f5511855 Mon Sep 17 00:00:00 2001 From: Colton Lewis Date: Fri, 23 Aug 2024 17:58:35 +0000 Subject: KVM: arm64: selftests: Ensure pending interrupts are handled in arch_timer test Break up the asm instructions poking daifclr and daifset to handle interrupts. R_RBZYL specifies pending interrupts will be handle after context synchronization events such as an ISB. Introduce a function wrapper for the WFI instruction. Signed-off-by: Colton Lewis Link: https://lore.kernel.org/r/20240823175836.2798235-2-coltonlewis@google.com Signed-off-by: Marc Zyngier --- tools/testing/selftests/kvm/lib/aarch64/processor.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/testing/selftests/kvm/lib/aarch64/processor.c') diff --git a/tools/testing/selftests/kvm/lib/aarch64/processor.c b/tools/testing/selftests/kvm/lib/aarch64/processor.c index 0ac7cc89f38c..fe4dc3693112 100644 --- a/tools/testing/selftests/kvm/lib/aarch64/processor.c +++ b/tools/testing/selftests/kvm/lib/aarch64/processor.c @@ -639,3 +639,9 @@ void vm_vaddr_populate_bitmap(struct kvm_vm *vm) sparsebit_set_num(vm->vpages_valid, 0, (1ULL << vm->va_bits) >> vm->page_shift); } + +/* Helper to call wfi instruction. */ +void wfi(void) +{ + asm volatile("wfi"); +} -- cgit v1.2.3