Skip to contentSkip to conversation

qemu: CCIX pcie config space emulation

RFC PATCH In review Jonathan Cameron 2 participants 11 messages Jun 25, 2019 – Aug 19, 2019

lore
Share & tools
lore
#0 lore raw

cover qemu: CCIX pcie config space emulation

CCIX topologies are 'layered' on top of PCIe tree topologies. This is done primarily by allowing a single CCIX device to appear as multiple disjoint nodes in the PCIe tree.

This layering is described via extensive PCIe DVSEC extended capabilities in PCIe config space across all the functions that are present in the device (some placement rules apply).

The extremely flexible nature of allowed topologies makes the development of generic firmware and OS software difficult if we rely on actual hardware setups, due to the large test set that is necessary.

To enable the ongoing work on EDK2 and within the Linux kernel and userspace, this series provides the bare bones of what is necessary to be able to test 'configuration' of a CCIX topology. Note that no actual CCIX data flow is being emulated within this patchset, merely a substantial subset of the interface that allows the topologies to be configured. Testing has to rely on verification based on the result rather than true emulation of the coherency protocol. (that is a very different form of emulation for which other tools are perhaps better suited).

For information on how to do the coherency protocol configuration, see the forthcoming CCIX SW guide, in conjunction with the CCIX 1.0 Base Specification.

An example of a 2x2 mesh with a spur to the host can be run with:

qemu-system-aarch64 -M virt -m 1024 -cpu cortex-a53 \
...
-device ioh3420,id=root_port1 \
-device ccix-upstream-port,num_links=4,primaryport=true,rsam_entries=4,ccix_device="ccix_dev1",bus=root_port1,addr=0.0,multifunction="on",id=up0,port_id=0 \
-device ccix-downstream-port,ccix_device="ccix_dev1",bus=up0,slot=0,chassis=2,id=bus_top,port_id=1 \
-device ccix-downstream-port,ccix_device="ccix_dev1",bus=up0,slot=1,chassis=2,id=bus_left,port_id=2 \
-device ccix-ep,primaryport=false,home_agents=1,request_agents=1,ccix_device="ccix_dev1",bus=root_port1,addr=0.1,multifunction="on" \
-device ccix-upstream-port,num_links=4,primaryport=true,rsam_entries=4,ccix_device="ccix_dev2",bus=bus_top,addr=0.0,multifunction="on",id=up1,port_id=0 \
-device ccix-downstream-port,ccix_device="ccix_dev2",bus=up1,slot=0,chassis=3,id=bus_right,port_id=1 \
-device ccix-ep,primaryport=false,request_agents=2,ccix_device="ccix_dev2",bus=bus_top,addr=0.1,multifunction="on" \
-device ccix-upstream-port,num_links=4,primaryport=true,rsam_entries=4,ccix_device="ccix_dev3",bus=bus_left,addr=0.0,multifunction="on",id=up2,port_id=0 \
-device ccix-downstream-port,ccix_device="ccix_dev3",bus=up2,slot=0,chassis=4,id=bus_bottom,port_id=1,multifunciton="on" \
-device ccix-ep,primaryport=false,request_agents=2,ccix_device="ccix_dev3",bus=bus_left,addr=0.1,multifunction="on" \
-device ccix-ep,primaryport=true,request_agents=2,ccix_device="ccix_dev4",bus=bus_right,addr=0.0,port_id=0 \
-device ccix-ep,primaryport=true,request_agents=2,ccix_device="ccix_dev4",bus=bus_bottom,addr=0.0,port_id=1

I'm not going to try drawing all the detail (it's bad enough trying to draw these in inkscape, but in a very much simplifed fashion, this generates.

-----------------

|     Host      |
|               | 
--- root_port1--
        |
        |
        v
-----------------          ---------------
|  ccix_dev1    | -------> |  ccix_dev2  |
-----------------          ---------------
        |                         |
        V                         V
