s390_replace_asce(9)
π s390_replace_asce(9) β the Kernel API Manual page, but make it make sense π
okay so bestie, you're in the Kernel API Manual and this is the page for s390_replace_asce. it's a little s390-specific number and honestly she's doing a lot, so let's get into it β¨
πΈ SYNOPSIS πΈ
int s390_replace_asce (struct gmap *gmap );
π ARGUMENTS π
gmapβ the gmap whose ASCE needs to be replaced. that's her. that's the one. π«Ά
π¦ DESCRIPTION π¦
okay so here's the whole vibe π
if the ASCE is a SEGMENT type, this function will return -EINVAL. no exceptions, no slay. and like, that check is load-bearing, because otherwise the pointers in the host_to_guest radix tree would keep pointing at the wrong pages β and that is use-after-free and memory corruption territory ππ we do not want that fr fr.
if the allocation of the new top level page table fails, then the ASCE just doesn't get replaced. that's it, that's the outcome. no memory, no new ASCE, stay in your lane.
and here's the part you really need to clock π: in any case, the old ASCE is always removed from the gmap CRST list. like, whether it works out or not, she's off the list. so the caller has to make sure to save a pointer to it beforehand β unless a leak is actually what you intended, in which case, um, live your truth I guess π
β οΈ bestie please save that pointer. the old ASCE leaves the CRST list no matter what, and if you didn't keep a reference you're gonna have a bad time.
β RETURN β
0β success, we ate π-EINVALβ the ASCE is segment type ASCE π«-ENOMEMβ running out of memory π
π SEE ALSO π
kernel file ./arch/s390/kvm/gmap/gmap.c and honestly the whole friend group: gmap_new(9), gmap_dispose(9), gmap_age_gfn(9), gmap_unmap_gfn_range(9), gmap_try_fixup_minor(9), gmap_2g_allowed(9), gmap_1m_allowed(9), gmap_ucas_translate(9), gmap_find_shadow(9), gmap_create_shadow(9) π
that's the whole page bestie, no cap π this one lives in ./arch/s390/kvm/gmap and the version/date vibes are October 2026 β see you in the next one, 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