KVM: SVM: Update avic_kick_target_vcpus to support 32-bit APIC ID
In x2APIC mode, ICRH contains 32-bit destination APIC ID. So, update the avic_kick_target_vcpus() accordingly. Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Message-Id: <20220519102709.24125-6-suravee.suthikulpanit@amd.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
d2fe6bf5b8
commit
c514d3a348
1 changed files with 8 additions and 2 deletions
|
@ -402,9 +402,15 @@ static void avic_kick_target_vcpus(struct kvm *kvm, struct kvm_lapic *source,
|
||||||
* since entered the guest will have processed pending IRQs at VMRUN.
|
* since entered the guest will have processed pending IRQs at VMRUN.
|
||||||
*/
|
*/
|
||||||
kvm_for_each_vcpu(i, vcpu, kvm) {
|
kvm_for_each_vcpu(i, vcpu, kvm) {
|
||||||
|
u32 dest;
|
||||||
|
|
||||||
|
if (apic_x2apic_mode(vcpu->arch.apic))
|
||||||
|
dest = icrh;
|
||||||
|
else
|
||||||
|
dest = GET_XAPIC_DEST_FIELD(icrh);
|
||||||
|
|
||||||
if (kvm_apic_match_dest(vcpu, source, icrl & APIC_SHORT_MASK,
|
if (kvm_apic_match_dest(vcpu, source, icrl & APIC_SHORT_MASK,
|
||||||
GET_XAPIC_DEST_FIELD(icrh),
|
dest, icrl & APIC_DEST_MASK)) {
|
||||||
icrl & APIC_DEST_MASK)) {
|
|
||||||
vcpu->arch.apic->irr_pending = true;
|
vcpu->arch.apic->irr_pending = true;
|
||||||
svm_complete_interrupt_delivery(vcpu,
|
svm_complete_interrupt_delivery(vcpu,
|
||||||
icrl & APIC_MODE_MASK,
|
icrl & APIC_MODE_MASK,
|
||||||
|
|
Loading…
Add table
Reference in a new issue