-----------------          ---------------
|  ccix_dev3    | -------> |  ccix_dev4  |
-----------------          ---------------

$lspci -t
-[0000:00]-+-00.0

           +-01.0-[01-08]--+-00.0-[02-08]--+-00.0-[03-05]--+-00.0-[04-05]----00.0-[05]----00.0
                           |               |               |               \-00.1
                           |               |               \-01.0-[06-08]--+-00.0-[07-08]----00.0-[08]----00.0
                           |               |                               \-00.1
                           |               \-00.1

RFC questions:

1. The nature of CCIX devices is that we need to extend normal PCI devices, slots, and ports. I could not find an elegant way of doing this without lots of code replication. The current solution just exposes some internal functions from xio3130 port implementations. Is there a better way to do this?

2. The association of the different PCIDevices to a given CCIX device is currently somewhat of a hack. Can anyone suggest a cleaner solution for this? I can improved the current implementation, but don't really like that we basically search for all the parts whenever a cross device implementation is needed.

3. Is emulation via a large number of PCIe devices like this a good approach or is there a nicer way to handle it? Given we need to be able to 'spread' the CCIX device configuration across multiple PCIe functions anyway perhaps this is the most sensible approach.

4. I've cut and paste a 100+ lines of code from each of the xio3130_* modules as we are also implemening PCIE up and downstream ports and as this is a emulation only device, we might as well use the same register set. There are various possible ways to avoid this:
* Add a library with the shared code in it.
* Add an xio3130_upstream.h header and similar to allow the CCIX port modules to call those functions directly.
* Don't worry about the replication in the interests of keeping the code structure simple.

5. I'm not that familiar with qemu 'style' yet, so pointers on structures to use etc most welcome.

Note that not all elements of CCIX are supported by the current implementation, for example slave agents and error records are missing. These will follow either in later revisions or as follow patches. We also have no actual accelerator functions in the current design and hence no mapping to RAs.

Only a subset of configuration constraints are currently implemented. This will want tightenning up in future.

As we don't have any actual chunks of the spec in here so I haven't added the statement from the trademark grant that follows.

Thanks,

Jonathan

This patch is being distributed by the CCIX Consortium, Inc. (CCIX) to you and other parties that are paticipating (the "participants") in qemu with the understanding that the participants will use CCIX's name and trademark only when this patch is used in association with qemu.

CCIX is also distributing this patch to these participants with the understanding that if any portion of the CCIX specification will be used or referenced in qemu, the participants will not modify the cited portion of the CCIX specification and will give CCIX propery copyright attribution by including the following copyright notice with the cited part of the CCIX specification:
"© 2019 CCIX CONSORTIUM, INC. ALL RIGHTS RESERVED."

Jonathan Cameron (7):
Temp: Add the PCI_EXT_ID_DVSEC definition to the qemu pci_regs.h copy.
pci: Add Huawei vendor ID and Huawei Emulated CCIX Device IDs.
pci: CCIX config space emulation library.
pci-bridge: CCIX capable PCIE/CCIX switch upstream port.
pci-bridge: CCIX capable PCIE/CCIX switch downstream port
misc: CCIX endpoint function
Temp: Add to ARM64 makefiles for testing

 default-configs/arm-softmmu.mak           |    3 +-
 hw/misc/Kconfig                           |    5 +
 hw/misc/Makefile.objs                     |    1 +
 hw/misc/ccix-ep.c                         |  112 ++
 hw/pci-bridge/Kconfig                     |    5 +
 hw/pci-bridge/Makefile.objs               |    1 +
 hw/pci-bridge/ccix_downstream.c           |  222 ++++
 hw/pci-bridge/ccix_upstream.c             |  197 ++++
 hw/pci/Kconfig                            |    3 +
 hw/pci/Makefile.objs                      |    1 +
 hw/pci/ccix_lib.c                         | 1299 +++++++++++++++++++++
 include/hw/misc/ccix.h                    |   28 +
 include/hw/pci/pci_ids.h                  |    7 +
 include/standard-headers/linux/pci_regs.h |    3 +-
 14 files changed, 1885 insertions(+), 2 deletions(-)
 create mode 100644 hw/misc/ccix-ep.c
 create mode 100644 hw/pci-bridge/ccix_downstream.c
 create mode 100644 hw/pci-bridge/ccix_upstream.c
 create mode 100644 hw/pci/ccix_lib.c
 create mode 100644 include/hw/misc/ccix.h
