• Sean Christopherson's avatar
    KVM: x86: Inhibit APICv/AVIC if the optimized physical map is disabled · 5063c41b
    Sean Christopherson authored
    Inhibit APICv/AVIC if the optimized physical map is disabled so that KVM
    KVM provides consistent APIC behavior if xAPIC IDs are aliased due to
    vcpu_id being truncated and the x2APIC hotplug hack isn't enabled.  If
    the hotplug hack is disabled, events that are emulated by KVM will follow
    architectural behavior (all matching vCPUs receive events, even if the
    "match" is due to truncation), whereas APICv and AVIC will deliver events
    only to the first matching vCPU, i.e. the vCPU that matches without
    truncation.
    
    Note, the "extra" inhibit is needed because  KVM deliberately ignores
    mismatches due to truncation when applying the APIC_ID_MODIFIED inhibit
    so that large VMs (>255 vCPUs) can run with APICv/AVIC.
    Reviewed-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <20230106011306.85230-24-seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    5063c41b
kvm_host.h 66.1 KB