]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Honor the disabled setting for MSI-X interrupts for passthrough devices.
authorjhb <jhb@FreeBSD.org>
Tue, 24 Nov 2020 23:18:52 +0000 (23:18 +0000)
committerjhb <jhb@FreeBSD.org>
Tue, 24 Nov 2020 23:18:52 +0000 (23:18 +0000)
commit58dcf6f998ecccf01eac876d8ecf9bd35fe88407
tree8724060974d53d8848ede2155765b07a3e804c53
parent70d05fa9b69fb752c5bb874888face794dc5f625
Honor the disabled setting for MSI-X interrupts for passthrough devices.

Add a new ioctl to disable all MSI-X interrupts for a PCI passthrough
device and invoke it if a write to the MSI-X capability registers
disables MSI-X.  This avoids leaving MSI-X interrupts enabled on the
host if a guest device driver has disabled them (e.g. as part of
detaching a guest device driver).

This was found by Chelsio QA when testing that a Linux guest could
switch from MSI-X to MSI interrupts when using the cxgb4vf driver.

While here, explicitly fail requests to enable MSI on a passthrough
device if MSI-X is enabled and vice versa.

Reported by: Sony Arpita Das @ Chelsio
Reviewed by: grehan, markj
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27212
lib/libvmmapi/vmmapi.c
lib/libvmmapi/vmmapi.h
sys/amd64/include/vmm_dev.h
sys/amd64/vmm/io/ppt.c
sys/amd64/vmm/io/ppt.h
sys/amd64/vmm/vmm_dev.c
usr.sbin/bhyve/pci_passthru.c