Signature · 1 line
2.20.1
#1 lore raw

RFC PATCH 1/7 Temp: Add the PCI_EXT_ID_DVSEC definition to the qemu pci_regs.h copy.

This hasn't yet been added to the linux kernel tree, so for purposes of this RFC just add it locally.

---
 include/standard-headers/linux/pci_regs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/standard-headers/linux/pci_regs.h +2 -1
index 27164769d1..224b52e62b 100644
@@ -709,7 +709,8 @@
 #define PCI_EXT_CAP_ID_DPC	0x1D	/* Downstream Port Containment */
 #define PCI_EXT_CAP_ID_L1SS	0x1E	/* L1 PM Substates */
 #define PCI_EXT_CAP_ID_PTM	0x1F	/* Precision Time Measurement */
-#define PCI_EXT_CAP_ID_MAX	PCI_EXT_CAP_ID_PTM
+#define PCI_EXT_CAP_ID_DVSEC	0x23    /* Designated Vendor-Specific */
+#define PCI_EXT_CAP_ID_MAX	PCI_EXT_CAP_ID_DVSEC
 
 #define PCI_EXT_CAP_DSN_SIZEOF	12
 #define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
Signature · 1 line
2.20.1
#2 lore raw

RFC PATCH 2/7 pci: Add Huawei vendor ID and Huawei Emulated CCIX Device IDs.

In reply to Jonathan Cameron

These device IDs have been allocated for emulated only devices, giving us more flexibility than would be possible by emulating real devices.

They will be used for the CCIX PCIe configuration space emulation modules that follow.

---
 include/hw/pci/pci_ids.h | 5 +++++
 1 file changed, 5 insertions(+)
include/hw/pci/pci_ids.h +5 -0
index 0abe27a53a..f49be07328 100644
@@ -220,6 +220,11 @@
 #define PCI_VENDOR_ID_FREESCALE          0x1957
 #define PCI_DEVICE_ID_MPC8533E           0x0030
 
+#define PCI_VENDOR_ID_HUAWEI             0x19E5
+#define PCI_DEVICE_ID_HUAWEI_CCIX_UP     0xA260
+#define PCI_DEVICE_ID_HUAWEI_CCIX_DOWN   0xA261
+#define PCI_DEVICE_ID_HUAWEI_CCIX_EP     0xA262
+
 #define PCI_VENDOR_ID_INTEL              0x8086
 #define PCI_DEVICE_ID_INTEL_82378        0x0484
 #define PCI_DEVICE_ID_INTEL_82441        0x1237
Signature · 1 line
2.20.1
#3 lore raw

RFC PATCH 3/7 pci: CCIX config space emulation library.

In reply to Jonathan Cameron

The nature of the complex topologies supported by CCIX means that it will be sometime before it is possible to construct many of the interesting cases in hardware, and it will be extermely hard to exercise all of the combinations whilst developing firwmare and drivers.

To that end, the intent of this library and following device emulations is to allow the construction of complex CCIX toplogies via their overlaying on PCIe. The CCIX topologies are configured through CCIX specific PCIe DVSEC capabillity and control structures.

A typical mesh capable CCIX device will overlay onto N upstream PCIe switch ports, M downstream PCIe switch ports, function 0 EPs which are not PCIe switch upstream ports, P functions 1+ which have additional CCIX protocol elements described and Q functions 1+ which respresent acceleration functions, with no CCIX protocol elements (these look to be normal PCIe functions so are not covered by this patch set).

---
 hw/pci/Kconfig           |    3 +
 hw/pci/Makefile.objs     |    1 +
 hw/pci/ccix_lib.c        | 1299 ++++++++++++++++++++++++++++++++++++++
 include/hw/misc/ccix.h   |   28 +
 include/hw/pci/pci_ids.h |    2 +
 5 files changed, 1333 insertions(+)
hw/pci/Kconfig +3 -0
index 77f8b005ff..605f8dcd18 100644
@@ -13,3 +13,6 @@ config MSI_NONBROKEN
     # or support it and have a good implementation. See commit
     # 47d2b0f33c664533b8dbd5cb17faa8e6a01afe1f.
     bool
+
+config CCIX_LIB
+    bool
hw/pci/Makefile.objs +1 -0
index 8642fab622..efc17ff4dd 100644
@@ -13,3 +13,4 @@ common-obj-$(CONFIG_PCI) += ccix_per.o
 
 common-obj-$(call lnot,$(CONFIG_PCI)) += pci-stub.o
 common-obj-$(CONFIG_ALL) += pci-stub.o
+common-obj-$(CONFIG_CCIX_LIB) += ccix_lib.o
hw/pci/ccix_lib.c new file +1299 -0

1,299 lines not on this page · raw message

include/hw/misc/ccix.h new file +28 -0
new file mode 100644
index 0000000000..94aa904b53
@@ -0,0 +1,28 @@
+
+#include "hw/pci/pcie_port.h"
+typedef struct CCIXState {
+    GTree *am_tree;
+#define PRIMARY_PORT_BIT 0
+#define CCIX_IS_PORT 1
+    uint32_t flags;
+    char *ccix_dev_name;
+    uint8_t port_id;
+    uint8_t num_links;
+    uint8_t psam_entries;
+    uint8_t num_ras;
+    uint8_t num_has;
+    uint8_t rsam_entries;
+    uint8_t hsam_entries;
+    PCIDevice *pci_dev;
+    uint16_t enable_offset;
+} CCIXState;
+
+extern CCIXState *CCIXFuncs[256];
+
+uint16_t ccix_add_prldvsec(PCIDevice *pci_dev, CCIXState *s, uint16_t offset);
+void ccix_write_config(PCIDevice *pci_dev, CCIXState *s, uint32_t addr, uint32_t val_in, int l);
+uint16_t ccix_add_tdldvsec(PCIDevice *pci_dev, uint16_t offset);
+void initialize_ccixstate(CCIXState *s, PCIDevice *pci_dev);
+void ccix_register(CCIXState *s);
+
+void ccix_set_port(CCIXState *s);
include/hw/pci/pci_ids.h +2 -0
index f49be07328..19675fdac1 100644
@@ -225,6 +225,8 @@
 #define PCI_DEVICE_ID_HUAWEI_CCIX_DOWN   0xA261
 #define PCI_DEVICE_ID_HUAWEI_CCIX_EP     0xA262
 
+#define PCI_VENDOR_ID_CCIX               0x1e2c
+
 #define PCI_VENDOR_ID_INTEL              0x8086
 #define PCI_DEVICE_ID_INTEL_82378        0x0484
 #define PCI_DEVICE_ID_INTEL_82441        0x1237
Signature · 1 line
2.20.1
#4 lore raw

RFC PATCH 4/7 pci-bridge: CCIX capable PCIE/CCIX switch upstream port.

In reply to Jonathan Cameron

Note that these occur as function 0 within CCIX devices that have many other elements in the PCIE topology.

This driver has around 100 lines of code copied directly from the xio3130-upstream.c file. There are various options to avoid this:

1) Expose the xio3130 functions so this module can just call them.
2) Create a library for the code that is shared.
3) Don't worry too much about it as it's likely they will diverge overtime as we extend the CCIX driver.

