to_pos(9)
β¨ to_pos(9) β¨
okay so bestie, welcome to the to_pos page from the Kernel API Manual β it's giving "tiny function, very specific job," and honestly? We respect it. π
πΈ NAME πΈ
to_pos β extract an interleave position from an HPA offset. That's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
u64 to_pos (u64 hpa_offset , u8 r_eiw , u16 r_eig , u8 hb_ways , u8 math
);
literally the whole signature, no cap. Note the very chic line break before that last ); β that's just how it is. π
π ARGUMENTS π
okay so the original page is lowkey mysterious about these, and we are not gonna invent lore. Every single one is listed as -- undescribed --:
hpa_offsetβ-- undescribed --r_eiwβ-- undescribed --r_eigβ-- undescribed --hb_waysβ-- undescribed --mathβ-- undescribed --
likeβ¦ the AUDACITY of leaving us on read π but we're keeping it exactly as written. No guessing, no extra tips, periodt.
π DESCRIPTION π
okay so here's where the page actually spills:
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 yes, those five mystery arguments from above do have meanings β they're just all crammed into the description instead of the argument list. iconic formatting choice, honestly. π
β RETURN β
devices position in region interleave π«Ά
that's the return value, bestie. short, sweet, and serving exactly one job.
π SEE ALSO π
- Kernel file
./tools/testing/cxl/test/cxl_translate.c to_hpa(9)to_dpa(9)run_translation_test(9)parse_test_vector(9)
go read those if you wanna complete the lore arc πβ¨
warning-ish reminder: this page gives us zero extra details beyond what's above β no hidden defaults, no secret edge cases, no extra behaviour claims. if you need more, the SEE ALSO girlies are right there. π
and that's the whole page, bestie β go off, translate those addresses, and slay π
source/version vibes: ./tools/testing/cxl/test, dated October 2026, and the manual name is to_pos(9) β mwah, signed, sealed, delivered. ππ¦π
π¦ 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