• Vitaly Kuznetsov's avatar
    KVM: x86: hyper-v: Deactivate APICv only when AutoEOI feature is in use · 0f250a64
    Vitaly Kuznetsov authored
    APICV_INHIBIT_REASON_HYPERV is currently unconditionally forced upon
    SynIC activation as SynIC's AutoEOI is incompatible with APICv/AVIC. It is,
    however, possible to track whether the feature was actually used by the
    guest and only inhibit APICv/AVIC when needed.
    
    TLFS suggests a dedicated 'HV_DEPRECATING_AEOI_RECOMMENDED' flag to let
    Windows know that AutoEOI feature should be avoided. While it's up to
    KVM userspace to set the flag, KVM can help a bit by exposing global
    APICv/AVIC enablement.
    
    Maxim:
       - always set HV_DEPRECATING_AEOI_RECOMMENDED in kvm_get_hv_cpuid,
         since this feature can be used regardless of AVIC
    
    Paolo:
       - use arch.apicv_update_lock to protect the hv->synic_auto_eoi_used
         instead of atomic ops
    Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
    Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20210810205251.424103-12-mlevitsk@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    0f250a64
hyperv.c 66 KB