---
 hw/pci-bridge/Kconfig         |   5 +
 hw/pci-bridge/Makefile.objs   |   1 +
 hw/pci-bridge/ccix_upstream.c | 197 ++++++++++++++++++++++++++++++++++
 3 files changed, 203 insertions(+)
hw/pci-bridge/Kconfig +5 -0
index a51ec716f5..f6ff8975a5 100644
@@ -27,3 +27,8 @@ config DEC_PCI
 
 config SIMBA
     bool
+
+config CCIX_SWITCH
+    default y if CCIX_EP
+    depends on PCI_EXPRESS && MSI_NONBROKEN
+    select CCIX_LIB
hw/pci-bridge/Makefile.objs +1 -0
index 47065f87d9..e266e39fed 100644
@@ -8,3 +8,4 @@ common-obj-$(CONFIG_I82801B11) += i82801b11.o
 common-obj-$(CONFIG_DEC_PCI) += dec.o
 # Sun4u
 common-obj-$(CONFIG_SIMBA) += simba.o
+common-obj-$(CONFIG_CCIX_SWITCH) += ccix_upstream.o
hw/pci-bridge/ccix_upstream.c new file +197 -0

197 lines not on this page · raw message

Signature · 1 line
2.20.1
#5 lore raw

RFC PATCH 5/7 pci-bridge: CCIX capable PCIE/CCIX switch downstream port

In reply to Jonathan Cameron

Note that this is simply emulation of the configuration space.

Has the same issue with cut and paste code as the upstream port driver. Solution likely to be the same.

---
 hw/pci-bridge/Makefile.objs     |   2 +-
 hw/pci-bridge/ccix_downstream.c | 222 ++++++++++++++++++++++++++++++++
 2 files changed, 223 insertions(+), 1 deletion(-)
hw/pci-bridge/Makefile.objs +1 -1
index e266e39fed..78a49fb90b 100644
@@ -8,4 +8,4 @@ common-obj-$(CONFIG_I82801B11) += i82801b11.o
 common-obj-$(CONFIG_DEC_PCI) += dec.o
 # Sun4u
 common-obj-$(CONFIG_SIMBA) += simba.o
-common-obj-$(CONFIG_CCIX_SWITCH) += ccix_upstream.o
+common-obj-$(CONFIG_CCIX_SWITCH) += ccix_upstream.o ccix_downstream.o
hw/pci-bridge/ccix_downstream.c new file +222 -0

222 lines not on this page · raw message

Signature · 1 line
2.20.1
#6 lore raw

RFC PATCH 6/7 misc: CCIX endpoint function

In reply to Jonathan Cameron

This handles the case where a given function is not also a PCIe topology upstream or downstream port.

This include, non function 0 functions on upstream ports and any function on a device without a PCIe switch. Note that this doesn't exclude the possibility of this being the upstream port of a CCIX layer switch.

---
 hw/misc/Kconfig       |   5 ++
 hw/misc/Makefile.objs |   1 +
 hw/misc/ccix-ep.c     | 112 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 118 insertions(+)
hw/misc/Kconfig +5 -0
index 385e1b0cec..7aba167999 100644
@@ -118,3 +118,8 @@ config AUX
     select I2C
 
 source macio/Kconfig
+
+config CCIX_EP
+    bool
+    select CCIX_LIB
+    
\ No newline at end of file
hw/misc/Makefile.objs +1 -0
index 77b9df9796..56a6cb3591 100644
@@ -6,6 +6,7 @@ common-obj-$(CONFIG_ISA_DEBUG) += debugexit.o
 common-obj-$(CONFIG_SGA) += sga.o
 common-obj-$(CONFIG_ISA_TESTDEV) += pc-testdev.o
 common-obj-$(CONFIG_PCI_TESTDEV) += pci-testdev.o
+common-obj-$(CONFIG_CCIX_EP) += ccix-ep.o
 common-obj-$(CONFIG_EDU) += edu.o
 common-obj-$(CONFIG_PCA9552) += pca9552.o
 
