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. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html