dat_entry_walk(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ dat_entry_walk(9) ✨

okay so bestie, welcome to dat_entry_walk β€” it's a real one from the Kernel API Manual, and it's basically the girl whose whole job is walking the gmap page tables πŸ’… like she literally strolls through them. no cap. let's get into it 🫢


🌸 NAME 🌸

dat_entry_walk β€” walk the gmap page tables. that's it, that's the vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int dat_entry_walk (struct kvm_s390_mmu_cache *mc , gfn_t gfn , union
asce asce , int flags , int walk_level , union crste **last , union pte
**ptepp );

πŸ’– ARGUMENTS πŸ’–

  • mc β€” the cache she uses to allocate dat tables, if needed. and like, you can literally pass NULL here if neither DAT_WALK_SPLIT nor DAT_WALK_ALLOC is specified in flags. so she doesn't even need it, she's flexible like that ✨
  • gfn β€” the guest frame. yeah. that one.
  • asce β€” the ASCE of the address space πŸ‘‘
  • flags β€” the flags, from the WALK_* macros. there's a whole lineup of them below, keep reading πŸ’€
  • walk_level β€” the level to walk to, using the LEVEL_* macros.
  • last β€” gets filled with the last visited non-pte DAT entry πŸŽ€
  • ptepp β€” gets filled with the last visited pte entry, if there even is one β€” otherwise it's NULL. not every walk finds a pte, and that's okay πŸ™ˆ

🌈 DESCRIPTION 🌈

so what does she actually do? she returns a table entry pointer for the given guest address and walk_level. that's the whole main character energy of this function, fr fr πŸ’…

and the flags? each one has a meaning, so let's go through them one by one, no skipping, i would never 😀

  • DAT_WALK_IGN_HOLES: consider holes as normal table entries. holes are just entries to her, she doesn't judge πŸ•³οΈβœ¨
  • DAT_WALK_ALLOC: allocate new tables to reach the requested level, if needed.
  • DAT_WALK_SPLIT: split existing large pages to reach the requested level, if needed. she will absolutely break up a large page if that's what it takes πŸ’”
  • DAT_WALK_LEAF: return successfully whenever a large page is encountered. like, found a big one? we're done here, slay.
  • DAT_WALK_ANY: return successfully even if the requested level could not be reached. she's forgiving. she's chill. lowkey iconic.
  • DAT_WALK_CONTINUE: walk to the requested level with the specified flags, and then try to continue walking to ptes with only DAT_WALK_ANY. two-step queen behavior πŸ‘‘
  • DAT_WALK_USES_SKEYS: storage keys are in use. noted. logged. tracked. πŸ”‘

πŸ’œ CONTEXT πŸ’œ

this one's important bestie, don't skip it: called with kvm->mmu_lock held. like, that's the rule. that's the whole rule. don't be out here calling her without the lock, that's not the move 😭


πŸ“ RETURN πŸ“

okay so she can come back with a bunch of different things depending on what went down, and you need to know which is which:

  • PGM_ADDRESSING if the requested address lies outside memory.
  • a PIC number if the requested address lies in a memory hole of type _DAT_TOKEN_PIC.
  • -EFAULT if the requested address lies inside a memory hole of a different type.
  • -EINVAL if the given ASCE is not compatible with the requested level. mismatch arc πŸ’€
  • -EFBIG if the requested level could not be reached because a larger frame was found.
  • -ENOENT if the requested level could not be reached for other reasons.
  • -ENOMEM if running out of memory while allocating or splitting a table. the classic 😭

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./arch/s390/kvm/gmap/dat.c dat_crstep_xchg_atomic(9), _dat_walk_gfn_range(9), dat_test_age_gfn(9), dat_perform_essa(9), dat_set_cmma_bits(9)

they're all in the group chat together, go say hi 🫢


okay and that's the whole page!! this one lives over in ./arch/s390/kvm/gmap, and it's dated October 2026 β€” so like, mark your calendars bestie πŸŽ€πŸ’–βœ¨ slay, bye! πŸ¦‹

πŸ“¦ where this page comes from