All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Borislav Petkov <bp@alien8.de>
Cc: KVM <kvm@vger.kernel.org>, Paolo Bonzini <pbonzini@redhat.com>,
	Andre Przywara <andre@andrep.de>,
	"H. Peter Anvin" <hpa@zytor.com>, X86 ML <x86@kernel.org>,
	Borislav Petkov <bp@suse.de>
Subject: Re: [PATCH 3/4] kvm, emulator: Rename VendorSpecific flag
Date: Wed, 26 Jun 2013 18:25:03 +0300	[thread overview]
Message-ID: <20130626152503.GA2512@redhat.com> (raw)
In-Reply-To: <20130626141158.GE20274@pd.tnic>

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.

      reply	other threads:[~2013-06-26 15:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1371720647-17216-1-git-send-email-bp@alien8.de>
     [not found] ` <1371720647-17216-4-git-send-email-bp@alien8.de>
2013-06-25 11:10   ` [PATCH 3/4] kvm, emulator: Rename VendorSpecific flag Gleb Natapov
2013-06-26 14:11     ` Borislav Petkov
2013-06-26 15:25       ` Gleb Natapov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130626152503.GA2512@redhat.com \
    --to=gleb@redhat.com \
    --cc=andre@andrep.de \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.