From: Zenghui Yu <yuzenghui@huawei.com>
To: Marc Zyngier <maz@kernel.org>, <kvm@vger.kernel.org>,
<kvmarm@lists.cs.columbia.edu>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/2] KVM: arm64: Don't write junk to sysregs on reset
Date: Tue, 6 Aug 2019 14:29:20 +0800 [thread overview]
Message-ID: <01b74492-c59f-dfd9-e439-752e6b1c53dc@huawei.com> (raw)
In-Reply-To: <20190805121555.130897-2-maz@kernel.org>
Hi Marc,
On 2019/8/5 20:15, Marc Zyngier wrote:
> At the moment, the way we reset system registers is mildly insane:
> We write junk to them, call the reset functions, and then check that
> we have something else in them.
>
> The "fun" thing is that this can happen while the guest is running
> (PSCI, for example). If anything in KVM has to evaluate the state
> of a system register while junk is in there, bad thing may happen.
>
> Let's stop doing that. Instead, we track that we have called a
> reset function for that register, and assume that the reset
> function has done something. This requires fixing a couple of
> sysreg refinition in the trap table.
>
> In the end, the very need of this reset check is pretty dubious,
> as it doesn't check everything (a lot of the sysregs leave outside of
> the sys_regs[] array). It may well be axed in the near future.
>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
(Regardless of whether this check is needed or not,) I tested this patch
with kvm-unit-tests:
for i in {1..100}; do QEMU=/path/to/qemu-system-aarch64 accel=kvm
arch=arm64 ./run_tests.sh; done
And all the tests passed!
Thanks,
zenghui
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
next prev parent reply other threads:[~2019-08-06 6:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 12:15 [PATCH 0/2] KVM: arm/arm64: Revamp sysreg reset checks Marc Zyngier
2019-08-05 12:15 ` [PATCH 1/2] KVM: arm64: Don't write junk to sysregs on reset Marc Zyngier
2019-08-06 6:29 ` Zenghui Yu [this message]
2019-08-06 8:35 ` Marc Zyngier
2019-08-06 8:52 ` Zenghui Yu
2019-08-05 12:15 ` [PATCH 2/2] KVM: arm: Don't write junk to CP15 registers " Marc Zyngier
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=01b74492-c59f-dfd9-e439-752e6b1c53dc@huawei.com \
--to=yuzenghui@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
/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