arch/riscv/include/uapi/asm/kvm.h
Source file repositories/reference/linux-study-clean/arch/riscv/include/uapi/asm/kvm.h
File Facts
- System
- Linux kernel
- Corpus path
arch/riscv/include/uapi/asm/kvm.h- Extension
.h- Size
- 12559 bytes
- Lines
- 402
- Domain
- Architecture Layer
- Bucket
- arch/riscv
- 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/types.hasm/bitsperlong.hasm/ptrace.h
Detected Declarations
struct kvm_regsstruct kvm_fpustruct kvm_debug_exit_archstruct kvm_guest_debug_archstruct kvm_sync_regsstruct kvm_sregsstruct kvm_riscv_configstruct kvm_riscv_corestruct kvm_riscv_csrstruct kvm_riscv_aia_csrstruct kvm_riscv_smstateen_csrstruct kvm_riscv_timerstruct kvm_riscv_sbi_stastruct kvm_riscv_sbi_fwft_featurestruct kvm_riscv_sbi_fwftenum KVM_RISCV_ISA_EXT_IDenum KVM_RISCV_SBI_EXT_ID
Annotated Snippet
struct kvm_regs {
};
/* for KVM_GET_FPU and KVM_SET_FPU */
struct kvm_fpu {
};
/* KVM Debug exit structure */
struct kvm_debug_exit_arch {
};
/* for KVM_SET_GUEST_DEBUG */
struct kvm_guest_debug_arch {
};
/* definition of registers in kvm_run */
struct kvm_sync_regs {
};
/* for KVM_GET_SREGS and KVM_SET_SREGS */
struct kvm_sregs {
};
/* CONFIG registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
struct kvm_riscv_config {
unsigned long isa;
unsigned long zicbom_block_size;
unsigned long mvendorid;
unsigned long marchid;
unsigned long mimpid;
unsigned long zicboz_block_size;
unsigned long satp_mode;
unsigned long zicbop_block_size;
};
/* CORE registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
struct kvm_riscv_core {
struct user_regs_struct regs;
unsigned long mode;
};
/* Possible privilege modes for kvm_riscv_core */
#define KVM_RISCV_MODE_S 1
#define KVM_RISCV_MODE_U 0
/* General CSR registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
struct kvm_riscv_csr {
unsigned long sstatus;
unsigned long sie;
unsigned long stvec;
unsigned long sscratch;
unsigned long sepc;
unsigned long scause;
unsigned long stval;
unsigned long sip;
unsigned long satp;
unsigned long scounteren;
unsigned long senvcfg;
};
/* AIA CSR registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
struct kvm_riscv_aia_csr {
unsigned long siselect;
unsigned long iprio1;
unsigned long iprio2;
unsigned long sieh;
unsigned long siph;
unsigned long iprio1h;
unsigned long iprio2h;
};
/* Smstateen CSR for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
struct kvm_riscv_smstateen_csr {
unsigned long sstateen0;
};
/* TIMER registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
struct kvm_riscv_timer {
__u64 frequency;
__u64 time;
__u64 compare;
__u64 state;
};
/* Possible states for kvm_riscv_timer */
#define KVM_RISCV_TIMER_STATE_OFF 0
#define KVM_RISCV_TIMER_STATE_ON 1
/*
* ISA extension IDs specific to KVM. This is not the same as the host ISA
Annotation
- Immediate include surface: `linux/types.h`, `asm/bitsperlong.h`, `asm/ptrace.h`.
- Detected declarations: `struct kvm_regs`, `struct kvm_fpu`, `struct kvm_debug_exit_arch`, `struct kvm_guest_debug_arch`, `struct kvm_sync_regs`, `struct kvm_sregs`, `struct kvm_riscv_config`, `struct kvm_riscv_core`, `struct kvm_riscv_csr`, `struct kvm_riscv_aia_csr`.
- Atlas domain: Architecture Layer / arch/riscv.
- 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.