提交 619353c5 编写于 作者: S Shenming Lu 提交者: Zheng Zengkai

KVM: arm64: GICv4.1: Give a chance to save VLPI state

virt inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I3ZSU3
CVE: NA

---------------------------

Before GICv4.1, we don't have direct access to the VLPI state. So
we simply let it fail early when encountering any VLPI in saving.

But now we don't have to return -EACCES directly if on GICv4.1. Let’s
change the hard code and give a chance to save the VLPI state (and
preserve the UAPI).
Signed-off-by: NShenming Lu <lushenming@huawei.com>
Signed-off-by: NMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210322060158.1584-7-lushenming@huawei.comReviewed-by: NKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 0ad3a8a6
...@@ -80,7 +80,7 @@ KVM_DEV_ARM_VGIC_GRP_CTRL ...@@ -80,7 +80,7 @@ KVM_DEV_ARM_VGIC_GRP_CTRL
-EFAULT Invalid guest ram access -EFAULT Invalid guest ram access
-EBUSY One or more VCPUS are running -EBUSY One or more VCPUS are running
-EACCES The virtual ITS is backed by a physical GICv4 ITS, and the -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 KVM_DEV_ARM_VGIC_GRP_ITS_REGS
......
...@@ -2218,10 +2218,10 @@ static int vgic_its_save_itt(struct vgic_its *its, struct its_device *device) ...@@ -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 * If an LPI carries the HW bit, this means that this
* interrupt is controlled by GICv4, and we do not * interrupt is controlled by GICv4, and we do not
* have direct access to that state. Let's simply fail * have direct access to that state without GICv4.1.
* the save operation... * Let's simply fail the save operation...
*/ */
if (ite->irq->hw) if (ite->irq->hw && !kvm_vgic_global_state.has_gicv4_1)
return -EACCES; return -EACCES;
ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz); ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册