Use x2apic_mode instead of x2apic_enabled() when adjusting the
destination ID during Posted Interrupt updates.  This avoids the costly
RDMSR that is hidden behind x2apic_enabled().
Reported-by: luferry <luferry@163.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <
20210115220354.434807-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
 
                dest = cpu_physical_id(cpu);
 
-               if (x2apic_enabled())
+               if (x2apic_mode)
                        new.ndst = dest;
                else
                        new.ndst = (dest << 8) & 0xFF00;
 
                dest = cpu_physical_id(vcpu->cpu);
 
-               if (x2apic_enabled())
+               if (x2apic_mode)
                        new.ndst = dest;
                else
                        new.ndst = (dest << 8) & 0xFF00;
                 */
                dest = cpu_physical_id(vcpu->pre_pcpu);
 
-               if (x2apic_enabled())
+               if (x2apic_mode)
                        new.ndst = dest;
                else
                        new.ndst = (dest << 8) & 0xFF00;