Skip to content

cxl/region: Support unaligned address translations

Alison Schofield linux-cxl 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 1 replyIn review
  2. v52 patches 1 replySuperseded
  3. v42 patches 3 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v31 patch0 repliesSuperseded
v21 patch3 repliesSuperseded
v11 patch2 repliesSuperseded

Changes in v6 from the cover letter

- Replace 64-bit division operators with div64_u64() helpers (lkp)

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2cxl/region: Translate DPA->HPA in unaligned MOD3 regionsdrivers/cxl/core/region.c+158 -80 replies
2/2cxl/region: Translate HPA to DPA and memdev in unaligned regionsdrivers/cxl/core/region.c+46 -00 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJonathan CameronDave Jiang
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/2] cxl/region: Support unaligned address translations

Changes in v6:
- Replace 64-bit division operators with div64_u64() helpers (lkp)

Changes in v5:
- s/reg_ways/region_ways in decode_pos (DaveJ)
- Add comments in decode_pos
- Update the CXL spec references to 4.0

Changes in v4:
- Rebased Patch 1 onto 6.19-rc4 with minimal conflict.
- Added Patch 2 because 6.19 introduced poison by region offset meaning that too needed support for unaligned regions.

Changes in v3:
- Add bracketing to avert possibly uninitialized usage (lkp)
- Remove excessive narration in decode_pos() (Jonathan)
- Calculate devices_per_hb only once after switch in decode_pos() (Jonathan)
- Reduce scope of hpa and shifted in unaligned_dpa_to_hpa() (Jonathan)
- Unmix non- and assignment declarations in unaligned_dpa_to_hpa() (Jonathan)
- Add blank line after return ULLONG_MAX in unaligned_dpa_to_hpa() (Jonathan)
- s/index/position in for loop in unaligned_dpa_to_hpa() (Jonathan)
- Initialize bool aligned true
- Comment that restore_parent() math relies on power-of-2 granularity
- Tidy-up the restore_parent() comment block

Changes in v2:
- Add 6 and 12 Host Bridge interleaves to decode_pos() (Jonathan)
- Limit the unalignment check to MOD3 regions
- Move the cache_size increment to a single place
- Updated some in code comments
- Rebase on v6.18-rc1

Changes in v1 (was RFC):
- Replace "/" with do_div() to quiet i386 build warning (lkp)
- Replace 'cxld->interleave_ways' with 'hbiw' for clarity
- Use div64_u64_rem() for alignment alignment
- Fix up a printk format specifier (lkp)
- Update code comments and commit log
- Rebase on v6.17-rc7

Begin Cover Letter:
With the introduction of MOD3 interleave way support, platforms may create regions at starting addresses that are not power-of-2 aligned. This allows platforms to avoid gaps in the memory map, but addresses within those regions cannot be translated using the existing bit manipulation method.

Introduce support for translating these unaligned addresses.

Alison Schofield (2):
cxl/region: Translate DPA->HPA in unaligned MOD3 regions cxl/region: Translate HPA to DPA and memdev in unaligned regions

 drivers/cxl/core/region.c | 212 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 204 insertions(+), 8 deletions(-)

base-commit: 9ace4753a5202b02191d54e9fdf7f9e3d02b85eb

Signature · 1 line
2.37.3