diff options
author | Sean Christopherson <seanjc@google.com> | 2022-07-12 21:46:53 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-07-14 19:26:30 +0300 |
commit | 8031d87aa9953ddeb047a5356ebd0b240c30f233 (patch) | |
tree | 66cbe1d6ff7879f3c6ea8ae19fb614f5ce3b9841 /Documentation/virt/kvm/api.rst | |
parent | fbccc4f5c2b190ef2cedf27baa4303ed9b1a1755 (diff) | |
download | linux-8031d87aa9953ddeb047a5356ebd0b240c30f233.tar.xz |
KVM: x86: Check target, not vCPU's x2APIC ID, when applying hotplug hack
When applying the hotplug hack to match x2APIC IDs for vCPUs in xAPIC
mode, check the target APID ID for being unaddressable in xAPIC mode
instead of checking the vCPU's x2APIC ID, and in that case proceed as
if apic_x2apic_mode(vcpu) were true.
Functionally, it does not matter whether you compare kvm_x2apic_id(apic)
or mda with 0xff, since the two values are then checked for equality.
But in isolation, checking the x2APIC ID takes an unnecessary dependency
on the x2APIC ID being read-only (which isn't strictly true on AMD CPUs,
and is difficult to document as well); it also requires KVM to fallthrough
and check the xAPIC ID as well to deal with a writable xAPIC ID, whereas
the xAPIC ID _can't_ match a target ID greater than 0xff.
Opportunistically reword the comment to call out the various subtleties,
and to fix a typo reported by Zhang Jiaming.
No functional change intended.
Cc: Zhang Jiaming <jiaming@nfschina.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Documentation/virt/kvm/api.rst')
0 files changed, 0 insertions, 0 deletions