to_dpa(9)
β¨ to_dpa(9) β¨
okay bestie, welcome to the <pink>Kernel API Manual</pink> π
this one's called to_dpa, and honestly it's giving "tiny function, big lore."
πΈ NAME πΈ
to_dpa β translate an HPA offset to a DPA offset π¦
like, host brain β device brain. iykyk.
π SYNOPSIS π
u64 to_dpa (u64 hpa_offset , u8 r_eiw , u16 r_eig , u8 hb_ways , u8 math );
that's the whole vibe. five args, one u64 back. slay.
π ARGUMENTS π
so the manpage is literally no help here β every single one of these says -- undescribed -- π not me reading the DESCRIPTION to figure out what anything means:
hpa_offsetβ-- undescribed --π (the DESCRIPTION spills it tho: host physical address offset)r_eiwβ-- undescribed --π (DESCRIPTION says region encoded interleave ways)r_eigβ-- undescribed --π (DESCRIPTION says region encoded interleave granularity)hb_waysβ-- undescribed --π (DESCRIPTION says host bridge interleave ways)mathβ-- undescribed --π (DESCRIPTION says interleave arithmetic, akaMODULO_MATHorXOR_MATH)
no cap, the argument list just gave up. but the description ate, so we move π
π₯ DESCRIPTION π₯
here's the real tea, laid out exactly like the page has it:
hpa_offset: host physical address offsetr_eiw: region encoded interleave waysr_eig: region encoded interleave granularityhb_ways: host bridge interleave waysmath: interleave arithmetic (MODULO_MATHorXOR_MATH)
so it takes where you are in host-physical land, plus all the interleave deets β the ways, the granularity, the host bridge ways β plus which math flavor you're vibing with (MODULO_MATH or XOR_MATH, pick one bestie, those are the options), and it hands you back the device side. main character energy fr fr π
β RETURN β
device physical address offset π
that's it. that's what you get back. a u64 of pure device-physical destination. π«Ά
π SEE ALSO π
- Kernel file
./tools/testing/cxl/test/cxl_translate.cβ yes the actual file, go read it π to_hpa(9)β the reverse girly πto_pos(9)run_translation_test(9)parse_test_vector(9)
vibe check: the arguments section is literally all -- undescribed --, so if you're confused, that's not you, that's the page. the DESCRIPTION is the only one doing homework here πβ¨
and that's the whole page, bestie π§ from <purple>./tools/testing/cxl/test</purple> with much love, dated <cyan>October 2026</cyan>, to_dpa(9)` signing off β mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms