• Vitaly Kuznetsov's avatar
    KVM: x86: hyper-v: Introduce TLB flush fifo · 0823570f
    Vitaly Kuznetsov authored
    To allow flushing individual GVAs instead of always flushing the whole
    VPID a per-vCPU structure to pass the requests is needed. Use standard
    'kfifo' to queue two types of entries: individual GVA (GFN + up to 4095
    following GFNs in the lower 12 bits) and 'flush all'.
    
    The size of the fifo is arbitrarily set to '16'.
    
    Note, kvm_hv_flush_tlb() only queues 'flush all' entries for now and
    kvm_hv_vcpu_flush_tlb() doesn't actually read the fifo just resets the
    queue before returning -EOPNOTSUPP (which triggers full TLB flush) so
    the functional change is very small but the infrastructure is prepared
    to handle individual GVA flush requests.
    Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
    Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Message-Id: <20221101145426.251680-10-vkuznets@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    0823570f
hyperv.h 5 KB