• David Woodhouse's avatar
    KVM: Reinstate gfn_to_pfn_cache with invalidation support · 982ed0de
    David Woodhouse authored
    This can be used in two modes. There is an atomic mode where the cached
    mapping is accessed while holding the rwlock, and a mode where the
    physical address is used by a vCPU in guest mode.
    
    For the latter case, an invalidation will wake the vCPU with the new
    KVM_REQ_GPC_INVALIDATE, and the architecture will need to refresh any
    caches it still needs to access before entering guest mode again.
    
    Only one vCPU can be targeted by the wake requests; it's simple enough
    to make it wake all vCPUs or even a mask but I don't see a use case for
    that additional complexity right now.
    
    Invalidation happens from the invalidate_range_start MMU notifier, which
    needs to be able to sleep in order to wake the vCPU and wait for it.
    
    This means that revalidation potentially needs to "wait" for the MMU
    operation to complete and the invalidate_range_end notifier to be
    invoked. Like the vCPU when it takes a page fault in that period, we
    just spin — fixing that in a future...
    982ed0de
Kconfig 3.7 KB