]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Update the cached MSI state when any MSI capability register is written.
authorjhb <jhb@FreeBSD.org>
Mon, 27 Apr 2020 22:27:35 +0000 (22:27 +0000)
committerjhb <jhb@FreeBSD.org>
Mon, 27 Apr 2020 22:27:35 +0000 (22:27 +0000)
commite8a9ef1b0e1d34627019fc409471f6482b14f169
tree5dbb468594f501effc57048080da75a334511265
parent83723aa6b0f87d16f36181c34b9f23095204b493
Update the cached MSI state when any MSI capability register is written.

bhyve uses cached copies of the MSI capability registers to generate
MSI interrupts for device models.  Previously, these cached fields
were only set when the MSI capability control register was updated.
The Linux kernel recently adopted a change to deal with races in MSI
interrupt delivery that writes to the MSI capability address and data
registers to alter the destination of MSI interrupts without writing
to the MSI capability control register.  bhyve was not updating its
cached registers for these writes and continued to send interrupts
with the old data value to the old address.  Fix this by recomputing
the cached values for every write to any MSI capability register.

Reported by: Jason Tubnor, Ryan Moeller
Reported by: Marc Dionne (bisected the Linux kernel commit)
Reviewed by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24593
usr.sbin/bhyve/pci_emul.c