Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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: Shenming Lu <lushenming@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210322060158.1584-7-lushenming@huawei.com

authored by

Shenming Lu and committed by
Marc Zyngier
8082d50f 12df7429

+4 -4
+1 -1
Documentation/virt/kvm/devices/arm-vgic-its.rst
··· 80 80 -EFAULT Invalid guest ram access 81 81 -EBUSY One or more VCPUS are running 82 82 -EACCES The virtual ITS is backed by a physical GICv4 ITS, and the 83 - state is not available 83 + state is not available without GICv4.1 84 84 ======= ========================================================== 85 85 86 86 KVM_DEV_ARM_VGIC_GRP_ITS_REGS
+3 -3
arch/arm64/kvm/vgic/vgic-its.c
··· 2218 2218 /* 2219 2219 * If an LPI carries the HW bit, this means that this 2220 2220 * interrupt is controlled by GICv4, and we do not 2221 - * have direct access to that state. Let's simply fail 2222 - * the save operation... 2221 + * have direct access to that state without GICv4.1. 2222 + * Let's simply fail the save operation... 2223 2223 */ 2224 - if (ite->irq->hw) 2224 + if (ite->irq->hw && !kvm_vgic_global_state.has_gicv4_1) 2225 2225 return -EACCES; 2226 2226 2227 2227 ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz);