public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] KVM: VMX: Initialize vm86 TSS only once.
Date: Sun, 27 Feb 2011 18:58:59 +0200	[thread overview]
Message-ID: <20110227165859.GD22252@redhat.com> (raw)
In-Reply-To: <4D6A7C51.1000000@redhat.com>

On Sun, Feb 27, 2011 at 06:31:13PM +0200, Avi Kivity wrote:
> On 02/27/2011 06:27 PM, Gleb Natapov wrote:
> >>
> >>  Or we can keep the old behaviour.  If KVM_SET_TSS_ADDR hasn't been
> >>  called by the time of the first entry into real mode (the first
> >>  KVM_CREATE_VCPU?), use the top of the first slot.
> >>
> >Do we require that KVM_SET_TSS_ADDR is called before first KVM_CREATE_VCPU?
> >We may still break some theoretical userspaces this way.
> 
> The documentation doesn't say, but I think it's unlikely that
> userspace will start a guest and then configure it.
> 
KVM_CREATE_VCPU is done before guest is started. Starting of a guest
happens when KVM_RUN is done for the first time.

> >
> >>  We can avoid the SMP problem by initializing the memory in a single
> >>  pass, writing each byte exactly once with its final value.  This way
> >>  concurrent initialization doesn't corrupt an in-use TSS.
> >>
> >Sounds hackish, but may work. Doing so will make entering pmode much
> >more slow.
> 
> Why?  do it at most once per vcpu.
> 
The reboot may fail since guest may have used the memory while running,
so memory should be reinited on reboot, but since KVM doesn't always
know about reboot it should be done at each protected mode entry. 

--
			Gleb.

  reply	other threads:[~2011-02-27 16:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 10:07 [PATCH 1/2] KVM: VMX: write new TR selector value into vmcs immediately if it changes during vm86 mode Gleb Natapov
2011-02-21 10:07 ` [PATCH 2/2] KVM: VMX: Initialize vm86 TSS only once Gleb Natapov
2011-02-27 15:43   ` Avi Kivity
2011-02-27 15:52     ` Gleb Natapov
2011-02-27 15:58       ` Avi Kivity
2011-02-27 16:04         ` Avi Kivity
2011-02-27 16:27           ` Gleb Natapov
2011-02-27 16:31             ` Avi Kivity
2011-02-27 16:58               ` Gleb Natapov [this message]
2011-02-27 16:12         ` Gleb Natapov
2011-02-27 16:18           ` Avi Kivity
2011-02-27 15:38 ` [PATCH 1/2] KVM: VMX: write new TR selector value into vmcs immediately if it changes during vm86 mode Avi Kivity

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=20110227165859.GD22252@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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