Skip to content

Commit c41c0da

Browse files
ZideChen0lijinxia
authored andcommitted
hv: properly initialize MSI-X table
Though guests are not supposed to read Message Data/Addr, it's still better off to initialize them to 0. vector_control should be initialize to zero besides the mask bit. Tracked-On: #1568 Signed-off-by: Zide Chen <zide.chen@intel.com> Reviewed-by: Li, Fei1 <fei1.li@intel.com>
1 parent 53971e1 commit c41c0da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hypervisor/dm/vpci/msix.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ static int vmsix_init(struct pci_vdev *vdev)
350350

351351
/* Mask all table entries */
352352
for (i = 0U; i < msix->table_count; i++) {
353-
msix->tables[i].vector_control |= PCIM_MSIX_VCTRL_MASK;
353+
msix->tables[i].vector_control = PCIM_MSIX_VCTRL_MASK;
354+
msix->tables[i].addr = 0U;
355+
msix->tables[i].data = 0U;
354356
}
355357

356358
decode_msix_table_bar(vdev);

0 commit comments

Comments
 (0)