[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <566e8346-1e78-2737-be86-0ec27ad147a5@redhat.com>
Date: Thu, 10 Dec 2020 12:48:11 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Maxim Levitsky <mlevitsk@...hat.com>, kvm@...r.kernel.org
Cc: "H. Peter Anvin" <hpa@...or.com>, Jonathan Corbet <corbet@....net>,
Jim Mattson <jmattson@...gle.com>,
Wanpeng Li <wanpengli@...cent.com>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Marcelo Tosatti <mtosatti@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Sean Christopherson <sean.j.christopherson@...el.com>,
open list <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Joerg Roedel <joro@...tes.org>, Borislav Petkov <bp@...en8.de>,
Shuah Khan <shuah@...nel.org>,
Andrew Jones <drjones@...hat.com>,
Oliver Upton <oupton@...gle.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v2 0/3] RFC: Precise TSC migration
I'm queueing patches 2 and 3 for now, since the sane MSR interface is a
prerequisite anyway.
Paolo
On 03/12/20 18:11, Maxim Levitsky wrote:
> Hi!
>
> This is the second version of the work to make TSC migration more accurate,
> as was defined by Paulo at:
> https://www.spinics.net/lists/kvm/msg225525.html
>
> I omitted most of the semi-offtopic points I raised related to TSC
> in the previous RFC where we can continue the discussion.
>
> I do want to raise another thing that I almost forgot.
>
> On AMD systems, the Linux kernel will mark the guest tsc as
> unstable unless invtsc is set which is set on recent AMD
> hardware.
>
> Take a look at 'unsynchronized_tsc()' to verify this.
>
> This is another thing that IMHO should be fixed at least when
> running under KVM.
>
> Note that I forgot to mention that
> X86_FEATURE_TSC_RELIABLE also short-circuits this code,
> thus giving another reason to enable it under KVM.
>
> Changes from V1:
>
> - added KVM_TSC_STATE_TIMESTAMP_VALID instead of testing ns == 0
> - allow diff < 0, because it is still better that capping it to 0
> - updated tsc_msr_test unit test to cover this feature
> - refactoring
>
> Patches to enable this feature in qemu are in the process of
> being sent to qemu-devel mailing list.
>
> Best regards,
> Maxim Levitsky
>
> Maxim Levitsky (3):
> KVM: x86: implement KVM_{GET|SET}_TSC_STATE
> KVM: x86: introduce KVM_X86_QUIRK_TSC_HOST_ACCESS
> kvm/selftests: update tsc_msrs_test to cover
> KVM_X86_QUIRK_TSC_HOST_ACCESS
>
> Documentation/virt/kvm/api.rst | 65 +++++++++++++
> arch/x86/include/uapi/asm/kvm.h | 1 +
> arch/x86/kvm/x86.c | 92 ++++++++++++++++++-
> include/uapi/linux/kvm.h | 15 +++
> .../selftests/kvm/x86_64/tsc_msrs_test.c | 79 ++++++++++++++--
> 5 files changed, 237 insertions(+), 15 deletions(-)
>
Powered by blists - more mailing lists