include/kvm/arm_vgic.h
Source file repositories/reference/linux-study-clean/include/kvm/arm_vgic.h
File Facts
- System
- Linux kernel
- Corpus path
include/kvm/arm_vgic.h- Extension
.h- Size
- 17923 bytes
- Lines
- 645
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bits.hlinux/kvm.hlinux/irqreturn.hlinux/mutex.hlinux/refcount.hlinux/spinlock.hlinux/static_key.hlinux/types.hlinux/xarray.hkvm/iodev.hlinux/list.hlinux/jump_label.hlinux/irqchip/arm-gic-v4.hlinux/irqchip/arm-gic-v5.h
Detected Declarations
struct vgic_globalstruct vgic_irqstruct irq_opsstruct vgic_irqstruct vgic_register_regionstruct vgic_itsstruct vgic_io_devicestruct vgic_itsstruct vgic_state_iterstruct vgic_redist_regionstruct vgic_v5_vmstruct vgic_diststruct vgic_v2_cpu_ifstruct vgic_v3_cpu_ifstruct vgic_v5_cpu_ifstruct vgic_cpustruct kvm_kernel_irq_routing_entryenum vgic_typeenum vgic_irq_configenum iodev_typefunction vgic_irq_needs_resamplingfunction kvm_vgic_get_max_vcpus
Annotated Snippet
struct vgic_global {
/* type of the host GIC */
enum vgic_type type;
/* Physical address of vgic virtual cpu interface */
phys_addr_t vcpu_base;
/* GICV mapping, kernel VA */
void __iomem *vcpu_base_va;
/* GICV mapping, HYP VA */
void __iomem *vcpu_hyp_va;
/* virtual control interface mapping, kernel VA */
void __iomem *vctrl_base;
/* virtual control interface mapping, HYP VA */
void __iomem *vctrl_hyp;
/* Physical CPU interface, kernel VA */
void __iomem *gicc_base;
/* Number of implemented list registers */
int nr_lr;
/* Maintenance IRQ number */
unsigned int maint_irq;
/* maximum number of VCPUs allowed (GICv2 limits us to 8) */
int max_gic_vcpus;
/* Only needed for the legacy KVM_CREATE_IRQCHIP */
bool can_emulate_gicv2;
/* Hardware has GICv4? */
bool has_gicv4;
bool has_gicv4_1;
/* Pseudo GICv3 from outer space */
bool no_hw_deactivation;
/* GICv3 system register CPU interface */
struct static_key_false gicv3_cpuif;
/* GICv3 compat mode on a GICv5 host */
bool has_gcie_v3_compat;
u32 ich_vtr_el2;
/* GICv5 PPI capabilities */
struct {
DECLARE_BITMAP(impl_ppi_mask, VGIC_V5_NR_PRIVATE_IRQS);
} vgic_v5_ppi_caps;
};
extern struct vgic_global kvm_vgic_global_state;
#define VGIC_V2_MAX_LRS (1 << 6)
#define VGIC_V3_MAX_LRS 16
#define VGIC_V3_LR_INDEX(lr) (VGIC_V3_MAX_LRS - 1 - lr)
enum vgic_irq_config {
VGIC_CONFIG_EDGE = 0,
VGIC_CONFIG_LEVEL
};
struct vgic_irq;
/*
* Per-irq ops overriding some common behavious.
*
* Always called in non-preemptible section and the functions can use
* kvm_arm_get_running_vcpu() to get the vcpu pointer for private IRQs.
*/
struct irq_ops {
/* Per interrupt flags for special-cased interrupts */
unsigned long (*get_flags)(void);
#define VGIC_IRQ_SW_RESAMPLE BIT(0) /* Clear the active state for resampling */
/*
* Callback function pointer to in-kernel devices that can tell us the
* state of the input level of mapped level-triggered IRQ faster than
* peaking into the physical GIC.
*/
bool (*get_input_level)(int vintid);
/*
* Function pointer to override the queuing of an IRQ.
*/
bool (*queue_irq_unlock)(struct kvm *kvm, struct vgic_irq *irq,
unsigned long flags) __releases(&irq->irq_lock);
Annotation
- Immediate include surface: `linux/bits.h`, `linux/kvm.h`, `linux/irqreturn.h`, `linux/mutex.h`, `linux/refcount.h`, `linux/spinlock.h`, `linux/static_key.h`, `linux/types.h`.
- Detected declarations: `struct vgic_global`, `struct vgic_irq`, `struct irq_ops`, `struct vgic_irq`, `struct vgic_register_region`, `struct vgic_its`, `struct vgic_io_device`, `struct vgic_its`, `struct vgic_state_iter`, `struct vgic_redist_region`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.