From: Marc Zyngier <maz@kernel.org>
To: Zenghui Yu <yuzenghui@huawei.com>
Cc: <stable@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<gregkh@linuxfoundation.org>, <sashal@kernel.org>,
<alexandru.elisei@arm.com>, <wanghaibin.wang@huawei.com>
Subject: Re: [PATCH stable-5.12.y backport 2/2] KVM: arm64: Resolve all pending PC updates before immediate exit
Date: Tue, 01 Jun 2021 12:44:55 +0100 [thread overview]
Message-ID: <87tumh24i0.wl-maz@kernel.org> (raw)
In-Reply-To: <20210601111238.1059-3-yuzenghui@huawei.com>
On Tue, 01 Jun 2021 12:12:38 +0100,
Zenghui Yu <yuzenghui@huawei.com> wrote:
>
> commit e3e880bb1518eb10a4b4bb4344ed614d6856f190 upstream.
>
> Commit 26778aaa134a ("KVM: arm64: Commit pending PC adjustemnts before
> returning to userspace") fixed the PC updating issue by forcing an explicit
> synchronisation of the exception state on vcpu exit to userspace.
>
> However, we forgot to take into account the case where immediate_exit is
> set by userspace and KVM_RUN will exit immediately. Fix it by resolving all
> pending PC updates before returning to userspace.
>
> Since __kvm_adjust_pc() relies on a loaded vcpu context, I moved the
> immediate_exit checking right after vcpu_load(). We will get some overhead
> if immediate_exit is true (which should hopefully be rare).
>
> Fixes: 26778aaa134a ("KVM: arm64: Commit pending PC adjustemnts before returning to userspace")
> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> Link: https://lore.kernel.org/r/20210526141831.1662-1-yuzenghui@huawei.com
> Cc: stable@vger.kernel.org # 5.11
Reviewed-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
prev parent reply other threads:[~2021-06-01 11:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 11:12 [PATCH stable-5.12.y backport 0/2] KVM: arm64: Commit exception state on exit to userspace Zenghui Yu
2021-06-01 11:12 ` [PATCH stable-5.12.y backport 1/2] KVM: arm64: Commit pending PC adjustemnts before returning " Zenghui Yu
2021-06-01 11:44 ` Marc Zyngier
2021-06-01 13:47 ` Zenghui Yu
2021-06-01 11:12 ` [PATCH stable-5.12.y backport 2/2] KVM: arm64: Resolve all pending PC updates before immediate exit Zenghui Yu
2021-06-01 11:44 ` Marc Zyngier [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=87tumh24i0.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=alexandru.elisei@arm.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wanghaibin.wang@huawei.com \
--cc=yuzenghui@huawei.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