All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Oliver Upton <oupton@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	kvm <kvm@vger.kernel.org>, Will Deacon <will@kernel.org>,
	Sean Christopherson <seanjc@google.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Peter Shier <pshier@google.com>,
	Maxim Levitsky <mlevitsk@redhat.com>,
	Marc Zyngier <maz@kernel.org>,
	David Matlack <dmatlack@google.com>,
	KVM ARM <kvmarm@lists.cs.columbia.edu>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Jim Mattson <jmattson@google.com>
Subject: Re: [PATCH v7 6/6] KVM: x86: Expose TSC offset controls to userspace
Date: Sun, 29 Aug 2021 10:25:51 +0200	[thread overview]
Message-ID: <CABgObfbqHG59n8jitJGzL0=J-tvKYvpg4+2xV7z2dFf2rNHhqg@mail.gmail.com> (raw)
In-Reply-To: <YSf5SV0AZMvfIEib@google.com>


[-- Attachment #1.1: Type: text/plain, Size: 2332 bytes --]

This will bounce to the mailing lists because I am on a text/plain-impaired
phone, but anyway.

One reason to have selftests is to allow having APIs that are not used by
QEMU. Still, I think Maxim had an implementation of his own TSC migration
API and it shouldn't be too hard to use the algorithm that is documented in
this series.

Paolo

Il gio 26 ago 2021, 22:28 Oliver Upton <oupton@google.com> ha scritto:

> Marcelo,
>
> On Thu, Aug 26, 2021 at 09:48:36AM -0300, Marcelo Tosatti wrote:
> > On Mon, Aug 23, 2021 at 01:56:30PM -0700, Oliver Upton wrote:
> > > Paolo,
> > >
> > > On Sun, Aug 15, 2021 at 5:11 PM Oliver Upton <oupton@google.com>
> wrote:
> > > >
> > > > To date, VMM-directed TSC synchronization and migration has been a
> bit
> > > > messy. KVM has some baked-in heuristics around TSC writes to infer if
> > > > the VMM is attempting to synchronize. This is problematic, as it
> depends
> > > > on host userspace writing to the guest's TSC within 1 second of the
> last
> > > > write.
> > > >
> > > > A much cleaner approach to configuring the guest's views of the TSC
> is to
> > > > simply migrate the TSC offset for every vCPU. Offsets are idempotent,
> > > > and thus not subject to change depending on when the VMM actually
> > > > reads/writes values from/to KVM. The VMM can then read the TSC once
> with
> > > > KVM_GET_CLOCK to capture a (realtime, host_tsc) pair at the instant
> when
> > > > the guest is paused.
> > > >
> > > > Cc: David Matlack <dmatlack@google.com>
> > > > Cc: Sean Christopherson <seanjc@google.com>
> > > > Signed-off-by: Oliver Upton <oupton@google.com>
> > >
> > > Could you please squash the following into this patch? We need to
> > > advertise KVM_CAP_VCPU_ATTRIBUTES to userspace. Otherwise, happy to
> > > resend.
> > >
> > > Thanks,
> > > Oliver
> >
> > Oliver,
> >
> > Is there QEMU support for this, or are you using your own
> > userspace with this?
>
> Apologies for not getting back to you on your first mail. Sadly, I am
> using our own userspace for this. That being said, adding support to
> QEMU shouldn't be too challenging. I can take a stab at it if it makes
> the series more amenable to upstream, with the giant disclaimer that I
> haven't done work in QEMU before. Otherwise, happy to review someone
> else's implementation.
>
> --
> Thanks,
> Oliver
>
>

[-- Attachment #1.2: Type: text/html, Size: 3389 bytes --]

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  reply	other threads:[~2021-08-29  8:26 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16  0:11 [PATCH v7 0/6] KVM: x86: Add idempotent controls for migrating system counter state Oliver Upton
2021-08-16  0:11 ` Oliver Upton
2021-08-16  0:11 ` Oliver Upton
2021-08-16  0:11 ` [PATCH v7 1/6] KVM: x86: Fix potential race in KVM_GET_CLOCK Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-19 18:24   ` Marcelo Tosatti
2021-08-19 18:24     ` Marcelo Tosatti
2021-08-19 18:24     ` Marcelo Tosatti
2021-08-20 18:22     ` Oliver Upton
2021-08-20 18:22       ` Oliver Upton
2021-08-20 18:22       ` Oliver Upton
2021-08-16  0:11 ` [PATCH v7 2/6] KVM: x86: Create helper methods for KVM_{GET,SET}_CLOCK ioctls Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-16  0:11 ` [PATCH v7 3/6] KVM: x86: Report host tsc and realtime values in KVM_GET_CLOCK Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-20 12:46   ` Marcelo Tosatti
2021-08-20 12:46     ` Marcelo Tosatti
2021-08-20 12:46     ` Marcelo Tosatti
2021-09-24  8:30     ` Paolo Bonzini
2021-09-24  8:30       ` Paolo Bonzini
2021-09-24  8:30       ` Paolo Bonzini
2021-08-16  0:11 ` [PATCH v7 4/6] KVM: x86: Take the pvclock sync lock behind the tsc_write_lock Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-09-02 19:22   ` Sean Christopherson
2021-09-02 19:22     ` Sean Christopherson
2021-09-02 19:22     ` Sean Christopherson
2021-08-16  0:11 ` [PATCH v7 5/6] KVM: x86: Refactor tsc synchronization code Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-09-02 19:21   ` Sean Christopherson
2021-09-02 19:21     ` Sean Christopherson
2021-09-02 19:21     ` Sean Christopherson
2021-09-02 19:41     ` Oliver Upton
2021-09-02 19:41       ` Oliver Upton
2021-09-02 19:41       ` Oliver Upton
2021-09-24  9:28     ` Paolo Bonzini
2021-09-24  9:28       ` Paolo Bonzini
2021-09-24  9:28       ` Paolo Bonzini
2021-08-16  0:11 ` [PATCH v7 6/6] KVM: x86: Expose TSC offset controls to userspace Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-16  0:11   ` Oliver Upton
2021-08-23 20:56   ` Oliver Upton
2021-08-23 20:56     ` Oliver Upton
2021-08-23 20:56     ` Oliver Upton
2021-08-26 12:48     ` Marcelo Tosatti
2021-08-26 12:48       ` Marcelo Tosatti
2021-08-26 12:48       ` Marcelo Tosatti
2021-08-26 20:27       ` Oliver Upton
2021-08-26 20:27         ` Oliver Upton
2021-08-26 20:27         ` Oliver Upton
2021-08-29  8:25         ` Paolo Bonzini [this message]
2021-09-02 19:23 ` [PATCH v7 0/6] KVM: x86: Add idempotent controls for migrating system counter state Sean Christopherson
2021-09-02 19:23   ` Sean Christopherson
2021-09-02 19:23   ` Sean Christopherson
2021-09-02 19:45   ` Oliver Upton
2021-09-02 19:45     ` Oliver Upton
2021-09-02 19:45     ` Oliver Upton

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='CABgObfbqHG59n8jitJGzL0=J-tvKYvpg4+2xV7z2dFf2rNHhqg@mail.gmail.com' \
    --to=pbonzini@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=dmatlack@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=oupton@google.com \
    --cc=pshier@google.com \
    --cc=seanjc@google.com \
    --cc=will@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.