KVM: x86: Warning APICv inconsistency only when vcpu APIC mode is valid
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Thu, 19 May 2022 10:27:06 +0000 (05:27 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Jun 2022 16:51:15 +0000 (12:51 -0400)
commitf8d8ac215919cf40d3b358846ed8e8e3a3683131
treeecf61e9e63a3489e2039da6e1187219dc9bff94b
parent0e311d33bfbef86da130674e8528cc23e6acfe16
KVM: x86: Warning APICv inconsistency only when vcpu APIC mode is valid

When launching a VM with x2APIC and specify more than 255 vCPUs,
the guest kernel can disable x2APIC (e.g. specify nox2apic kernel option).
The VM fallbacks to xAPIC mode, and disable the vCPU ID 255 and greater.

In this case, APICV is deactivated for the disabled vCPUs.
However, the current APICv consistency warning does not account for
this case, which results in a warning.

Therefore, modify warning logic to report only when vCPU APIC mode
is valid.

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Message-Id: <20220519102709.24125-15-suravee.suthikulpanit@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c