From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/2] x86: Bail out on unemulated instructions Date: Sun, 15 Aug 2010 19:17:10 +0300 Message-ID: <4C681306.6000400@redhat.com> References: <1281801094-4515-1-git-send-email-m.gamal005@gmail.com> <1281801094-4515-2-git-send-email-m.gamal005@gmail.com> <20100815073236.GP10499@redhat.com> <20100815124112.GR10499@redhat.com> <20100815124900.GS10499@redhat.com> <4C680E8E.2090001@redhat.com> <20100815161157.GA25987@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Mohammed Gamal , mtosatti@redhat.com, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52958 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932245Ab0HOQRO (ORCPT ); Sun, 15 Aug 2010 12:17:14 -0400 In-Reply-To: <20100815161157.GA25987@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/15/2010 07:11 PM, Gleb Natapov wrote: > >> Neither are possible. We can have one cpu in big real mode and >> others in paged mode, so even in real mode we cannot rule out a >> spurious page fault due to shadow write protection. >> > Correct, just checking X86EMUL_MODE_REAL is not enough due to smp, but > why checking for big real mode will not work? If instruction can't be > emulated while vcpu is in big real mode returning to vcpu is not an option, > so kvm will fail anyway. Right. I guess we can have an emulation_reason variable which explains why we are emulating (unvirtualizable state, mmu page fault, mmio page fault, unvirtualizable instruction) and decide accordingly. But it's a lot of work. -- error compiling committee.c: too many arguments to function