kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Arthur Chunqi Li <yzt356@gmail.com>,
	kvm@vger.kernel.org, jan.kiszka@web.de, yang.z.zhang@intel.com
Subject: Re: [PATCH v4] KVM: nVMX: Fully support of nested VMX preemption timer
Date: Mon, 16 Sep 2013 12:09:11 +0300	[thread overview]
Message-ID: <20130916090911.GL17294@redhat.com> (raw)
In-Reply-To: <5236C824.8090700@redhat.com>

On Mon, Sep 16, 2013 at 10:58:12AM +0200, Paolo Bonzini wrote:
> >>>  	vmx->__launched = vmx->loaded_vmcs->launched;
> >>> +	if (is_guest_mode(vcpu) && !(vmx->nested.nested_vmx_exit))
> >>> +		nested_adjust_preemption_timer(vcpu);
> >>
> >> Please leave the assignment to __launched last, since it's already
> >> initializing the asm below.
> >>
> >> I don't like the is_guest_mode check here... Maybe it's
> >> micro-optimizing, but I wonder if we already do too many checks in
> >> vmx_vcpu_run...  For example, is_guest_mode could be changed (I think)
> >> to a check for "vmx->loaded_vmcs == &vmx->vmcs1".
> >>
> > Why this will be more efficient that HF_GUEST_MASK check?
> 
> Because we have already loaded vmx->loaded_vmcs, so it's one memory
> access less.
> 
But we will have to load vmx->vmcs1 instead :) Looks like very minor
optimization if at all. If we could avoid additional if() at all
somehow, may be mimicking vcpu->requests in vmx to get rid of most ifs
there.

--
			Gleb.

  reply	other threads:[~2013-09-16  9:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06  2:04 [PATCH v4] KVM: nVMX: Fully support of nested VMX preemption timer Arthur Chunqi Li
2013-09-13 17:15 ` Paolo Bonzini
2013-09-14  7:44   ` Jan Kiszka
2013-09-15  7:59     ` Arthur Chunqi Li
2013-09-16  5:42   ` Arthur Chunqi Li
2013-09-16  7:18     ` Jan Kiszka
2013-09-16  7:44   ` Gleb Natapov
2013-09-16  8:58     ` Paolo Bonzini
2013-09-16  9:09       ` Gleb Natapov [this message]
2013-09-16  9:49         ` Paolo Bonzini
2013-09-16 10:44           ` Gleb Natapov
2013-09-16 10:50             ` Paolo Bonzini
2013-09-15 12:31 ` Gleb Natapov
2013-09-16  5:49   ` Arthur Chunqi Li
2013-09-16  6:20     ` Gleb Natapov

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=20130916090911.GL17294@redhat.com \
    --to=gleb@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=yang.z.zhang@intel.com \
    --cc=yzt356@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).