• Paul Mackerras's avatar
    KVM: PPC: Book3S HV: Close race with page faults around memslot flushes · 11362b1b
    Paul Mackerras authored
    There is a potential race condition between hypervisor page faults
    and flushing a memslot.  It is possible for a page fault to read the
    memslot before a memslot is updated and then write a PTE to the
    partition-scoped page tables after kvmppc_radix_flush_memslot has
    completed.  (Note that this race has never been explicitly observed.)
    
    To close this race, it is sufficient to increment the MMU sequence
    number while the kvm->mmu_lock is held.  That will cause
    mmu_notifier_retry() to return true, and the page fault will then
    return to the guest without inserting a PTE.
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    11362b1b
book3s_64_mmu_radix.c 34.9 KB