hw/misc/ccix-ep.c new file +112 -0

112 lines not on this page · raw message

Signature · 1 line
2.20.1
#7 lore raw

RFC PATCH 7/7 Temp: Add to ARM64 makefiles for testing

In reply to Jonathan Cameron
---
 default-configs/arm-softmmu.mak | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
default-configs/arm-softmmu.mak +2 -1
index 3158e1a10a..d5d4c8ecf1 100644
@@ -41,4 +41,5 @@ CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
 CONFIG_SEMIHOSTING=y
 CONFIG_ACPI_APEI=y
-
+CONFIG_CCIX_LIB=y
+CONFIG_CCIX_EP=y
\ No newline at end of file
Signature · 1 line
2.20.1
#8 lore raw
In reply to Jonathan Cameron

For reference alongside this patch set.

Evaluation version of the CCIX 1.0a base specification now available, (though there is a form to complete and license agreement)..

https://www.ccixconsortium.com/ccix-library/download-form/

Thanks,

Jonathan

Quoted 164 lines · On Tue, 25 Jun 2019 19:27:45 +0800 Jonathan Cameron…

CCIX topologies are 'layered' on top of PCIe tree topologies. This is done primarily by allowing a single CCIX device to appear as multiple disjoint nodes in the PCIe tree.

This layering is described via extensive PCIe DVSEC extended capabilities in PCIe config space across all the functions that are present in the device (some placement rules apply).

The extremely flexible nature of allowed topologies makes the development of generic firmware and OS software difficult if we rely on actual hardware setups, due to the large test set that is necessary.

To enable the ongoing work on EDK2 and within the Linux kernel and userspace, this series provides the bare bones of what is necessary to be able to test 'configuration' of a CCIX topology. Note that no actual CCIX data flow is being emulated within this patchset, merely a substantial subset of the interface that allows the topologies to be configured. Testing has to rely on verification based on the result rather than true emulation of the coherency protocol. (that is a very different form of emulation for which other tools are perhaps better suited).

For information on how to do the coherency protocol configuration, see the forthcoming CCIX SW guide, in conjunction with the CCIX 1.0 Base Specification.

An example of a 2x2 mesh with a spur to the host can be run with:

qemu-system-aarch64 -M virt -m 1024 -cpu cortex-a53 \
...
-device ioh3420,id=root_port1 \
-device ccix-upstream-port,num_links=4,primaryport=true,rsam_entries=4,ccix_device="ccix_dev1",bus=root_port1,addr=0.0,multifunction="on",id=up0,port_id=0 \
-device ccix-downstream-port,ccix_device="ccix_dev1",bus=up0,slot=0,chassis=2,id=bus_top,port_id=1 \
-device ccix-downstream-port,ccix_device="ccix_dev1",bus=up0,slot=1,chassis=2,id=bus_left,port_id=2 \
-device ccix-ep,primaryport=false,home_agents=1,request_agents=1,ccix_device="ccix_dev1",bus=root_port1,addr=0.1,multifunction="on" \
-device ccix-upstream-port,num_links=4,primaryport=true,rsam_entries=4,ccix_device="ccix_dev2",bus=bus_top,addr=0.0,multifunction="on",id=up1,port_id=0 \
-device ccix-downstream-port,ccix_device="ccix_dev2",bus=up1,slot=0,chassis=3,id=bus_right,port_id=1 \
-device ccix-ep,primaryport=false,request_agents=2,ccix_device="ccix_dev2",bus=bus_top,addr=0.1,multifunction="on" \
-device ccix-upstream-port,num_links=4,primaryport=true,rsam_entries=4,ccix_device="ccix_dev3",bus=bus_left,addr=0.0,multifunction="on",id=up2,port_id=0 \
-device ccix-downstream-port,ccix_device="ccix_dev3",bus=up2,slot=0,chassis=4,id=bus_bottom,port_id=1,multifunciton="on" \
-device ccix-ep,primaryport=false,request_agents=2,ccix_device="ccix_dev3",bus=bus_left,addr=0.1,multifunction="on" \
-device ccix-ep,primaryport=true,request_agents=2,ccix_device="ccix_dev4",bus=bus_right,addr=0.0,port_id=0 \
-device ccix-ep,primaryport=true,request_agents=2,ccix_device="ccix_dev4",bus=bus_bottom,addr=0.0,port_id=1

