]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: Return LA57 feature based on hardware capability
authorYu Zhang <yu.c.zhang@linux.intel.com>
Thu, 31 Jan 2019 16:09:43 +0000 (00:09 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Feb 2019 18:25:05 +0000 (19:25 +0100)
commit2301ca4dccb1714edb1b30de68bbe9a66c8a398b
treee688f8fe345665af98863606f6eb38174a4fc3e9
parent70e353245fdeb23f7e7f86d386169076b3c65db8
kvm: x86: Return LA57 feature based on hardware capability

Previously, 'commit f5b5cc4ddb27 ("x86/mm: Introduce the 'no5lvl' kernel
parameter")' cleared X86_FEATURE_LA57 in boot_cpu_data, if Linux chooses
to not run in 5-level paging mode. Yet boot_cpu_data is queried by
do_cpuid_ent() as the host capability later when creating vcpus, and Qemu
will not be able to detect this feature and create VMs with LA57 feature.

As discussed earlier, VMs can still benefit from extended linear address
width, e.g. to enhance features like ASLR. So we would like to fix this,
by return the true hardware capability when Qemu queries.

Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c