Skip to content

Commit e59f75d

Browse files
bonzinisean-jc
authored andcommitted
KVM: x86/mmu: fix comment about mmu_unsync_pages_lock
Fix the comment about what can and cannot happen when mmu_unsync_pages_lock is not help. The comment correctly mentions "clearing sp->unsync", but then it talks about unsync going from 0 to 1. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Link: https://lore.kernel.org/r/20231125083400.1399197-5-pbonzini@redhat.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 250ce1b commit e59f75d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,9 +2850,9 @@ int mmu_try_to_unsync_pages(struct kvm *kvm, const struct kvm_memory_slot *slot,
28502850
/*
28512851
* Recheck after taking the spinlock, a different vCPU
28522852
* may have since marked the page unsync. A false
2853-
* positive on the unprotected check above is not
2853+
* negative on the unprotected check above is not
28542854
* possible as clearing sp->unsync _must_ hold mmu_lock
2855-
* for write, i.e. unsync cannot transition from 0->1
2855+
* for write, i.e. unsync cannot transition from 1->0
28562856
* while this CPU holds mmu_lock for read (or write).
28572857
*/
28582858
if (READ_ONCE(sp->unsync))

0 commit comments

Comments
 (0)