Linux CXL
 help / color / mirror / Atom feed
* [PATCH 0/4] CXL Address Translation
@ 2022-11-22 23:07 alison.schofield
  2022-11-22 23:07 ` [PATCH 1/4] cxl/region: Add a DPA to HPA translation helper alison.schofield
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: alison.schofield @ 2022-11-22 23:07 UTC (permalink / raw)
  To: Dan Williams, Ira Weiny, Vishal Verma, Ben Widawsky, Dave Jiang
  Cc: Alison Schofield, linux-cxl

From: Alison Schofield <alison.schofield@intel.com>

Introducing CXL DPA->HPA address translations. User space requires
HPA addresses when CXL devices, participating in a region, report
errors. For example, a patchset[1] adding trace events for media errors 
is in review on this list, yet it only provides userspace with the DPA.
By adding this translation, HPA’s can be added to those media error
trace events.

Patch 1 performs the translation and Patch 2 gives it exercise by
translating a small sample of addresses at every pmem region creation,
in a debug kernel.

Patches 1 & 2 deliver what is required for address translation, and
do not depend on Patches 3 & 4.

Patches 3 & 4 seem like a good idea, however, the value of that idea
is not clear. The idea is to add another level of validation to address
translations for regions using XOR arithmetic (as opposed to modulo).

Patch 4 runs the newly constructed HPA through the existing XORMAP filter
to see if it maps to the expected dport. While a valid check, it's not
clear that it offers anything more than the range checking already done
in the generic translation. That is, if an HPA translation passes the
range check, how can a match on dport test ever fail? I don't know.
I’m looking for help in proving or disproving the usefulness of 3 & 4.

Using cxl_test, existing unit tests that create regions exercise
the address translation and the results can be viewed like this:

# meson test -C build --suite=cxl
ninja: Entering directory `/root/ndctl/build'
[109/109] Linking target ndctl/ndctl
1/5 ndctl:cxl / cxl-topology.sh             OK               4.19s
2/5 ndctl:cxl / cxl-region-sysfs.sh         OK               2.69s
3/5 ndctl:cxl / cxl-labels.sh               OK               5.85s
4/5 ndctl:cxl / cxl-create-region.sh        OK               5.35s
5/5 ndctl:cxl / cxl-xor-region.sh           OK               1.62s

# dmesg | grep -m1 "Address translation"
cxl_core:devm_cxl_add_pmem_region:2006: cxl_region region6: Address translation check: Pass

# dmesg | grep Addr | grep Pass | wc -l
46
That '46', is how many regions are created and their addresses successfully
translated in the existing cxl unit tests.  (No Fails today ;))

TODO in ndctl: If the check on region creation gets merged, add watchers for
it to cxl unit tests that create regions.

Alison Schofield (4):
  cxl/region: Add a DPA to HPA translation helper
  cxl/region: Check addr trans at pmem region create (debug only)
  cxl/acpi: Move the target entry(n) calc to its own function
  cxl/acpi: Add a match on dport check for XOR addr translation

 drivers/cxl/acpi.c        |  91 +++++++++++++++++++++++-------
 drivers/cxl/core/port.c   |   5 +-
 drivers/cxl/core/region.c | 116 +++++++++++++++++++++++++++++++++++++-
 drivers/cxl/cxl.h         |  11 +++-
 4 files changed, 199 insertions(+), 24 deletions(-)


base-commit: f0c4d9fc9cc9462659728d168387191387e903cc

This is built upon 6.1-rc4 plus CXL XOR Interleave Arithmetic [2]
If Patches 3 & 4 are discarded, then there is no dependency on [2]

[1] https://lore.kernel.org/linux-cxl/cover.1668115235.git.alison.schofield@intel.com/
[2] https://lore.kernel.org/linux-cxl/cover.1669153633.git.alison.schofield@intel.com/

Gobble Gobble
-- 
2.37.3


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

end of thread, other threads:[~2023-01-04 20:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-22 23:07 [PATCH 0/4] CXL Address Translation alison.schofield
2022-11-22 23:07 ` [PATCH 1/4] cxl/region: Add a DPA to HPA translation helper alison.schofield
2022-11-30 16:27   ` Jonathan Cameron
2023-01-04 20:45     ` Alison Schofield
2022-11-30 16:38   ` Jonathan Cameron
2023-01-04 20:29     ` Alison Schofield
2022-11-22 23:07 ` [PATCH 2/4] cxl/region: Check addr trans at pmem region create (debug only) alison.schofield
2022-11-30 16:42   ` Jonathan Cameron
2023-01-04 20:25     ` Alison Schofield
2022-11-22 23:07 ` [PATCH 3/4] cxl/acpi: Move the target entry(n) calc to its own function alison.schofield
2022-11-22 23:07 ` [PATCH 4/4] cxl/acpi: Add a match on dport check for XOR addr translation alison.schofield

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