From: Shenming Lu <lushenming@huawei.com>
To: Marc Zyngier <maz@kernel.org>, Eric Auger <eric.auger@redhat.com>,
"Will Deacon" <will@kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<kvmarm@lists.cs.columbia.edu>, <kvm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Alex Williamson <alex.williamson@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
<wanghaibin.wang@huawei.com>, <yuzenghui@huawei.com>,
<lushenming@huawei.com>
Subject: [PATCH v3 4/4] KVM: arm64: GICv4.1: Give a chance to save VLPI's pending state
Date: Wed, 27 Jan 2021 20:13:37 +0800 [thread overview]
Message-ID: <20210127121337.1092-5-lushenming@huawei.com> (raw)
In-Reply-To: <20210127121337.1092-1-lushenming@huawei.com>
Before GICv4.1, we don't have direct access to the VLPI's pending
state. So we simply let it fail early when encountering any VLPI.
But now we don't have to return -EACCES directly if on GICv4.1. So
let’s change the hard code and give a chance to save the VLPI's pending
state (and preserve the UAPI).
Signed-off-by: Shenming Lu <lushenming@huawei.com>
---
Documentation/virt/kvm/devices/arm-vgic-its.rst | 2 +-
arch/arm64/kvm/vgic/vgic-its.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Documentation/virt/kvm/devices/arm-vgic-its.rst b/Documentation/virt/kvm/devices/arm-vgic-its.rst
index 6c304fd2b1b4..d257eddbae29 100644
--- a/Documentation/virt/kvm/devices/arm-vgic-its.rst
+++ b/Documentation/virt/kvm/devices/arm-vgic-its.rst
@@ -80,7 +80,7 @@ KVM_DEV_ARM_VGIC_GRP_CTRL
-EFAULT Invalid guest ram access
-EBUSY One or more VCPUS are running
-EACCES The virtual ITS is backed by a physical GICv4 ITS, and the
- state is not available
+ state is not available without GICv4.1
======= ==========================================================
KVM_DEV_ARM_VGIC_GRP_ITS_REGS
diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c
index 40cbaca81333..ec7543a9617c 100644
--- a/arch/arm64/kvm/vgic/vgic-its.c
+++ b/arch/arm64/kvm/vgic/vgic-its.c
@@ -2218,10 +2218,10 @@ static int vgic_its_save_itt(struct vgic_its *its, struct its_device *device)
/*
* If an LPI carries the HW bit, this means that this
* interrupt is controlled by GICv4, and we do not
- * have direct access to that state. Let's simply fail
- * the save operation...
+ * have direct access to that state without GICv4.1.
+ * Let's simply fail the save operation...
*/
- if (ite->irq->hw)
+ if (ite->irq->hw && !kvm_vgic_global_state.has_gicv4_1)
return -EACCES;
ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz);
--
2.19.1
next prev parent reply other threads:[~2021-01-27 12:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-27 12:13 [PATCH v3 0/4] KVM: arm64: Add VLPI migration support on GICv4.1 Shenming Lu
2021-01-27 12:13 ` [PATCH v3 1/4] KVM: arm64: GICv4.1: Add function to get VLPI state Shenming Lu
[not found] ` <87wnuef4oj.wl-maz@kernel.org>
2021-03-11 12:26 ` Shenming Lu
2021-01-27 12:13 ` [PATCH v3 2/4] KVM: arm64: GICv4.1: Try to save hw pending state in save_pending_tables Shenming Lu
[not found] ` <87v99yf450.wl-maz@kernel.org>
2021-03-11 12:31 ` Shenming Lu
[not found] ` <87lfasg2wt.wl-maz@kernel.org>
2021-03-12 10:47 ` Shenming Lu
2021-01-27 12:13 ` [PATCH v3 3/4] KVM: arm64: GICv4.1: Restore VLPI's pending state to physical side Shenming Lu
[not found] ` <87tupif3x3.wl-maz@kernel.org>
2021-03-11 12:32 ` Shenming Lu
[not found] ` <87k0qcg2s6.wl-maz@kernel.org>
2021-03-12 10:48 ` Shenming Lu
[not found] ` <87h7lgfwzu.wl-maz@kernel.org>
2021-03-12 11:34 ` Shenming Lu
[not found] ` <87ft10fulr.wl-maz@kernel.org>
2021-03-12 12:31 ` Shenming Lu
2021-01-27 12:13 ` Shenming Lu [this message]
2021-02-26 8:58 ` [PATCH v3 0/4] KVM: arm64: Add VLPI migration support on GICv4.1 Shenming Lu
2021-03-11 7:03 ` Shenming Lu
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=20210127121337.1092-5-lushenming@huawei.com \
--to=lushenming@huawei.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=eric.auger@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=maz@kernel.org \
--cc=wanghaibin.wang@huawei.com \
--cc=will@kernel.org \
--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
all inboxes | Powered by JetHome®