]> git.baikalelectronics.ru Git - kernel.git/commit
x86/kvm: do not setup pv tlb flush when not paravirtualized
authorThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 31 Jan 2020 15:56:55 +0000 (12:56 -0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 5 Feb 2020 14:28:07 +0000 (15:28 +0100)
commit6e0fc82ccbf963c06ecf76e9daa67ae8f032e7ed
tree150605fae3625b5c78d460c7b3f30c224be2e7a2
parent37e4a255f148795460f871a209ab5d9a6baf06c4
x86/kvm: do not setup pv tlb flush when not paravirtualized

kvm_setup_pv_tlb_flush will waste memory and print a misguiding message
when KVM paravirtualization is not available.

Intel SDM says that the when cpuid is used with EAX higher than the
maximum supported value for basic of extended function, the data for the
highest supported basic function will be returned.

So, in some systems, kvm_arch_para_features will return bogus data,
causing kvm_setup_pv_tlb_flush to detect support for pv tlb flush.

Testing for kvm_para_available will work as it checks for the hypervisor
signature.

Besides, when the "nopv" command line parameter is used, it should not
continue as well, as kvm_guest_init will no be called in that case.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/kvm.c