arch/arm64/kvm/emulate-nested.c
Source file repositories/reference/linux-study-clean/arch/arm64/kvm/emulate-nested.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm64/kvm/emulate-nested.c- Extension
.c- Size
- 104232 bytes
- Lines
- 2956
- Domain
- Architecture Layer
- Bucket
- arch/arm64
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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/kvm.hlinux/kvm_host.hasm/kvm_emulate.hasm/kvm_nested.hhyp/include/hyp/adjust_pc.htrace.h
Detected Declarations
struct trap_bitsstruct encoding_to_trap_configenum trap_behaviourenum cgt_group_idenum fg_filter_idfunction get_sanitized_cnthctlfunction check_cnthctl_el1pctenfunction check_cnthctl_el1ptenfunction is_nested_nv2_guestfunction check_cnthctl_el1nvpctfunction check_cnthctl_el1nvvctfunction check_cptr_ttafunction check_mdcr_hpmnfunction get_trap_configfunction print_nv_trap_errorfunction encoding_nextfunction aggregate_fgtfunction check_fgt_masksfunction for_each_set_bitfunction check_all_fgt_masksfunction populate_nv_trap_configfunction for_each_encoding_infunction for_each_encoding_infunction populate_sysreg_configfunction get_behaviourfunction __compute_trap_behaviourfunction compute_trap_behaviourfunction kvm_get_sysreg_res0function check_fgt_bitfunction triage_sysreg_trapfunction UnimplementedIDRegisterfunction __forward_trapsfunction forward_hcr_trapsfunction forward_smc_trapfunction forward_mdcr_trapsfunction forward_debug_exceptionfunction kvm_check_illegal_exception_returnfunction kvm_emulate_nested_eretfunction exceptionfunction kvm_inject_el2_exceptionfunction kvm_inject_nestedfunction kvm_inject_nested_syncfunction kvm_inject_nested_irqfunction kvm_inject_nested_seafunction kvm_inject_nested_serror
Annotated Snippet
struct trap_bits {
const enum vcpu_sysreg index;
const enum trap_behaviour behaviour;
const u64 value;
const u64 mask;
};
/* Coarse Grained Trap definitions */
enum cgt_group_id {
/* Indicates no coarse trap control */
__RESERVED__,
/*
* The first batch of IDs denote coarse trapping that are used
* on their own instead of being part of a combination of
* trap controls.
*/
CGT_HCR_TID1,
CGT_HCR_TID2,
CGT_HCR_TID3,
CGT_HCR_IMO,
CGT_HCR_FMO,
CGT_HCR_TIDCP,
CGT_HCR_TACR,
CGT_HCR_TSW,
CGT_HCR_TPC,
CGT_HCR_TPU,
CGT_HCR_TTLB,
CGT_HCR_TVM,
CGT_HCR_TDZ,
CGT_HCR_TRVM,
CGT_HCR_TLOR,
CGT_HCR_TERR,
CGT_HCR_APK,
CGT_HCR_NV,
CGT_HCR_NV_nNV2,
CGT_HCR_NV1_nNV2,
CGT_HCR_AT,
CGT_HCR_nFIEN,
CGT_HCR_TID4,
CGT_HCR_TICAB,
CGT_HCR_TOCU,
CGT_HCR_ENSCXT,
CGT_HCR_TTLBIS,
CGT_HCR_TTLBOS,
CGT_HCR_TID5,
CGT_MDCR_TPMCR,
CGT_MDCR_TPM,
CGT_MDCR_TDE,
CGT_MDCR_TDA,
CGT_MDCR_TDOSA,
CGT_MDCR_TDRA,
CGT_MDCR_E2PB,
CGT_MDCR_TPMS,
CGT_MDCR_TTRF,
CGT_MDCR_E2TB,
CGT_MDCR_TDCC,
CGT_CPTR_TAM,
CGT_CPTR_TCPAC,
CGT_HCRX_EnFPM,
CGT_HCRX_TCR2En,
CGT_HCRX_SCTLR2En,
CGT_CNTHCTL_EL1TVT,
CGT_CNTHCTL_EL1TVCT,
CGT_ICH_HCR_TC,
CGT_ICH_HCR_TALL0,
CGT_ICH_HCR_TALL1,
CGT_ICH_HCR_TDIR,
/*
* Anything after this point is a combination of coarse trap
* controls, which must all be evaluated to decide what to do.
*/
__MULTIPLE_CONTROL_BITS__,
CGT_HCR_IMO_FMO_ICH_HCR_TC = __MULTIPLE_CONTROL_BITS__,
CGT_HCR_TID2_TID4,
CGT_HCR_TTLB_TTLBIS,
CGT_HCR_TTLB_TTLBOS,
CGT_HCR_TVM_TRVM,
CGT_HCR_TVM_TRVM_HCRX_TCR2En,
CGT_HCR_TVM_TRVM_HCRX_SCTLR2En,
CGT_HCR_TPU_TICAB,
CGT_HCR_TPU_TOCU,
CGT_HCR_NV1_nNV2_ENSCXT,
CGT_MDCR_TPM_TPMCR,
Annotation
- Immediate include surface: `linux/kvm.h`, `linux/kvm_host.h`, `asm/kvm_emulate.h`, `asm/kvm_nested.h`, `hyp/include/hyp/adjust_pc.h`, `trace.h`.
- Detected declarations: `struct trap_bits`, `struct encoding_to_trap_config`, `enum trap_behaviour`, `enum cgt_group_id`, `enum fg_filter_id`, `function get_sanitized_cnthctl`, `function check_cnthctl_el1pcten`, `function check_cnthctl_el1pten`, `function is_nested_nv2_guest`, `function check_cnthctl_el1nvpct`.
- Atlas domain: Architecture Layer / arch/arm64.
- Implementation status: source implementation candidate.
- 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.