arch/arm64/kvm/config.c
Source file repositories/reference/linux-study-clean/arch/arm64/kvm/config.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm64/kvm/config.c- Extension
.c- Size
- 52055 bytes
- Lines
- 1748
- 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_host.hasm/kvm_emulate.hasm/kvm_nested.hasm/sysreg.h
Detected Declarations
struct reg_bits_to_feat_mapstruct reg_feat_map_descfunction not_feat_aa64el3function feat_nv2function feat_nv2_e2h0_nifunction feat_rasv1p1function feat_csv2_2_csv2_1p2function feat_pauthfunction feat_pauth_lrfunction feat_aderrfunction feat_anerrfunction feat_sme_smpsfunction feat_spe_fdsfunction feat_spe_fnefunction feat_trbe_mpamfunction feat_ebep_pmuv3_ssfunction feat_mixedendel0function feat_mte_asyncfunction feat_pmuv3p1function feat_pmuv3p5function feat_pmuv3p7function feat_pmuv3p9function kvm_has_featfunction feat_vmid16function check_feat_mapfunction reg_feat_map_bitsfunction check_reg_descfunction check_feature_mapfunction idreg_feat_matchfunction compute_resx_bitsfunction compute_reg_resx_bitsfunction compute_fgu_bitsfunction compute_fgufunction get_reg_fixed_bitsfunction __compute_fgtfunction __compute_hfgwtrfunction __compute_hdfgwtrfunction __compute_ich_hfgrtrfunction __compute_ich_hfgwtrfunction kvm_vcpu_load_fgt
Annotated Snippet
struct reg_bits_to_feat_map {
union {
u64 bits;
struct fgt_masks *masks;
};
#define NEVER_FGU BIT(0) /* Can trap, but never UNDEF */
#define CALL_FUNC BIT(1) /* Needs to evaluate tons of crap */
#define FORCE_RESx BIT(2) /* Unconditional RESx */
#define MASKS_POINTER BIT(3) /* Pointer to fgt_masks struct instead of bits */
#define AS_RES1 BIT(4) /* RES1 when not supported */
#define REQUIRES_E2H1 BIT(5) /* Add HCR_EL2.E2H RES1 as a pre-condition */
#define RES1_WHEN_E2H0 BIT(6) /* RES1 when E2H=0 and not supported */
#define RES1_WHEN_E2H1 BIT(7) /* RES1 when E2H=1 and not supported */
unsigned long flags;
union {
struct {
u8 regidx;
u8 shift;
u8 width;
bool sign;
s8 lo_lim;
};
bool (*match)(struct kvm *);
};
};
/*
* Describes the dependencies for a given register:
*
* @feat_map describes the dependency for the whole register. If the
* features the register depends on are not present, the whole
* register is effectively RES0.
*
* @bit_feat_map describes the dependencies for a set of bits in that
* register. If the features these bits depend on are not present, the
* bits are effectively RES0.
*/
struct reg_feat_map_desc {
const char *name;
const struct reg_bits_to_feat_map feat_map;
const struct reg_bits_to_feat_map *bit_feat_map;
const unsigned int bit_feat_map_sz;
};
#define __NEEDS_FEAT_3(m, f, w, id, fld, lim) \
{ \
.w = (m), \
.flags = (f), \
.regidx = IDREG_IDX(SYS_ ## id), \
.shift = id ##_## fld ## _SHIFT, \
.width = id ##_## fld ## _WIDTH, \
.sign = id ##_## fld ## _SIGNED, \
.lo_lim = id ##_## fld ##_## lim \
}
#define __NEEDS_FEAT_1(m, f, w, fun) \
{ \
.w = (m), \
.flags = (f) | CALL_FUNC, \
.match = (fun), \
}
#define __NEEDS_FEAT_0(m, f, w, ...) \
{ \
.w = (m), \
.flags = (f), \
}
#define __NEEDS_FEAT_FLAG(m, f, w, ...) \
CONCATENATE(__NEEDS_FEAT_, COUNT_ARGS(__VA_ARGS__))(m, f, w, __VA_ARGS__)
#define NEEDS_FEAT_FLAG(m, f, ...) \
__NEEDS_FEAT_FLAG(m, f, bits, __VA_ARGS__)
#define NEEDS_FEAT_MASKS(p, ...) \
__NEEDS_FEAT_FLAG(p, MASKS_POINTER, masks, __VA_ARGS__)
/*
* Declare the dependency between a set of bits and a set of features,
* generating a struct reg_bit_to_feat_map.
*/
#define NEEDS_FEAT(m, ...) NEEDS_FEAT_FLAG(m, 0, __VA_ARGS__)
/* Declare fixed RESx bits */
#define FORCE_RES0(m) NEEDS_FEAT_FLAG(m, FORCE_RESx)
#define FORCE_RES1(m) NEEDS_FEAT_FLAG(m, FORCE_RESx | AS_RES1)
Annotation
- Immediate include surface: `linux/kvm_host.h`, `asm/kvm_emulate.h`, `asm/kvm_nested.h`, `asm/sysreg.h`.
- Detected declarations: `struct reg_bits_to_feat_map`, `struct reg_feat_map_desc`, `function not_feat_aa64el3`, `function feat_nv2`, `function feat_nv2_e2h0_ni`, `function feat_rasv1p1`, `function feat_csv2_2_csv2_1p2`, `function feat_pauth`, `function feat_pauth_lr`, `function feat_aderr`.
- 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.