All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>,
	"David S. Ahern" <daahern@cisco.com>,
	Chris Wright <chrisw@redhat.com>,
	Glauber de Oliveira Costa <gcosta@redhat.com>
Subject: Re: RFC: VMX: initialize TSC offset relative to vm creation time
Date: Sat, 13 Sep 2008 07:55:02 +0300	[thread overview]
Message-ID: <48CB47A6.1050301@qumranet.com> (raw)
In-Reply-To: <20080910205842.GA12514@dmt.cnet>

Marcelo Tosatti wrote:
> VMX initializes the TSC offset for each vcpu at different times, and
> also reinitializes it for vcpus other than 0 on APIC SIPI message.
>
> This bug causes the TSC's to appear unsynchronized in the guest, even if
> the host is good.
>
> Older Linux kernels don't handle the situation very well, so
> gettimeofday is likely to go backwards in time:
>
> http://www.mail-archive.com/kvm@vger.kernel.org/msg02955.html
> http://sourceforge.net/tracker/index.php?func=detail&aid=2025534&group_id=180599&atid=893831
>
> Fix it by initializating the offset of each vcpu relative to vm creation
> time, and moving it from vmx_vcpu_reset to vmx_vcpu_setup, out of the
> APIC MP init path.
>
>
>   

This is good in principle, but we need to detect if we're on a multiple
board host (or a host with unsynced tscs) and do something else in that
case.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  parent reply	other threads:[~2008-09-13  4:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-10 20:58 RFC: VMX: initialize TSC offset relative to vm creation time Marcelo Tosatti
2008-09-10 22:18 ` Glauber Costa
2008-09-11  8:32   ` Marcelo Tosatti
2008-09-11  4:58 ` David S. Ahern
2008-09-13  4:55 ` Avi Kivity [this message]
2008-10-27 23:42   ` Marcelo Tosatti
2008-10-28 18:36     ` David S. Ahern
2008-10-30 10:20       ` Marcelo Tosatti
2008-10-30 14:00         ` David S. Ahern
2008-10-30 10:34       ` Avi Kivity
2008-10-13 13:12 ` David S. Ahern

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=48CB47A6.1050301@qumranet.com \
    --to=avi@qumranet.com \
    --cc=chrisw@redhat.com \
    --cc=daahern@cisco.com \
    --cc=gcosta@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 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.