kvm_arch_vcp...fault_memory(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kvm_arch_vcp...fault_memory(9) πŸ’…

okay bestie, welcome to the Kernel API Manual β€” yes, THE manual, and yes, this page is called kvm_arch_vcp...fault_memory(9) (the title got truncated mid-word and honestly? icon behavior, we respect it). So sit down, grab a boba, and let's get into it ✨


πŸŽ€ NAME πŸŽ€

kvm_arch_vcpu_pre_fault_memory β€” pre-fault and link gmap dat tables

Like, that's the whole vibe. Pre-faulting. Linking gmap dat tables. Slay.


πŸ¦‹ SYNOPSIS πŸ¦‹

long kvm_arch_vcpu_pre_fault_memory (struct kvm_vcpu *vcpu , struct
kvm_pre_fault_memory *range );

That's the signature, copy it exactly, no cap πŸ’–


🌸 ARGUMENTS 🌸

  • vcpu β€” the vcpu that shall appear to have generated the fault-in. ok so this one is literally just vibing as the ~alleged~ source of the fault-in, like it's taking the credit 😭
  • range β€” the range that needs to be faulted in. this is the actual work, bestie.

⭐ DESCRIPTION ⭐

So here's what happens, lowkey the whole plot:

The first page of the given range gets faulted in, and the corresponding gmap page tables get created β€” all as if the given vCPU had performed a read operation. Main character energy: the vcpu did nothing but we're all acting like it read something 🫢

Now the vibe checks:

If the range starts outside any memslots, an error is returned. no memslot, no service πŸ’€
An error is also returned for UCONTROL VMs β€” those should instead use the KVM_S390_VCPU_FAULT ioctl. different ioctl for different... VMs, iykyk.

πŸ”₯ RETURN πŸ”₯

The return value menu, fr fr:

  • -ENOENT if the range lies outside of a memslot. (you are not on the list, goodbye πŸ™ˆ)
  • -EINVAL in case of invalid state (for example if the VM is UCONTROL). invalid state = invalid state, that's the rule ✨
  • -EIO if errors happen while faulting-in the page (will trigger a warning in the caller). yeah, the caller is gonna hear about this one 😭
  • other error codes < 0 in case of other errors. mysterious. iconic. unspecified. πŸ‘‘
  • otherwise a number > 0 of bytes that have been faulted in successfully. that's the good ending, we love a positive return πŸ’–

🌈 SEE ALSO 🌈

all the besties in the same friend group, go read them too πŸ’œ


and that's the page!! πŸŽ€ this lil masterpiece lives in ./arch/s390/kvm/s390 and it's dated October 2026, so mark your calendars bestie β€” sending you all the πŸ’– and hoping every range you fault in lands inside a memslot. periodt. πŸ¦‹βœ¨

πŸ“¦ where this page comes from