pte_needs_unshadow(9)
π pte_needs_unshadow β a Kernel API Manual moment (section 9, bestie)
okay so picture this: you're deep in the kernel, section 9 of the manual, and you need to know whether a pte operation is gonna trigger unshadowing. that's the whole vibe of pte_needs_unshadow(9). lowkey iconic. let's get into it π«Ά
β¨ SYNOPSIS β¨
bool pte_needs_unshadow (union pte oldpte , union pte newpte , union
pgste pgste );
like, that's the whole signature, no cap β copy it exactly, don't @ me π
π ARGUMENTS π
oldpteβ the previous value for the guest pte. the before pic πΈnewpteβ the new pte being set. the glow-up in progress β¨pgsteβ the pgste for the pte entry. the receipts, basically π§Ύ
πΈ DESCRIPTION πΈ
okay so first things first: if the pgste.vsie_notif bit is not set, just return false and go home. the page is not involved in vsie, so it should literally not trigger an unshadow operation. not its business, not its problem, we move π
now, if the pgste.vsie_gmem bit is set? that means this pte represents shadowed guest memory, and the access rights on g3's memory should be synchronized with g1's and g2's. so unshadowing gets triggered if the new and old pte differ in protection, or if the new pte is invalid. mismatched protection = drama = unshadow event. invalid pte = also drama. periodt π
and if the pgste.vsie_gmem bit is not set? then this pte maps the g2 dat tables for g3. but here's the catch, bestie β if the entry becomes writable or absent, it becomes impossible to guarantee that the shadow mapping will match g2's mapping. and in that case?? trigger an unshadow event. that's the rule, iykyk π
β RETURN β
returns true if an unshadow event should be triggered β otherwise false. simple as that, no notes π
π¦ SEE ALSO π¦
- Kernel file
./arch/s390/kvm/gmap/gmap.henumgmap_flags(9) crste_needs_unshadow(9)gmap_is_shadow_valid(9)
fr fr the whole gmap squad is linked above, go read them, they're giving main character energy too π
and that's a wrap, bestie π this page lives at ./arch/s390/kvm/gmap, and the date on it is October 2026 β so like, mark your calendar, because we're literally so ahead of schedule β¨π
π¦ 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