mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-16 02:15:47 +00:00
kvm tools: Add arch-specific KVM_RUN exit handling via kvm_cpu__handle_exit()
This patch creates a new function in x86/kvm-cpu.c, kvm_cpu__handle_exit(), in which arch-specific exit reasons can be handled outside of the common runloop. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define KVM__KVM_CPU_H
|
||||
|
||||
#include "kvm/kvm-cpu-arch.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
struct kvm_cpu *kvm_cpu__init(struct kvm *kvm, unsigned long cpu_id);
|
||||
void kvm_cpu__delete(struct kvm_cpu *vcpu);
|
||||
@@ -11,6 +12,7 @@ void kvm_cpu__enable_singlestep(struct kvm_cpu *vcpu);
|
||||
void kvm_cpu__run(struct kvm_cpu *vcpu);
|
||||
void kvm_cpu__reboot(void);
|
||||
int kvm_cpu__start(struct kvm_cpu *cpu);
|
||||
bool kvm_cpu__handle_exit(struct kvm_cpu *vcpu);
|
||||
|
||||
int kvm_cpu__get_debug_fd(void);
|
||||
void kvm_cpu__set_debug_fd(int fd);
|
||||
|
||||
@@ -137,8 +137,14 @@ int kvm_cpu__start(struct kvm_cpu *cpu)
|
||||
goto exit_kvm;
|
||||
case KVM_EXIT_SHUTDOWN:
|
||||
goto exit_kvm;
|
||||
default:
|
||||
goto panic_kvm;
|
||||
default: {
|
||||
bool ret;
|
||||
|
||||
ret = kvm_cpu__handle_exit(cpu);
|
||||
if (!ret)
|
||||
goto panic_kvm;
|
||||
break;
|
||||
}
|
||||
}
|
||||
kvm_cpu__handle_coalesced_mmio(cpu);
|
||||
}
|
||||
|
||||
@@ -212,6 +212,11 @@ void kvm_cpu__reset_vcpu(struct kvm_cpu *vcpu)
|
||||
kvm_cpu__setup_msrs(vcpu);
|
||||
}
|
||||
|
||||
bool kvm_cpu__handle_exit(struct kvm_cpu *vcpu)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static void print_dtable(const char *name, struct kvm_dtable *dtable)
|
||||
{
|
||||
dprintf(debug_fd, " %s %016llx %08hx\n",
|
||||
|
||||
Reference in New Issue
Block a user