From 4513d9232badcc5039d69dae946054ba2682c258 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Mon, 10 May 2010 11:21:34 +0300 Subject: Do not stop VM if emulation failed in userspace. Continue vcpu execution in case emulation failure happened while vcpu was in userspace. In this case #UD will be injected into the guest allowing guest OS to kill offending process and continue. Signed-off-by: Gleb Natapov Signed-off-by: Marcelo Tosatti --- target-i386/kvm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'target-i386') diff --git a/target-i386/kvm.c b/target-i386/kvm.c index bd7a190..676aa60 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -1289,3 +1289,10 @@ void kvm_arch_update_guest_debug(CPUState *env, struct kvm_guest_debug *dbg) } } #endif /* KVM_CAP_SET_GUEST_DEBUG */ + +bool kvm_arch_stop_on_emulation_error(CPUState *env) +{ + return !(env->cr[0] & CR0_PE_MASK) || + ((env->segs[R_CS].selector & 3) != 3); +} + -- cgit v1.1