[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 65/73] hw/mem/cxl-type3: Add AER extended capability
From: |
Michael S. Tsirkin |
Subject: |
[PULL 65/73] hw/mem/cxl-type3: Add AER extended capability |
Date: |
Tue, 7 Mar 2023 20:14:05 -0500 |
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This enables AER error injection to function as expected.
It is intended as a building block in enabling CXL RAS error injection
in the following patches.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Message-Id: <20230302133709.30373-6-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
---
hw/mem/cxl_type3.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c
index 217a5e639b..6cdd988d1d 100644
--- a/hw/mem/cxl_type3.c
+++ b/hw/mem/cxl_type3.c
@@ -250,6 +250,7 @@ static void ct3d_config_write(PCIDevice *pci_dev, uint32_t
addr, uint32_t val,
pcie_doe_write_config(&ct3d->doe_cdat, addr, val, size);
pci_default_write_config(pci_dev, addr, val, size);
+ pcie_aer_write_config(pci_dev, addr, val, size);
}
/*
@@ -452,8 +453,19 @@ static void ct3_realize(PCIDevice *pci_dev, Error **errp)
cxl_cstate->cdat.free_cdat_table = ct3_free_cdat_table;
cxl_cstate->cdat.private = ct3d;
cxl_doe_cdat_init(cxl_cstate, errp);
+
+ pcie_cap_deverr_init(pci_dev);
+ /* Leave a bit of room for expansion */
+ rc = pcie_aer_init(pci_dev, PCI_ERR_VER, 0x200, PCI_ERR_SIZEOF, NULL);
+ if (rc) {
+ goto err_release_cdat;
+ }
+
return;
+err_release_cdat:
+ cxl_doe_cdat_release(cxl_cstate);
+ g_free(regs->special_ops);
err_address_space_free:
address_space_destroy(&ct3d->hostmem_as);
return;
@@ -465,6 +477,7 @@ static void ct3_exit(PCIDevice *pci_dev)
CXLComponentState *cxl_cstate = &ct3d->cxl_cstate;
ComponentRegisters *regs = &cxl_cstate->crb;
+ pcie_aer_exit(pci_dev);
cxl_doe_cdat_release(cxl_cstate);
g_free(regs->special_ops);
address_space_destroy(&ct3d->hostmem_as);
--
MST
- [PULL 51/73] tests: acpi: update expected blobs, (continued)
- [PULL 51/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 56/73] acpi: pci: drop BSEL usage when deciding that device isn't hotpluggable, Michael S. Tsirkin, 2023/03/07
- [PULL 57/73] acpi: pci: move BSEL into build_append_pcihp_slots(), Michael S. Tsirkin, 2023/03/07
- [PULL 59/73] pcihp: move fields enabling hotplug into AcpiPciHpState, Michael S. Tsirkin, 2023/03/07
- [PULL 58/73] acpi: pci: move out ACPI PCI hotplug generator from generic slot generator build_append_pci_bus_devices(), Michael S. Tsirkin, 2023/03/07
- [PULL 60/73] pcihp: add ACPI PCI hotplug specific is_hotpluggable_bus() callback, Michael S. Tsirkin, 2023/03/07
- [PULL 61/73] hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register, Michael S. Tsirkin, 2023/03/07
- [PULL 62/73] hw/pci/aer: Add missing routing for AER errors, Michael S. Tsirkin, 2023/03/07
- [PULL 63/73] hw/pci-bridge/cxl_root_port: Wire up AER, Michael S. Tsirkin, 2023/03/07
- [PULL 64/73] hw/pci-bridge/cxl_root_port: Wire up MSI, Michael S. Tsirkin, 2023/03/07
- [PULL 65/73] hw/mem/cxl-type3: Add AER extended capability,
Michael S. Tsirkin <=
- [PULL 66/73] hw/cxl: Fix endian issues in CXL RAS capability defaults / masks, Michael S. Tsirkin, 2023/03/07
- [PULL 67/73] hw/pci/aer: Make PCIE AER error injection facility available for other emulation to use., Michael S. Tsirkin, 2023/03/07
- [PULL 68/73] hw/mem/cxl_type3: Add CXL RAS Error Injection Support., Michael S. Tsirkin, 2023/03/07
- [PULL 69/73] hw/pci: Add pcie_count_ds_port() and pcie_find_port_first() helpers, Michael S. Tsirkin, 2023/03/07
- [PULL 71/73] hw/virtio/vhost-user: avoid using unitialized errp, Michael S. Tsirkin, 2023/03/07
- [PULL 70/73] hw/pxb-cxl: Support passthrough HDM Decoders unless overridden, Michael S. Tsirkin, 2023/03/07
- [PULL 72/73] virtio: fix reachable assertion due to stale value of cached region size, Michael S. Tsirkin, 2023/03/07
- [PULL 73/73] virtio: refresh vring region cache after updating a virtqueue size, Michael S. Tsirkin, 2023/03/07
- Re: [PULL 00/73] virtio,pc,pci: features, fixes, Michael S. Tsirkin, 2023/03/09