[RFC PATCH 0/4] hw/i386: Factor out PXB parts of DSDT into an SSDT table

2023-03-17 Thread Jonathan Cameron via
Michael Tsirkin raised that we have recently had churn in the bios-tables-test and perhaps it was worth factoring some parts of DSDT out as SSDT files. This is an attempt to do that for the entries from pxb-pcie and pxb-cxl PCI root bridges. The main PCI root bridge and related elements are left

Re: Call failed: MCTP Endpoint did not respond: Qemu CXL switch with mctp-1.0

2023-03-17 Thread Jonathan Cameron via
On Fri, 17 Mar 2023 00:11:10 +0530 Maverickk 78 wrote: > Hi > > I am trying mctp & mctpd with aspeed +buildroot(master) + linux v6.2 > with Qemu 7.2. > > > I have added necessary FMAPI related patches into QEMU to support CLX > switch emulation > >

Re: [RESEND PATCH v6 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-03-14 Thread Jonathan Cameron via
> > diff --git a/include/hw/cxl/cxl_device.h b/include/hw/cxl/cxl_device.h > > index 7e5ad65c1d..d589f78202 100644 > > --- a/include/hw/cxl/cxl_device.h > > +++ b/include/hw/cxl/cxl_device.h > > @@ -232,6 +232,14 @@ REG64(CXL_MEM_DEV_STS, 0) > > FIELD(CXL_MEM_DEV_STS, MBOX_READY, 4, 1) > >

Re: [PATCH v4 6/6] hw/cxl: Add clear poison mailbox command support.

2023-03-13 Thread Jonathan Cameron via
On Fri, 3 Mar 2023 15:09:08 + Jonathan Cameron wrote: > Current implementation is very simple so many of the corner > cases do not exist (e.g. fragmenting larger poison list entries) > > Signed-off-by: Jonathan Cameron Another case in here of directly accessing MemoryRegion->size. I'll fix

Re: [PATCH v4 2/2] hw/cxl: Multi-Region CXL Type-3 Devices (Volatile and Persistent)

2023-03-13 Thread Jonathan Cameron via
... > > +if (vmr) { > > +if (*dpa_offset < int128_get64(vmr->size)) { > > +*as = >hostvmem_as; > > +} else { > > +*as = >hostpmem_as; > > +*dpa_offset -= vmr->size; > > You can't do math on vmr->size, it's Int128. > And generally please

Re: [PATCH v4 6/6] hw/cxl: Add clear poison mailbox command support.

2023-03-06 Thread Jonathan Cameron via
On Fri, 3 Mar 2023 22:47:20 -0800 Ira Weiny wrote: > Jonathan Cameron wrote: > > Current implementation is very simple so many of the corner > > cases do not exist (e.g. fragmenting larger poison list entries) > > One coding style change at the bottom and I'm still hung up on that loop >

[PATCH v4 7/7] hw/cxl/events: Add injection of Memory Module Events

2023-03-03 Thread Jonathan Cameron via
These events include a copy of the device health information at the time of the event. Actually using the emulated device health would require a lot of controls to manipulate that state. Given the aim of this injection code is to just test the flows when events occur, inject the contents of the

[PATCH v4 6/7] hw/cxl/events: Add injection of DRAM events

2023-03-03 Thread Jonathan Cameron via
Defined in CXL r3.0 8.2.9.2.1.2 DRAM Event Record, this event provides information related to DRAM devices. Example injection command in QMP: { "execute": "cxl-inject-dram-event", "arguments": { "path": "/machine/peripheral/cxl-mem0", "log": "informational", "flags":

[PATCH v4 5/7] hw/cxl/events: Add injection of General Media Events

2023-03-03 Thread Jonathan Cameron via
From: Ira Weiny To facilitate testing provide a QMP command to inject a general media event. The event can be added to the log specified. Signed-off-by: Ira Weiny Signed-off-by: Jonathan Cameron --- v4: * Fix endian conversion on physaddr. --- hw/mem/cxl_type3.c | 111

[PATCH v4 3/7] hw/cxl/events: Wire up get/clear event mailbox commands

2023-03-03 Thread Jonathan Cameron via
From: Ira Weiny CXL testing is benefited from an artificial event log injection mechanism. Add an event log infrastructure to insert, get, and clear events from the various logs available on a device. Replace the stubbed out CXL Get/Clear Event mailbox commands with commands that operate on

[PATCH v4 4/7] hw/cxl/events: Add event interrupt support

2023-03-03 Thread Jonathan Cameron via
From: Ira Weiny Replace the stubbed out CXL Get/Set Event interrupt policy mailbox commands. Enable those commands to control interrupts for each of the event log types. Skip the standard input mailbox length on the Set command due to DCD being optional. Perform the checks separately.

[PATCH v4 2/7] hw/cxl: Move CXLRetCode definition to cxl_device.h

2023-03-03 Thread Jonathan Cameron via
Following patches will need access to the mailbox return code type so move it to the header. Reviewed-by: Ira Weiny Signed-off-by: Jonathan Cameron --- hw/cxl/cxl-mailbox-utils.c | 28 include/hw/cxl/cxl_device.h | 28 2 files changed,

[PATCH v4 1/7] hw/cxl/events: Add event status register

2023-03-03 Thread Jonathan Cameron via
From: Ira Weiny The device status register block was defined. However, there were no individual registers nor any data wired up. Define the event status register [CXL 3.0; 8.2.8.3.1] as part of the device status register block. Wire up the register and initialize the event status for each

[PATCH v4 0/7] QEMU CXL Provide mock CXL events and irq support

2023-03-03 Thread Jonathan Cameron via
Whilst I'm an optimist, I suspect this is now 8.1 material because we have 5 CXL patch sets outstanding before it. Current bottleneck being QAPI review for the RAS error series. v4 changes: Thanks to Ira and to some feedback I received off list. - More endian fixes for a future big endian

[PATCH v4 6/6] hw/cxl: Add clear poison mailbox command support.

2023-03-03 Thread Jonathan Cameron via
Current implementation is very simple so many of the corner cases do not exist (e.g. fragmenting larger poison list entries) Signed-off-by: Jonathan Cameron --- v4: - Fix off by one on check of edge of vmr (cut and paste from similar but long fixed in the volatile memory series) - Drop

[PATCH v4 5/6] hw/cxl: Add poison injection via the mailbox.

2023-03-03 Thread Jonathan Cameron via
Very simple implementation to allow testing of corresponding kernel code. Note that for now we track each 64 byte section independently. Whilst a valid implementation choice, it may make sense to fuse entries so as to prove out more complex corners of the kernel code. Reviewed-by: Ira Weiny

[PATCH v4 4/6] hw/cxl: QMP based poison injection support

2023-03-03 Thread Jonathan Cameron via
Inject poison using qmp command cxl-inject-poison to add an entry to the poison list. For now, the poison is not returned CXL.mem reads, but only via the mailbox command Get Poison List. See CXL rev 3.0, sec 8.2.9.8.4.1 Get Poison list (Opcode 4300h) Kernel patches to use this interface here:

[PATCH v4 3/6] bswap: Add the ability to store to an unaligned 24 bit field

2023-03-03 Thread Jonathan Cameron via
From: Ira Weiny CXL has 24 bit unaligned fields which need to be stored to. CXL is specified as little endian. Define st24_le_p() and the supporting functions to store such a field from a 32 bit host native value. The use of b, w, l, q as the size specifier is limiting. So "24" was used for

[PATCH v4 2/6] hw/cxl: Introduce cxl_device_get_timestamp() utility function

2023-03-03 Thread Jonathan Cameron via
From: Ira Weiny There are new users of this functionality coming shortly so factor it out from the GET_TIMESTAMP mailbox command handling. Signed-off-by: Ira Weiny Reviewed-by: Fan Ni Signed-off-by: Jonathan Cameron --- v8: Picked up tag from Fan Ni --- hw/cxl/cxl-device-utils.c | 15

[PATCH v4 1/6] hw/cxl: rename mailbox return code type from ret_code to CXLRetCode

2023-03-03 Thread Jonathan Cameron via
Given the increasing usage of this mailbox return code type, now is a good time to switch to QEMU style naming. Reviewed-by: Ira Weiny Reviewed-by: Fan Ni Signed-off-by: Jonathan Cameron --- v8: Picked up tag from Fan Ni --- hw/cxl/cxl-mailbox-utils.c | 64

[PATCH v4 0/6] hw/cxl: Poison get, inject, clear

2023-03-03 Thread Jonathan Cameron via
Note there are several series ahead of this one and in particular the RAS error injection series needs some QAPI review. The QAPI stuff in this patch is similar but in essence very similar to what we have in that series. Whilst I'm an always an optimist, this may well end up as 8.1 material now.

Re: [PATCH v3 6/7] hw/cxl/events: Add injection of DRAM events

2023-03-03 Thread Jonathan Cameron via
On Wed, 1 Mar 2023 22:38:26 -0800 Ira Weiny wrote: > Jonathan Cameron wrote: > > Defined in CXL r3.0 8.2.9.2.1.2 DRAM Event Record, this event > > provides information related to DRAM devices. > > > > Example injection command in QMP: > > > > { "execute": "cxl-inject-dram-event", > >

Re: [PATCH v3 4/6] hw/cxl: QMP based poison injection support

2023-03-03 Thread Jonathan Cameron via
> > +memset(out, 0, out_pl_len); > > +QLIST_FOREACH(ent, poison_list, node) { > > +uint64_t start, stop; > > + > > +/* Check for no overlap */ > > +if (ent->start >= query_start + query_length || > > +ent->start + ent->length <= query_start) { > > +

Re: [PATCH v3 6/6] hw/cxl: Add clear poison mailbox command support.

2023-03-03 Thread Jonathan Cameron via
On Thu, 2 Mar 2023 17:05:22 -0800 Ira Weiny wrote: > Jonathan Cameron wrote: > > Current implementation is very simple so many of the corner > > cases do not exist (e.g. fragmenting larger poison list entries) > > > > Signed-off-by: Jonathan Cameron > > --- > > v2: > > - Endian fix > > --- > >

Re: [PATCH v3 5/7] hw/cxl/events: Add injection of General Media Events

2023-03-02 Thread Jonathan Cameron via
On Mon, 27 Feb 2023 17:34:14 + Jonathan Cameron wrote: > From: Ira Weiny > > To facilitate testing provide a QMP command to inject a general media > event. The event can be added to the log specified. > > Signed-off-by: Ira Weiny > Link: >

Re: [PATCH v6 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-03-02 Thread Jonathan Cameron via
with lots > of stuff among them QAPI. Thanks for the tip. Resent with additional CCs (hopefully to right people!) and a note that we are looking for qapi review. With the benefit of hindsight I'd have ordered the series differently if I'd guessed we'd bottleneck here. Jonathan > &g

[RESEND PATCH v6 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-03-02 Thread Jonathan Cameron via
CXL uses PCI AER Internal errors to signal to the host that an error has occurred. The host can then read more detailed status from the CXL RAS capability. For uncorrectable errors: support multiple injection in one operation as this is needed to reliably test multiple header logging support in

[RESEND PATCH v6 7/8] hw/pci/aer: Make PCIE AER error injection facility available for other emulation to use.

2023-03-02 Thread Jonathan Cameron via
This infrastructure will be reused for CXL RAS error injection in patches that follow. Reviewed-by: Dave Jiang Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Jonathan Cameron --- hw/pci/pci-internal.h | 1 - include/hw/pci/pcie_aer.h | 1 + 2 files changed, 1 insertion(+), 1

[RESEND PATCH v6 6/8] hw/cxl: Fix endian issues in CXL RAS capability defaults / masks

2023-03-02 Thread Jonathan Cameron via
As these are about to be modified, fix the endian handle for this set of registers rather than making it worse. Note that CXL is currently only supported in QEMU on x86 (arm64 patches out of tree) so we aren't going to yet hit an problems with big endian. However it is good to avoid making things

[RESEND PATCH v6 5/8] hw/mem/cxl-type3: Add AER extended capability

2023-03-02 Thread Jonathan Cameron via
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 Reviewed-by: Dave Jiang --- hw/mem/cxl_type3.c | 13 + 1 file changed, 13 insertions(+) diff

[RESEND PATCH v6 4/8] hw/pci-bridge/cxl_root_port: Wire up MSI

2023-03-02 Thread Jonathan Cameron via
Done to avoid fixing ACPI route description of traditional PCI interrupts on q35 and because we should probably move with the times anyway. Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang --- hw/pci-bridge/cxl_root_port.c | 61 +++ 1 file changed, 61

[RESEND PATCH v6 3/8] hw/pci-bridge/cxl_root_port: Wire up AER

2023-03-02 Thread Jonathan Cameron via
We are missing necessary config write handling for AER emulation in the CXL root port. Add it based on pcie_root_port.c Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang --- hw/pci-bridge/cxl_root_port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/pci-bridge/cxl_root_port.c

[RESEND PATCH v6 2/8] hw/pci/aer: Add missing routing for AER errors

2023-03-02 Thread Jonathan Cameron via
PCIe r6.0 Figure 6-3 "Pseudo Logic Diagram for Selected Error Message Control and Status Bits" includes a right hand branch under "All PCI Express devices" that allows for messages to be generated or sent onwards without SERR# being set as long as the appropriate per error class bit in the PCIe

[RESEND PATCH v6 0/8] hw/cxl: RAS error emulation and injection

2023-03-02 Thread Jonathan Cameron via
Resending to expand CC list. Looking in particular for review of the QAPI part of patch 8. v6: Thanks to Philippe Mathieu-Daudé - Added 'Since' entries to qapi docs. - Added error prints to stubs rather than doing nothing at all. (these two comments will be applied to the Poison injeciton series

[RESEND PATCH v6 1/8] hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register

2023-03-02 Thread Jonathan Cameron via
This register in AER should be both writeable and should have a default value with a couple of the errors masked including the Uncorrectable Internal Error used by CXL for it's error reporting. Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang --- hw/pci/pcie_aer.c | 4

Re: [PATCH 00/33] pci(pc/q35): acpi-index support on non-hotpluggable slots

2023-03-02 Thread Jonathan Cameron via
On Thu, 2 Mar 2023 05:59:16 -0500 "Michael S. Tsirkin" wrote: > On Fri, Feb 24, 2023 at 04:37:39PM +0100, Igor Mammedov wrote: > > Series extends acpi-index support to host-bridge(s) and bridges > > with disabled hotplug (either explicitly or implicitly). > > Whats new (it is still limited to

[PATCH v3 6/6] hw/cxl: Add clear poison mailbox command support.

2023-03-02 Thread Jonathan Cameron via
Current implementation is very simple so many of the corner cases do not exist (e.g. fragmenting larger poison list entries) Signed-off-by: Jonathan Cameron --- v2: - Endian fix --- hw/cxl/cxl-mailbox-utils.c | 79 + hw/mem/cxl_type3.c | 36

[PATCH v3 5/6] hw/cxl: Add poison injection via the mailbox.

2023-03-02 Thread Jonathan Cameron via
Very simple implementation to allow testing of corresponding kernel code. Note that for now we track each 64 byte section independently. Whilst a valid implementation choice, it may make sense to fuse entries so as to prove out more complex corners of the kernel code. Signed-off-by: Jonathan

[PATCH v3 4/6] hw/cxl: QMP based poison injection support

2023-03-02 Thread Jonathan Cameron via
Inject poison using qmp command cxl-inject-poison to add an entry to the poison list. For now, the poison is not returned CXL.mem reads, but only via the mailbox command Get Poison List. See CXL rev 3.0, sec 8.2.9.8.4.1 Get Poison list (Opcode 4300h) Kernel patches to use this interface here:

[PATCH v3 3/6] bswap: Add the ability to store to an unaligned 24 bit field

2023-03-02 Thread Jonathan Cameron via
From: Ira Weiny CXL has 24 bit unaligned fields which need to be stored to. CXL is specified as little endian. Define st24_le_p() and the supporting functions to store such a field from a 32 bit host native value. The use of b, w, l, q as the size specifier is limiting. So "24" was used for

[PATCH v3 2/6] hw/cxl: Introduce cxl_device_get_timestamp() utility function

2023-03-02 Thread Jonathan Cameron via
From: Ira Weiny There are new users of this functionality coming shortly so factor it out from the GET_TIMESTAMP mailbox command handling. Signed-off-by: Ira Weiny Reviewed-by: Fan Ni Signed-off-by: Jonathan Cameron --- v8: Picked up tag from Fan Ni --- hw/cxl/cxl-device-utils.c | 15

[PATCH v3 1/6] hw/cxl: rename mailbox return code type from ret_code to CXLRetCode

2023-03-02 Thread Jonathan Cameron via
Given the increasing usage of this mailbox return code type, now is a good time to switch to QEMU style naming. Reviewed-by: Ira Weiny Reviewed-by: Fan Ni Signed-off-by: Jonathan Cameron --- v8: Picked up tag from Fan Ni --- hw/cxl/cxl-mailbox-utils.c | 64

[PATCH v3 0/6] hw/cxl: Poison get, inject, clear

2023-03-02 Thread Jonathan Cameron via
v3: - Gather tags. Thanks Fan Ni - CC qapi maintainers. Thanks Michael Tsirkin Note Alison has stated the kernel series will be post 6.3 material so this one isn't quite as urgent as the patches it is based on. However I think this series in a good state (plus I have lots more queued behind it)

Re: [PATCH v6 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-03-02 Thread Jonathan Cameron via
Jonathan Cameron via wrote: > CXL uses PCI AER Internal errors to signal to the host that an error has > occurred. The host can then read more detailed status from the CXL RAS > capability. > > For uncorrectable errors: support multiple injection in one operation > as this is

Re: [PATCH v2 0/6] hw/cxl: Poison get, inject, clear

2023-03-02 Thread Jonathan Cameron via
On Wed, 1 Mar 2023 17:15:56 -0800 Alison Schofield wrote: > On Mon, Feb 27, 2023 at 05:03:05PM +, Jonathan Cameron wrote: > > Hi Jonathan, > Can you share your repo with this support? How about your qemu cmdline? > I'm more of a 'try it out' type of a reviewer for qemu changes.

[PATCH] MAINTAINERS: Add Fan Ni as Compute eXpress Link QEMU reviewer

2023-02-28 Thread Jonathan Cameron via
Fan Ni has offered to help out with QEMU CXL emulation reviewing. Add him as a designated reviewer. Signed-off-by: Jonathan Cameron -- Thanks to Fan for stepping up after I requested help following Ben stepping down as co-maintainer. Fan base been active in testing and review recently so great

Re: [RFC] CXL: TCG/KVM instruction alignment issue discussion default

2023-02-28 Thread Jonathan Cameron via
On Mon, 27 Feb 2023 11:06:47 + Jørgen Hansen wrote: > On 2/18/23 11:22, Gregory Price wrote: > > Breaking this off into a separate thread for archival sake. > > > > There's a bug with handling execution of instructions held in CXL > > memory - specifically when an instruction crosses a page

[PATCH v3 7/7] hw/cxl/events: Add injection of Memory Module Events

2023-02-27 Thread Jonathan Cameron via
These events include a copy of the device health information at the time of the event. Actually using the emulated device health would require a lot of controls to manipulate that state. Given the aim of this injection code is to just test the flows when events occur, inject the contents of the

[PATCH v3 6/7] hw/cxl/events: Add injection of DRAM events

2023-02-27 Thread Jonathan Cameron via
Defined in CXL r3.0 8.2.9.2.1.2 DRAM Event Record, this event provides information related to DRAM devices. Example injection command in QMP: { "execute": "cxl-inject-dram-event", "arguments": { "path": "/machine/peripheral/cxl-mem0", "log": "informational", "flags":

[PATCH v3 5/7] hw/cxl/events: Add injection of General Media Events

2023-02-27 Thread Jonathan Cameron via
From: Ira Weiny To facilitate testing provide a QMP command to inject a general media event. The event can be added to the log specified. Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20221221-ira-cxl-events-2022-11-17-v2-8-2ce2ecc06...@intel.com Signed-off-by: Jonathan Cameron

[PATCH v3 4/7] hw/cxl/events: Add event interrupt support

2023-02-27 Thread Jonathan Cameron via
From: Ira Weiny Replace the stubbed out CXL Get/Set Event interrupt policy mailbox commands. Enable those commands to control interrupts for each of the event log types. Skip the standard input mailbox length on the Set command due to DCD being optional. Perform the checks separately.

[PATCH v3 3/7] hw/cxl/events: Wire up get/clear event mailbox commands

2023-02-27 Thread Jonathan Cameron via
From: Ira Weiny CXL testing is benefited from an artificial event log injection mechanism. Add an event log infrastructure to insert, get, and clear events from the various logs available on a device. Replace the stubbed out CXL Get/Clear Event mailbox commands with commands that operate on

[PATCH v3 2/7] hw/cxl: Move CXLRetCode definition to cxl_device.h

2023-02-27 Thread Jonathan Cameron via
Following patches will need access to the mailbox return code type so move it to the header. Reviewed-by: Ira Weiny Signed-off-by: Jonathan Cameron --- hw/cxl/cxl-mailbox-utils.c | 28 include/hw/cxl/cxl_device.h | 28 2 files changed,

[PATCH v3 1/7] hw/cxl/events: Add event status register

2023-02-27 Thread Jonathan Cameron via
From: Ira Weiny The device status register block was defined. However, there were no individual registers nor any data wired up. Define the event status register [CXL 3.0; 8.2.8.3.1] as part of the device status register block. Wire up the register and initialize the event status for each

[PATCH v3 0/7] QEMU CXL Provide mock CXL events and irq support

2023-02-27 Thread Jonathan Cameron via
Whilst I'm an optimist, I suspect this is now 8.1 material because we have 5 CXL patch sets outstanding before it. One of the earlier series has non trivial PCI changes, so I'm hoping to route all these through Michael Tsirkin as for previous releases. v3: A lot of changes due to rebasing on

[PATCH v2 6/6] hw/cxl: Add clear poison mailbox command support.

2023-02-27 Thread Jonathan Cameron via
Current implementation is very simple so many of the corner cases do not exist (e.g. fragmenting larger poison list entries) Signed-off-by: Jonathan Cameron --- v2: - Endian fix --- hw/cxl/cxl-mailbox-utils.c | 79 + hw/mem/cxl_type3.c | 36

[PATCH v2 5/6] hw/cxl: Add poison injection via the mailbox.

2023-02-27 Thread Jonathan Cameron via
Very simple implementation to allow testing of corresponding kernel code. Note that for now we track each 64 byte section independently. Whilst a valid implementation choice, it may make sense to fuse entries so as to prove out more complex corners of the kernel code. Signed-off-by: Jonathan

[PATCH v2 4/6] hw/cxl: QMP based poison injection support

2023-02-27 Thread Jonathan Cameron via
Inject poison using qmp command cxl-inject-poison to add an entry to the poison list. For now, the poison is not returned CXL.mem reads, but only via the mailbox command Get Poison List. See CXL rev 3.0, sec 8.2.9.8.4.1 Get Poison list (Opcode 4300h) Kernel patches to use this interface here:

[PATCH v2 3/6] bswap: Add the ability to store to an unaligned 24 bit field

2023-02-27 Thread Jonathan Cameron via
From: Ira Weiny CXL has 24 bit unaligned fields which need to be stored to. CXL is specified as little endian. Define st24_le_p() and the supporting functions to store such a field from a 32 bit host native value. The use of b, w, l, q as the size specifier is limiting. So "24" was used for

[PATCH v2 1/6] hw/cxl: rename mailbox return code type from ret_code to CXLRetCode

2023-02-27 Thread Jonathan Cameron via
Given the increasing usage of this mailbox return code type, now is a good time to switch to QEMU style naming. Reviewed-by: Ira Weiny Signed-off-by: Jonathan Cameron -- v7: (thanks to Ira Weiny for review) - Rename in place as the move to the header isn't needed for this series That move

[PATCH v2 2/6] hw/cxl: Introduce cxl_device_get_timestamp() utility function

2023-02-27 Thread Jonathan Cameron via
From: Ira Weiny There are new users of this functionality coming shortly so factor it out from the GET_TIMESTAMP mailbox command handling. Signed-off-by: Ira Weiny Signed-off-by: Jonathan Cameron --- hw/cxl/cxl-device-utils.c | 15 +++ hw/cxl/cxl-mailbox-utils.c | 11

[PATCH v2 0/6] hw/cxl: Poison get, inject, clear

2023-02-27 Thread Jonathan Cameron via
v2: Thanks to Ira for review and also to Philippe as some of the changes follow through from comments on precusor series. - Fixed a bunch of endian issues. Note that QEMU CXL suppport only currently supports platforms that happen to be little endian so these are more theoretical than bugs

[PATCH v4 2/2] hw/cxl: Multi-Region CXL Type-3 Devices (Volatile and Persistent)

2023-02-27 Thread Jonathan Cameron via
From: Gregory Price This commit enables each CXL Type-3 device to contain one volatile memory region and one persistent region. Two new properties have been added to cxl-type3 device initialization: [volatile-memdev] and [persistent-memdev] The existing [memdev] property has been

[PATCH v4 1/2] tests/qtest/cxl-test: whitespace, line ending cleanup

2023-02-27 Thread Jonathan Cameron via
From: Gregory Price Defines are starting to exceed line length limits, align them for cleanliness before making modifications. Signed-off-by: Gregory Price Signed-off-by: Jonathan Cameron --- tests/qtest/cxl-test.c | 84 +++--- 1 file changed, 46

[PATCH v4 0/2] hw/mem: CXL Type-3 Volatile Memory Support

2023-02-27 Thread Jonathan Cameron via
v4: Thanks to Philippe for review. - Fixed up little endian issues in code that was changing anyway. - Added deprected docs entry. Based on following series (in order) 1. [PATCH v4 00/10] hw/cxl: CXL emulation cleanups and minor fixes for upstream 2. [PATCH v6 0/8] hw/cxl: RAS error emulation and

[PATCH v2 2/2] hw/pxb-cxl: Support passthrough HDM Decoders unless overridden

2023-02-27 Thread Jonathan Cameron via
The CXL r3.0 specification allows for there to be no HDM decoders on CXL Host Bridges if they have only a single root port. Instead, all accesses directed to the host bridge (as specified in CXL Fixed Memory Windows) are assumed to be routed to the single root port. Linux currently assumes this

[PATCH v2 1/2] hw/pci: Add pcie_count_ds_port() and pcie_find_port_first() helpers

2023-02-27 Thread Jonathan Cameron via
These two helpers enable host bridges to operate differently depending on the number of downstream ports, in particular if there is only a single port. Useful for CXL where HDM address decoders are allowed to be implicit in the host bridge if there is only a single root port. Signed-off-by:

[PATCH v2 0/2] hw/cxl: Passthrough HDM decoder emulation

2023-02-27 Thread Jonathan Cameron via
v2: - Rebase and pick up tags. - State prereq patche sets more clearly. Mostly sending out again because some of the precursors have been updated and to fix a typo in a tag given on v1. Until now, testing using CXL has relied up always using two root ports below a host bridge, to work around a

Re: [PATCH 5/6] hw/cxl: Add poison injection via the mailbox.

2023-02-27 Thread Jonathan Cameron via
On Tue, 21 Feb 2023 17:18:01 -0800 Ira Weiny wrote: > Jonathan Cameron wrote: > > Very simple implementation to allow testing of corresponding > > kernel code. Note that for now we track each 64 byte section > > independently. Whilst a valid implementation choice, it may > > make sense to fuse

[PATCH v6 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-02-27 Thread Jonathan Cameron via
CXL uses PCI AER Internal errors to signal to the host that an error has occurred. The host can then read more detailed status from the CXL RAS capability. For uncorrectable errors: support multiple injection in one operation as this is needed to reliably test multiple header logging support in

[PATCH v6 7/8] hw/pci/aer: Make PCIE AER error injection facility available for other emulation to use.

2023-02-27 Thread Jonathan Cameron via
This infrastructure will be reused for CXL RAS error injection in patches that follow. Reviewed-by: Dave Jiang Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Jonathan Cameron --- hw/pci/pci-internal.h | 1 - include/hw/pci/pcie_aer.h | 1 + 2 files changed, 1 insertion(+), 1

[PATCH v6 6/8] hw/cxl: Fix endian issues in CXL RAS capability defaults / masks

2023-02-27 Thread Jonathan Cameron via
As these are about to be modified, fix the endian handle for this set of registers rather than making it worse. Note that CXL is currently only supported in QEMU on x86 (arm64 patches out of tree) so we aren't going to yet hit an problems with big endian. However it is good to avoid making things

[PATCH v6 5/8] hw/mem/cxl-type3: Add AER extended capability

2023-02-27 Thread Jonathan Cameron via
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 Reviewed-by: Dave Jiang --- hw/mem/cxl_type3.c | 13 + 1 file changed, 13 insertions(+) diff

[PATCH v6 4/8] hw/pci-bridge/cxl_root_port: Wire up MSI

2023-02-27 Thread Jonathan Cameron via
Done to avoid fixing ACPI route description of traditional PCI interrupts on q35 and because we should probably move with the times anyway. Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang --- hw/pci-bridge/cxl_root_port.c | 61 +++ 1 file changed, 61

[PATCH v6 3/8] hw/pci-bridge/cxl_root_port: Wire up AER

2023-02-27 Thread Jonathan Cameron via
We are missing necessary config write handling for AER emulation in the CXL root port. Add it based on pcie_root_port.c Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang --- hw/pci-bridge/cxl_root_port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/pci-bridge/cxl_root_port.c

[PATCH v6 2/8] hw/pci/aer: Add missing routing for AER errors

2023-02-27 Thread Jonathan Cameron via
PCIe r6.0 Figure 6-3 "Pseudo Logic Diagram for Selected Error Message Control and Status Bits" includes a right hand branch under "All PCI Express devices" that allows for messages to be generated or sent onwards without SERR# being set as long as the appropriate per error class bit in the PCIe

[PATCH v6 1/8] hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register

2023-02-27 Thread Jonathan Cameron via
This register in AER should be both writeable and should have a default value with a couple of the errors masked including the Uncorrectable Internal Error used by CXL for it's error reporting. Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang --- hw/pci/pcie_aer.c | 4

[PATCH v6 0/8] hw/cxl: RAS error emulation and injection

2023-02-27 Thread Jonathan Cameron via
v6: Thanks to Philippe Mathieu-Daudé - Added 'Since' entries to qapi docs. - Added error prints to stubs rather than doing nothing at all. (these two comments will be applied to the Poison injeciton series as well) - Picked up tags Long discussion on whether there was a good way to make the qapi

Re: [PATCH v5 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-02-24 Thread Jonathan Cameron via
On Thu, 23 Feb 2023 14:27:48 + Jonathan Cameron wrote: > On Thu, 23 Feb 2023 08:37:46 +0100 > Markus Armbruster wrote: > > > Thomas Huth writes: > > > > > On 22/02/2023 19.16, Philippe Mathieu-Daudé wrote: > > >> +Thomas (meson) & Marc-André (conditional QAPI) > > > > > > +

Re: [PATCH 1/6] hw/cxl: Move enum ret_code definition to cxl_device.h

2023-02-24 Thread Jonathan Cameron via
On Tue, 21 Feb 2023 17:47:23 -0800 Ira Weiny wrote: > Jonathan Cameron wrote: > > Needs tidy up and rename to something more generic now it is > > in a header. > > I'm not opposed to this change and patch 2 but I don't see where > CXLRetCode is being used outside of cxl-mailbox-utils.c in

Re: [PATCH 2/2] hw/cxl: Multi-Region CXL Type-3 Devices (Volatile and Persistent)

2023-02-24 Thread Jonathan Cameron via
On Fri, 24 Feb 2023 00:29:47 + Fan Ni wrote: > On Mon, Feb 20, 2023 at 11:46:46AM +, Jonathan Cameron wrote: > > > On Fri, 17 Feb 2023 06:08:57 -0500 > > Gregory Price wrote: > > > > > On Fri, Feb 17, 2023 at 04:16:17PM +, Jonathan Cameron vi

Re: [PATCH v5 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-02-23 Thread Jonathan Cameron via
On Thu, 23 Feb 2023 08:37:46 +0100 Markus Armbruster wrote: > Thomas Huth writes: > > > On 22/02/2023 19.16, Philippe Mathieu-Daudé wrote: > >> +Thomas (meson) & Marc-André (conditional QAPI) > > > > + Markus > > > >> On 22/2/23 17:49, Jonathan Cameron wrote: > > [...] > > >>

Re: [PATCH 4/6] hw/cxl: QMP based poison injection support

2023-02-22 Thread Jonathan Cameron via
On Tue, 21 Feb 2023 17:14:05 -0800 Ira Weiny wrote: > Jonathan Cameron wrote: > > Inject poison using qmp command cxl-inject-poison to add an entry to the > > poison list. > > > > For now, the poison is not returned CXL.mem reads, but only via the > > mailbox command Get Poison List. > > > >

Re: [PATCH v5 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-02-22 Thread Jonathan Cameron via
... > >>> +# Type of uncorrectable CXL error to inject. These errors are reported > >>> via > >>> +# an AER uncorrectable internal error with additional information logged > >>> at > >>> +# the CXL device. > >>> +# > >>> +# @cache-data-parity: Data error such as data parity or data ECC error

Re: [PATCH v5 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-02-22 Thread Jonathan Cameron via
On Tue, 21 Feb 2023 23:15:49 +0100 Philippe Mathieu-Daudé wrote: > Hi Jonathan, > > On 21/2/23 16:21, Jonathan Cameron wrote: > > CXL uses PCI AER Internal errors to signal to the host that an error has > > occurred. The host can then read more detailed status from the CXL RAS > > capability. >

Re: [PATCH v3 0/2] hw/mem: CXL Type-3 Volatile Memory Support

2023-02-21 Thread Jonathan Cameron via
On Tue, 21 Feb 2023 14:00:21 + Jonathan Cameron wrote: > v3: Noticed whilst chasing an unrelated kernel bug. > - Drop setting of DVSEC range base addresses. Whilst harmless, >expectation is that this will be 0 until the OS sets it (or uses >HDM decoders instead) > > Based on

[PATCH v5 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-02-21 Thread Jonathan Cameron via
CXL uses PCI AER Internal errors to signal to the host that an error has occurred. The host can then read more detailed status from the CXL RAS capability. For uncorrectable errors: support multiple injection in one operation as this is needed to reliably test multiple header logging support in

[PATCH v5 7/8] hw/pci/aer: Make PCIE AER error injection facility available for other emulation to use.

2023-02-21 Thread Jonathan Cameron via
This infrastructure will be reused for CXL RAS error injection in patches that follow. Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang --- hw/pci/pci-internal.h | 1 - include/hw/pci/pcie_aer.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v5 6/8] hw/cxl: Fix endian issues in CXL RAS capability defaults / masks

2023-02-21 Thread Jonathan Cameron via
As these are about to be modified, fix the endian handle for this set of registers rather than making it worse. Note that CXL is currently only supported in QEMU on x86 (arm64 patches out of tree) so we aren't going to yet hit an problems with big endian. However it is good to avoid making things

[PATCH v5 5/8] hw/mem/cxl-type3: Add AER extended capability

2023-02-21 Thread Jonathan Cameron via
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. Reviewed-by: Dave Jiang Signed-off-by: Jonathan Cameron --- hw/mem/cxl_type3.c | 13 + 1 file changed, 13 insertions(+) diff

[PATCH v5 4/8] hw/pci-bridge/cxl_root_port: Wire up MSI

2023-02-21 Thread Jonathan Cameron via
Done to avoid fixing ACPI route description of traditional PCI interrupts on q35 and because we should probably move with the times anyway. Reviewed-by: Dave Jiang Signed-off-by: Jonathan Cameron --- hw/pci-bridge/cxl_root_port.c | 61 +++ 1 file changed, 61

[PATCH v5 3/8] hw/pci-bridge/cxl_root_port: Wire up AER

2023-02-21 Thread Jonathan Cameron via
We are missing necessary config write handling for AER emulation in the CXL root port. Add it based on pcie_root_port.c Reviewed-by: Dave Jiang Signed-off-by: Jonathan Cameron --- hw/pci-bridge/cxl_root_port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH v5 2/8] hw/pci/aer: Add missing routing for AER errors

2023-02-21 Thread Jonathan Cameron via
PCIe r6.0 Figure 6-3 "Pseudo Logic Diagram for Selected Error Message Control and Status Bits" includes a right hand branch under "All PCI Express devices" that allows for messages to be generated or sent onwards without SERR# being set as long as the appropriate per error class bit in the PCIe

[PATCH v5 1/8] hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register

2023-02-21 Thread Jonathan Cameron via
This register in AER should be both writeable and should have a default value with a couple of the errors masked including the Uncorrectable Internal Error used by CXL for it's error reporting. Reviewed-by: Dave Jiang Signed-off-by: Jonathan Cameron --- hw/pci/pcie_aer.c | 4

[PATCH v5 0/8] hw/cxl: RAS error emulation and injection

2023-02-21 Thread Jonathan Cameron via
v5: thanks to Dave Jiang for review. - Spell out Implementation Defined. - Pick up Dave's tags - thanks! v4: In response to similar feedback on poison injection series (Markus Armbruster). - More detailed documentation in cxl.json - Based on tag in format suggested by Markus. Based on series

[PATCH v3 2/2] hw/cxl: Multi-Region CXL Type-3 Devices (Volatile and Persistent)

2023-02-21 Thread Jonathan Cameron via
From: Gregory Price This commit enables each CXL Type-3 device to contain one volatile memory region and one persistent region. Two new properties have been added to cxl-type3 device initialization: [volatile-memdev] and [persistent-memdev] The existing [memdev] property has been

[PATCH v3 1/2] tests/qtest/cxl-test: whitespace, line ending cleanup

2023-02-21 Thread Jonathan Cameron via
From: Gregory Price Defines are starting to exceed line length limits, align them for cleanliness before making modifications. Signed-off-by: Gregory Price Signed-off-by: Jonathan Cameron --- tests/qtest/cxl-test.c | 84 +++--- 1 file changed, 46

[PATCH v3 0/2] hw/mem: CXL Type-3 Volatile Memory Support

2023-02-21 Thread Jonathan Cameron via
v3: Noticed whilst chasing an unrelated kernel bug. - Drop setting of DVSEC range base addresses. Whilst harmless, expectation is that this will be 0 until the OS sets it (or uses HDM decoders instead) Based on following series (in order) 1. [PATCH v4 00/10] hw/cxl: CXL emulation cleanups

Re: [PATCH] MAINTAINERS: Remove CXL maintainer Ben Widawsky

2023-02-21 Thread Jonathan Cameron via
On Mon, 20 Feb 2023 22:24:37 +0100 Markus Armbruster wrote: > Ben is no longer with intel. He told me he expected to get back to > CXL, but it's not happening as quickly as he'd like, and that it's > best to remove him as maintainer. So let's do that. > > Thank you for serving as maintainer,

Re: [PATCH 2/2] hw/cxl: Multi-Region CXL Type-3 Devices (Volatile and Persistent)

2023-02-20 Thread Jonathan Cameron via
On Fri, 17 Feb 2023 06:08:57 -0500 Gregory Price wrote: > On Fri, Feb 17, 2023 at 04:16:17PM +0000, Jonathan Cameron via wrote: > > On Tue, 31 Jan 2023 16:38:47 + > > Jonathan Cameron via wrote: > > > > > From: Gregory Price > > > > >

<    4   5   6   7   8   9   10   11   12   13   >