Linux CXL
 help / color / mirror / Atom feed
From: alison.schofield@intel.com
To: Dan Williams <dan.j.williams@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ben Widawsky <bwidawsk@kernel.org>,
	Dave Jiang <dave.jiang@intel.com>
Cc: Alison Schofield <alison.schofield@intel.com>, linux-cxl@vger.kernel.org
Subject: [PATCH 0/4] CXL Address Translation
Date: Tue, 22 Nov 2022 15:07:47 -0800	[thread overview]
Message-ID: <cover.1669153711.git.alison.schofield@intel.com> (raw)

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


             reply	other threads:[~2022-11-22 23:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 23:07 alison.schofield [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1669153711.git.alison.schofield@intel.com \
    --to=alison.schofield@intel.com \
    --cc=bwidawsk@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox