On Wed, Jun 20, 2012 at 10:37 AM, Cyrill Gorcunov <gorcu...@openvz.org> wrote:
> From: Sasha Levin <levinsasha...@gmail.com>
> Subject: [PATCH] kvm tools: set the HYPERVISOR flag in cpuid
>
> 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 <levinsasha...@gmail.com>
> [gorcunov@: Add comments on bits]
> Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org>
> ---
>  tools/kvm/x86/cpuid.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> Index: linux-2.6.git/tools/kvm/x86/cpuid.c
> ===================================================================
> --- linux-2.6.git.orig/tools/kvm/x86/cpuid.c
> +++ linux-2.6.git/tools/kvm/x86/cpuid.c
> @@ -21,8 +21,13 @@ static void filter_cpuid(struct kvm_cpui
>                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:

I applied the patch. Thanks!
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to