gmap_create_shadow(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ gmap_create_shadow πŸ’…

okay so this is gmap_create_shadow(9) from the Kernel API Manual, and it's literally the function that creates or finds you a shadow guest address space. yes bestie, both. it's giving multitasking icon energy ✨


🌸 NAME 🌸

gmap_create_shadow β€” Create/find a shadow guest address space. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

struct gmap * gmap_create_shadow (struct kvm_s390_mmu_cache *mc , struct
       gmap *parent , union asce asce , int edat_level );

like, look at that signature. she's got range. 🫢


⭐ ARGUMENTS ⭐

  • mc β€” the cache you're gonna use to allocate the dat tables. that's her whole job, no cap.
  • parent β€” pointer to the parent gmap. the mother ship, if you will πŸ‘‘
  • asce β€” the ASCE that this shadow table is being created for.
  • edat_level β€” the Edat level to use for the shadow translation. lowkey important.

πŸ’– DESCRIPTION πŸ’–

so here's the tea πŸ“ β€” the pages of the top level page table that the asce parameter refers to get set to read-only and marked in the PGSTEs of the kvm process. yup.

and the shadow table? she gets removed automatically on any change to the PTE mapping for the source table. no manual cleanup era, we love a self-cleaning queen 🧚

also, the returned shadow gmap comes back with one extra reference. don't forget to deal with that, bestie πŸ™ˆ


πŸ”₯ RETURN πŸ”₯

  • a guest address space structure πŸ’– (the good ending)
  • ERR_PTR(-ENOMEM) if out of memory 😭
  • ERR_PTR(-EAGAIN) if the caller has to retry πŸ”
  • ERR_PTR(-EFAULT) if the parent gmap table could not be protected πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./arch/s390/kvm/gmap/gmap.c β€” and honestly the whole friend group:


and that's the whole page, diva. this one lives in ./arch/s390/kvm/gmap, dated October 2026, from the Kernel API Manual. go forth and shadow-translate responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from