Skip to content

Commit 8248650

Browse files
DamianB-BitFlipperlikebreath
authored andcommitted
pci: Handle dword MSI-X control writes
Some guests update the MSI-X capability through a 32-bit write at offset 0 instead of a 16-bit write at offset 2. Update the cached Message Control state for that path as well so MSI-X enablement stays in sync with the guest configuration. Add a short comment documenting why the dword write path also updates the cached MSI-X Message Control state. This is important for passthrough GPUs, where MSI-X interrupts are used during NVIDIA Fabric Manager registration. Without updating the cached state on the dword write path, interrupt delivery can remain stale and GPU initialization or fabric registration can fail. Signed-off-by: Damian Barabonkov <dbctl@pm.me>
1 parent 17919a7 commit 8248650

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pci/src/vfio.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ impl VfioMsix {
158158
// Update "Message Control" word
159159
if offset == 2 && data.len() == 2 {
160160
self.bar.set_msg_ctl(LittleEndian::read_u16(data));
161+
} else if offset == 0 && data.len() == 4 {
162+
// Some guests update MSI-X control through the dword config write path.
163+
self.bar
164+
.set_msg_ctl((LittleEndian::read_u32(data) >> 16) as u16);
161165
}
162166

163167
let new_enabled = self.bar.enabled();

0 commit comments

Comments
 (0)