kvm_riscv_vcpu_virtual_insn(9)
π kvm_riscv_vcpu_virtual_insn(9) π
okay so bestie, welcome to the Kernel API Manual β section 9, the good section, the "we're talking about kernel functions now" section. This page is all about kvm_riscv_vcpu_virtual_insn, and literally the whole vibe is: it handles the virtual instruction trap. That's it, that's the job. π
β¨ NAME β¨
kvm_riscv_vcpu_virtual_insn β handle virtual instruction trap. no cap, that's the entire name-and-purpose combo right there π¦
πΈ SYNOPSIS πΈ
int kvm_riscv_vcpu_virtual_insn (struct kvm_vcpu *vcpu , struct kvm_run
*run , struct kvm_cpu_trap *trap );
so it returns an int, and it takes three things: a struct kvm_vcpu * called vcpu, a struct kvm_run * called run, and a struct kvm_cpu_trap * called trap. that's the whole signature, she's not complicated π
π¦ ARGUMENTS π¦
vcpuβ the VCPU pointer. iconic. the main character of this whole little function π«Άrunβ the VCPU run struct that's carrying the mmio data. it's giving "I hold the data, you handle the logic" β¨trapβ the trap details. everything you ever wanted to know about the trap, right here πΈ
π DESCRIPTION π
okay so here's the return-value situation, and honestly it's a whole mood board:
- returns > 0 β continue the run-loop, we're so back, keep going bestie π₯
- returns 0 β exit the run-loop and handle it in user-space. stepping out, doing it elsewhere, still slay π
- returns < 0 β report failure and exit the run-loop. not the vibe, but we said it clearly π
that's genuinely the whole description. three outcomes, zero fluff, she ate π
π SEE ALSO π
- the kernel file
./arch/riscv/kvm/vcpu_insn.cβ go read the source, iykyk π kvm_riscv_vcpu_wfi(9)kvm_riscv_vcpu_csr_return(9)kvm_riscv_vcpu_mmio_load(9)kvm_riscv_vcpu_mmio_store(9)kvm_riscv_vcpu_mmio_return(9)
the whole friend group π§ the mmio siblings are lowkey all here and they're iconic
fr fr bestie, it's just a trap handler with three return paths β read it, love it, cite it in your commit message π
and that's a wrap on our little kernel-API hangout π this page lives in ./arch/riscv/kvm, it's dated October 2026, and it's filed under kvm_riscv_vcpu_virtual_insn(9) β go off, and remember: highkey always check your return values β
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms