From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/5] KVM: emulator: sysexit should #GP in non protected mode. Date: Tue, 12 Apr 2011 15:30:52 +0300 Message-ID: <4DA445FC.8070501@redhat.com> References: <1302600985-10704-1-git-send-email-gleb@redhat.com> <1302600985-10704-2-git-send-email-gleb@redhat.com> <4DA442EF.3010108@redhat.com> <20110412122357.GO17809@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mtosatti@redhat.com To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51970 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755272Ab1DLMa4 (ORCPT ); Tue, 12 Apr 2011 08:30:56 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3CCUtrZ006630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 12 Apr 2011 08:30:56 -0400 In-Reply-To: <20110412122357.GO17809@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04/12/2011 03:23 PM, Gleb Natapov wrote: > On Tue, Apr 12, 2011 at 03:17:51PM +0300, Avi Kivity wrote: > > On 04/12/2011 12:36 PM, Gleb Natapov wrote: > > >Signed-off-by: Gleb Natapov > > >--- > > > arch/x86/kvm/emulate.c | 2 ++ > > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > > >diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c > > >index 3e8b4ab..eb4c7eb 100644 > > >--- a/arch/x86/kvm/emulate.c > > >+++ b/arch/x86/kvm/emulate.c > > >@@ -1973,6 +1973,8 @@ emulate_sysexit(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) > > > cs.d = 0; > > > cs.l = 1; > > > break; > > >+ default: > > >+ return emulate_gp(ctxt, 0); > > > } > > > > In addition, looks like the instruction is valid in 16-bit protected mode. > > > Actually we already check for real mode and vm86 at the start of the > function, so the patch is incorrect. Will have to fix compile warning in > some other way. > Right. Note the check for vm86 is unneeded, since we have the Priv tag set and vm86 implies cpl 3. -- error compiling committee.c: too many arguments to function