Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177566822
D60605.1794754836.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D60605.1794754836.diff
View Options
diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c
--- a/sys/amd64/vmm/io/ppt.c
+++ b/sys/amd64/vmm/io/ppt.c
@@ -482,9 +482,10 @@
if (error != 0)
goto out;
+ /* Mask INTx before MSI teardown (PCI_QUIRK_MSI_INTX_BUG leaves it clear). */
cmd = pci_read_config(ppt->dev, PCIR_COMMAND, 2);
cmd |= PCIM_CMD_INTxDIS;
- cmd &= ~(PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN);
+ cmd &= ~PCIM_CMD_BUSMASTEREN;
pci_write_config(ppt->dev, PCIR_COMMAND, cmd, 2);
ppt->resetting = true;
@@ -493,6 +494,9 @@
ppt_unmap_all_mmio(vm, ppt);
ppt_teardown_msi(ppt);
ppt_teardown_msix(ppt);
+ /* Gate decode after MSI-X teardown, which writes the table BAR. */
+ cmd &= ~(PCIM_CMD_PORTEN | PCIM_CMD_MEMEN);
+ pci_write_config(ppt->dev, PCIR_COMMAND, cmd, 2);
pci_save_state(ppt->dev);
ppt_pci_reset(ppt->dev);
pci_restore_state(ppt->dev);
@@ -540,13 +544,16 @@
/*
* Disable physical INTx before releasing its handler. This also makes
* an asserted Function send Deassert_INTx before FLR, as required by
- * PCIe. Gate decoding and DMA before tearing down MSI or MSI-X.
+ * PCIe.
*/
cmd = original_cmd | PCIM_CMD_INTxDIS;
- cmd &= ~(PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN);
+ cmd &= ~PCIM_CMD_BUSMASTEREN;
pci_write_config(ppt->dev, PCIR_COMMAND, cmd, 2);
ppt_teardown_msi(ppt);
ppt_teardown_msix(ppt);
+ /* Gate decode after MSI-X teardown, which writes the table BAR. */
+ cmd &= ~(PCIM_CMD_PORTEN | PCIM_CMD_MEMEN);
+ pci_write_config(ppt->dev, PCIR_COMMAND, cmd, 2);
/*
* Save the host-owned state after interrupt teardown, then restore BARs
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 3:00 PM (17 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41477728
Default Alt Text
D60605.1794754836.diff (1 KB)
Attached To
Mode
D60605: vmm: keep memory decode enabled through MSI-X teardown
Attached
Detach File
Event Timeline