arch/mips/include/asm/kvm_host.h
Source file repositories/reference/linux-study-clean/arch/mips/include/asm/kvm_host.h
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/include/asm/kvm_host.h- Extension
.h- Size
- 30152 bytes
- Lines
- 898
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpumask.hlinux/mutex.hlinux/hrtimer.hlinux/interrupt.hlinux/types.hlinux/kvm.hlinux/kvm_types.hlinux/threads.hlinux/spinlock.hasm/asm.hasm/inst.hasm/mipsregs.hkvm/iodev.h
Detected Declarations
struct kvm_vm_statstruct kvm_vcpu_statstruct kvm_arch_memory_slotstruct ipi_statestruct loongson_kvm_ipistruct ipi_io_devicestruct loongson_kvm_ipistruct kvm_archstruct mips_coprocstruct kvm_mips_tlbstruct kvm_vcpu_archstruct kvm_mips_callbacksenum emulation_resultfunction kvm_is_error_hvafunction _kvm_atomic_set_c0_guest_regfunction _kvm_atomic_clear_c0_guest_regfunction _kvm_atomic_change_c0_guest_regfunction accessorsfunction kvm_mips_guest_has_fpufunction kvm_mips_guest_can_have_msafunction kvm_mips_guest_has_msafunction kvm_is_ifetch_faultfunction kvm_arch_free_memslot
Annotated Snippet
struct kvm_vm_stat {
struct kvm_vm_stat_generic generic;
};
struct kvm_vcpu_stat {
struct kvm_vcpu_stat_generic generic;
u64 wait_exits;
u64 cache_exits;
u64 signal_exits;
u64 int_exits;
u64 cop_unusable_exits;
u64 tlbmod_exits;
u64 tlbmiss_ld_exits;
u64 tlbmiss_st_exits;
u64 addrerr_st_exits;
u64 addrerr_ld_exits;
u64 syscall_exits;
u64 resvd_inst_exits;
u64 break_inst_exits;
u64 trap_inst_exits;
u64 msa_fpe_exits;
u64 fpe_exits;
u64 msa_disabled_exits;
u64 flush_dcache_exits;
u64 vz_gpsi_exits;
u64 vz_gsfc_exits;
u64 vz_hc_exits;
u64 vz_grr_exits;
u64 vz_gva_exits;
u64 vz_ghfc_exits;
u64 vz_gpa_exits;
u64 vz_resvd_exits;
#ifdef CONFIG_CPU_LOONGSON64
u64 vz_cpucfg_exits;
#endif
};
struct kvm_arch_memory_slot {
};
#ifdef CONFIG_CPU_LOONGSON64
struct ipi_state {
uint32_t status;
uint32_t en;
uint32_t set;
uint32_t clear;
uint64_t buf[4];
};
struct loongson_kvm_ipi;
struct ipi_io_device {
int node_id;
struct loongson_kvm_ipi *ipi;
struct kvm_io_device device;
};
struct loongson_kvm_ipi {
spinlock_t lock;
struct kvm *kvm;
struct ipi_state ipistate[16];
struct ipi_io_device dev_ipi[4];
};
#endif
struct kvm_arch {
/* Guest physical mm */
struct mm_struct gpa_mm;
/* Mask of CPUs needing GPA ASID flush */
cpumask_t asid_flush_mask;
#ifdef CONFIG_CPU_LOONGSON64
struct loongson_kvm_ipi ipi;
#endif
};
#define N_MIPS_COPROC_REGS 32
#define N_MIPS_COPROC_SEL 8
struct mips_coproc {
unsigned long reg[N_MIPS_COPROC_REGS][N_MIPS_COPROC_SEL];
#ifdef CONFIG_KVM_MIPS_DEBUG_COP0_COUNTERS
unsigned long stat[N_MIPS_COPROC_REGS][N_MIPS_COPROC_SEL];
#endif
};
/*
* Coprocessor 0 register names
*/
#define MIPS_CP0_TLB_INDEX 0
#define MIPS_CP0_TLB_RANDOM 1
Annotation
- Immediate include surface: `linux/cpumask.h`, `linux/mutex.h`, `linux/hrtimer.h`, `linux/interrupt.h`, `linux/types.h`, `linux/kvm.h`, `linux/kvm_types.h`, `linux/threads.h`.
- Detected declarations: `struct kvm_vm_stat`, `struct kvm_vcpu_stat`, `struct kvm_arch_memory_slot`, `struct ipi_state`, `struct loongson_kvm_ipi`, `struct ipi_io_device`, `struct loongson_kvm_ipi`, `struct kvm_arch`, `struct mips_coproc`, `struct kvm_mips_tlb`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.