Messages in this thread | | | Subject | Re: [PATCH 2/2] KVM: x86: introduce KVM_X86_QUIRK_TSC_HOST_ACCESS | From | Paolo Bonzini <> | Date | Mon, 30 Nov 2020 15:15:11 +0100 |
| |
On 30/11/20 15:11, Maxim Levitsky wrote: > On Mon, 2020-11-30 at 14:54 +0100, Paolo Bonzini wrote: >> On 30/11/20 14:35, Maxim Levitsky wrote: >>> This quirk reflects the fact that we currently treat MSR_IA32_TSC >>> and MSR_TSC_ADJUST access by the host (e.g qemu) in a way that is different >>> compared to an access from the guest. >>> >>> For host's MSR_IA32_TSC read we currently always return L1 TSC value, and for >>> host's write we do the tsc synchronization. >>> >>> For host's MSR_TSC_ADJUST write, we don't make the tsc 'jump' as we should >>> for this msr. >>> >>> When the hypervisor uses the new TSC GET/SET state ioctls, all of this is no >>> longer needed, thus leave this enabled only with a quirk >>> which the hypervisor can disable. >>> >>> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> >>> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> >> >> This needs to be covered by a variant of the existing selftests testcase >> (running the same guest code, but different host code of course). > Do you think that the test should go to the kernel's kvm unit tests, > or to kvm-unit-tests project?
The latter already has x86_64/tsc_msrs_test.c (which I created in preparation for this exact change :)).
Paolo
| |