Linux CXL
 help / color / mirror / Atom feed
* [PATCH v5 0/7] cxl: Introduce HDM decoder emulation from DVSEC range registers
@ 2023-02-14 19:41 Dan Williams
  2023-02-14 19:41 ` [PATCH v5 1/7] cxl/pci: Break out range register decoding from cxl_hdm_decode_init() Dan Williams
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Dan Williams @ 2023-02-14 19:41 UTC (permalink / raw)
  To: linux-cxl; +Cc: Jonathan Cameron, Dave Jiang

Changes since v4 [1]:
- Fold in changes to make this emulation compatible with cxl_test. For
  the most part this is providing a stub version of
  cxl_dvsec_rr_decode() so cxl_test can ignore 'struct
  cxl_endpoint_dvsec_info' related logic, and otherwise match the new
  function signatures.

[1]: http://lore.kernel.org/r/167588394236.1155956.8466475582138210344.stgit@djiang5-mobl3.local

---

(cover letter from v4)

This series provides the emulation of HDM decoders from the programmed range
registers. From CXL 3.0 spec 8.1.3.8, there can be up to 2 ranges programmed.
Some devices may not implement HDM decoder registers and some may not be
programmed by the BIOS. Under such scenarios, if one of more range registers
are programmed, then we can create an emulated HDM decoder per active range
indicated by the range registers. The emulated HDM decoders will show up as
locked and cannot be reprogrammed.

Below is a table that indicates different scenarios the driver may encounter:

rr: Range registers not programmed
hdm: HDM decoders not programmed
RR: Range registers programmed by BIOS
HDM: HDM decoders programmed by BIOS

emulate HDM: Create HDM decoder software structs and use values from range registers.
keep HDM: Populate HDM decoder software structs with values in HDM decoder registers.

Case 1:        Case 2:        Case 3:    Case 4:     Case 5:       Case 6:
rr             RR             rr hdm     rr HDM      RR hdm        RR HDM
unsupported    emulate HDM    keep HDM   keep HDM    emulate HDM   keep HDM

---

Dave Jiang (7):
      cxl/pci: Break out range register decoding from cxl_hdm_decode_init()
      cxl/port: Export cxl_dvsec_rr_decode() to cxl_port
      cxl/pci: Refactor cxl_hdm_decode_init()
      cxl/hdm: Emulate HDM decoder from DVSEC range registers
      cxl/hdm: Create emulated cxl_hdm for devices that do not have HDM decoders
      cxl/hdm: Add emulation when HDM decoders are not committed
      cxl/pci: Remove locked check for dvsec_range_allowed()


 drivers/cxl/core/hdm.c        |  119 ++++++++++++++++++++++--
 drivers/cxl/core/pci.c        |  200 +++++++++++++++++++----------------------
 drivers/cxl/cxl.h             |   20 ++++
 drivers/cxl/cxlmem.h          |   12 --
 drivers/cxl/cxlpci.h          |    3 -
 drivers/cxl/port.c            |   24 +++--
 tools/testing/cxl/Kbuild      |    1 
 tools/testing/cxl/test/cxl.c  |    6 +
 tools/testing/cxl/test/mock.c |   36 ++++++-
 tools/testing/cxl/test/mock.h |    6 +
 10 files changed, 273 insertions(+), 154 deletions(-)

base-commit: 6d796c50f84ca79f1722bb131799e5a5710c4700

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-02-21 16:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-14 19:41 [PATCH v5 0/7] cxl: Introduce HDM decoder emulation from DVSEC range registers Dan Williams
2023-02-14 19:41 ` [PATCH v5 1/7] cxl/pci: Break out range register decoding from cxl_hdm_decode_init() Dan Williams
2023-02-14 19:41 ` [PATCH v5 2/7] cxl/port: Export cxl_dvsec_rr_decode() to cxl_port Dan Williams
2023-02-14 19:41 ` [PATCH v5 3/7] cxl/pci: Refactor cxl_hdm_decode_init() Dan Williams
2023-02-14 19:41 ` [PATCH v5 4/7] cxl/hdm: Emulate HDM decoder from DVSEC range registers Dan Williams
2023-02-14 19:41 ` [PATCH v5 5/7] cxl/hdm: Create emulated cxl_hdm for devices that do not have HDM decoders Dan Williams
2023-02-14 19:41 ` [PATCH v5 6/7] cxl/hdm: Add emulation when HDM decoders are not committed Dan Williams
2023-02-20 11:36   ` Jonathan Cameron
2023-02-21 16:06     ` Dave Jiang
2023-02-21 16:45       ` Jonathan Cameron
2023-02-21 16:48         ` Dave Jiang
2023-02-14 19:41 ` [PATCH v5 7/7] cxl/pci: Remove locked check for dvsec_range_allowed() Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox