From: Dave Martin <Dave.Martin@arm.com>
To: "Zhang, Lei" <zhang.lei@jp.fujitsu.com>
Cc: "Okamoto, Takayuki" <tokamoto@jp.fujitsu.com>,
Marc Zyngier <marc.zyngier@arm.com>,
'Viresh Kumar' <viresh.kumar@linaro.org>,
Will Deacon <will.deacon@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
"Mizuma, Masayoshi" <masayoshi.mizuma@fujitsu.com>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"Indoh, Takao" <indou.takao@fujitsu.com>
Subject: Re: [PATCH V3] KVM: arm64: Implement vq_present() as a macro
Date: Wed, 3 Jul 2019 18:46:08 +0100 [thread overview]
Message-ID: <20190703174605.GX2790@e103592.cambridge.arm.com> (raw)
In-Reply-To: <8898674D84E3B24BA3A2D289B872026A78BA95D6@G01JPEXMBKW03>
On Wed, Jul 03, 2019 at 12:04:11PM +0000, Zhang, Lei wrote:
> Hi guys,
>
> I can't start up KVM guest os with SVE feature with your patch.
> The error message is
> qemu-system-aarch64: kvm_init_vcpu failed: Invalid argument.
>
> My test enviroment.
> kernel linux-5.2-rc6
> qemu [Qemu-devel] [PATCH v2 00/14] target/arm/kvm: enable SVE in guests https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg04945.html
> KVM start up option
> -machine virt,gic-version=host,accel=kvm \
> -cpu host \
> -machine type=virt \
> -nographic \
> -smp 16 \ -m 4096 \
> -drive if=none,file=/root/image.qcow2,id=hd0,format=qcow2 \
> -device virtio-blk-device,drive=hd0 \
> -netdev user,id=mynet0,restrict=off,hostfwd=tcp::38001-:22 \
> -device virtio-net-device,netdev=mynet0 \
> -bios /root/QEMU_EFI.fd
>
> sve_vq_available function's return value' type is bool.
> But vq_present is macro, so the value is not only TRUE, FALSE but also some numbers.
> So It failed at
> if (vq_present(vqs, vq) != sve_vq_available(vq)).
> I think it is nessary to make vq_present macro's value only TRUE and FALSE.
>
> arch/arm64/kvm/guest.c
> static int set_sve_vls(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
> for (vq = SVE_VQ_MIN; vq <= max_vq; ++vq)
> if (vq_present(vqs, vq) != sve_vq_available(vq)) // It failed at here.
> return -EINVAL;
>
> My patch as follows.
> I have started up KVM guest os successfully with SVE feature with this patch.
>
> Could you review and merge my patch?
[...]
Thanks for reporting this! It looks like we didn't realise we dropped
the implicit cast to bool when the result was returned from the original
version of vq_present().
Your fix looks sensible to me.
For the future, see Documentation/process/submitting-patches.rst for
guidance on how to prepare a patch for submission.
However, due to the fact that we're already at -rc7 I've written a
commit message for the patch and reposted [1]. Since the fix is yours,
I'll keep your authorship and S-o-B.
Please retest when you can (though the diff should be the same).
Note, your mail seems to be corrupted, but since the diff is a one-line
fix, I'm pretty confident I decoded it correctly. If anything looks
wrong, please let me know.
[...]
Cheers
---Dave
[1] [PATCH] KVM: arm64/sve: Fix vq_present() macro to yield a bool
http://lists.infradead.org/pipermail/linux-arm-kernel/2019-July/664745.html
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
prev parent reply other threads:[~2019-07-03 17:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 10:00 [PATCH V3] KVM: arm64: Implement vq_present() as a macro Viresh Kumar
2019-07-03 12:04 ` Zhang, Lei
2019-07-03 17:46 ` Dave Martin [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=20190703174605.GX2790@e103592.cambridge.arm.com \
--to=dave.martin@arm.com \
--cc=catalin.marinas@arm.com \
--cc=indou.takao@fujitsu.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=masayoshi.mizuma@fujitsu.com \
--cc=tokamoto@jp.fujitsu.com \
--cc=viresh.kumar@linaro.org \
--cc=will.deacon@arm.com \
--cc=zhang.lei@jp.fujitsu.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;
as well as URLs for NNTP newsgroup(s).