qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] hw/pci-bridge: Make PCIe and CXL PXB Devices inherit fro


From: Thomas Huth
Subject: Re: [PATCH 2/2] hw/pci-bridge: Make PCIe and CXL PXB Devices inherit from TYPE_PXB_DEV
Date: Fri, 21 Apr 2023 16:46:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 20/04/2023 16.27, Jonathan Cameron via wrote:
Previously, PXB_CXL_DEVICE, PXB_PCIE_DEVICE and PXB_DEVICE all
have PCI_DEVICE as their direct parent but share a common state
struct PXBDev. convert_to_pxb() is used to get the PXBDev
instance from which ever of these types it is called on.

This patch switches to an explicit heirarchy based on shared
functionality.  To allow use of OBJECT_DECLARE_SIMPLE_TYPE()
whilst minimizing code changes, all types are renamed to have
the postfix _DEV rather than _DEVICE.  The new heirarchy

s/heirarchy/hierarchy/

has PXB_CXL_DEV with parent PXB_PCIE_DEV which in turn
has parent PXB_DEV which continues to have parent PCI_DEVICE.

This allows simple use of PXB_DEV() etc rather than a custom function
+ removal of duplicated properties and moving the CXL specific
elements out of struct PXBDev.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
  hw/acpi/cxl.c                       | 11 +++---
  hw/cxl/cxl-host.c                   |  4 +-
  hw/pci-bridge/pci_expander_bridge.c | 59 ++++++++++-------------------
  include/hw/cxl/cxl.h                |  4 +-
  include/hw/pci/pci_bridge.h         | 28 ++++++++++----
  5 files changed, 49 insertions(+), 57 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]