I'm not going to try drawing all the detail (it's bad enough trying to draw these in inkscape, but in a very much simplifed fashion, this generates.

-----------------

|     Host      |
|               | 
--- root_port1--
        |
        |
        v
-----------------          ---------------
|  ccix_dev1    | -------> |  ccix_dev2  |
-----------------          ---------------
        |                         |
        V                         V
-----------------          ---------------
|  ccix_dev3    | -------> |  ccix_dev4  |
-----------------          ---------------

$lspci -t
-[0000:00]-+-00.0

           +-01.0-[01-08]--+-00.0-[02-08]--+-00.0-[03-05]--+-00.0-[04-05]----00.0-[05]----00.0
                           |               |               |               \-00.1
                           |               |               \-01.0-[06-08]--+-00.0-[07-08]----00.0-[08]----00.0
                           |               |                               \-00.1
                           |               \-00.1

RFC questions:

1. The nature of CCIX devices is that we need to extend normal PCI devices, slots, and ports. I could not find an elegant way of doing this without lots of code replication. The current solution just exposes some internal functions from xio3130 port implementations. Is there a better way to do this?

2. The association of the different PCIDevices to a given CCIX device is currently somewhat of a hack. Can anyone suggest a cleaner solution for this? I can improved the current implementation, but don't really like that we basically search for all the parts whenever a cross device implementation is needed.

3. Is emulation via a large number of PCIe devices like this a good approach or is there a nicer way to handle it? Given we need to be able to 'spread' the CCIX device configuration across multiple PCIe functions anyway perhaps this is the most sensible approach.

4. I've cut and paste a 100+ lines of code from each of the xio3130_* modules as we are also implemening PCIE up and downstream ports and as this is a emulation only device, we might as well use the same register set. There are various possible ways to avoid this:
* Add a library with the shared code in it.
* Add an xio3130_upstream.h header and similar to allow the CCIX port modules to call those functions directly.
* Don't worry about the replication in the interests of keeping the code structure simple.

5. I'm not that familiar with qemu 'style' yet, so pointers on structures to use etc most welcome.

Note that not all elements of CCIX are supported by the current implementation, for example slave agents and error records are missing. These will follow either in later revisions or as follow patches. We also have no actual accelerator functions in the current design and hence no mapping to RAs.

Only a subset of configuration constraints are currently implemented. This will want tightenning up in future.

As we don't have any actual chunks of the spec in here so I haven't added the statement from the trademark grant that follows.

Thanks,

Jonathan

This patch is being distributed by the CCIX Consortium, Inc. (CCIX) to you and other parties that are paticipating (the "participants") in qemu with the understanding that the participants will use CCIX's name and trademark only when this patch is used in association with qemu.

CCIX is also distributing this patch to these participants with the understanding that if any portion of the CCIX specification will be used or referenced in qemu, the participants will not modify the cited portion of the CCIX specification and will give CCIX propery copyright attribution by including the following copyright notice with the cited part of the CCIX specification:
"© 2019 CCIX CONSORTIUM, INC. ALL RIGHTS RESERVED."

