kvm_vgic_addr(9)
π 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, iykykwriteβ iftrueset the address in the VM address space, iffalseread 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
- 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