[Bug 1908450] [NEW] ide/core.c ATA Major Version reporting incorrect

2020-12-16 Thread Gregory Price
Public bug reported: @@ -165,7 +165,7 @@ static void ide_identify(IDEState *s) put_le16(p + 76, (1 << 8)); } put_le16(p + 80, 0xf0); /* ata3 -> ata6 supported */ - put_le16(p + 80, 0xf0); /* ata3 -> ata6 supported */ + put_le16(p + 80, ((1 << 6) | (1 << 5) (1 << 4) (1 << 3));

[Bug 1908450] Re: ide/core.c ATA Major Version reporting incorrect

2021-01-14 Thread Gregory Price
for what it's worth, i have yet to see a driver actually check this field. I have seen a ton of code (OVMF and others) detect other information and just straight up say "I'm in QEMU" and YOLO a bunch of things like assuming DMA is available and such, so I somewhat doubt anyone *actually* checks

[Bug 1908450] Re: ide/core.c ATA Major Version reporting incorrect

2021-01-14 Thread Gregory Price
I would just fix the comment for now, likewise I don't have the time to audit whether the emulation provides full coverage of the standard. Really there's two cases here 1) We report ATA4-7 (current status), someone discovers missing bits feature Response: They file a ticket on the missing

Re: [PATCH 4/5] cxl/type3: add an optional mhd validation function for memory accesses

2023-09-05 Thread Gregory Price
On Mon, Sep 04, 2023 at 06:02:14PM +0100, Jonathan Cameron wrote: > On Thu, 31 Aug 2023 21:29:13 -0400 > Gregory Price wrote: > > > When memory accesses are made, some MHSLD's would validate the address > > is within the scope of allocated sections. To do this, the base

Re: [PATCH 0/5 v2] CXL: SK hynix Niagara MHSLD Device

2023-09-05 Thread Gregory Price
On Tue, Sep 05, 2023 at 11:04:56AM +0200, Philippe Mathieu-Daudé wrote: > On 1/9/23 03:29, Gregory Price wrote: > > v2: > > - 5 patch series, first 4 are pull-aheads that can be merged separately > > > > This patch set includes an emulation of the SK hynix Niagara MHS

Re: [PATCH 3/5] cxl/type3: Expose ct3 functions so that inheriters can call them

2023-09-05 Thread Gregory Price
On Tue, Sep 05, 2023 at 10:59:15AM +0200, Philippe Mathieu-Daudé wrote: > Hi Gregory, > > On 1/9/23 03:29, Gregory Price wrote: > > For devices built on top of ct3, we need the init, realize, and > > exit functions exposed to correctly start up and tear down. > > Yo

[PATCH v3 5/6] cxl/mailbox, type3: Implement MHD get info command callback

2023-09-06 Thread Gregory Price
For multi-headed type 3 devices, this command reports logical device mappings for each head. Implement a callback which can be initialized by MHD devices to field these commands. Reports "unsupported" if the command is called but the callback is not implemented. Signed-off-by: Gre

[PATCH v3 1/6] cxl/mailbox: move mailbox effect definitions to a header

2023-09-06 Thread Gregory Price
Preparation for allowing devices to define their own CCI commands Signed-off-by: Gregory Price --- hw/cxl/cxl-mailbox-utils.c | 30 +- include/hw/cxl/cxl_mailbox.h | 18 ++ 2 files changed, 31 insertions(+), 17 deletions(-) create mode 100644

[PATCH v3 3/6] cxl/type3: Expose ct3 functions so that inheriters can call them

2023-09-06 Thread Gregory Price
For devices built on top of ct3, we need the init, realize, and exit functions exposed to correctly start up and tear down. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 6 +++--- include/hw/cxl/cxl_device.h | 4 2 files changed, 7 insertions(+), 3 deletions(-) diff --git

[PATCH v3 6/6] cxl/vendor: SK hynix Niagara Multi-Headed SLD Device

2023-09-06 Thread Gregory Price
of sections section_size : size of a section in 128mb increments shmid : shmid produced by ipcmk Example: $shmid1=ipcmk -M 131072 ./init_niagara 4 32 1 $shmid1 Signed-off-by: Gregory Price --- hw/cxl/Kconfig | 4 + hw/cxl/meson.build

[PATCH v3 4/6] cxl/type3: add an optional mhd validation function for memory accesses

2023-09-06 Thread Gregory Price
When memory accesses are made, some MHSLD's would validate the address is within the scope of allocated sections. To do this, the base device must call an optional function set by inherited devices. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 15 +++ include/hw

[PATCH v3 0/6] CXL: SK hynix Niagara MHSLD Device

2023-09-06 Thread Gregory Price
CXL commands to be passed through the mailbox driver, so users should enable `CONFIG_CXL_MEM_RAW_COMMANDS=y` on the kernel of their QEMU instance if they wish to test it. Signed-off-by: Gregory Price Gregory Price (6): cxl/mailbox: move mailbox effect definitions to a header cxl/type3

[PATCH v3 2/6] cxl/type3: Cleanup multiple CXL_TYPE3() calls in read/write functions

2023-09-06 Thread Gregory Price
Call CXL_TYPE3 once at top of function to avoid multiple invocations. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index fd9d134d46..80d596ee10 100644 --- a/hw/mem

Re: [PATCH 3/4] cxl/type3: minimum MHD cci support

2023-08-31 Thread Gregory Price
On Mon, Aug 07, 2023 at 03:56:09PM +0100, Jonathan Cameron wrote: > On Fri, 21 Jul 2023 12:35:08 -0400 > Gregory Price wrote: > > > Implement the MHD GET_INFO cci command and add a shared memory > > region to the type3 device to host the information. > > > > A

[PATCH 5/5] cxl/vendor: SK hynix Niagara Multi-Headed SLD Device

2023-08-31 Thread Gregory Price
of sections section_size : size of a section in 128mb increments shmid : shmid produced by ipcmk Example: $shmid1=ipcmk -M 131072 ./init_niagara 4 32 1 $shmid1 Signed-off-by: Gregory Price Signed-off-by: Junhee Ryu Signed-off-by: Kwangjin Ko --- hw/cxl/Kconfig

[PATCH 1/5] cxl/mailbox: move mailbox effect definitions to a header

2023-08-31 Thread Gregory Price
Preparation for allowing devices to define their own CCI commands Signed-off-by: Gregory Price --- hw/cxl/cxl-mailbox-utils.c | 35 +++ include/hw/cxl/cxl_mailbox.h | 18 ++ 2 files changed, 37 insertions(+), 16 deletions(-) create mode 100644

[PATCH 0/5 v2] CXL: SK hynix Niagara MHSLD Device

2023-08-31 Thread Gregory Price
allowing raw CXL commands to be passed through the mailbox driver, so users should enable `CONFIG_CXL_MEM_RAW_COMMANDS=y` on the kernel of their QEMU instance if they wish to test it Signed-off-by: Gregory Price Gregory Price (5): cxl/mailbox: move mailbox effect definitions to a header cxl/type3

[PATCH 3/5] cxl/type3: Expose ct3 functions so that inheriters can call them

2023-08-31 Thread Gregory Price
For devices built on top of ct3, we need the init, realize, and exit functions exposed to correctly start up and tear down. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 8 include/hw/cxl/cxl_device.h | 5 + 2 files changed, 9 insertions(+), 4 deletions(-) diff

[PATCH 4/5] cxl/type3: add an optional mhd validation function for memory accesses

2023-08-31 Thread Gregory Price
When memory accesses are made, some MHSLD's would validate the address is within the scope of allocated sections. To do this, the base device must call an optional function set by inherited devices. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 15 +++ include/hw

[PATCH 2/5] cxl/type3: Cleanup multiple CXL_TYPE3() calls in read/write functions

2023-08-31 Thread Gregory Price
Call CXL_TYPE3 once at top of function to avoid multiple invocations. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index fd9d134d46..80d596ee10 100644 --- a/hw/mem

Re: [PATCH 5/5] cxl/vendor: SK hynix Niagara Multi-Headed SLD Device

2023-09-06 Thread Gregory Price
On Wed, Sep 06, 2023 at 02:04:45PM +0100, Jonathan Cameron wrote: > On Thu, 31 Aug 2023 21:29:14 -0400 > Gregory Price wrote: > > Hi Gregory, > > Some comments inline, but I'm happy to add this to my staging tree in the > meantime > as it stands (might be a few days u

[PATCH v2] cxl/vendor: update niagara to only build on linux, add KConfig options

2023-09-22 Thread Gregory Price
Niagara uses which presently limits its compatibility to linux hosts. Change build to only build it on linux. Add Kconfig file for skhynix directory, and make niagara depend on CXL_MEM_DEVICE and LINUX. Add an explicit flag for niagara. Signed-off-by: Gregory Price --- hw/cxl/Kconfig

Re: [PATCH v4 1/1] cxl/vendor: SK hynix Niagara Multi-Headed SLD Device

2023-09-20 Thread Gregory Price
On Wed, Sep 20, 2023 at 01:46:18PM +0100, Jonathan Cameron wrote: > On Mon, 18 Sep 2023 13:36:56 -0400 > Gregory Price wrote: > > > Create a new device to emulate the SK hynix Niagara MHSLD platform. > > > > Hi Gregory, > > Seems this doesn't drop in

[PATCH v4 1/1] cxl/vendor: SK hynix Niagara Multi-Headed SLD Device

2023-09-18 Thread Gregory Price
of sections section_size : size of a section in 128mb increments shmid : shmid produced by ipcmk Example: $shmid1=ipcmk -M 131072 ./init_niagara 4 32 1 $shmid1 Signed-off-by: Gregory Price Signed-off-by: Junhee Ryu Signed-off-by: Kwangjin Ko --- hw/cxl/Kconfig

[PATCH v4 0/1] Niagara MHSLD

2023-09-18 Thread Gregory Price
v4 update: Kconfig and meson fixes Since Niagara uses , it presently can only be built for linux. Also addings missing Kconfig files and options to turn it off, and turns it off by default if VENDOR or CXL_MEM_DEVICE are turned off. Gregory Price (1): cxl/vendor: SK hynix Niagara Multi-Headed

[PATCH] cxl/vendor: update niagara to only build on linux, add KConfig options

2023-09-20 Thread Gregory Price
Niagara uses which presently limits its compatibility to linux hosts. Change build to only build it on linux. Add Kconfig file for skhynix directory, and make niagara depend on CXL_MEM_DEVICE. Add an explicit flag for niagara. Signed-off-by: Gregory Price --- hw/cxl/Kconfig

Re: [PATCH 00/19] QEMU: CXL mailbox rework and features

2023-09-28 Thread Gregory Price
er. To save some list spam, I can't say i've reviewed and tested the entire set, but this patch series to help model the Niagara work so please add my tags as appropriate to the above. Reviewed-by: Gregory Price Tested-by: Gregory Price ~Gregory

Re: [BUG] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios

2022-10-18 Thread Gregory Price
AM Gregory Price > wrote: > > > > Early-boot e820 records will be inserted by the bios/efi/early boot > > software and be reported to the kernel via insert_resource. Later, when > > CXL drivers iterate through the regions again, they will insert another > > resour

Re: [BUG] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios

2022-10-18 Thread Gregory Price
> > -e820_add_entry(cxl_base, cxl_size, E820_RESERVED); > > memory_region_init(mr, OBJECT(machine), "cxl_host_reg", cxl_size); > > memory_region_add_subregion(system_memory, cxl_base, mr); > > cxl_resv_end = cxl_base + cxl_size; > > @@ -1077,7 +1076,6 @@ void

Re: [PATCH v9 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-24 Thread Gregory Price
On Fri, Oct 14, 2022 at 04:10:44PM +0100, Jonathan Cameron wrote: > From: Huai-Cheng Kuo > > The CDAT can be specified in two ways. One is to add ",cdat=" > in "-device cxl-type3"'s command option. The file is required to provide > the whole CDAT table in binary mode. The other is to use the

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

2022-10-25 Thread Gregory Price
at DPA(0x0), while Persistent memory is mapped at DPA(vmem->size), per CXL Spec 8.2.9.8.2.0 - Get Partition Info. Signed-off-by: Gregory Price --- docs/system/devices/cxl.rst | 53 +-- hw/cxl/cxl-mailbox-utils.c | 21 ++- hw/mem/cxl_type3.c |

[PATCH 1/4] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios

2022-10-25 Thread Gregory Price
s `cxl create-region` to always fail. Signed-off-by: Gregory Price --- hw/i386/pc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 768982ae9a..203c90fedb 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1062,7 +1062,6 @@ void pc_memory_init(PCMachineState *p

[PATCH 0/4 v3] Multi-Region and Volatile Memory support for CXL Type-3 Devices

2022-10-25 Thread Gregory Price
ory regions may be supported on following patch sets. Gregory Price (4): hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios hw/cxl: Add CXL_CAPACITY_MULTIPLIER definition hw/cxl: Multi-Region CXL Type-3 Devices (Volatile and Persistent) hw/acpi/cxl.c: Fill in SRAT for v

[PATCH 2/4] hw/cxl: Add CXL_CAPACITY_MULTIPLIER definition

2022-10-25 Thread Gregory Price
Remove usage of magic numbers when accessing capacity fields and replace with CXL_CAPACITY_MULTIPLIER, matching the kernel definition. Signed-off-by: Gregory Price Reviewed-by: Davidlohr Bueso --- hw/cxl/cxl-mailbox-utils.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[PATCH 4/4] hw/acpi/cxl.c: Fill in SRAT for vmem/pmem if NUMA node is assigned

2022-10-25 Thread Gregory Price
-off-by: Gregory Price --- docs/system/devices/cxl.rst | 21 hw/acpi/cxl.c | 67 + hw/i386/acpi-build.c| 4 +++ include/hw/acpi/cxl.h | 1 + 4 files changed, 93 insertions(+) diff --git a/docs/system/devices/cxl.rst b

Re: [PATCH 0/4 v3] Multi-Region and Volatile Memory support for CXL Type-3 Devices

2022-10-26 Thread Gregory Price
On Wed, Oct 26, 2022 at 08:13:24PM +, Adam Manzanares wrote: > On Tue, Oct 25, 2022 at 08:47:33PM -0400, Gregory Price wrote: > > Submitted as an extention to the multi-feature branch maintained > > by Jonathan Cameron at: > > https://urldefense.com/v3/__https://gitlab.

[PATCH] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios

2022-10-26 Thread Gregory Price
s `cxl create-region` to always fail. Signed-off-by: Gregory Price --- hw/i386/pc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 768982ae9a..203c90fedb 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1062,7 +1062,6 @@ void pc_memory_init(PCMachineState *p

Re: [PATCH 0/4 v3] Multi-Region and Volatile Memory support for CXL Type-3 Devices

2022-10-26 Thread Gregory Price
On Wed, Oct 26, 2022 at 04:20:40PM -0400, Michael S. Tsirkin wrote: > On Tue, Oct 25, 2022 at 08:47:33PM -0400, Gregory Price wrote: > > Submitted as an extention to the multi-feature branch maintained > > by Jonathan Cameron at: > > https://gitlab.com/jic23/qemu/-/tree/cxl-20

RE: [PATCH 1/2] hw/cxl: set cxl-type3 device type to PCI_CLASS_MEMORY_CXL

2022-10-26 Thread Gregory Price
:06 PM To: Gregory Price Cc: qemu-devel@nongnu.org; jonathan.came...@huawei.com; linux-...@vger.kernel.org; alison.schofi...@intel.com; d...@stgolabs.net; a.manzana...@samsung.com; bwida...@kernel.org; Gregory Price Subject: Re: [PATCH 1/2] hw/cxl: set cxl-type3 device type

Re: [PATCH 1/2] hw/cxl: set cxl-type3 device type to PCI_CLASS_MEMORY_CXL

2022-10-26 Thread Gregory Price
On Wed, Oct 26, 2022 at 04:11:29PM -0400, Michael S. Tsirkin wrote: > He does but in the end he sends patches not pull requests. > I don't care really as long as someone will send it up. > Jonathan will submit this, it's not a critical issue so it can wait for the larger feature set.

Re: [PATCH 0/4 v3] Multi-Region and Volatile Memory support for CXL Type-3 Devices

2022-10-27 Thread Gregory Price
0100, Jonathan Cameron wrote: > On Wed, 26 Oct 2022 16:47:18 -0400 > Gregory Price wrote: > > > On Wed, Oct 26, 2022 at 08:13:24PM +, Adam Manzanares wrote: > > > On Tue, Oct 25, 2022 at 08:47:33PM -0400, Gregory Price wrote: > > > > Submitted as an extentio

[BUG] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios

2022-10-17 Thread Gregory Price
_intersects()`. Due to this reserved area, the intersect check will only ever return REGION_INTERSECTS, which causes `cxl create-region` to always fail. Signed-off-by: Gregory Price --- hw/i386/pc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 566accf7e6..5bf5465a21

[PATCH 3/5] hw/mem/cxl_type3: CDAT pre-allocate and check resources prior to work

2022-10-12 Thread Gregory Price
Makes the size of the allocated cdat table static (6 entries), flattens the code, and reduces the number of exit conditions Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 52 -- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/hw

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-12 Thread Gregory Price
This code contains heap corruption on free, and I think should be refactored to pre-allocate all the entries we're interested in putting into the table. This would flatten the code and simplify the error handling steps. Also, should we consider making a union with all the possible entries to

[PATCH 4/5] hw/mem/cxl_type3: Change the CDAT allocation/free strategy

2022-10-12 Thread Gregory Price
The existing code allocates a subtable for SLBIS entries, uses a local variable to avoid a g_autofree footgun, and the cleanup code causes heap corruption. Rather than allocate a table, explicitly allocate each individual entry and make the sub-table size static. Signed-off-by: Gregory Price

[PATCH 2/5] hw/mem/cxl_type3: Pull validation checks ahead of functional code

2022-10-12 Thread Gregory Price
For style - pulling these validations ahead flattens the code. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 193 ++--- 1 file changed, 96 insertions(+), 97 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index 94bc439d89

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-12 Thread Gregory Price
resolves a heap corruption bug 5) Refactor of CDAT initialization code into a function that initializes sub-tables per memory-region. Gregory Price (5): hw/mem/cxl_type3: fix checkpatch errors hw/mem/cxl_type3: Pull validation checks ahead of functional code hw/mem/cxl_type3: CDAT pre

[PATCH 1/5] hw/mem/cxl_type3: fix checkpatch errors

2022-10-12 Thread Gregory Price
This fixes checkpatch errors in the prior commit. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index 3fa5d70662..94bc439d89 100644 --- a/hw/mem/cxl_type3.c +++ b/hw

[PATCH 5/5] hw/mem/cxl_type3: Refactor CDAT sub-table entry initialization into a function

2022-10-12 Thread Gregory Price
The CDAT can contain multiple entries for multiple memory regions, this will allow us to re-use the initialization code when volatile memory region support is added. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 137 - 1 file changed, 72

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Gregory Price
turn ret; } On Thu, Oct 13, 2022 at 12:53:13PM +0100, Jonathan Cameron wrote: > On Thu, 13 Oct 2022 07:36:28 -0400 > Gregory Price wrote: > > > Reading through your notes, everything seems reasonable, though I'm not > > sure I agree with the two pass notion, though I'll

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Gregory Price
) and allocate the table as I have once we know how many MRs are present? 6 eggs/half dozen though, I'm ultimately fine with either. On Thu, Oct 13, 2022, 4:58 AM Jonathan Cameron wrote: > On Wed, 12 Oct 2022 14:21:15 -0400 > Gregory Price wrote: > > > Included in this response is a recomm

Re: [PATCH v8 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Gregory Price
Cameron wrote: > On Thu, 13 Oct 2022 13:09:26 -0400 > "Michael S. Tsirkin" wrote: > > > On Thu, Oct 13, 2022 at 12:26:58PM -0400, Gregory Price wrote: > > > Other than the nitpicks below, lgtm. Not sure if you need a sign off > > > from me given the contrib

Re: [PATCH 5/5] hw/mem/cxl_type3: Refactor CDAT sub-table entry initialization into a function

2022-10-13 Thread Gregory Price
> > /* For now, no memory side cache, plausiblish numbers */ > > -*dslbis_nonvolatile1 = (CDATDslbis) { > > +*dslbis1 = (CDATDslbis) { > > .header = { > > .type = CDAT_TYPE_DSLBIS, > > -.length = sizeof(*dslbis_nonvolatile1), > > +.length

Re: [PATCH v8 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Gregory Price
Other than the nitpicks below, lgtm. Not sure if you need a sign off from me given the contributions: Signed-off-by: Gregory Price > +/* If no cdat_table == NULL returns number of entries */ > +static int ct3_build_cdat_entries_for_mr(CDATSubHeader **cdat

[BUG] cxl,i386: e820 mappings may not be correct for cxl

2022-10-13 Thread Gregory Price
Context included below from prior discussion - `cxl create-region` would fail on inability to allocate memory - traced this down to the memory region being marked RESERVED - E820 map marks the CXL fixed memory window as RESERVED Re: x86 errors, I found that region worked with this

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-06 Thread Gregory Price
On Thu, Oct 06, 2022 at 09:50:07AM +0100, Jonathan Cameron wrote: > On Thu, 6 Oct 2022 09:45:57 +0100 > Jonathan Cameron wrote: > > > Great to see this. > > > > Missing Signed-off by so we can't apply this (no developer certificate of > > origin) Probably want your from address to match that

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-07 Thread Gregory Price
CDAT". Do the devices presently emulate this? I'm finding it hard to pick apart the code to identify it. On Thu, Oct 6, 2022 at 1:30 PM Gregory Price wrote: > On Thu, Oct 06, 2022 at 05:42:14PM +0100, Jonathan Cameron wrote: > > > > > > 1) The PCI device typ

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-06 Thread Gregory Price
On Thu, Oct 06, 2022 at 05:42:14PM +0100, Jonathan Cameron wrote: > > > > 1) The PCI device type is set prior to realize/attributes, and is > > currently still set to PCI_CLASS_STORAGE_EXPRESS. Should this instead > > be PCI_CLASS_MEMORY_CXL when presenting as a simple memory expander? > > We

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-07 Thread Gregory Price
On Fri, Oct 07, 2022 at 11:16:19AM -0700, Davidlohr Bueso wrote: > > Yeah, putting this back together was on my todo list, but happy to see > patches are out. Recollecting my thoughts on this, my original approach > was also to support only volatile or persistent capacities, but through > two

[PATCH 2/2] hw/cxl: Allow CXL type-3 devices to be persistent or volatile

2022-10-06 Thread Gregory Price
ces to represent DIMMs on a Single-Logical-Device MemoryExpander fairly straightforward. Signed-off-by: Gregory Price --- hw/cxl/cxl-mailbox-utils.c | 22 ++ hw/mem/cxl_type3.c | 46 + include/hw/cxl/cxl_device.h | 7 +- 3 files chan

[PATCH 1/2] hw/cxl: set cxl-type3 device type to PCI_CLASS_MEMORY_CXL

2022-10-06 Thread Gregory Price
Current code sets to STORAGE_EXPRESS and then overrides it. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index ada2108fac..1837c1c83a 100644 --- a/hw/mem/cxl_type3.c +++ b/hw/mem

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-10 Thread Gregory Price
> > https://gitlab.com/jic23/qemu/-/commits/cxl-2022-10-09 > There are a few messy corners in that tree but it should work. I'll be > pushing out a new version in a few days. > > I updated that in latest version to build the tables based on the > memdev provided. We'll want to add the volatile

Re: [PATCH 2/2] hw/cxl: Allow CXL type-3 devices to be persistent or volatile

2022-10-10 Thread Gregory Price
Hang tight, I'm whipping up a multi-region patch that will support a vmem and pmem region and such. Finally got oriented enough to figure out the DPA decoding a bit. I will probably need some help validating the decoder logic and the CDAT table logic. I will integrate the suggestions below

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-10 Thread Gregory Price
> > > > Maybe we should consider 2 new options: > > --persistent-memdevs=pm1 pm2 pm3 > > --volatile-memdevs=vm1 vm2 vm3 > > > > etc, and deprecate --memdev, and go with your array of memdevs idea. > > > > I think I could probably whip that up in a day or two. Thoughts? > > I wonder if we care

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-10 Thread Gregory Price
and Read/Write Change Validation* 5/5: Test and documentation update On Mon, Oct 10, 2022 at 11:25:31AM -0400, Gregory Price wrote: > > > > https://gitlab.com/jic23/qemu/-/commits/cxl-2022-10-09 > > There are a few messy corners in that tree but it should work. I'll be > > p

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-11 Thread Gregory Price
to mailing list contributions, where would these go exactly? On Tue, Oct 11, 2022 at 10:14:38AM -0700, Davidlohr Bueso wrote: > On Mon, 10 Oct 2022, Gregory Price wrote: > > > I've pushed 5 new commits to this branch here (@Jonathan I've also made > > a merge request to pull the

[PATCH 3/5] hw/mem/cxl_type: Generalize CDATDsmas initialization for Memory Regions

2022-10-11 Thread Gregory Price
This is a preparatory commit for enabling multiple memory regions within a single CXL Type-3 device. We will need to initialize multiple CDAT DSMAS regions (and subsequent DSLBIS, and DSEMTS entries), so generalize the intialization into a function. Signed-off-by: Gregory Price --- hw/mem

[PATCH 0/5] Multi-Region and Volatile Memory support for CXL Type-3 Devices

2022-10-11 Thread Gregory Price
MAS entry concerns memory mapping and is required to successfully map memory regions correctly in bios/efi. Gregory Price (5): hw/cxl: set cxl-type3 device type to PCI_CLASS_MEMORY_CXL hw/cxl: Add CXL_CAPACITY_MULTIPLIER definition hw/mem/cxl_type: Generalize CDATDsmas initialization for Mem

[PATCH 1/5] hw/cxl: set cxl-type3 device type to PCI_CLASS_MEMORY_CXL

2022-10-11 Thread Gregory Price
Current code sets to STORAGE_EXPRESS and then overrides it. Signed-off-by: Gregory Price Reviewed-by: Davidlohr Bueso Reviewed-by: Jonathan Cameron --- hw/mem/cxl_type3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index

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

2022-10-11 Thread Gregory Price
at DPA(0x0), while Persistent memory is mapped at DPA(vmem->size), per CXL Spec 8.2.9.8.2.0 - Get Partition Info. Signed-off-by: Gregory Price --- hw/cxl/cxl-mailbox-utils.c | 21 ++-- hw/mem/cxl_type3.c | 197 ++-- include/hw/cxl/cxl_device.h | 11 +-

[PATCH 5/5] cxl: update tests and documentation for new cxl properties

2022-10-11 Thread Gregory Price
Adds explicit examples for --persistent-memdev and --volatile-memdev Signed-off-by: Gregory Price --- docs/system/devices/cxl.rst | 53 ++-- tests/qtest/cxl-test.c | 81 +++-- 2 files changed, 110 insertions(+), 24 deletions(-) diff

[PATCH 2/5] hw/cxl: Add CXL_CAPACITY_MULTIPLIER definition

2022-10-11 Thread Gregory Price
Remove usage of magic numbers when accessing capacity fields and replace with CXL_CAPACITY_MULTIPLIER, matching the kernel definition. Signed-off-by: Gregory Price Reviewed-by: Davidlohr Bueso --- hw/cxl/cxl-mailbox-utils.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-12 Thread Gregory Price
On Wed, Jan 11, 2023 at 02:24:32PM +, Jonathan Cameron via wrote: > Gregory's patches were posted as part of his work on adding volatile support. > https://lore.kernel.org/linux-cxl/20221006233702.18532-1-gregory.pr...@memverge.com/ >

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-12 Thread Gregory Price
On Thu, Jan 12, 2023 at 05:21:30PM +, Jonathan Cameron wrote: > On Thu, 12 Jan 2023 10:39:17 -0500 > Gregory Price wrote: > > > On Wed, Jan 11, 2023 at 02:24:32PM +, Jonathan Cameron via wrote: > > > Gregory's patches were posted as part of his work on adding

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-13 Thread Gregory Price
Ah I see, i forgot about that one. Give me a bit and I'll see if it is the same issue. On Fri, Jan 13, 2023 at 9:41 AM Jonathan Cameron < jonathan.came...@huawei.com> wrote: > On Fri, 13 Jan 2023 09:19:59 -0500 > Gregory Price wrote: > > > On Fri, Jan 13, 2023 at 09:12

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-13 Thread Gregory Price
On Fri, Jan 13, 2023 at 04:12:06PM +0100, Lukas Wunner wrote: > On Fri, Jan 13, 2023 at 02:45:11PM +, Jonathan Cameron wrote: > > On Fri, 13 Jan 2023 14:40:26 + Jonathan Cameron > > wrote: > > > On Fri, 13 Jan 2023 09:19:59 -0500 Gregory Price > > > wr

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-13 Thread Gregory Price
On Fri, Jan 13, 2023 at 09:12:13AM +, Jonathan Cameron wrote: > > Just to check, are these different from the on stack problem you reported > previously? Doesn't look like the fix for that has made it upstream yet. > > What kernel are you running? > > The prior issue I saw was related to

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

2023-01-03 Thread Gregory Price
instances. On Tue, Jan 3, 2023, 10:56 AM Jonathan Cameron wrote: > On Tue, 20 Dec 2022 14:27:31 -0500 > Gregory Price wrote: > > > On Tue, Dec 20, 2022 at 03:34:53PM +, Jonathan Cameron wrote: > > > > However I don't think this is successful in creating the dax dev

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

2022-12-19 Thread Gregory Price
On Mon, Dec 19, 2022 at 12:42:11PM +, Jonathan Cameron wrote: > As a process thing, when reworking a patch I picked up for the > CXL qemu gitlab tree, drop the SOB that I added as it's not relevant > to the new patch. > ack > Still no need to post a new version unless you particularly >

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

2022-12-19 Thread Gregory Price
> I think an address space needs a memory region, not a memdev. > Initialize a container region with memory_region_init() > We could then add the two memdev associated regions (with different > attributes) as subregions using memory_region_add_subregion() > > Similar is done for the system

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

2022-12-20 Thread Gregory Price
On Tue, Dec 20, 2022 at 03:34:53PM +, Jonathan Cameron wrote: > > However I don't think this is successful in creating the dax devices, > > and therefore the reconfiguring into ram. > > Sure. I only bothered testing the it in some dax modes rather than via kmem. > It 'should' work but more

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

2022-12-08 Thread Gregory Price
On Thu, Dec 08, 2022 at 10:55:58PM +, Fan Ni wrote: > On Mon, Nov 28, 2022 at 10:01:57AM -0500, Gregory Price wrote: > > > > -if (cxl_dstate->pmem_size < CXL_CAPACITY_MULTIPLIER) { > > +if ((cxl_dstate->vmem_size < CXL_CAPACITY_MULTIPLIER) || &g

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

2022-11-23 Thread Gregory Price
> > - -object > > memory-backend-file,id=cxl-mem1,share=on,mem-path=/tmp/cxltest.raw,size=256M > > \ > > - -object > > memory-backend-file,id=cxl-lsa1,share=on,mem-path=/tmp/lsa.raw,size=256M \ > > + -object > >

[RFC v4 1/3] hw/cxl: Add CXL_CAPACITY_MULTIPLIER definition

2022-11-28 Thread Gregory Price
From: Gregory Price Remove usage of magic numbers when accessing capacity fields and replace with CXL_CAPACITY_MULTIPLIER, matching the kernel definition. Signed-off-by: Gregory Price Reviewed-by: Davidlohr Bueso Signed-off-by: Jonathan Cameron Signed-off-by: Jonathan Cameron --- hw/cxl

[RFC v4 0/3] CXL Type-3 Volatile Memory Support

2022-11-28 Thread Gregory Price
DPA immediately following the volatile capacity Partitioning of Persistent Memory regions may be supported on following patch sets, but is not supported in this version. Gregory Price (3): hw/cxl: Add CXL_CAPACITY_MULTIPLIER definition tests/qtest/cxl-test: whitespace, line ending cleanup

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

2022-11-28 Thread Gregory Price
Defines are starting to exceed line length limits, align them for cleanliness before making modifications. Signed-off-by: Gregory Price --- tests/qtest/cxl-test.c | 99 +++--- 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/tests/qtest/cxl

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

2022-11-28 Thread Gregory Price
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

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

2023-01-19 Thread Gregory Price
On Thu, Jan 19, 2023 at 05:31:12PM +, Jonathan Cameron wrote: > On Thu, 19 Jan 2023 12:15:45 -0500 > Gregory Price wrote: > > > Found a bug, not sure how we missed this, probably happed with rebasing > > and some fixups. We're presently reporting the volatile region a

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-19 Thread Gregory Price
On Thu, Jan 19, 2023 at 10:19:46AM +, Jonathan Cameron wrote: > Even if everything else worked, it will currently fail because of the > issue with pass through decoders. > (Kernel assumes always pass through for single rp, qemu assumes never > pass through - both are valid under spec). > Add

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-19 Thread Gregory Price
On Thu, Jan 19, 2023 at 06:48:11AM -0500, Michael S. Tsirkin wrote: > > > > I clearly need to run some more rests as not seen this issue (and I've > > had a couple of reports of it now). I guess I never tend to be running > > a completely clean tree on either side + testing is mostly on arm64 >

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

2023-01-19 Thread Gregory Price
Found a bug, not sure how we missed this, probably happed with rebasing and some fixups. We're presently reporting the volatile region as non-volatile, 1 line patch. Jonathan do you want a separate patch shipped or would you rather just apply a fixup to the commit in your current branch? diff

Re: cxl nvdimm Potential probe ordering issues.

2023-01-19 Thread Gregory Price
On Thu, Jan 19, 2023 at 03:04:49PM +, Jonathan Cameron wrote: > Gregory, would you mind checking if > cxl_nvb is NULL here... > https://elixir.bootlin.com/linux/v6.2-rc4/source/drivers/cxl/pmem.c#L67 > (printk before it is used should work). > > Might also be worth checking cxl_nvd and cxl_ds

Re: cxl nvdimm Potential probe ordering issues.

2023-01-19 Thread Gregory Price
On Thu, Jan 19, 2023 at 04:17:11PM +, Jonathan Cameron wrote: > > Whilst I still have no idea if this is the same problem, I have identified > what goes wrong if there is a module probe ordering issue. > https://elixir.bootlin.com/linux/v6.2-rc4/source/drivers/cxl/core/pmem.c#L306 > >

Re: cxl nvdimm Potential probe ordering issues.

2023-01-20 Thread Gregory Price
On Fri, Jan 20, 2023 at 09:38:13AM -0800, Dan Williams wrote: > As it stands currently that dax device and the cxl device are not > related since a default dax-device is loaded just based on the presence > of an EFI_MEMORY_SP address range in the address map. With the new ram > enabling that

Re: [RFC v4 2/3] tests/qtest/cxl-test: whitespace, line ending cleanup

2023-01-30 Thread Gregory Price
On Mon, Jan 30, 2023 at 01:11:50PM +, Jonathan Cameron wrote: > On Thu, 5 Jan 2023 14:38:07 + > Jonathan Cameron wrote: > > > On Mon, 28 Nov 2022 10:01:56 -0500 > > Gregory Price wrote: > > > > > Defines are starting to exceed line length limits, ali

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

2023-01-30 Thread Gregory Price
On Mon, Jan 30, 2023 at 01:24:51PM +, Jonathan Cameron wrote: > > > diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c > > index e59ba22387..6893f54e28 100644 > > --- a/tests/qtest/cxl-test.c > > +++ b/tests/qtest/cxl-test.c > > @@ -40,32 +40,46 @@ > >"-device

Re: [PATCH v3 00/10] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-30 Thread Gregory Price
Tested and reviewed this series (except my own patches, obviously). Reviewed-by: Gregory Price Tested-by: Gregory Price On Mon, Jan 30, 2023 at 02:36:55PM +, Jonathan Cameron wrote: > V3: Thanks to Michael Tsirkin > - Update tests/data/acpi/q35/DSDT.cxl to reflect dr

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-18 Thread Gregory Price
I apparently forgot an intro lol I tested the DOE linux branch with the 2023-1-11 QEMU branch with both volatile, non-volatile, and "legacy" (pre-my-patch) non-volatile mode. 1) *In volatile mode, there are no stack traces present (during boot*) On Wed, Jan 18, 2023 at 02:22:08PM -050

Re: [PATCH 0/8] hw/cxl: CXL emulation cleanups and minor fixes for upstream

2023-01-18 Thread Gregory Price
1) No stack traces present 2) Device usage appears to work, but cxl-cli fails to create a region, i haven't checked why yet (also tried ndctl-75, same results) 3) There seems to be some other regression with the cxl_pmem_init routine, because I get a stack trace in this setup regardless of

Re: cxl nvdimm Potential probe ordering issues.

2023-01-23 Thread Gregory Price
On Fri, Jan 20, 2023 at 02:41:05PM -0800, Dan Williams wrote: > > Which mode are you referring? > > The next steps for the kernel enabling relevant to this thread are: > > * ram region discovery (platform firmware or kexec established) > * ram region creation > * pmem region discovery (from

  1   2   >