From c41c0dab0802ae87f74dea159265662311533301 Mon Sep 17 00:00:00 2001 From: Zide Chen Date: Mon, 19 Nov 2018 15:55:21 -0800 Subject: [PATCH] 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 Reviewed-by: Li, Fei1 --- hypervisor/dm/vpci/msix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hypervisor/dm/vpci/msix.c b/hypervisor/dm/vpci/msix.c index 4fbb25956..50c3df3d3 100644 --- a/hypervisor/dm/vpci/msix.c +++ b/hypervisor/dm/vpci/msix.c @@ -350,7 +350,9 @@ static int vmsix_init(struct pci_vdev *vdev) /* Mask all table entries */ for (i = 0U; i < msix->table_count; i++) { - msix->tables[i].vector_control |= PCIM_MSIX_VCTRL_MASK; + msix->tables[i].vector_control = PCIM_MSIX_VCTRL_MASK; + msix->tables[i].addr = 0U; + msix->tables[i].data = 0U; } decode_msix_table_bar(vdev);