-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V: KVM: Factor-out instruction emulation into separate sources
The instruction and CSR emulation for VCPU is going to grow over time due to upcoming AIA, PMU, Nested and other virtualization features. Let us factor-out VCPU instruction emulation from vcpu_exit.c to a separate source dedicated for this purpose. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org>
- Loading branch information
Anup Patel
authored and
Anup Patel
committed
Jul 29, 2022
1 parent
fe283e5
commit b91f0e4
Showing
5 changed files
with
562 additions
and
493 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* | ||
* Copyright (c) 2022 Ventana Micro Systems Inc. | ||
*/ | ||
|
||
#ifndef __KVM_VCPU_RISCV_INSN_H | ||
#define __KVM_VCPU_RISCV_INSN_H | ||
|
||
struct kvm_vcpu; | ||
struct kvm_run; | ||
struct kvm_cpu_trap; | ||
|
||
struct kvm_mmio_decode { | ||
unsigned long insn; | ||
int insn_len; | ||
int len; | ||
int shift; | ||
int return_handled; | ||
}; | ||
|
||
void kvm_riscv_vcpu_wfi(struct kvm_vcpu *vcpu); | ||
int kvm_riscv_vcpu_virtual_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, | ||
struct kvm_cpu_trap *trap); | ||
|
||
int kvm_riscv_vcpu_mmio_load(struct kvm_vcpu *vcpu, struct kvm_run *run, | ||
unsigned long fault_addr, | ||
unsigned long htinst); | ||
int kvm_riscv_vcpu_mmio_store(struct kvm_vcpu *vcpu, struct kvm_run *run, | ||
unsigned long fault_addr, | ||
unsigned long htinst); | ||
int kvm_riscv_vcpu_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.