Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1438527

Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX
Date 2016-07-07 13:10 +0200
Message-ID <rSflU-66A-29@gated-at.bofh.it> (permalink)
References <rRVnc-1pJ-13@gated-at.bofh.it> <rRVQd-1PF-27@gated-at.bofh.it> <rRVZT-1T1-3@gated-at.bofh.it> <rSf2y-5Kz-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 07/07/2016 12:41, Borislav Petkov wrote:
> On Wed, Jul 06, 2016 at 04:29:35PM +0200, Paolo Bonzini wrote:
>> Can you test this in the meanwhile:
>>
>>    git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git
>>    cd kvm-unit-tests
>>    ./configure
>>    make
>>    ./x86/run x86/tsc.flat -cpu kvm64,+rdtscp
>>
>> On Intel I see:
>>
>>    enabling apic
>>    rdtsc latency 18
>>    rdtsc after wrtsc(0): 727124155
>>    rdtsc after wrtsc(100000000000): 100000001759
>>    PASS: Test RDTSCP 0
>>    PASS: Test RDTSCP 10
>>    PASS: Test RDTSCP 256
>>    SUMMARY: 3 tests
> 
> Ok, found it: I need to start the guest with "+rdtscp", see below.

Yeah, I thought you were using your own QEMU patch which adds it to
Opteron CPU models.

> Which begs the question: can we readd CPUID_EXT2_RDTSCP to the Opteron_*
> models as in the second diff here:

We'll probably add -cpu Opteron_G2_rdtscp but we will indeed do
something like that.

Paolo

> Or are we still afraid of "host doesn't support requested feature"
> messages from:
> 
> 33b5e8c03ae7 ("target-i386: Disable rdtscp on Opteron_G* CPU models")
> 
> ?
> 
> $ ./x86/run x86/tsc.flat -cpu kvm64,+rdtscp
> qemu-system-x86_64 -enable-kvm -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -kernel x86/tsc.flat -cpu kvm64,+rdtscp
> enabling apic
> rdtsc latency 68
> rdtsc after wrtsc(0): 988590164
> rdtsc after wrtsc(100000000000): 100000002807
> PASS: Test RDTSCP 0
> PASS: Test RDTSCP 10
> PASS: Test RDTSCP 256
> 
> SUMMARY: 3 tests
> 
> latest qemu:
> 
> $ QEMU=/root/src/qemu/qemu.git/x86_64-softmmu/qemu-system-x86_64 ./x86/run x86/tsc.flat -cpu kvm64,+rdtscp
> /root/src/qemu/qemu.git/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -kernel x86/tsc.flat -cpu kvm64,+rdtscp
> enabling apic
> rdtsc latency 69
> rdtsc after wrtsc(0): 715310314
> rdtsc after wrtsc(100000000000): 100000002434
> PASS: Test RDTSCP 0
> PASS: Test RDTSCP 10
> PASS: Test RDTSCP 256
> 
> SUMMARY: 3 tests
> 
> guest booted *without* "+rdtscp":
> 
> taskset -c 3 ./rdtscp
> aux1: 0x0
> aux2: 0x0
> p1: 284683839780, p2: 284684080314, 240534
> 
> with "+rdtscp":
> 
> $ taskset -c 3 ./rdtscp
> aux1: 0x3
> aux2: 0x3
> p1: 168907589830, p2: 168907856068, 266238
> $ taskset -c 2 ./rdtscp
> aux1: 0x2
> aux2: 0x2
> p1: 176251144121, p2: 176251427089, 282968
> 
> Ok, all good.
> 
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Paolo Bonzini <pbonzini@redhat.com> - 2016-07-06 15:50 +0200
  Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Borislav Petkov <bp@alien8.de> - 2016-07-06 16:20 +0200
    Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Paolo Bonzini <pbonzini@redhat.com> - 2016-07-06 16:30 +0200
      Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Borislav Petkov <bp@alien8.de> - 2016-07-07 12:50 +0200
        Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Paolo Bonzini <pbonzini@redhat.com> - 2016-07-07 13:10 +0200
          Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Borislav Petkov <bp@alien8.de> - 2016-07-07 13:50 +0200
            Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Paolo Bonzini <pbonzini@redhat.com> - 2016-07-07 14:30 +0200
              Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Borislav Petkov <bp@alien8.de> - 2016-07-07 15:00 +0200
                Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Paolo Bonzini <pbonzini@redhat.com> - 2016-07-07 15:20 +0200
                Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Borislav Petkov <bp@alien8.de> - 2016-07-07 18:10 +0200
                Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Paolo Bonzini <pbonzini@redhat.com> - 2016-07-07 18:20 +0200
                Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Eduardo Habkost <ehabkost@redhat.com> - 2016-07-07 18:30 +0200
                Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Borislav Petkov <bp@alien8.de> - 2016-07-07 19:10 +0200
                Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Eduardo Habkost <ehabkost@redhat.com> - 2016-07-07 19:50 +0200
                Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Borislav Petkov <bp@alien8.de> - 2016-07-08 13:10 +0200
                Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Paolo Bonzini <pbonzini@redhat.com> - 2016-07-08 13:20 +0200
                Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX Borislav Petkov <bp@alien8.de> - 2016-07-08 15:00 +0200
  Re: [PATCH] KVM: SVM: fix trashing of MSR_TSC_AUX kbuild test robot <lkp@intel.com> - 2016-07-06 17:10 +0200

csiph-web