Jonathan Cameron (7):
Temp: Add the PCI_EXT_ID_DVSEC definition to the qemu pci_regs.h copy.
pci: Add Huawei vendor ID and Huawei Emulated CCIX Device IDs.
pci: CCIX config space emulation library.
pci-bridge: CCIX capable PCIE/CCIX switch upstream port.
pci-bridge: CCIX capable PCIE/CCIX switch downstream port
misc: CCIX endpoint function
Temp: Add to ARM64 makefiles for testing

 default-configs/arm-softmmu.mak           |    3 +-
 hw/misc/Kconfig                           |    5 +
 hw/misc/Makefile.objs                     |    1 +
 hw/misc/ccix-ep.c                         |  112 ++
 hw/pci-bridge/Kconfig                     |    5 +
 hw/pci-bridge/Makefile.objs               |    1 +
 hw/pci-bridge/ccix_downstream.c           |  222 ++++
 hw/pci-bridge/ccix_upstream.c             |  197 ++++
 hw/pci/Kconfig                            |    3 +
 hw/pci/Makefile.objs                      |    1 +
 hw/pci/ccix_lib.c                         | 1299 +++++++++++++++++++++
 include/hw/misc/ccix.h                    |   28 +
 include/hw/pci/pci_ids.h                  |    7 +
 include/standard-headers/linux/pci_regs.h |    3 +-
 14 files changed, 1885 insertions(+), 2 deletions(-)
 create mode 100644 hw/misc/ccix-ep.c
 create mode 100644 hw/pci-bridge/ccix_downstream.c
 create mode 100644 hw/pci-bridge/ccix_upstream.c
 create mode 100644 hw/pci/ccix_lib.c
 create mode 100644 include/hw/misc/ccix.h
#9 lore raw
In reply to Jonathan Cameron
Quoted 11 lines · Jonathan Cameron

CCIX topologies are 'layered' on top of PCIe tree topologies. This is done primarily by allowing a single CCIX device to appear as multiple disjoint nodes in the PCIe tree.

This patch is being distributed by the CCIX Consortium, Inc. (CCIX) to you and other parties that are paticipating (the "participants") in qemu with the understanding that the participants will use CCIX's name and trademark only when this patch is used in association with qemu.

Quoted 7 lines

CCIX is also distributing this patch to these participants with the understanding that if any portion of the CCIX specification will be used or referenced in qemu, the participants will not modify the cited portion of the CCIX specification and will give CCIX propery copyright attribution by including the following copyright notice with the cited part of the CCIX specification:
"© 2019 CCIX CONSORTIUM, INC. ALL RIGHTS RESERVED."

(Apologies for replying to this now quite old email, but your more recent followup email drew it to my attention.)

I think that as a project, QEMU can't take patches which come with this kind of additional constraint on top of the GPL. Could you drop these extra legal clauses, please?

thanks
-- PMM

#10 lore raw
Quoted 21 lines · On Fri, 16 Aug 2019 13:59:02 +0100 Peter Maydell <[email protected]>…
Quoted 11 lines · Jonathan Cameron

CCIX topologies are 'layered' on top of PCIe tree topologies. This is done primarily by allowing a single CCIX device to appear as multiple disjoint nodes in the PCIe tree.

This patch is being distributed by the CCIX Consortium, Inc. (CCIX) to you and other parties that are paticipating (the "participants") in qemu with the understanding that the participants will use CCIX's name and trademark only when this patch is used in association with qemu.

Quoted 7 lines

CCIX is also distributing this patch to these participants with the understanding that if any portion of the CCIX specification will be used or referenced in qemu, the participants will not modify the cited portion of the CCIX specification and will give CCIX propery copyright attribution by including the following copyright notice with the cited part of the CCIX specification:
"© 2019 CCIX CONSORTIUM, INC. ALL RIGHTS RESERVED."

Quoted 6 lines

(Apologies for replying to this now quite old email, but your more recent followup email drew it to my attention.)

I think that as a project, QEMU can't take patches which come with this kind of additional constraint on top of the GPL. Could you drop these extra legal clauses, please?

Jon, if you could raise this with CCIX legal that would be great.

Thanks,

Jonathan

Quoted 3 lines

thanks
-- PMM