From: Avi Kivity <avi@redhat.com>
To: nitin.a.kamble@intel.com
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
kraxel@redhat.com, chrisw@sous-sol.org
Subject: Re: thread/core siblings info for guests
Date: Sun, 19 Oct 2008 11:29:47 +0200 [thread overview]
Message-ID: <48FAFE0B.5030209@redhat.com> (raw)
In-Reply-To: <1224283519.18637.23.camel@lnitindesktop.sc.intel.com>
Nitin A Kamble wrote:
> Hi Avi,
> Attached is a patch to handle the "host mode" as you mentioned earlier.
>
> It works this way:
> Qemu's -cpu option is extended to take a new paramenter: -cpu _host_.
> With that parameter the cpuid bits are collected from the host cpu. And
> few bits of cleared to get it working with the kvm.
> I tested the patch with Windows & Linux guests, and I see the host
> topology is propagating into the guest. With that windows server is not
> imposing the incorrect licensing restriction to guest, as it was doing
> earlier. With the patch I could bring up the windows server guest with
> 16 cpus on kvm.
> I also fixed implementation of indexed cpuid leaves (0x4 & 0xb) in
> qemu. And also some code cleanup are there for consistent terminology to
> have more readable code,
>
> Please check-in the patch in kvm-usermode.git tree. There are no
> changes for the kernel side or kvm.git tree for this.
>
> Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
>
> Next things:
> * Default mode: I am not planning to do anything for this. I see the
> current situation is good enough for the default mode.
>
> * Managed mode: For this, I am thinking few things.
> 1. Either an option can be added to qemu to take (almost) all of
> it's cpuid bits from a file.
> 2. Or use command line options to modify particular bits of guest
> cpuid.
> 3. Or do the both.
>
> What do you think about the managed mode implementation? you probably
> have better idea regarding how and what kind of tools will be managing
> it.
>
>
> +static int fill_x86_defs_for_host(CPUX86State *env, x86_def_t * def)
> +{
> + uint32 eax, ebx, ecx, edx;
> +
> + env->cpu_host_cpu = 1;
> +
> + host_cpuid(0, 0, &eax, &ebx, &ecx, &edx);
> + env->cpuid_level = eax;
> + env->cpuid_vendor1 = ebx;
> + env->cpuid_vendor2 = ecx;
> + env->cpuid_vendor3 = edx;
> +
> + host_cpuid(1, 0, &eax, &ebx, &ecx, &edx);
> + env->cpuid_version = eax;
> + env->cpuid_features = edx & 0xdfffffff; /* disable Thermal Monitro */
> + env->cpuid_ext_features = ecx;
> +
> + host_cpuid(0x80000000, 0, &eax, &ebx, &ecx, &edx);
> + env->cpuid_xlevel = eax;
> +
> + host_cpuid(0x80000001, 0, &eax, &ebx, &ecx, &edx);
> + env->cpuid_ext3_features = ecx;
> + env->cpuid_ext2_features = edx & 0xf7ffffff; /* disable rdtscp */
> +
> + host_cpuid(0x80000002, 0, &eax, &ebx, &ecx, &edx);
> + env->cpuid_model[0] = eax;
> + env->cpuid_model[1] = ebx;
> + env->cpuid_model[2] = ecx;
> + env->cpuid_model[3] = edx;
> +
> + host_cpuid(0x80000003, 0, &eax, &ebx, &ecx, &edx);
> + env->cpuid_model[4] = eax;
> + env->cpuid_model[5] = ebx;
> + env->cpuid_model[6] = ecx;
> + env->cpuid_model[7] = edx;
> +
> + host_cpuid(0x80000004, 0, &eax, &ebx, &ecx, &edx);
> + env->cpuid_model[8] = eax;
> + env->cpuid_model[9] = ebx;
> + env->cpuid_model[10] = ecx;
> + env->cpuid_model[11] = edx;
> +
> + return 0;
> +}
> +
There is already a kernel function for this (KVM_GET_SUPPORTED_CPUID,
IIRC) that does this. It has the advantage of knowing which bits the
kernel supports, so there's no need to keep the kernel and userspace at
the same version.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2008-10-19 9:30 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-02 20:35 thread/core siblings info for guests Kamble, Nitin A
2008-10-05 9:44 ` Avi Kivity
2008-10-06 10:23 ` Gerd Hoffmann
2008-10-06 18:01 ` Kamble, Nitin A
2008-10-06 20:54 ` Chris Wright
2008-10-17 22:45 ` Nitin A Kamble
2008-10-18 0:18 ` Alexander Graf
2008-10-20 16:46 ` Kamble, Nitin A
2008-10-19 9:29 ` Avi Kivity [this message]
2008-10-20 18:37 ` Nitin A Kamble
2008-10-21 8:52 ` Avi Kivity
2008-10-31 16:47 ` Nitin A Kamble
2008-11-04 14:59 ` Avi Kivity
2008-11-04 19:02 ` Nitin A Kamble
2008-11-05 6:38 ` Avi Kivity
2008-11-05 23:37 ` [Patch 1] " Nitin A Kamble
2008-11-06 13:10 ` Avi Kivity
2008-11-05 23:56 ` [patch 2] " Nitin A Kamble
2008-11-06 13:18 ` Avi Kivity
2008-11-06 0:25 ` [Patch 3] " Nitin A Kamble
2008-11-06 13:20 ` Avi Kivity
2008-11-06 18:01 ` Kamble, Nitin A
2008-11-16 13:26 ` Avi Kivity
2008-11-18 0:09 ` Nitin A Kamble
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48FAFE0B.5030209@redhat.com \
--to=avi@redhat.com \
--cc=chrisw@sous-sol.org \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=nitin.a.kamble@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.