Skip to content

Commit 2f8b1ad

Browse files
Gavin ShanMarc Zyngier
authored andcommitted
KVM: arm64: Allow no running vcpu on restoring vgic3 LPI pending status
We don't have a running VCPU context to restore vgic3 LPI pending status due to command KVM_DEV_ARM_{VGIC_GRP_CTRL, ITS_RESTORE_TABLES} on KVM device "kvm-arm-vgic-its". Use vgic_write_guest_lock() to restore vgic3 LPI pending status. Signed-off-by: Gavin Shan <[email protected]> Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a23eaf9 commit 2f8b1ad

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Documentation/virt/kvm/api.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8070,9 +8070,11 @@ considering the state as complete. VMM needs to ensure that the dirty
80708070
state is final and avoid missing dirty pages from another ioctl ordered
80718071
after the bitmap collection.
80728072

8073-
NOTE: One example of using the backup bitmap is saving arm64 vgic/its
8074-
tables through KVM_DEV_ARM_{VGIC_GRP_CTRL, ITS_SAVE_TABLES} command on
8075-
KVM device "kvm-arm-vgic-its" when dirty ring is enabled.
8073+
NOTE: Multiple examples of using the backup bitmap: (1) save vgic/its
8074+
tables through command KVM_DEV_ARM_{VGIC_GRP_CTRL, ITS_SAVE_TABLES} on
8075+
KVM device "kvm-arm-vgic-its". (2) restore vgic/its tables through
8076+
command KVM_DEV_ARM_{VGIC_GRP_CTRL, ITS_RESTORE_TABLES} on KVM device
8077+
"kvm-arm-vgic-its". VGICv3 LPI pending status is restored.
80768078

80778079
8.30 KVM_CAP_XEN_HVM
80788080
--------------------

arch/arm64/kvm/vgic/vgic-v3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ int vgic_v3_lpi_sync_pending_status(struct kvm *kvm, struct vgic_irq *irq)
339339
if (status) {
340340
/* clear consumed data */
341341
val &= ~(1 << bit_nr);
342-
ret = kvm_write_guest_lock(kvm, ptr, &val, 1);
342+
ret = vgic_write_guest_lock(kvm, ptr, &val, 1);
343343
if (ret)
344344
return ret;
345345
}

0 commit comments

Comments
 (0)