mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
LoongArch: KVM: Add hypercall service support for usermode VMM
Some VMMs provides special hypercall service in usermode, KVM should not handle the usermode hypercall service, thus pass it to usermode, let the usermode VMM handle it. Here a new code KVM_HCALL_CODE_USER_SERVICE is added for the user-mode hypercall service, KVM lets all six registers visible to usermode VMM. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
@@ -1732,9 +1732,14 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
|
||||
vcpu->mmio_needed = 0;
|
||||
}
|
||||
|
||||
if (run->exit_reason == KVM_EXIT_LOONGARCH_IOCSR) {
|
||||
switch (run->exit_reason) {
|
||||
case KVM_EXIT_HYPERCALL:
|
||||
kvm_complete_user_service(vcpu, run);
|
||||
break;
|
||||
case KVM_EXIT_LOONGARCH_IOCSR:
|
||||
if (!run->iocsr_io.is_write)
|
||||
kvm_complete_iocsr_read(vcpu, run);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!vcpu->wants_to_run)
|
||||
|
||||
Reference in New Issue
Block a user