From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 3/4] kvm, emulator: Rename VendorSpecific flag Date: Wed, 26 Jun 2013 18:25:03 +0300 Message-ID: <20130626152503.GA2512@redhat.com> References: <1371720647-17216-1-git-send-email-bp@alien8.de> <1371720647-17216-4-git-send-email-bp@alien8.de> <20130625111020.GO18508@redhat.com> <20130626141158.GE20274@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: KVM , Paolo Bonzini , Andre Przywara , "H. Peter Anvin" , X86 ML , Borislav Petkov To: Borislav Petkov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56231 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751585Ab3FZPZZ (ORCPT ); Wed, 26 Jun 2013 11:25:25 -0400 Content-Disposition: inline In-Reply-To: <20130626141158.GE20274@pd.tnic> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jun 26, 2013 at 04:11:59PM +0200, Borislav Petkov wrote: > On Tue, Jun 25, 2013 at 02:10:20PM +0300, Gleb Natapov wrote: > > > - if (!(ctxt->d & VendorSpecific) && ctxt->only_vendor_specific_insn) > > > + if (!(ctxt->d & EmulateOnUD) && ctxt->only_vendor_specific_insn) > > Lets rename only_vendor_specific_insn to something like ->ud too. > > So this thing is set only when either svm or vmx encounter an #UD and go > and emulate the instruction. > > I guess this is for the case where we actually do want to inject the #UD > into the guest and not emulate the instruction. > > Btw, it is only checked in x86_decode_insn so we could just as well hand > down the emulation_type from the caller x86_emulate_instruction and kill > ->only_vendor_specific_insn completely like so: > > if (!(ctxt->d & EmulateOnUD) && (emul_type & EMULTYPE_TRAP_UD)) > EMULTYPE_ values are external to emulator.c and control how x86.c invokes the emulator. I prefer not to change kvm<->emulator interface just to get rid of one ctxt field. -- Gleb.