Hyper-V: vPCI: limit 64 cpus for msi/msix interrupt handling

On older Hyper-V vPCI protocol version 1.1, only the first 64 cpus
are able to handle msi/msix. This is true on FreeBSD 13.x and earlier
releases. If MSI IRQ is assigned to cpu id greater than 63, it would
lead to missing interrupts. Add check in set_interrupt_apic_ids() to
only add first 64 cpus into the interrupt cpu set.

Reported by:	NetApp
Tested by:	NetApp
Reviewed by:	kib
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D44297
This commit is contained in:
Wei Hu 2024-03-11 10:15:09 +00:00
parent 6766a47c02
commit e4b8828947

View file

@ -1184,6 +1184,13 @@ set_interrupt_apic_ids(void)
!hyperthreading_intr_allowed) !hyperthreading_intr_allowed)
continue; continue;
/*
* Currently Hyper-V only supports intr on first
* 64 cpus.
*/
if (vm_guest == VM_GUEST_HV && i > 63)
continue;
intr_add_cpu(i); intr_add_cpu(i);
} }
} }