Re: [PATCH] x86, kvm, vmx: Always use LOAD_IA32_EFER if available

From: Andy Lutomirski
Date: Mon Nov 10 2014 - 14:32:26 EST


On Sun, Nov 9, 2014 at 8:33 PM, Wanpeng Li <wanpeng.li@xxxxxxxxxxxxxxx> wrote:
> Hi Andy,
> On Fri, Nov 07, 2014 at 06:25:18PM -0800, Andy Lutomirski wrote:
>>At least on Sandy Bridge, letting the CPU switch IA32_EFER is much
>>faster than switching it manually.
>>
>>I benchmarked this using the vmexit kvm-unit-test (single run, but
>>GOAL multiplied by 5 to do more iterations):
>>
>>Test Before After Change
>>cpuid 2000 1932 -3.40%
>>vmcall 1914 1817 -5.07%
>>mov_from_cr8 13 13 0.00%
>>mov_to_cr8 19 19 0.00%
>>inl_from_pmtimer 19164 10619 -44.59%
>>inl_from_qemu 15662 10302 -34.22%
>
> What's the difference of IA32_EFER between guest and host in your config?
>
> IIUC,
> - NX is not consistent
> IA32_EFER will be auto load w/ and w/o the patch.
> - SCE is not consistent
> IA32_EFER will be switched through wrmsr(urn) w/o the patch, and auto load
> w/ the patch.

This is with kvm-unit-test as is, so NX is consistent but SCE is different.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/