Skip to content

Commit b8add3f

Browse files
ouptongregkh
authored andcommitted
selftests: KVM: Align SMCCC call with the spec in steal_time
[ Upstream commit 01f91ac ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 352b025 commit b8add3f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tools/testing/selftests/kvm/steal_time.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ struct st_time {
120120
uint64_t st_time;
121121
};
122122

123-
static int64_t smccc(uint32_t func, uint32_t arg)
123+
static int64_t smccc(uint32_t func, uint64_t arg)
124124
{
125125
unsigned long ret;
126126

127127
asm volatile(
128-
"mov x0, %1\n"
128+
"mov w0, %w1\n"
129129
"mov x1, %2\n"
130130
"hvc #0\n"
131131
"mov %0, x0\n"

0 commit comments

Comments
 (0)