From: Paolo Bonzini <pbonzini@redhat.com>
To: Andrew Jones <drjones@redhat.com>, Oliver Upton <oupton@google.com>
Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Jim Mattson <jmattson@google.com>,
Sean Christopherson <seanjc@google.com>
Subject: Re: [PATCH 2/2] selftests: KVM: Fix 'asm-operand-width' warnings in steal_time.c
Date: Tue, 21 Sep 2021 19:38:15 +0200 [thread overview]
Message-ID: <b242d9d8-ec1c-bba5-6272-a7a42e2e4011@redhat.com> (raw)
In-Reply-To: <20210921071904.5irj3q5yiquoubj2@gator.home>
On 21/09/21 09:19, Andrew Jones wrote:
> On Tue, Sep 21, 2021 at 01:01:20AM +0000, Oliver Upton wrote:
>> Building steal_time.c for arm64 with clang throws the following:
>>
>>>> steal_time.c:130:22: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths]
>> : "=r" (ret) : "r" (func), "r" (arg) :
>> ^
>>>> steal_time.c:130:34: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths]
>> : "=r" (ret) : "r" (func), "r" (arg) :
>> ^
>>
>> Silence by casting operands to 64 bits.
>>
>> Signed-off-by: Oliver Upton <oupton@google.com>
>> ---
>> tools/testing/selftests/kvm/steal_time.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
>> index ecec30865a74..eb75b31122c5 100644
>> --- a/tools/testing/selftests/kvm/steal_time.c
>> +++ b/tools/testing/selftests/kvm/steal_time.c
>> @@ -127,7 +127,7 @@ static int64_t smccc(uint32_t func, uint32_t arg)
>> "mov x1, %2\n"
>> "hvc #0\n"
>> "mov %0, x0\n"
>> - : "=r" (ret) : "r" (func), "r" (arg) :
>> + : "=r" (ret) : "r" ((uint64_t)func), "r" ((uint64_t)arg) :
>
> Actually, I think I'd rather fix this smccc implementation to match the
> spec, which I think should be done like this
>
> diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
> index ecec30865a74..7da957259ce4 100644
> --- a/tools/testing/selftests/kvm/steal_time.c
> +++ b/tools/testing/selftests/kvm/steal_time.c
> @@ -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"
>
Agreed, can you send out a patch? Thanks,
Paolo
prev parent reply other threads:[~2021-09-21 17:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-21 1:01 [PATCH 0/2] selftests: KVM: Fix some compiler warnings Oliver Upton
2021-09-21 1:01 ` [PATCH 1/2] selftests: KVM: Fix compiler warning in demand_paging_test Oliver Upton
2021-09-21 7:09 ` Andrew Jones
2021-09-21 17:38 ` Paolo Bonzini
2021-09-21 17:42 ` Oliver Upton
2021-09-21 1:01 ` [PATCH 2/2] selftests: KVM: Fix 'asm-operand-width' warnings in steal_time.c Oliver Upton
2021-09-21 7:19 ` Andrew Jones
2021-09-21 17:38 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b242d9d8-ec1c-bba5-6272-a7a42e2e4011@redhat.com \
--to=pbonzini@redhat.com \
--cc=alexandru.elisei@arm.com \
--cc=drjones@redhat.com \
--cc=james.morse@arm.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=maz@kernel.org \
--cc=oupton@google.com \
--cc=seanjc@google.com \
--cc=suzuki.poulose@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox