OSDN Git Service

KVM: selftests: Add exception handling support for aarch64
authorRicardo Koller <ricarkol@google.com>
Fri, 11 Jun 2021 01:10:19 +0000 (18:10 -0700)
committerMarc Zyngier <maz@kernel.org>
Mon, 14 Jun 2021 08:06:23 +0000 (09:06 +0100)
commite3db7579ef355a0b2bfef4448b84d9ac882c8f2c
treeb8b0354b427585812cd2182cf7d788442b657988
parent67f709f52bf0b5c19f24d1234163123cbb6af545
KVM: selftests: Add exception handling support for aarch64

Add the infrastructure needed to enable exception handling in aarch64
selftests. The exception handling defaults to an unhandled-exception
handler which aborts the test, just like x86. These handlers can be
overridden by calling vm_install_exception_handler(vector) or
vm_install_sync_handler(vector, ec). The unhandled exception reporting
from the guest is done using the ucall type introduced in a previous
commit, UCALL_UNHANDLED.

The exception handling code is inspired on kvm-unit-tests.

Signed-off-by: Ricardo Koller <ricarkol@google.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210611011020.3420067-6-ricarkol@google.com
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/aarch64/processor.h
tools/testing/selftests/kvm/lib/aarch64/handlers.S [new file with mode: 0644]
tools/testing/selftests/kvm/lib/aarch64/processor.c