kvm_vgic_addr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– kvm_vgic_addr β€” set or get vgic VM base addresses πŸ’–

okay so this is kvm_vgic_addr(9) from the Kernel API Manual and bestie, it's literally the little helper that handles where your virtual GIC lives in memory. let's get into it πŸŽ€


✨ SYNOPSIS ✨

int kvm_vgic_addr (struct kvm *kvm , struct kvm_device_attr *attr , bool
write );

yeah she's a three-argument girlie, no cap πŸ’…


🫢 ARGUMENTS 🫢

  • kvm β€” pointer to the vm struct. the actual VM we're messing with, main character energy πŸ‘‘
  • attr β€” pointer to the attribute being retrieved/updated. this is the thing you're reading or writing, iykyk
  • write β€” if true set the address in the VM address space, if false read the address. so like, <kbd>W</kbd> mode or <kbd>R</kbd> mode, pick your fighter πŸ¦‹

🌸 DESCRIPTION 🌸

so what she does is set or get the vgic base addresses for the distributor and the virtual CPU interface in the VM physical address space ✨

and here's the tea: these addresses are properties of the emulated core/SoC, which means user space initially knows this information β€” like, it comes in already knowing, that's the whole vibe πŸ’œ

she checks them for sanity (alignment, double assignment) πŸ”₯ because we're not about that messy life, ngl

but β€” and this is the important caveat bestie, don't skip it 😭 β€” we can't check for overlapping regions in case of a virtual GICv3 here, since we don't know the number of VCPUs yet. so we defer this check to map_resources. literally "not my problem yet, ask me later" πŸ’€

fr fr: the overlap check for virtual GICv3 does not happen here. it's deferred to map_resources because the VCPU count isn't known at this point πŸ™ˆ

πŸ” SEE ALSO πŸ”

  • Kernel file ./arch/arm64/kvm/vgic/vgic-kvm-device.c β€” go read the source, it ate πŸ’…
  • vgic_v2_attr_regs_access(9) β€” the sibling function, also iconic ✨

and that's the whole page, bestie, you're now a vgic address expert πŸ§šβ€β™€οΈπŸ’–

πŸŒΈπŸ’œπŸŽ€ this lil rewrite came from the Kernel API Manual page for kvm_vgic_addr(9), source ./arch/arm64/kvm/vgic, dated October 2026 β€” mwah, go touch some kernel code, slay πŸŽ€πŸ’œπŸŒΈ

πŸ“¦ where this page comes from