• Vitaly Kuznetsov's avatar
    KVM: selftests: Hyper-V PV TLB flush selftest · 9e7726a8
    Vitaly Kuznetsov authored
    Introduce a selftest for Hyper-V PV TLB flush hypercalls
    (HvFlushVirtualAddressSpace/HvFlushVirtualAddressSpaceEx,
    HvFlushVirtualAddressList/HvFlushVirtualAddressListEx).
    
    The test creates one 'sender' vCPU and two 'worker' vCPU which do busy
    loop reading from a certain GVA checking the observed value. Sender
    vCPU swaos the data page with another page filled with a different value.
    The expectation for workers is also altered. Without TLB flush on worker
    vCPUs, they may continue to observe old value. To guard against accidental
    TLB flushes for worker vCPUs the test is repeated 100 times.
    
    Hyper-V TLB flush hypercalls are tested in both 'normal' and 'XMM
    fast' modes.
    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-38-vkuznets@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    9e7726a8
hyperv_tlb_flush.c 21.3 KB