Re: [PATCH 1/4] kvm: x86: add KVM_{GET,SET}_TSC_OFFSET ioctls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 10, 2020 at 3:09 PM Jim Mattson <jmattson@xxxxxxxxxx> wrote:
>
> On Fri, Jul 10, 2020 at 1:38 PM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
> >
> > On 10/07/20 22:07, Oliver Upton wrote:
> > > From: Peter Hornyack <peterhornyack@xxxxxxxxxx>
> > >
> > > The KVM_SET_MSR vcpu ioctl has some temporal and value-based heuristics
> > > for determining when userspace is attempting to synchronize TSCs.
> > > Instead of guessing at userspace's intentions in the kernel, directly
> > > expose control of the TSC offset field to userspace such that userspace
> > > may deliberately synchronize the guest TSCs.
> > >
> > > Note that TSC offset support is mandatory for KVM on both SVM and VMX.
> > >
> > > Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>
> > > Signed-off-by: Peter Hornyack <peterhornyack@xxxxxxxxxx>
> > > Signed-off-by: Oliver Upton <oupton@xxxxxxxxxx>
> > > ---
> > >  Documentation/virt/kvm/api.rst | 27 +++++++++++++++++++++++++++
> > >  arch/x86/kvm/x86.c             | 28 ++++++++++++++++++++++++++++
> > >  include/uapi/linux/kvm.h       |  5 +++++
> > >  3 files changed, 60 insertions(+)
> >
> > Needless to say, a patch that comes with tests starts on the fast lane.
> >  But I have a fundamental question that isn't answered by either the
> > test or the documentation: how should KVM_SET_TSC_OFFSET be used _in
> > practice_ by a VMM?
>
> One could either omit IA32_TIME_STAMP_COUNTER from KVM_SET_MSRS, or
> one could call KVM_SET_TSC_OFFSET after KVM_SET_MSRS. We do the
> former.
>
> This isn't the only undocumented dependency among the various
> KVM_SET_* calls, but I agree that it would be helpful to document it.

Sorry, I was AFK for a bit but it seems Jim beat me to the punch :-)

I'd be glad to add a bit of color on this to the documentation.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux