diff options
author | sephe <sephe@FreeBSD.org> | 2016-10-14 04:13:59 +0000 |
---|---|---|
committer | sephe <sephe@FreeBSD.org> | 2016-10-14 04:13:59 +0000 |
commit | b9a383a46eb93f94637b8bf79b4db0f85c41d312 (patch) | |
tree | 572bb10ff1ca92e203e10bb53ecc87d5fe100173 /sys/x86 | |
parent | 951111ff346d9014696d6bebb5b0e0858dadfdb9 (diff) | |
download | FreeBSD-src-b9a383a46eb93f94637b8bf79b4db0f85c41d312.zip FreeBSD-src-b9a383a46eb93f94637b8bf79b4db0f85c41d312.tar.gz |
MFC 306481
x86/ioapic: Fix destination cpu for Hyper-V
On Hyper-V:
- Stick to the first cpu for all I/O APIC pins.
- And don't allow destination cpu changes.
Reviewed by: jhb
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7949
Diffstat (limited to 'sys/x86')
-rw-r--r-- | sys/x86/x86/io_apic.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/x86/x86/io_apic.c b/sys/x86/x86/io_apic.c index 8dafa96..bf12881 100644 --- a/sys/x86/x86/io_apic.c +++ b/sys/x86/x86/io_apic.c @@ -325,6 +325,18 @@ ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id) u_int old_id; /* + * On Hyper-V: + * - Stick to the first cpu for all I/O APIC pins. + * - And don't allow destination cpu changes. + */ + if (vm_guest == VM_GUEST_HV) { + if (intpin->io_vector) + return (EINVAL); + else + apic_id = 0; + } + + /* * keep 1st core as the destination for NMI */ if (intpin->io_irq == IRQ_NMI) |