From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCHv2] KVM: inject #UD if instruction emulation fails and exit to userspace Date: Mon, 10 May 2010 20:33:37 +0300 Message-ID: <20100510173337.GD4497@redhat.com> References: <20100510081656.GJ24787@redhat.com> <20100510102525.GO24787@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org To: Mohammed Gamal Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39916 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751452Ab0EJRdl (ORCPT ); Mon, 10 May 2010 13:33:41 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Mon, May 10, 2010 at 07:06:05PM +0300, Mohammed Gamal wrote: > On Mon, May 10, 2010 at 1:25 PM, Gleb Natapov wrote: > > On Mon, May 10, 2010 at 11:16:56AM +0300, Gleb Natapov wrote: > >> Do not kill VM when instruction emulation fails. Inject #UD and report > >> failure to userspace instead. Userspace may choose to reenter guest if > >> vcpu is in userspace (cpl == 3) in which case guest OS will kill > >> offending process and continue running. > >> > > I am curious to know what'd happen in case the vcpu is in kernel space > (cpl == 0). Is that case handled? > Currently no matter where emulation fails VM is stopped and cpu state is printed on stderr. After that patch userspace may choose to continue VM execution after emulation error (#UD will be injected into VM though). The policy is in userspace, but I don't see the point to continue execution after emulation failed in kernel. How kernel can recover from the #UD? -- Gleb.