From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 07/24] KVM: x86 emulator: fix 0f 01 /5 emulation Date: Tue, 09 Mar 2010 16:27:39 +0200 Message-ID: <4B965ADB.2090305@redhat.com> References: <1268143762-4000-1-git-send-email-gleb@redhat.com> <1268143762-4000-8-git-send-email-gleb@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 To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:28043 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753668Ab0CIO1l (ORCPT ); Tue, 9 Mar 2010 09:27:41 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o29ERfnL009352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Mar 2010 09:27:41 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o29ERe2Y019633 for ; Tue, 9 Mar 2010 09:27:40 -0500 In-Reply-To: <1268143762-4000-8-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/09/2010 04:09 PM, Gleb Natapov wrote: > It is undefined and should generate #UD. > > Signed-off-by: Gleb Natapov > --- > arch/x86/kvm/emulate.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c > index 2df510b..1a32b78 100644 > --- a/arch/x86/kvm/emulate.c > +++ b/arch/x86/kvm/emulate.c > @@ -2486,6 +2486,9 @@ twobyte_insn: > (c->src.val& 0x0f), ctxt->vcpu); > c->dst.type = OP_NONE; > break; > + case 5: /* not defined */ > + kvm_queue_exception(ctxt->vcpu, UD_VECTOR); > + goto done; > case 7: /* invlpg*/ > emulate_invlpg(ctxt->vcpu, memop); > /* Disable writeback. */ > Why is this needed? We can only get here if the guest tricks us (otherwise the #UD would go back to the guest, or rather, we'd trap it to see if it's a hypercall instruction, but not pass it on to the emulator). -- error compiling committee.c: too many arguments to function