diff options
author | Oliver Upton <oupton@google.com> | 2022-04-09 21:45:46 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-05-03 23:30:20 +0300 |
commit | e918e2bc52c8ac1cccd6ef822ac23eded41761b6 (patch) | |
tree | 843d473fe466f7378747648b316defecba4c727d /tools/testing/selftests/kvm/steal_time.c | |
parent | bf08515d39cb843c81f991ee67ff543eecdba0c3 (diff) | |
download | linux-e918e2bc52c8ac1cccd6ef822ac23eded41761b6.tar.xz |
selftests: KVM: Create helper for making SMCCC calls
The PSCI and PV stolen time tests both need to make SMCCC calls within
the guest. Create a helper for making SMCCC calls and rework the
existing tests to use the library function.
Signed-off-by: Oliver Upton <oupton@google.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220409184549.1681189-11-oupton@google.com
Diffstat (limited to 'tools/testing/selftests/kvm/steal_time.c')
-rw-r--r-- | tools/testing/selftests/kvm/steal_time.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c index 62f2eb9ee3d5..8c4e811bd586 100644 --- a/tools/testing/selftests/kvm/steal_time.c +++ b/tools/testing/selftests/kvm/steal_time.c @@ -118,17 +118,10 @@ struct st_time { static int64_t smccc(uint32_t func, uint64_t arg) { - unsigned long ret; + struct arm_smccc_res res; - asm volatile( - "mov w0, %w1\n" - "mov x1, %2\n" - "hvc #0\n" - "mov %0, x0\n" - : "=r" (ret) : "r" (func), "r" (arg) : - "x0", "x1", "x2", "x3"); - - return ret; + smccc_hvc(func, arg, 0, 0, 0, 0, 0, 0, &res); + return res.a0; } static void check_status(struct st_time *st) |