Skip to content

Commit

Permalink
selftests: KVM: Align SMCCC call with the spec in steal_time
Browse files Browse the repository at this point in the history
The SMC64 calling convention passes a function identifier in w0 and its
parameters in x1-x17. Given this, there are two deviations in the
SMC64 call performed by the steal_time test: the function identifier is
assigned to a 64 bit register and the parameter is only 32 bits wide.

Align the call with the SMCCC by using a 32 bit register to handle the
function identifier and increasing the parameter width to 64 bits.

Suggested-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Oliver Upton <oupton@google.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20210921171121.2148982-3-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Oliver Upton authored and Paolo Bonzini committed Sep 22, 2021
1 parent 90b5412 commit 01f91ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/kvm/steal_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ struct st_time {
uint64_t st_time;
};

static int64_t smccc(uint32_t func, uint32_t arg)
static int64_t smccc(uint32_t func, uint64_t arg)
{
unsigned long ret;

asm volatile(
"mov x0, %1\n"
"mov w0, %w1\n"
"mov x1, %2\n"
"hvc #0\n"
"mov %0, x0\n"
Expand Down

0 comments on commit 01f91ac

Please sign in to comment.