We need to set the HYPERVISOR flag to let the kernel know we're running
under a hypervisor.
This makes the kernel enable all sorts of para-virtualization options
such as kvm-clock.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
[gorcunov@: Add comments on bits]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
struct kvm_cpuid_entry2 *entry = &kvm_cpuid->entries[i];
switch (entry->function) {
+ case 1:
+ /* Set X86_FEATURE_HYPERVISOR */
+ if (entry->index == 0)
+ entry->ecx |= (1 << 31);
+ break;
case 6:
- /* Clear presence of IA32_ENERGY_PERF_BIAS */
+ /* Clear X86_FEATURE_EPB */
entry->ecx = entry->ecx & ~(1 << 3);
break;
case CPUID_FUNC_PERFMON: