mbox series

[RFC,0/7] Revamped region creation

Message ID 20220316230303.1813397-1-ben.widawsky@intel.com
Headers show
Series Revamped region creation | expand

Message

Ben Widawsky March 16, 2022, 11:02 p.m. UTC
From: Ben Widawsky <ben@bwidawsk.net>

I will be on vacation all of next week so I'm trying to get this out now, even
though I still need to go over the locking and lifetimes. I'm certain there are
still issues there. I did want to start the discussion sooner rather than later
around the ABI changes.

The major changes from this series are:
- disambiguation of decoder types
- endpoint decoders size and volatility must be set
- regions are comprised of decoders instead of devices
- device physical address space is now managed
- split attrs for pmem and volatile region creation

In addition to these, I've tried to incorporate most of the fixes from Dan and
Jonathan up until this point in the original series, but I may have lost track
of some. I will circle back there too.

The last version of the patch series (with relevant cover letter) can be found
here: https://lore.kernel.org/linux-cxl/20220128002707.391076-1-ben.widawsky@intel.com/T/#t

Ben Widawsky (7):
  cxl/core: Use is_endpoint_decoder
  cxl/core: Distinguish cxl_decoder into types
  cxl/port: Surface ram and pmem resources
  cxl/core/hdm: Allocate resources from the media
  cxl/core/port: add decoder attrs for size and volatility
  cxl/region: Add region creation ABI
  cxl/region: Introduce concept of region configuration

 Documentation/ABI/testing/sysfs-bus-cxl       |  91 ++-
 .../driver-api/cxl/memory-devices.rst         |  11 +
 drivers/cxl/Kconfig                           |   8 +-
 drivers/cxl/acpi.c                            |   9 +-
 drivers/cxl/core/Makefile                     |   1 +
 drivers/cxl/core/core.h                       |   6 +
 drivers/cxl/core/hdm.c                        |  52 +-
 drivers/cxl/core/port.c                       | 452 ++++++++++++--
 drivers/cxl/core/region.c                     | 569 ++++++++++--------
 drivers/cxl/cxl.h                             | 161 ++++-
 drivers/cxl/mem.c                             |   7 +-
 drivers/cxl/region.h                          |  93 +++
 tools/testing/cxl/Kbuild                      |   1 +
 tools/testing/cxl/test/cxl.c                  |   7 +-
 14 files changed, 1134 insertions(+), 334 deletions(-)
 create mode 100644 drivers/cxl/region.h


base-commit: 74be98774dfbc5b8b795db726bd772e735d2edd4
prerequisite-patch-id: 034aeb7e124c5a34785c963bf014aa5380f00a2e
prerequisite-patch-id: 26f18c2ca586e6d734cd319e0e7f24398b17217f
prerequisite-patch-id: ef97136efb8c077232fe39a0465389565803a7b7
prerequisite-patch-id: 6a63e03117287b748cfec00e2c16a41ed38f4f9a
prerequisite-patch-id: dee89e9fa127e6442365177361a81c769173a9cb
prerequisite-patch-id: 1281430c1569659bb0f4a4b8fac8a108a02926ae
prerequisite-patch-id: 3e44f9db4e6ca77d9f2f80ed138234c82f521f2e
prerequisite-patch-id: 1d99dc5579333bbb009d58f6cc9ad01e3c936225
prerequisite-patch-id: 2014261afabca3797a34e5a2a01de678cb0ff545
prerequisite-patch-id: d3c61c56364ef5ed08b0a6f47c9a6b710ec5b6eb
prerequisite-patch-id: d28e6f8d2c0faf3392857370bc77bb51081604c6
prerequisite-patch-id: 5e8495c10b41d2e77a97c5c8c57b64813d80050b
prerequisite-patch-id: 3bc596df9dad86121dc24141d6293e3d1b7e6f99
prerequisite-patch-id: 7d8b673c521deeaa5ecbc78a0770974edd4a8287
prerequisite-patch-id: 224190b7e113853e710ba5fb06aa74faa8415b01

Comments

Ben Widawsky March 17, 2022, 9:03 p.m. UTC | #1
On 22-03-16 16:02:56, Ben Widawsky wrote:
> From: Ben Widawsky <ben@bwidawsk.net>
> 
> I will be on vacation all of next week so I'm trying to get this out now, even
> though I still need to go over the locking and lifetimes. I'm certain there are
> still issues there. I did want to start the discussion sooner rather than later
> around the ABI changes.
> 
> The major changes from this series are:
> - disambiguation of decoder types
> - endpoint decoders size and volatility must be set
> - regions are comprised of decoders instead of devices
> - device physical address space is now managed

Dan/all, I used gen_pool API to manage the device's address space. When I
originally authored the patches, I was under the impression that HDM decoders
could be sparsely enabled [1], which leads to the device physical address space
being sparsely populated. As it turns out, this is explicitly disallowed
(8.2.5.12.20). However, I need /some/ way to manage address space, and on third
thought, maybe it's worth it to just leave the gen_pool usage as is.

What are your thoughts? I think the resource APIs are a little klunky given that
we may not yet have sysram mapping for the HDM decoders in the current
programming model. Ranges are possibly usable. gen_pool provides a lot of
flexibility, but it is more complex (but the code is written).

[1]: Practically speaking, decoders can be sparsely enabled. If you set base ==
limit for a decoder it will decode 0 address space. This trick might be nice to
use later.