hw/cxl: Fix msix_notify: Assertion `vector < dev->msix_entries_nr`
authorLi Zhijian <lizhijian@fujitsu.com>
Wed, 15 Jan 2025 07:58:34 +0000 (15:58 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 15 Jan 2025 18:07:30 +0000 (13:07 -0500)
This assertion always happens when we sanitize the CXL memory device.
$ echo 1 > /sys/bus/cxl/devices/mem0/security/sanitize

It is incorrect to register an MSIX number beyond the device's capability.

Increase the device's MSIX number to cover the mailbox msix number(9).

Fixes: 43efb0bfad2b ("hw/cxl/mbox: Wire up interrupts for background completion")
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Message-Id: <20250115075834.167504-1-lizhijian@fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/mem/cxl_type3.c

index bd7652740f4b5f8b0b2933b78e142e7cdfefc347..0ae1704a345cff09cdfca5d5655932491d697040 100644 (file)
@@ -843,7 +843,7 @@ static void ct3_realize(PCIDevice *pci_dev, Error **errp)
     ComponentRegisters *regs = &cxl_cstate->crb;
     MemoryRegion *mr = &regs->component_registers;
     uint8_t *pci_conf = pci_dev->config;
-    unsigned short msix_num = 6;
+    unsigned short msix_num = 10;
     int i, rc;
     uint16_t count;