[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cd1c80e6ed7367f8736a965c4100c333b79bbdcc.camel@redhat.com>
Date: Thu, 03 Dec 2020 13:11:47 +0200
From: Maxim Levitsky <mlevitsk@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>, kvm@...r.kernel.org
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Oliver Upton <oupton@...gle.com>,
Ingo Molnar <mingo@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
open list <linux-kernel@...r.kernel.org>,
Marcelo Tosatti <mtosatti@...hat.com>,
Jonathan Corbet <corbet@....net>,
Wanpeng Li <wanpengli@...cent.com>,
Borislav Petkov <bp@...en8.de>,
Jim Mattson <jmattson@...gle.com>,
"H. Peter Anvin" <hpa@...or.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
Joerg Roedel <joro@...tes.org>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Vitaly Kuznetsov <vkuznets@...hat.com>
Subject: Re: [PATCH 1/2] KVM: x86: implement
KVM_SET_TSC_PRECISE/KVM_GET_TSC_PRECISE
On Tue, 2020-12-01 at 20:43 +0100, Thomas Gleixner wrote:
> On Mon, Nov 30 2020 at 15:35, Maxim Levitsky wrote:
> > + struct kvm_tsc_info {
> > + __u32 flags;
> > + __u64 nsec;
> > + __u64 tsc;
> > + __u64 tsc_adjust;
> > + };
> > +
> > +flags values for ``struct kvm_tsc_info``:
> > +
> > +``KVM_TSC_INFO_TSC_ADJUST_VALID``
> > +
> > + ``tsc_adjust`` contains valid IA32_TSC_ADJUST value
>
> Why exposing TSC_ADJUST at all? Just because?
It's because we want to reduce the number of cases where
KVM's msr/read write behavior differs between guest and host
(e.g qemu) writes.
TSC and TSC_ADJUST are tied on architectural level, such as
chang
ing one, changes the other.
However for the migration to work we must be able
to set each one separately.
Currently, KVM does this by turning the host write to
TSC_ADJUST into a special case that bypasses
the actual TSC adjustment, and just sets this MSR.
The next patch in this series, will allow to disable
this special behavior, making host TSC_ADJUST write
work the same way as in guest.
Therefore to still allow to set TSC_ADJUST and TSC independently
after migration this ioctl will be used instead.
Best regards,
Maxim Levitsky
>
> Thanks,
>
> tglx
>
Powered by blists - more mailing lists