From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3 Date: Thu, 06 May 2010 15:48:16 +0300 Message-ID: <4BE2BA90.3070909@redhat.com> References: <20100429115847.GW10044@redhat.com> <4BE288CE.5050801@redhat.com> <20100506100645.GB24787@redhat.com> <4BE2964A.1090906@redhat.com> <20100506122553.GC24787@redhat.com> <4BE2B708.2020705@redhat.com> <20100506124104.GD24787@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33210 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752238Ab0EFMsS (ORCPT ); Thu, 6 May 2010 08:48:18 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o46CmHGr027158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 May 2010 08:48:18 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o46CmHLm025547 for ; Thu, 6 May 2010 08:48:17 -0400 In-Reply-To: <20100506124104.GD24787@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/06/2010 03:41 PM, Gleb Natapov wrote: > On Thu, May 06, 2010 at 03:33:12PM +0300, Avi Kivity wrote: > >> On 05/06/2010 03:25 PM, Gleb Natapov wrote: >> >>> >>>> We can expect that from a developer or a user subscribed to kvm@. >>>> But what about some random user running virt-manager? >>>> >>>> >>> What virt-manager would do about such error? >>> >> Call up abrt. >> >> > The idea is not to let userspace process running in a VM kill the VM. > Well, log the problem (including registers and instruction code), and continue with the #UD. >>>> True. But the same problem exists with cpl>0 #UD. It may be a >>>> critical driver in userspace (say, video driver). >>>> >>>> Also need to think consider nested kernels (which are userspace for >>>> this purpose). >>>> >>> Ugh, we can check if vcpu is in nested mode. >>> >> And do what? Inject #UD to the guest? Or force some vmexit? >> >> > Does host emulator will ever run on behalf of nested guest? We have > emulator inside nested guest for this. > If the guest doesn't map the page, it will emulate. If it does map the page, and the host doesn't, the host emulates. -- error compiling committee.c: too many arguments to function