History

RISC-V: KVM: Implement VCPU interrupts and requests handling

This patch implements VCPU interrupts and requests which are both asynchronous events. The VCPU interrupts can be set/unset using KVM_INTERRUPT ioctl from user-space. In future, the in-kernel IRQCHIP emulation will use kvm_riscv_vcpu_set_interrupt() and kvm_riscv_vcpu_unset_interrupt() functions to set/unset VCPU interrupts. Important VCPU requests implemented by this patch are: KVM_REQ_SLEEP - set whenever VCPU itself goes to sleep state KVM_REQ_VCPU_RESET - set whenever VCPU reset is requested The WFI trap-n-emulate (added later) will use KVM_REQ_SLEEP request and kvm_riscv_vcpu_has_interrupt() function. The KVM_REQ_VCPU_RESET request will be used by SBI emulation (added later) to power-up a VCPU in power-off state. The user-space can use the GET_MPSTATE/SET_MPSTATE ioctls to get/set power state of a VCPU.

Anup Patel committed 5 years ago

Commit cce69af1 parent a33c72f3 files · +197 −13Browse files

Showing the changes to arch/riscv/include/uapi (1 of 3 files). Show all

Unified · Split

arch/riscv/include/uapi/asm/kvm.h+3−0
@@ -18,6 +18,9 @@ · 17 unmodified lines
18 18
19#define KVM_COALESCED_MMIO_PAGE_OFFSET 119#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
20 20
21#define KVM_INTERRUPT_SET -1U
22#define KVM_INTERRUPT_UNSET -2U
23
21/* for KVM_GET_REGS and KVM_SET_REGS */24/* for KVM_GET_REGS and KVM_SET_REGS */
22struct kvm_regs {25struct kvm_regs {
23};26};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t