> > 
> > 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 to emulate beyond 1 volatile and 1 persistent.
> Sure devices might exist, but if we can exercise all the code paths
> with a simpler configuration, perhaps we don't need to handle the
> more complex ones?
> 
> The sticky corner here is Set Partition Info 
> CXL r3.0 8.2.9.8.2.1
> 
> Separation between volatile and non volatile is configurable at runtime.
> 

Set Partition Info (Opcode 4101h)
... snip ... Paritionable capacity is equal to
(total capacity - (volatile-only) - (persistent-only))

By definition, volatile backed memory can only contain volatile regions.
That's simple.

For persistent-backed memory, capacity can be chopped up (iif Identify
Memory Device reports Paritition Alignment to be non-zero).

--persistent-memdev=pmem-backing
--volatile-memdev=vmem-backing

By default, maybe we should make the entire size of persistent regions
to be persistent-only for the initial prototype.  This would let us
merge without support for Set Partition Info.  Then add an additional
argument to enable additional argument to set the partition alignment.

--partitionable-pmem=
  : Defaults to 0. If non-zero, up to N XBytes of PMem may be
    used as vmem by the operating system at runtime.

On the CXL tool side we should then see the following output for these
settings:

--persistent-memdev=pmem0     1GB
--volatile-memdev=vmem0       1GB
--partitionable-pmem=512M

Capacities:
----------------
Total Capacity: 2GB
Volatile Capacity: 1GB
Persistent Capacity: 1GB
Partitionable Capacity: 512MB
Partitioned Memory: 0MB

Available Memory:
-----------------
Volatile Memory: 1GB
Persistent Memory: 1GB


Then Run something along the lines of:
`cxl partition-pmem 512MB`   (or whatever args are needed)


Capacities:
----------------
Total Capacity: 2GB
Volatile Capacity: 1GB
Persistent Capacity: 1GB
Partitionable Capacity: 512MB
Partitioned Memory: 512MB

Available Memory:
-----------------
Volatile Memory: 1.5GB
Persistent Memory: 512MB


Thoughts?

Reply via email to