• Maciej S. Szmigiero's avatar
    KVM: Resync only arch fields when slots_arch_lock gets reacquired · 4e4d30cb
    Maciej S. Szmigiero authored
    There is no need to copy the whole memslot data after releasing
    slots_arch_lock for a moment to install temporary memslots copy in
    kvm_set_memslot() since this lock only protects the arch field of each
    memslot.
    
    Just resync this particular field after reacquiring slots_arch_lock.
    
    Note, this also eliminates the need to manually clear the INVALID flag
    when restoring memslots; the "setting" of the INVALID flag was an
    unwanted side effect of copying the entire memslots.
    
    Since kvm_copy_memslots() has just one caller remaining now
    open-code it instead.
    Signed-off-by: default avatarMaciej S. Szmigiero <maciej.szmigiero@oracle.com>
    [sean: tweak shortlog, note INVALID flag in changelog, revert comment]
    Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <b63035d114707792e9042f074478337f770dff6a.1638817638.git.maciej.szmigiero@oracle.com>
    4e4d30cb
kvm_main.c 140 KB