to_dpa(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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, aka MODULO_MATH or XOR_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 offset
  • r_eiw: region encoded interleave ways
  • r_eig: region encoded interleave granularity
  • hb_ways: host bridge interleave ways
  • math: interleave arithmetic (MODULO_MATH or XOR_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 🌈


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