drivers/gpu/drm/i915/gvt/gtt.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gvt/gtt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gvt/gtt.c- Extension
.c- Size
- 75216 bytes
- Lines
- 2797
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/vmalloc.hdrm/drm_print.hgt/intel_gt_regs.hgvt.hi915_drv.hi915_pvinfo.htrace.h
Detected Declarations
struct gtt_type_table_entryfunction intel_gvt_ggtt_validate_rangefunction get_next_pt_typefunction get_entry_typefunction get_pse_typefunction read_pte64function ggtt_invalidatefunction write_pte64function gtt_get_entry64function gtt_set_entry64function gen8_gtt_get_pfnfunction gen8_gtt_set_pfnfunction gen8_gtt_test_psefunction gen8_gtt_clear_psefunction gen8_gtt_test_ipsfunction gen8_gtt_clear_ipsfunction gen8_gtt_test_presentfunction gtt_entry_clear_presentfunction gtt_entry_set_presentfunction gen8_gtt_test_64k_splitedfunction gen8_gtt_set_64k_splitedfunction gen8_gtt_clear_64k_splitedfunction gma_to_ggtt_pte_indexfunction update_entry_type_for_realfunction _ppgtt_get_root_entryfunction ppgtt_get_guest_root_entryfunction ppgtt_get_shadow_root_entryfunction _ppgtt_set_root_entryfunction ppgtt_set_shadow_root_entryfunction ggtt_get_guest_entryfunction ggtt_set_guest_entryfunction ggtt_get_host_entryfunction ggtt_set_host_entryfunction ppgtt_spt_get_entryfunction ppgtt_spt_set_entryfunction free_sptfunction ppgtt_free_sptfunction ppgtt_free_all_sptfunction ppgtt_write_protection_handlerfunction ppgtt_put_sptfunction ppgtt_invalidate_spt_by_shadow_entryfunction ppgtt_invalidate_ptefunction ppgtt_invalidate_sptfunction for_each_present_shadow_entryfunction vgpu_ips_enabledfunction ppgtt_generate_shadow_entryfunction split_2MB_gtt_entryfunction for_each_shadow_entry
Annotated Snippet
struct gtt_type_table_entry {
int entry_type;
int pt_type;
int next_pt_type;
int pse_entry_type;
};
#define GTT_TYPE_TABLE_ENTRY(type, e_type, cpt_type, npt_type, pse_type) \
[type] = { \
.entry_type = e_type, \
.pt_type = cpt_type, \
.next_pt_type = npt_type, \
.pse_entry_type = pse_type, \
}
static const struct gtt_type_table_entry gtt_type_table[] = {
GTT_TYPE_TABLE_ENTRY(GTT_TYPE_PPGTT_ROOT_L4_ENTRY,
GTT_TYPE_PPGTT_ROOT_L4_ENTRY,
GTT_TYPE_INVALID,
GTT_TYPE_PPGTT_PML4_PT,
GTT_TYPE_INVALID),
GTT_TYPE_TABLE_ENTRY(GTT_TYPE_PPGTT_PML4_PT,
GTT_TYPE_PPGTT_PML4_ENTRY,
GTT_TYPE_PPGTT_PML4_PT,
GTT_TYPE_PPGTT_PDP_PT,
GTT_TYPE_INVALID),
GTT_TYPE_TABLE_ENTRY(GTT_TYPE_PPGTT_PML4_ENTRY,
GTT_TYPE_PPGTT_PML4_ENTRY,
GTT_TYPE_PPGTT_PML4_PT,
GTT_TYPE_PPGTT_PDP_PT,
GTT_TYPE_INVALID),
GTT_TYPE_TABLE_ENTRY(GTT_TYPE_PPGTT_PDP_PT,
GTT_TYPE_PPGTT_PDP_ENTRY,
GTT_TYPE_PPGTT_PDP_PT,
GTT_TYPE_PPGTT_PDE_PT,
GTT_TYPE_PPGTT_PTE_1G_ENTRY),
GTT_TYPE_TABLE_ENTRY(GTT_TYPE_PPGT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(GTT_TYPE_PPGTT_PTE_2M_ENTRY,
GTT_TYPE_PPGTT_PDE_ENTRY,
GTT_TYPE_PPGTT_PDE_PT,
GTT_TYPE_INVALID,
GTT_TYPE_PPGTT_PTE_2M_ENTRY),
GTT_TYPE_TABLE_ENTRY(GTT_TYPE_PPGTT_PTE_1G_ENTRY,
GTT_TYPE_PPGTT_PDP_ENTRY,
GTT_TYPE_PPGTT_PDP_PT,
GTT_TYPE_INVALID,
GTT_TYPE_PPGTT_PTE_1G_ENTRY),
GTT_TYPE_TABLE_ENTRY(GTT_TYPE_GGTT_PTE,
GTT_TYPE_GGTT_PTE,
GTT_TYPE_INVALID,
GTT_TYPE_INVALID,
GTT_TYPE_INVALID),
};
static inline int get_next_pt_type(int type)
Annotation
- Immediate include surface: `linux/vmalloc.h`, `drm/drm_print.h`, `gt/intel_gt_regs.h`, `gvt.h`, `i915_drv.h`, `i915_pvinfo.h`, `trace.h`.
- Detected declarations: `struct gtt_type_table_entry`, `function intel_gvt_ggtt_validate_range`, `function get_next_pt_type`, `function get_entry_type`, `function get_pse_type`, `function read_pte64`, `function ggtt_invalidate`, `function write_pte64`, `function gtt_get_entry64`, `function gtt_set_entry64`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.