All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "David S. Ahern" <daahern@cisco.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Avi Kivity <avi@qumranet.com>, kvm-devel <kvm@vger.kernel.org>,
	Chris Wright <chrisw@redhat.com>,
	Glauber de Oliveira Costa <gcosta@redhat.com>,
	Benjamin Serebrin <benjamin.serebrin@amd.com>
Subject: Re: RFC: VMX: initialize TSC offset relative to vm creation time
Date: Thu, 30 Oct 2008 12:34:49 +0200	[thread overview]
Message-ID: <49098DC9.9090504@redhat.com> (raw)
In-Reply-To: <49075B9E.1020007@cisco.com>

David S. Ahern wrote:
> Has anything changed "recently" with the TSC code? Recently here being
> the past 2 months since you first crafted the patch. I ask because in
> the past few runs based on kvm.git trees (e.g., as recently as a pull on
> 10/26), this tsc offset patch no longer fixes the problem.
>
> The following one does fix the problem with kvm.git pulled on 10/26/08:
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 64e2439..d5da717 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -860,7 +860,7 @@ static void guest_write_tsc(u64 guest_tsc)
>         u64 host_tsc;
>
>         rdtscll(host_tsc);
> -       vmcs_write64(TSC_OFFSET, guest_tsc - host_tsc);
> +       vmcs_write64(TSC_OFFSET, 0);
>  }
>   

That's a bit heavy handed, it doesn't start he guest tsc from zero and 
doesn't allow the guest to adjust tsc.

But it does work for the case the tscs are synced.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


  parent reply	other threads:[~2008-10-30 10:35 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
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 [this message]
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=49098DC9.9090504@redhat.com \
    --to=avi@redhat.com \
    --cc=avi@qumranet.com \
    --cc=benjamin.serebrin@amd.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.