summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/lib/aarch64/processor.c
diff options
context:
space:
mode:
authorColton Lewis <coltonlewis@google.com>2024-08-23 17:58:35 +0000
committerMarc Zyngier <maz@kernel.org>2024-08-30 09:03:45 +0100
commitca1a18368d764f9b29ab0c79b3ddd712f5511855 (patch)
tree695b712f3d6e9567f01a69bf51f32dcc41f8130a /tools/testing/selftests/kvm/lib/aarch64/processor.c
parent8400291e289ee6b2bf9779ff1c83a291501f017b (diff)
downloadlinux-next-ca1a18368d764f9b29ab0c79b3ddd712f5511855.tar.gz
linux-next-ca1a18368d764f9b29ab0c79b3ddd712f5511855.zip
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 <coltonlewis@google.com> Link: https://lore.kernel.org/r/20240823175836.2798235-2-coltonlewis@google.com Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/aarch64/processor.c')
-rw-r--r--tools/testing/selftests/kvm/lib/aarch64/processor.c6
1 files changed, 6 insertions, 0 deletions
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");
+}